mirror of https://github.com/Mai-with-u/MaiBot.git
363 lines
1.7 MiB
363 lines
1.7 MiB
import{r as S,j as a,u as ba,b as g9,R as Ue,d as LI,L as BI,e as II,f as Xr,g as FI,h as qI,O as x9,k as QI}from"./router-BWgTyY51.js";import{a as $I,b as HI,g as v9}from"./react-vendor-Dtc2IqVY.js";import{c as y9,R as UI,T as VI,L as WI,a as GI,C as Wm,X as Gm,Y as Th,b as XI,B as my,d as Xm,P as YI,e as KI,f as ZI,_ as JI,g as eF}from"./charts-B1JvyJzO.js";import{c as Hi,a as nx,u as ki,P as Yt,b as $e,d as Cn,e as Wf,f as So,g as es,h as Ls,i as b9,j as $4,k as H4,S as tF,l as w9,m as S9,R as O9,O as rx,n as U4,C as sx,o as V4,T as W4,D as G4,p as X4,q as k9,r as j9,W as nF,s as N9,I as rF,t as C9,v as T9,w as sF,x as M9,V as iF,L as A9,y as E9,z as aF,A as lF,B as _9,E as oF,F as cF,G as lo,H as ix,J as Sd,K as D9,M as R9,N as z9,Q as P9,U as Y4,X as K4,Y as ax,Z as lx,_ as Z4,$ as L9,a0 as uF,a1 as B9,a2 as dF,a3 as hF,a4 as I9,a5 as fF}from"./ui-vendor-nTGLnMlb.js";import{R as Ii,A as mF,D as pF,a as gF,Z as df,C as uc,M as Gf,T as xF,X as Xf,P as F9,S as vF,b as dc,I as oo,c as Uu,d as hc,e as Yb,E as Kb,f as qi,g as ua,h as Zb,i as yF,j as Jb,k as e2,L as ck,K as bF,l as xc,m as wF,n as SF,F as io,o as OF,B as kF,U as q9,p as J4,q as jF,r as NF,s as Ps,H as fg,t as Q9,u as hf,v as t2,w as ff,x as CF,y as TF,z as ox,G as ew,J as Wr,N as Ht,O as mg,Q as rd,V as Yf,W as Tc,Y as Mc,_ as Kf,$ as MF,a0 as uk,a1 as AF,a2 as fc,a3 as n2,a4 as sd,a5 as dk,a6 as pg,a7 as EF,a8 as hk,a9 as _F,aa as DF,ab as Zl,ac as py,ad as fk,ae as RF,af as Kh,ag as gg,ah as $9,ai as H9,aj as U9,ak as zF,al as PF,am as mk,an as LF,ao as BF,ap as pk,aq as IF}from"./icons-D6w7t-x9.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function t(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=t(s);fetch(s.href,i)}})();var gy={exports:{}},Mh={},xy={exports:{}},vy={};var gk;function FF(){return gk||(gk=1,(function(n){function e(H,ae){var ne=H.length;H.push(ae);e:for(;0<ne;){var ue=ne-1>>>1,R=H[ue];if(0<s(R,ae))H[ue]=ae,H[ne]=R,ne=ue;else break e}}function t(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var ae=H[0],ne=H.pop();if(ne!==ae){H[0]=ne;e:for(var ue=0,R=H.length,me=R>>>1;ue<me;){var Y=2*(ue+1)-1,P=H[Y],K=Y+1,$=H[K];if(0>s(P,ne))K<R&&0>s($,P)?(H[ue]=$,H[K]=ne,ue=K):(H[ue]=P,H[Y]=ne,ue=Y);else if(K<R&&0>s($,ne))H[ue]=$,H[K]=ne,ue=K;else break e}}return ae}function s(H,ae){var ne=H.sortIndex-ae.sortIndex;return ne!==0?ne:H.id-ae.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;n.unstable_now=function(){return i.now()}}else{var l=Date,c=l.now();n.unstable_now=function(){return l.now()-c}}var u=[],h=[],m=1,p=null,x=3,v=!1,b=!1,O=!1,k=!1,j=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function _(H){for(var ae=t(h);ae!==null;){if(ae.callback===null)r(h);else if(ae.startTime<=H)r(h),ae.sortIndex=ae.expirationTime,e(u,ae);else break;ae=t(h)}}function D(H){if(O=!1,_(H),!b)if(t(u)!==null)b=!0,E||(E=!0,V());else{var ae=t(h);ae!==null&&J(D,ae.startTime-H)}}var E=!1,z=-1,Q=5,q=-1;function B(){return k?!0:!(n.unstable_now()-q<Q)}function U(){if(k=!1,E){var H=n.unstable_now();q=H;var ae=!0;try{e:{b=!1,O&&(O=!1,T(z),z=-1),v=!0;var ne=x;try{t:{for(_(H),p=t(u);p!==null&&!(p.expirationTime>H&&B());){var ue=p.callback;if(typeof ue=="function"){p.callback=null,x=p.priorityLevel;var R=ue(p.expirationTime<=H);if(H=n.unstable_now(),typeof R=="function"){p.callback=R,_(H),ae=!0;break t}p===t(u)&&r(u),_(H)}else r(u);p=t(u)}if(p!==null)ae=!0;else{var me=t(h);me!==null&&J(D,me.startTime-H),ae=!1}}break e}finally{p=null,x=ne,v=!1}ae=void 0}}finally{ae?V():E=!1}}}var V;if(typeof M=="function")V=function(){M(U)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,W=ce.port2;ce.port1.onmessage=U,V=function(){W.postMessage(null)}}else V=function(){j(U,0)};function J(H,ae){z=j(function(){H(n.unstable_now())},ae)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(H){H.callback=null},n.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<H?Math.floor(1e3/H):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_next=function(H){switch(x){case 1:case 2:case 3:var ae=3;break;default:ae=x}var ne=x;x=ae;try{return H()}finally{x=ne}},n.unstable_requestPaint=function(){k=!0},n.unstable_runWithPriority=function(H,ae){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var ne=x;x=H;try{return ae()}finally{x=ne}},n.unstable_scheduleCallback=function(H,ae,ne){var ue=n.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?ue+ne:ue):ne=ue,H){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=ne+R,H={id:m++,callback:ae,priorityLevel:H,startTime:ne,expirationTime:R,sortIndex:-1},ne>ue?(H.sortIndex=ne,e(h,H),t(u)===null&&H===t(h)&&(O?(T(z),z=-1):O=!0,J(D,ne-ue))):(H.sortIndex=R,e(u,H),b||v||(b=!0,E||(E=!0,V()))),H},n.unstable_shouldYield=B,n.unstable_wrapCallback=function(H){var ae=x;return function(){var ne=x;x=ae;try{return H.apply(this,arguments)}finally{x=ne}}}})(vy)),vy}var xk;function qF(){return xk||(xk=1,xy.exports=FF()),xy.exports}var vk;function QF(){if(vk)return Mh;vk=1;var n=qF(),e=$I(),t=HI();function r(o){var d="https://react.dev/errors/"+o;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)d+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+o+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function i(o){var d=o,f=o;if(o.alternate)for(;d.return;)d=d.return;else{o=d;do d=o,(d.flags&4098)!==0&&(f=d.return),o=d.return;while(o)}return d.tag===3?f:null}function l(o){if(o.tag===13){var d=o.memoizedState;if(d===null&&(o=o.alternate,o!==null&&(d=o.memoizedState)),d!==null)return d.dehydrated}return null}function c(o){if(o.tag===31){var d=o.memoizedState;if(d===null&&(o=o.alternate,o!==null&&(d=o.memoizedState)),d!==null)return d.dehydrated}return null}function u(o){if(i(o)!==o)throw Error(r(188))}function h(o){var d=o.alternate;if(!d){if(d=i(o),d===null)throw Error(r(188));return d!==o?null:o}for(var f=o,g=d;;){var y=f.return;if(y===null)break;var w=y.alternate;if(w===null){if(g=y.return,g!==null){f=g;continue}break}if(y.child===w.child){for(w=y.child;w;){if(w===f)return u(y),o;if(w===g)return u(y),d;w=w.sibling}throw Error(r(188))}if(f.return!==g.return)f=y,g=w;else{for(var A=!1,I=y.child;I;){if(I===f){A=!0,f=y,g=w;break}if(I===g){A=!0,g=y,f=w;break}I=I.sibling}if(!A){for(I=w.child;I;){if(I===f){A=!0,f=w,g=y;break}if(I===g){A=!0,g=w,f=y;break}I=I.sibling}if(!A)throw Error(r(189))}}if(f.alternate!==g)throw Error(r(190))}if(f.tag!==3)throw Error(r(188));return f.stateNode.current===f?o:d}function m(o){var d=o.tag;if(d===5||d===26||d===27||d===6)return o;for(o=o.child;o!==null;){if(d=m(o),d!==null)return d;o=o.sibling}return null}var p=Object.assign,x=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),M=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function V(o){return o===null||typeof o!="object"?null:(o=U&&o[U]||o["@@iterator"],typeof o=="function"?o:null)}var ce=Symbol.for("react.client.reference");function W(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===ce?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case O:return"Fragment";case j:return"Profiler";case k:return"StrictMode";case D:return"Suspense";case E:return"SuspenseList";case q:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case b:return"Portal";case M:return o.displayName||"Context";case T:return(o._context.displayName||"Context")+".Consumer";case _:var d=o.render;return o=o.displayName,o||(o=d.displayName||d.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case z:return d=o.displayName||null,d!==null?d:W(o.type)||"Memo";case Q:d=o._payload,o=o._init;try{return W(o(d))}catch{}}return null}var J=Array.isArray,H=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},ue=[],R=-1;function me(o){return{current:o}}function Y(o){0>R||(o.current=ue[R],ue[R]=null,R--)}function P(o,d){R++,ue[R]=o.current,o.current=d}var K=me(null),$=me(null),fe=me(null),ye=me(null);function Re(o,d){switch(P(fe,d),P($,o),P(K,null),d.nodeType){case 9:case 11:o=(o=d.documentElement)&&(o=o.namespaceURI)?_O(o):0;break;default:if(o=d.tagName,d=d.namespaceURI)d=_O(d),o=DO(d,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}Y(K),P(K,o)}function de(){Y(K),Y($),Y(fe)}function We(o){o.memoizedState!==null&&P(ye,o);var d=K.current,f=DO(d,o.type);d!==f&&(P($,o),P(K,f))}function ct(o){$.current===o&&(Y(K),Y($)),ye.current===o&&(Y(ye),kh._currentValue=ne)}var ke,nt;function ut(o){if(ke===void 0)try{throw Error()}catch(f){var d=f.stack.trim().match(/\n( *(at )?)/);ke=d&&d[1]||"",nt=-1<f.stack.indexOf(`
|
||
at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||
`+ke+o+nt}var Ct=!1;function Bn(o,d){if(!o||Ct)return"";Ct=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(d){var Te=function(){throw Error()};if(Object.defineProperty(Te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Te,[])}catch(Oe){var be=Oe}Reflect.construct(o,[],Te)}else{try{Te.call()}catch(Oe){be=Oe}o.call(Te.prototype)}}else{try{throw Error()}catch(Oe){be=Oe}(Te=o())&&typeof Te.catch=="function"&&Te.catch(function(){})}}catch(Oe){if(Oe&&be&&typeof Oe.stack=="string")return[Oe.stack,be.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=g.DetermineComponentFrameRoot(),A=w[0],I=w[1];if(A&&I){var Z=A.split(`
|
||
`),xe=I.split(`
|
||
`);for(y=g=0;g<Z.length&&!Z[g].includes("DetermineComponentFrameRoot");)g++;for(;y<xe.length&&!xe[y].includes("DetermineComponentFrameRoot");)y++;if(g===Z.length||y===xe.length)for(g=Z.length-1,y=xe.length-1;1<=g&&0<=y&&Z[g]!==xe[y];)y--;for(;1<=g&&0<=y;g--,y--)if(Z[g]!==xe[y]){if(g!==1||y!==1)do if(g--,y--,0>y||Z[g]!==xe[y]){var je=`
|
||
`+Z[g].replace(" at new "," at ");return o.displayName&&je.includes("<anonymous>")&&(je=je.replace("<anonymous>",o.displayName)),je}while(1<=g&&0<=y);break}}}finally{Ct=!1,Error.prepareStackTrace=f}return(f=o?o.displayName||o.name:"")?ut(f):""}function Tn(o,d){switch(o.tag){case 26:case 27:case 5:return ut(o.type);case 16:return ut("Lazy");case 13:return o.child!==d&&d!==null?ut("Suspense Fallback"):ut("Suspense");case 19:return ut("SuspenseList");case 0:case 15:return Bn(o.type,!1);case 11:return Bn(o.type.render,!1);case 1:return Bn(o.type,!0);case 31:return ut("Activity");default:return""}}function Jn(o){try{var d="",f=null;do d+=Tn(o,f),f=o,o=o.return;while(o);return d}catch(g){return`
|
||
Error generating stack: `+g.message+`
|
||
`+g.stack}}var nn=Object.prototype.hasOwnProperty,_t=n.unstable_scheduleCallback,Yr=n.unstable_cancelCallback,In=n.unstable_shouldYield,or=n.unstable_requestPaint,yn=n.unstable_now,ft=n.unstable_getCurrentPriorityLevel,ee=n.unstable_ImmediatePriority,Se=n.unstable_UserBlockingPriority,Le=n.unstable_NormalPriority,rt=n.unstable_LowPriority,Tt=n.unstable_IdlePriority,cr=n.log,Kr=n.unstable_setDisableYieldValue,re=null,Me=null;function pt(o){if(typeof cr=="function"&&Kr(o),Me&&typeof Me.setStrictMode=="function")try{Me.setStrictMode(re,o)}catch{}}var vt=Math.clz32?Math.clz32:zn,vs=Math.log,dt=Math.LN2;function zn(o){return o>>>=0,o===0?32:31-(vs(o)/dt|0)|0}var mt=256,rn=262144,Ar=4194304;function Mt(o){var d=o&42;if(d!==0)return d;switch(o&-o){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 o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function Ic(o,d,f){var g=o.pendingLanes;if(g===0)return 0;var y=0,w=o.suspendedLanes,A=o.pingedLanes;o=o.warmLanes;var I=g&134217727;return I!==0?(g=I&~w,g!==0?y=Mt(g):(A&=I,A!==0?y=Mt(A):f||(f=I&~o,f!==0&&(y=Mt(f))))):(I=g&~w,I!==0?y=Mt(I):A!==0?y=Mt(A):f||(f=g&~o,f!==0&&(y=Mt(f)))),y===0?0:d!==0&&d!==y&&(d&w)===0&&(w=y&-y,f=d&-d,w>=f||w===32&&(f&4194048)!==0)?d:y}function Eo(o,d){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&d)===0}function n1(o,d){switch(o){case 1:case 2:case 4:case 8:case 64:return d+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 d+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 Fc(){var o=Ar;return Ar<<=1,(Ar&62914560)===0&&(Ar=4194304),o}function _o(o){for(var d=[],f=0;31>f;f++)d.push(o);return d}function Bd(o,d){o.pendingLanes|=d,d!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function jL(o,d,f,g,y,w){var A=o.pendingLanes;o.pendingLanes=f,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=f,o.entangledLanes&=f,o.errorRecoveryDisabledLanes&=f,o.shellSuspendCounter=0;var I=o.entanglements,Z=o.expirationTimes,xe=o.hiddenUpdates;for(f=A&~f;0<f;){var je=31-vt(f),Te=1<<je;I[je]=0,Z[je]=-1;var be=xe[je];if(be!==null)for(xe[je]=null,je=0;je<be.length;je++){var Oe=be[je];Oe!==null&&(Oe.lane&=-536870913)}f&=~Te}g!==0&&m3(o,g,0),w!==0&&y===0&&o.tag!==0&&(o.suspendedLanes|=w&~(A&~d))}function m3(o,d,f){o.pendingLanes|=d,o.suspendedLanes&=~d;var g=31-vt(d);o.entangledLanes|=d,o.entanglements[g]=o.entanglements[g]|1073741824|f&261930}function p3(o,d){var f=o.entangledLanes|=d;for(o=o.entanglements;f;){var g=31-vt(f),y=1<<g;y&d|o[g]&d&&(o[g]|=d),f&=~y}}function g3(o,d){var f=d&-d;return f=(f&42)!==0?1:r1(f),(f&(o.suspendedLanes|d))!==0?0:f}function r1(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=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:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function s1(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function x3(){var o=ae.p;return o!==0?o:(o=window.event,o===void 0?32:nk(o.type))}function v3(o,d){var f=ae.p;try{return ae.p=o,d()}finally{ae.p=f}}var Ol=Math.random().toString(36).slice(2),Br="__reactFiber$"+Ol,ys="__reactProps$"+Ol,qc="__reactContainer$"+Ol,i1="__reactEvents$"+Ol,NL="__reactListeners$"+Ol,CL="__reactHandles$"+Ol,y3="__reactResources$"+Ol,Id="__reactMarker$"+Ol;function a1(o){delete o[Br],delete o[ys],delete o[i1],delete o[NL],delete o[CL]}function Qc(o){var d=o[Br];if(d)return d;for(var f=o.parentNode;f;){if(d=f[qc]||f[Br]){if(f=d.alternate,d.child!==null||f!==null&&f.child!==null)for(o=FO(o);o!==null;){if(f=o[Br])return f;o=FO(o)}return d}o=f,f=o.parentNode}return null}function $c(o){if(o=o[Br]||o[qc]){var d=o.tag;if(d===5||d===6||d===13||d===31||d===26||d===27||d===3)return o}return null}function Fd(o){var d=o.tag;if(d===5||d===26||d===27||d===6)return o.stateNode;throw Error(r(33))}function Hc(o){var d=o[y3];return d||(d=o[y3]={hoistableStyles:new Map,hoistableScripts:new Map}),d}function Er(o){o[Id]=!0}var b3=new Set,w3={};function Do(o,d){Uc(o,d),Uc(o+"Capture",d)}function Uc(o,d){for(w3[o]=d,o=0;o<d.length;o++)b3.add(d[o])}var TL=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]*$"),S3={},O3={};function ML(o){return nn.call(O3,o)?!0:nn.call(S3,o)?!1:TL.test(o)?O3[o]=!0:(S3[o]=!0,!1)}function z0(o,d,f){if(ML(d))if(f===null)o.removeAttribute(d);else{switch(typeof f){case"undefined":case"function":case"symbol":o.removeAttribute(d);return;case"boolean":var g=d.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){o.removeAttribute(d);return}}o.setAttribute(d,""+f)}}function P0(o,d,f){if(f===null)o.removeAttribute(d);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(d);return}o.setAttribute(d,""+f)}}function Aa(o,d,f,g){if(g===null)o.removeAttribute(f);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(f);return}o.setAttributeNS(d,f,""+g)}}function li(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function k3(o){var d=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function AL(o,d,f){var g=Object.getOwnPropertyDescriptor(o.constructor.prototype,d);if(!o.hasOwnProperty(d)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var y=g.get,w=g.set;return Object.defineProperty(o,d,{configurable:!0,get:function(){return y.call(this)},set:function(A){f=""+A,w.call(this,A)}}),Object.defineProperty(o,d,{enumerable:g.enumerable}),{getValue:function(){return f},setValue:function(A){f=""+A},stopTracking:function(){o._valueTracker=null,delete o[d]}}}}function l1(o){if(!o._valueTracker){var d=k3(o)?"checked":"value";o._valueTracker=AL(o,d,""+o[d])}}function j3(o){if(!o)return!1;var d=o._valueTracker;if(!d)return!0;var f=d.getValue(),g="";return o&&(g=k3(o)?o.checked?"true":"false":o.value),o=g,o!==f?(d.setValue(o),!0):!1}function L0(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var EL=/[\n"\\]/g;function oi(o){return o.replace(EL,function(d){return"\\"+d.charCodeAt(0).toString(16)+" "})}function o1(o,d,f,g,y,w,A,I){o.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?o.type=A:o.removeAttribute("type"),d!=null?A==="number"?(d===0&&o.value===""||o.value!=d)&&(o.value=""+li(d)):o.value!==""+li(d)&&(o.value=""+li(d)):A!=="submit"&&A!=="reset"||o.removeAttribute("value"),d!=null?c1(o,A,li(d)):f!=null?c1(o,A,li(f)):g!=null&&o.removeAttribute("value"),y==null&&w!=null&&(o.defaultChecked=!!w),y!=null&&(o.checked=y&&typeof y!="function"&&typeof y!="symbol"),I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?o.name=""+li(I):o.removeAttribute("name")}function N3(o,d,f,g,y,w,A,I){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(o.type=w),d!=null||f!=null){if(!(w!=="submit"&&w!=="reset"||d!=null)){l1(o);return}f=f!=null?""+li(f):"",d=d!=null?""+li(d):f,I||d===o.value||(o.value=d),o.defaultValue=d}g=g??y,g=typeof g!="function"&&typeof g!="symbol"&&!!g,o.checked=I?o.checked:!!g,o.defaultChecked=!!g,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(o.name=A),l1(o)}function c1(o,d,f){d==="number"&&L0(o.ownerDocument)===o||o.defaultValue===""+f||(o.defaultValue=""+f)}function Vc(o,d,f,g){if(o=o.options,d){d={};for(var y=0;y<f.length;y++)d["$"+f[y]]=!0;for(f=0;f<o.length;f++)y=d.hasOwnProperty("$"+o[f].value),o[f].selected!==y&&(o[f].selected=y),y&&g&&(o[f].defaultSelected=!0)}else{for(f=""+li(f),d=null,y=0;y<o.length;y++){if(o[y].value===f){o[y].selected=!0,g&&(o[y].defaultSelected=!0);return}d!==null||o[y].disabled||(d=o[y])}d!==null&&(d.selected=!0)}}function C3(o,d,f){if(d!=null&&(d=""+li(d),d!==o.value&&(o.value=d),f==null)){o.defaultValue!==d&&(o.defaultValue=d);return}o.defaultValue=f!=null?""+li(f):""}function T3(o,d,f,g){if(d==null){if(g!=null){if(f!=null)throw Error(r(92));if(J(g)){if(1<g.length)throw Error(r(93));g=g[0]}f=g}f==null&&(f=""),d=f}f=li(d),o.defaultValue=f,g=o.textContent,g===f&&g!==""&&g!==null&&(o.value=g),l1(o)}function Wc(o,d){if(d){var f=o.firstChild;if(f&&f===o.lastChild&&f.nodeType===3){f.nodeValue=d;return}}o.textContent=d}var _L=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 M3(o,d,f){var g=d.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?g?o.setProperty(d,""):d==="float"?o.cssFloat="":o[d]="":g?o.setProperty(d,f):typeof f!="number"||f===0||_L.has(d)?d==="float"?o.cssFloat=f:o[d]=(""+f).trim():o[d]=f+"px"}function A3(o,d,f){if(d!=null&&typeof d!="object")throw Error(r(62));if(o=o.style,f!=null){for(var g in f)!f.hasOwnProperty(g)||d!=null&&d.hasOwnProperty(g)||(g.indexOf("--")===0?o.setProperty(g,""):g==="float"?o.cssFloat="":o[g]="");for(var y in d)g=d[y],d.hasOwnProperty(y)&&f[y]!==g&&M3(o,y,g)}else for(var w in d)d.hasOwnProperty(w)&&M3(o,w,d[w])}function u1(o){if(o.indexOf("-")===-1)return!1;switch(o){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 DL=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"]]),RL=/^[\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 B0(o){return RL.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function Ea(){}var d1=null;function h1(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Gc=null,Xc=null;function E3(o){var d=$c(o);if(d&&(o=d.stateNode)){var f=o[ys]||null;e:switch(o=d.stateNode,d.type){case"input":if(o1(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),d=f.name,f.type==="radio"&&d!=null){for(f=o;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+oi(""+d)+'"][type="radio"]'),d=0;d<f.length;d++){var g=f[d];if(g!==o&&g.form===o.form){var y=g[ys]||null;if(!y)throw Error(r(90));o1(g,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(d=0;d<f.length;d++)g=f[d],g.form===o.form&&j3(g)}break e;case"textarea":C3(o,f.value,f.defaultValue);break e;case"select":d=f.value,d!=null&&Vc(o,!!f.multiple,d,!1)}}}var f1=!1;function _3(o,d,f){if(f1)return o(d,f);f1=!0;try{var g=o(d);return g}finally{if(f1=!1,(Gc!==null||Xc!==null)&&(jm(),Gc&&(d=Gc,o=Xc,Xc=Gc=null,E3(d),o)))for(d=0;d<o.length;d++)E3(o[d])}}function qd(o,d){var f=o.stateNode;if(f===null)return null;var g=f[ys]||null;if(g===null)return null;f=g[d];e:switch(d){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)||(o=o.type,g=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!g;break e;default:o=!1}if(o)return null;if(f&&typeof f!="function")throw Error(r(231,d,typeof f));return f}var _a=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),m1=!1;if(_a)try{var Qd={};Object.defineProperty(Qd,"passive",{get:function(){m1=!0}}),window.addEventListener("test",Qd,Qd),window.removeEventListener("test",Qd,Qd)}catch{m1=!1}var kl=null,p1=null,I0=null;function D3(){if(I0)return I0;var o,d=p1,f=d.length,g,y="value"in kl?kl.value:kl.textContent,w=y.length;for(o=0;o<f&&d[o]===y[o];o++);var A=f-o;for(g=1;g<=A&&d[f-g]===y[w-g];g++);return I0=y.slice(o,1<g?1-g:void 0)}function F0(o){var d=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&d===13&&(o=13)):o=d,o===10&&(o=13),32<=o||o===13?o:0}function q0(){return!0}function R3(){return!1}function bs(o){function d(f,g,y,w,A){this._reactName=f,this._targetInst=y,this.type=g,this.nativeEvent=w,this.target=A,this.currentTarget=null;for(var I in o)o.hasOwnProperty(I)&&(f=o[I],this[I]=f?f(w):w[I]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?q0:R3,this.isPropagationStopped=R3,this}return p(d.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=q0)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=q0)},persist:function(){},isPersistent:q0}),d}var Ro={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Q0=bs(Ro),$d=p({},Ro,{view:0,detail:0}),zL=bs($d),g1,x1,Hd,$0=p({},$d,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:y1,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Hd&&(Hd&&o.type==="mousemove"?(g1=o.screenX-Hd.screenX,x1=o.screenY-Hd.screenY):x1=g1=0,Hd=o),g1)},movementY:function(o){return"movementY"in o?o.movementY:x1}}),z3=bs($0),PL=p({},$0,{dataTransfer:0}),LL=bs(PL),BL=p({},$d,{relatedTarget:0}),v1=bs(BL),IL=p({},Ro,{animationName:0,elapsedTime:0,pseudoElement:0}),FL=bs(IL),qL=p({},Ro,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),QL=bs(qL),$L=p({},Ro,{data:0}),P3=bs($L),HL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},UL={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"},VL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function WL(o){var d=this.nativeEvent;return d.getModifierState?d.getModifierState(o):(o=VL[o])?!!d[o]:!1}function y1(){return WL}var GL=p({},$d,{key:function(o){if(o.key){var d=HL[o.key]||o.key;if(d!=="Unidentified")return d}return o.type==="keypress"?(o=F0(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?UL[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:y1,charCode:function(o){return o.type==="keypress"?F0(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?F0(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),XL=bs(GL),YL=p({},$0,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),L3=bs(YL),KL=p({},$d,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:y1}),ZL=bs(KL),JL=p({},Ro,{propertyName:0,elapsedTime:0,pseudoElement:0}),eB=bs(JL),tB=p({},$0,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),nB=bs(tB),rB=p({},Ro,{newState:0,oldState:0}),sB=bs(rB),iB=[9,13,27,32],b1=_a&&"CompositionEvent"in window,Ud=null;_a&&"documentMode"in document&&(Ud=document.documentMode);var aB=_a&&"TextEvent"in window&&!Ud,B3=_a&&(!b1||Ud&&8<Ud&&11>=Ud),I3=" ",F3=!1;function q3(o,d){switch(o){case"keyup":return iB.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Q3(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Yc=!1;function lB(o,d){switch(o){case"compositionend":return Q3(d);case"keypress":return d.which!==32?null:(F3=!0,I3);case"textInput":return o=d.data,o===I3&&F3?null:o;default:return null}}function oB(o,d){if(Yc)return o==="compositionend"||!b1&&q3(o,d)?(o=D3(),I0=p1=kl=null,Yc=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1<d.char.length)return d.char;if(d.which)return String.fromCharCode(d.which)}return null;case"compositionend":return B3&&d.locale!=="ko"?null:d.data;default:return null}}var cB={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 $3(o){var d=o&&o.nodeName&&o.nodeName.toLowerCase();return d==="input"?!!cB[o.type]:d==="textarea"}function H3(o,d,f,g){Gc?Xc?Xc.push(g):Xc=[g]:Gc=g,d=_m(d,"onChange"),0<d.length&&(f=new Q0("onChange","change",null,f,g),o.push({event:f,listeners:d}))}var Vd=null,Wd=null;function uB(o){NO(o,0)}function H0(o){var d=Fd(o);if(j3(d))return o}function U3(o,d){if(o==="change")return d}var V3=!1;if(_a){var w1;if(_a){var S1="oninput"in document;if(!S1){var W3=document.createElement("div");W3.setAttribute("oninput","return;"),S1=typeof W3.oninput=="function"}w1=S1}else w1=!1;V3=w1&&(!document.documentMode||9<document.documentMode)}function G3(){Vd&&(Vd.detachEvent("onpropertychange",X3),Wd=Vd=null)}function X3(o){if(o.propertyName==="value"&&H0(Wd)){var d=[];H3(d,Wd,o,h1(o)),_3(uB,d)}}function dB(o,d,f){o==="focusin"?(G3(),Vd=d,Wd=f,Vd.attachEvent("onpropertychange",X3)):o==="focusout"&&G3()}function hB(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return H0(Wd)}function fB(o,d){if(o==="click")return H0(d)}function mB(o,d){if(o==="input"||o==="change")return H0(d)}function pB(o,d){return o===d&&(o!==0||1/o===1/d)||o!==o&&d!==d}var Qs=typeof Object.is=="function"?Object.is:pB;function Gd(o,d){if(Qs(o,d))return!0;if(typeof o!="object"||o===null||typeof d!="object"||d===null)return!1;var f=Object.keys(o),g=Object.keys(d);if(f.length!==g.length)return!1;for(g=0;g<f.length;g++){var y=f[g];if(!nn.call(d,y)||!Qs(o[y],d[y]))return!1}return!0}function Y3(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function K3(o,d){var f=Y3(o);o=0;for(var g;f;){if(f.nodeType===3){if(g=o+f.textContent.length,o<=d&&g>=d)return{node:f,offset:d-o};o=g}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=Y3(f)}}function Z3(o,d){return o&&d?o===d?!0:o&&o.nodeType===3?!1:d&&d.nodeType===3?Z3(o,d.parentNode):"contains"in o?o.contains(d):o.compareDocumentPosition?!!(o.compareDocumentPosition(d)&16):!1:!1}function J3(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var d=L0(o.document);d instanceof o.HTMLIFrameElement;){try{var f=typeof d.contentWindow.location.href=="string"}catch{f=!1}if(f)o=d.contentWindow;else break;d=L0(o.document)}return d}function O1(o){var d=o&&o.nodeName&&o.nodeName.toLowerCase();return d&&(d==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||d==="textarea"||o.contentEditable==="true")}var gB=_a&&"documentMode"in document&&11>=document.documentMode,Kc=null,k1=null,Xd=null,j1=!1;function e6(o,d,f){var g=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;j1||Kc==null||Kc!==L0(g)||(g=Kc,"selectionStart"in g&&O1(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}),Xd&&Gd(Xd,g)||(Xd=g,g=_m(k1,"onSelect"),0<g.length&&(d=new Q0("onSelect","select",null,d,f),o.push({event:d,listeners:g}),d.target=Kc)))}function zo(o,d){var f={};return f[o.toLowerCase()]=d.toLowerCase(),f["Webkit"+o]="webkit"+d,f["Moz"+o]="moz"+d,f}var Zc={animationend:zo("Animation","AnimationEnd"),animationiteration:zo("Animation","AnimationIteration"),animationstart:zo("Animation","AnimationStart"),transitionrun:zo("Transition","TransitionRun"),transitionstart:zo("Transition","TransitionStart"),transitioncancel:zo("Transition","TransitionCancel"),transitionend:zo("Transition","TransitionEnd")},N1={},t6={};_a&&(t6=document.createElement("div").style,"AnimationEvent"in window||(delete Zc.animationend.animation,delete Zc.animationiteration.animation,delete Zc.animationstart.animation),"TransitionEvent"in window||delete Zc.transitionend.transition);function Po(o){if(N1[o])return N1[o];if(!Zc[o])return o;var d=Zc[o],f;for(f in d)if(d.hasOwnProperty(f)&&f in t6)return N1[o]=d[f];return o}var n6=Po("animationend"),r6=Po("animationiteration"),s6=Po("animationstart"),xB=Po("transitionrun"),vB=Po("transitionstart"),yB=Po("transitioncancel"),i6=Po("transitionend"),a6=new Map,C1="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(" ");C1.push("scrollEnd");function _i(o,d){a6.set(o,d),Do(d,[o])}var U0=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var d=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(d))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},ci=[],Jc=0,T1=0;function V0(){for(var o=Jc,d=T1=Jc=0;d<o;){var f=ci[d];ci[d++]=null;var g=ci[d];ci[d++]=null;var y=ci[d];ci[d++]=null;var w=ci[d];if(ci[d++]=null,g!==null&&y!==null){var A=g.pending;A===null?y.next=y:(y.next=A.next,A.next=y),g.pending=y}w!==0&&l6(f,y,w)}}function W0(o,d,f,g){ci[Jc++]=o,ci[Jc++]=d,ci[Jc++]=f,ci[Jc++]=g,T1|=g,o.lanes|=g,o=o.alternate,o!==null&&(o.lanes|=g)}function M1(o,d,f,g){return W0(o,d,f,g),G0(o)}function Lo(o,d){return W0(o,null,null,d),G0(o)}function l6(o,d,f){o.lanes|=f;var g=o.alternate;g!==null&&(g.lanes|=f);for(var y=!1,w=o.return;w!==null;)w.childLanes|=f,g=w.alternate,g!==null&&(g.childLanes|=f),w.tag===22&&(o=w.stateNode,o===null||o._visibility&1||(y=!0)),o=w,w=w.return;return o.tag===3?(w=o.stateNode,y&&d!==null&&(y=31-vt(f),o=w.hiddenUpdates,g=o[y],g===null?o[y]=[d]:g.push(d),d.lane=f|536870912),w):null}function G0(o){if(50<xh)throw xh=0,Bv=null,Error(r(185));for(var d=o.return;d!==null;)o=d,d=o.return;return o.tag===3?o.stateNode:null}var eu={};function bB(o,d,f,g){this.tag=o,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=d,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 $s(o,d,f,g){return new bB(o,d,f,g)}function A1(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Da(o,d){var f=o.alternate;return f===null?(f=$s(o.tag,d,o.key,o.mode),f.elementType=o.elementType,f.type=o.type,f.stateNode=o.stateNode,f.alternate=o,o.alternate=f):(f.pendingProps=d,f.type=o.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=o.flags&65011712,f.childLanes=o.childLanes,f.lanes=o.lanes,f.child=o.child,f.memoizedProps=o.memoizedProps,f.memoizedState=o.memoizedState,f.updateQueue=o.updateQueue,d=o.dependencies,f.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},f.sibling=o.sibling,f.index=o.index,f.ref=o.ref,f.refCleanup=o.refCleanup,f}function o6(o,d){o.flags&=65011714;var f=o.alternate;return f===null?(o.childLanes=0,o.lanes=d,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=f.childLanes,o.lanes=f.lanes,o.child=f.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=f.memoizedProps,o.memoizedState=f.memoizedState,o.updateQueue=f.updateQueue,o.type=f.type,d=f.dependencies,o.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext}),o}function X0(o,d,f,g,y,w){var A=0;if(g=o,typeof o=="function")A1(o)&&(A=1);else if(typeof o=="string")A=jI(o,f,K.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case q:return o=$s(31,f,d,y),o.elementType=q,o.lanes=w,o;case O:return Bo(f.children,y,w,d);case k:A=8,y|=24;break;case j:return o=$s(12,f,d,y|2),o.elementType=j,o.lanes=w,o;case D:return o=$s(13,f,d,y),o.elementType=D,o.lanes=w,o;case E:return o=$s(19,f,d,y),o.elementType=E,o.lanes=w,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case M:A=10;break e;case T:A=9;break e;case _:A=11;break e;case z:A=14;break e;case Q:A=16,g=null;break e}A=29,f=Error(r(130,o===null?"null":typeof o,"")),g=null}return d=$s(A,f,d,y),d.elementType=o,d.type=g,d.lanes=w,d}function Bo(o,d,f,g){return o=$s(7,o,g,d),o.lanes=f,o}function E1(o,d,f){return o=$s(6,o,null,d),o.lanes=f,o}function c6(o){var d=$s(18,null,null,0);return d.stateNode=o,d}function _1(o,d,f){return d=$s(4,o.children!==null?o.children:[],o.key,d),d.lanes=f,d.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},d}var u6=new WeakMap;function ui(o,d){if(typeof o=="object"&&o!==null){var f=u6.get(o);return f!==void 0?f:(d={value:o,source:d,stack:Jn(d)},u6.set(o,d),d)}return{value:o,source:d,stack:Jn(d)}}var tu=[],nu=0,Y0=null,Yd=0,di=[],hi=0,jl=null,Gi=1,Xi="";function Ra(o,d){tu[nu++]=Yd,tu[nu++]=Y0,Y0=o,Yd=d}function d6(o,d,f){di[hi++]=Gi,di[hi++]=Xi,di[hi++]=jl,jl=o;var g=Gi;o=Xi;var y=32-vt(g)-1;g&=~(1<<y),f+=1;var w=32-vt(d)+y;if(30<w){var A=y-y%5;w=(g&(1<<A)-1).toString(32),g>>=A,y-=A,Gi=1<<32-vt(d)+y|f<<y|g,Xi=w+o}else Gi=1<<w|f<<y|g,Xi=o}function D1(o){o.return!==null&&(Ra(o,1),d6(o,1,0))}function R1(o){for(;o===Y0;)Y0=tu[--nu],tu[nu]=null,Yd=tu[--nu],tu[nu]=null;for(;o===jl;)jl=di[--hi],di[hi]=null,Xi=di[--hi],di[hi]=null,Gi=di[--hi],di[hi]=null}function h6(o,d){di[hi++]=Gi,di[hi++]=Xi,di[hi++]=jl,Gi=d.id,Xi=d.overflow,jl=o}var Ir=null,Fn=null,Ut=!1,Nl=null,fi=!1,z1=Error(r(519));function Cl(o){var d=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Kd(ui(d,o)),z1}function f6(o){var d=o.stateNode,f=o.type,g=o.memoizedProps;switch(d[Br]=o,d[ys]=g,f){case"dialog":Lt("cancel",d),Lt("close",d);break;case"iframe":case"object":case"embed":Lt("load",d);break;case"video":case"audio":for(f=0;f<yh.length;f++)Lt(yh[f],d);break;case"source":Lt("error",d);break;case"img":case"image":case"link":Lt("error",d),Lt("load",d);break;case"details":Lt("toggle",d);break;case"input":Lt("invalid",d),N3(d,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":Lt("invalid",d);break;case"textarea":Lt("invalid",d),T3(d,g.value,g.defaultValue,g.children)}f=g.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||d.textContent===""+f||g.suppressHydrationWarning===!0||AO(d.textContent,f)?(g.popover!=null&&(Lt("beforetoggle",d),Lt("toggle",d)),g.onScroll!=null&&Lt("scroll",d),g.onScrollEnd!=null&&Lt("scrollend",d),g.onClick!=null&&(d.onclick=Ea),d=!0):d=!1,d||Cl(o,!0)}function m6(o){for(Ir=o.return;Ir;)switch(Ir.tag){case 5:case 31:case 13:fi=!1;return;case 27:case 3:fi=!0;return;default:Ir=Ir.return}}function ru(o){if(o!==Ir)return!1;if(!Ut)return m6(o),Ut=!0,!1;var d=o.tag,f;if((f=d!==3&&d!==27)&&((f=d===5)&&(f=o.type,f=!(f!=="form"&&f!=="button")||Jv(o.type,o.memoizedProps)),f=!f),f&&Fn&&Cl(o),m6(o),d===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Fn=IO(o)}else if(d===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Fn=IO(o)}else d===27?(d=Fn,ql(o.type)?(o=sy,sy=null,Fn=o):Fn=d):Fn=Ir?pi(o.stateNode.nextSibling):null;return!0}function Io(){Fn=Ir=null,Ut=!1}function P1(){var o=Nl;return o!==null&&(ks===null?ks=o:ks.push.apply(ks,o),Nl=null),o}function Kd(o){Nl===null?Nl=[o]:Nl.push(o)}var L1=me(null),Fo=null,za=null;function Tl(o,d,f){P(L1,d._currentValue),d._currentValue=f}function Pa(o){o._currentValue=L1.current,Y(L1)}function B1(o,d,f){for(;o!==null;){var g=o.alternate;if((o.childLanes&d)!==d?(o.childLanes|=d,g!==null&&(g.childLanes|=d)):g!==null&&(g.childLanes&d)!==d&&(g.childLanes|=d),o===f)break;o=o.return}}function I1(o,d,f,g){var y=o.child;for(y!==null&&(y.return=o);y!==null;){var w=y.dependencies;if(w!==null){var A=y.child;w=w.firstContext;e:for(;w!==null;){var I=w;w=y;for(var Z=0;Z<d.length;Z++)if(I.context===d[Z]){w.lanes|=f,I=w.alternate,I!==null&&(I.lanes|=f),B1(w.return,f,o),g||(A=null);break e}w=I.next}}else if(y.tag===18){if(A=y.return,A===null)throw Error(r(341));A.lanes|=f,w=A.alternate,w!==null&&(w.lanes|=f),B1(A,f,o),A=null}else A=y.child;if(A!==null)A.return=y;else for(A=y;A!==null;){if(A===o){A=null;break}if(y=A.sibling,y!==null){y.return=A.return,A=y;break}A=A.return}y=A}}function su(o,d,f,g){o=null;for(var y=d,w=!1;y!==null;){if(!w){if((y.flags&524288)!==0)w=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var A=y.alternate;if(A===null)throw Error(r(387));if(A=A.memoizedProps,A!==null){var I=y.type;Qs(y.pendingProps.value,A.value)||(o!==null?o.push(I):o=[I])}}else if(y===ye.current){if(A=y.alternate,A===null)throw Error(r(387));A.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(o!==null?o.push(kh):o=[kh])}y=y.return}o!==null&&I1(d,o,f,g),d.flags|=262144}function K0(o){for(o=o.firstContext;o!==null;){if(!Qs(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function qo(o){Fo=o,za=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function Fr(o){return p6(Fo,o)}function Z0(o,d){return Fo===null&&qo(o),p6(o,d)}function p6(o,d){var f=d._currentValue;if(d={context:d,memoizedValue:f,next:null},za===null){if(o===null)throw Error(r(308));za=d,o.dependencies={lanes:0,firstContext:d},o.flags|=524288}else za=za.next=d;return f}var wB=typeof AbortController<"u"?AbortController:function(){var o=[],d=this.signal={aborted:!1,addEventListener:function(f,g){o.push(g)}};this.abort=function(){d.aborted=!0,o.forEach(function(f){return f()})}},SB=n.unstable_scheduleCallback,OB=n.unstable_NormalPriority,ur={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function F1(){return{controller:new wB,data:new Map,refCount:0}}function Zd(o){o.refCount--,o.refCount===0&&SB(OB,function(){o.controller.abort()})}var Jd=null,q1=0,iu=0,au=null;function kB(o,d){if(Jd===null){var f=Jd=[];q1=0,iu=Hv(),au={status:"pending",value:void 0,then:function(g){f.push(g)}}}return q1++,d.then(g6,g6),d}function g6(){if(--q1===0&&Jd!==null){au!==null&&(au.status="fulfilled");var o=Jd;Jd=null,iu=0,au=null;for(var d=0;d<o.length;d++)(0,o[d])()}}function jB(o,d){var f=[],g={status:"pending",value:null,reason:null,then:function(y){f.push(y)}};return o.then(function(){g.status="fulfilled",g.value=d;for(var y=0;y<f.length;y++)(0,f[y])(d)},function(y){for(g.status="rejected",g.reason=y,y=0;y<f.length;y++)(0,f[y])(void 0)}),g}var x6=H.S;H.S=function(o,d){eO=yn(),typeof d=="object"&&d!==null&&typeof d.then=="function"&&kB(o,d),x6!==null&&x6(o,d)};var Qo=me(null);function Q1(){var o=Qo.current;return o!==null?o:Mn.pooledCache}function J0(o,d){d===null?P(Qo,Qo.current):P(Qo,d.pool)}function v6(){var o=Q1();return o===null?null:{parent:ur._currentValue,pool:o}}var lu=Error(r(460)),$1=Error(r(474)),em=Error(r(542)),tm={then:function(){}};function y6(o){return o=o.status,o==="fulfilled"||o==="rejected"}function b6(o,d,f){switch(f=o[f],f===void 0?o.push(d):f!==d&&(d.then(Ea,Ea),d=f),d.status){case"fulfilled":return d.value;case"rejected":throw o=d.reason,S6(o),o;default:if(typeof d.status=="string")d.then(Ea,Ea);else{if(o=Mn,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=d,o.status="pending",o.then(function(g){if(d.status==="pending"){var y=d;y.status="fulfilled",y.value=g}},function(g){if(d.status==="pending"){var y=d;y.status="rejected",y.reason=g}})}switch(d.status){case"fulfilled":return d.value;case"rejected":throw o=d.reason,S6(o),o}throw Ho=d,lu}}function $o(o){try{var d=o._init;return d(o._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(Ho=f,lu):f}}var Ho=null;function w6(){if(Ho===null)throw Error(r(459));var o=Ho;return Ho=null,o}function S6(o){if(o===lu||o===em)throw Error(r(483))}var ou=null,eh=0;function nm(o){var d=eh;return eh+=1,ou===null&&(ou=[]),b6(ou,o,d)}function th(o,d){d=d.props.ref,o.ref=d!==void 0?d:null}function rm(o,d){throw d.$$typeof===x?Error(r(525)):(o=Object.prototype.toString.call(d),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":o)))}function O6(o){function d(oe,se){if(o){var pe=oe.deletions;pe===null?(oe.deletions=[se],oe.flags|=16):pe.push(se)}}function f(oe,se){if(!o)return null;for(;se!==null;)d(oe,se),se=se.sibling;return null}function g(oe){for(var se=new Map;oe!==null;)oe.key!==null?se.set(oe.key,oe):se.set(oe.index,oe),oe=oe.sibling;return se}function y(oe,se){return oe=Da(oe,se),oe.index=0,oe.sibling=null,oe}function w(oe,se,pe){return oe.index=pe,o?(pe=oe.alternate,pe!==null?(pe=pe.index,pe<se?(oe.flags|=67108866,se):pe):(oe.flags|=67108866,se)):(oe.flags|=1048576,se)}function A(oe){return o&&oe.alternate===null&&(oe.flags|=67108866),oe}function I(oe,se,pe,Ne){return se===null||se.tag!==6?(se=E1(pe,oe.mode,Ne),se.return=oe,se):(se=y(se,pe),se.return=oe,se)}function Z(oe,se,pe,Ne){var tt=pe.type;return tt===O?je(oe,se,pe.props.children,Ne,pe.key):se!==null&&(se.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===Q&&$o(tt)===se.type)?(se=y(se,pe.props),th(se,pe),se.return=oe,se):(se=X0(pe.type,pe.key,pe.props,null,oe.mode,Ne),th(se,pe),se.return=oe,se)}function xe(oe,se,pe,Ne){return se===null||se.tag!==4||se.stateNode.containerInfo!==pe.containerInfo||se.stateNode.implementation!==pe.implementation?(se=_1(pe,oe.mode,Ne),se.return=oe,se):(se=y(se,pe.children||[]),se.return=oe,se)}function je(oe,se,pe,Ne,tt){return se===null||se.tag!==7?(se=Bo(pe,oe.mode,Ne,tt),se.return=oe,se):(se=y(se,pe),se.return=oe,se)}function Te(oe,se,pe){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return se=E1(""+se,oe.mode,pe),se.return=oe,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case v:return pe=X0(se.type,se.key,se.props,null,oe.mode,pe),th(pe,se),pe.return=oe,pe;case b:return se=_1(se,oe.mode,pe),se.return=oe,se;case Q:return se=$o(se),Te(oe,se,pe)}if(J(se)||V(se))return se=Bo(se,oe.mode,pe,null),se.return=oe,se;if(typeof se.then=="function")return Te(oe,nm(se),pe);if(se.$$typeof===M)return Te(oe,Z0(oe,se),pe);rm(oe,se)}return null}function be(oe,se,pe,Ne){var tt=se!==null?se.key:null;if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return tt!==null?null:I(oe,se,""+pe,Ne);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case v:return pe.key===tt?Z(oe,se,pe,Ne):null;case b:return pe.key===tt?xe(oe,se,pe,Ne):null;case Q:return pe=$o(pe),be(oe,se,pe,Ne)}if(J(pe)||V(pe))return tt!==null?null:je(oe,se,pe,Ne,null);if(typeof pe.then=="function")return be(oe,se,nm(pe),Ne);if(pe.$$typeof===M)return be(oe,se,Z0(oe,pe),Ne);rm(oe,pe)}return null}function Oe(oe,se,pe,Ne,tt){if(typeof Ne=="string"&&Ne!==""||typeof Ne=="number"||typeof Ne=="bigint")return oe=oe.get(pe)||null,I(se,oe,""+Ne,tt);if(typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case v:return oe=oe.get(Ne.key===null?pe:Ne.key)||null,Z(se,oe,Ne,tt);case b:return oe=oe.get(Ne.key===null?pe:Ne.key)||null,xe(se,oe,Ne,tt);case Q:return Ne=$o(Ne),Oe(oe,se,pe,Ne,tt)}if(J(Ne)||V(Ne))return oe=oe.get(pe)||null,je(se,oe,Ne,tt,null);if(typeof Ne.then=="function")return Oe(oe,se,pe,nm(Ne),tt);if(Ne.$$typeof===M)return Oe(oe,se,pe,Z0(se,Ne),tt);rm(se,Ne)}return null}function Ge(oe,se,pe,Ne){for(var tt=null,Kt=null,Ke=se,Ot=se=0,Qt=null;Ke!==null&&Ot<pe.length;Ot++){Ke.index>Ot?(Qt=Ke,Ke=null):Qt=Ke.sibling;var Zt=be(oe,Ke,pe[Ot],Ne);if(Zt===null){Ke===null&&(Ke=Qt);break}o&&Ke&&Zt.alternate===null&&d(oe,Ke),se=w(Zt,se,Ot),Kt===null?tt=Zt:Kt.sibling=Zt,Kt=Zt,Ke=Qt}if(Ot===pe.length)return f(oe,Ke),Ut&&Ra(oe,Ot),tt;if(Ke===null){for(;Ot<pe.length;Ot++)Ke=Te(oe,pe[Ot],Ne),Ke!==null&&(se=w(Ke,se,Ot),Kt===null?tt=Ke:Kt.sibling=Ke,Kt=Ke);return Ut&&Ra(oe,Ot),tt}for(Ke=g(Ke);Ot<pe.length;Ot++)Qt=Oe(Ke,oe,Ot,pe[Ot],Ne),Qt!==null&&(o&&Qt.alternate!==null&&Ke.delete(Qt.key===null?Ot:Qt.key),se=w(Qt,se,Ot),Kt===null?tt=Qt:Kt.sibling=Qt,Kt=Qt);return o&&Ke.forEach(function(Vl){return d(oe,Vl)}),Ut&&Ra(oe,Ot),tt}function lt(oe,se,pe,Ne){if(pe==null)throw Error(r(151));for(var tt=null,Kt=null,Ke=se,Ot=se=0,Qt=null,Zt=pe.next();Ke!==null&&!Zt.done;Ot++,Zt=pe.next()){Ke.index>Ot?(Qt=Ke,Ke=null):Qt=Ke.sibling;var Vl=be(oe,Ke,Zt.value,Ne);if(Vl===null){Ke===null&&(Ke=Qt);break}o&&Ke&&Vl.alternate===null&&d(oe,Ke),se=w(Vl,se,Ot),Kt===null?tt=Vl:Kt.sibling=Vl,Kt=Vl,Ke=Qt}if(Zt.done)return f(oe,Ke),Ut&&Ra(oe,Ot),tt;if(Ke===null){for(;!Zt.done;Ot++,Zt=pe.next())Zt=Te(oe,Zt.value,Ne),Zt!==null&&(se=w(Zt,se,Ot),Kt===null?tt=Zt:Kt.sibling=Zt,Kt=Zt);return Ut&&Ra(oe,Ot),tt}for(Ke=g(Ke);!Zt.done;Ot++,Zt=pe.next())Zt=Oe(Ke,oe,Ot,Zt.value,Ne),Zt!==null&&(o&&Zt.alternate!==null&&Ke.delete(Zt.key===null?Ot:Zt.key),se=w(Zt,se,Ot),Kt===null?tt=Zt:Kt.sibling=Zt,Kt=Zt);return o&&Ke.forEach(function(PI){return d(oe,PI)}),Ut&&Ra(oe,Ot),tt}function Sn(oe,se,pe,Ne){if(typeof pe=="object"&&pe!==null&&pe.type===O&&pe.key===null&&(pe=pe.props.children),typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case v:e:{for(var tt=pe.key;se!==null;){if(se.key===tt){if(tt=pe.type,tt===O){if(se.tag===7){f(oe,se.sibling),Ne=y(se,pe.props.children),Ne.return=oe,oe=Ne;break e}}else if(se.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===Q&&$o(tt)===se.type){f(oe,se.sibling),Ne=y(se,pe.props),th(Ne,pe),Ne.return=oe,oe=Ne;break e}f(oe,se);break}else d(oe,se);se=se.sibling}pe.type===O?(Ne=Bo(pe.props.children,oe.mode,Ne,pe.key),Ne.return=oe,oe=Ne):(Ne=X0(pe.type,pe.key,pe.props,null,oe.mode,Ne),th(Ne,pe),Ne.return=oe,oe=Ne)}return A(oe);case b:e:{for(tt=pe.key;se!==null;){if(se.key===tt)if(se.tag===4&&se.stateNode.containerInfo===pe.containerInfo&&se.stateNode.implementation===pe.implementation){f(oe,se.sibling),Ne=y(se,pe.children||[]),Ne.return=oe,oe=Ne;break e}else{f(oe,se);break}else d(oe,se);se=se.sibling}Ne=_1(pe,oe.mode,Ne),Ne.return=oe,oe=Ne}return A(oe);case Q:return pe=$o(pe),Sn(oe,se,pe,Ne)}if(J(pe))return Ge(oe,se,pe,Ne);if(V(pe)){if(tt=V(pe),typeof tt!="function")throw Error(r(150));return pe=tt.call(pe),lt(oe,se,pe,Ne)}if(typeof pe.then=="function")return Sn(oe,se,nm(pe),Ne);if(pe.$$typeof===M)return Sn(oe,se,Z0(oe,pe),Ne);rm(oe,pe)}return typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint"?(pe=""+pe,se!==null&&se.tag===6?(f(oe,se.sibling),Ne=y(se,pe),Ne.return=oe,oe=Ne):(f(oe,se),Ne=E1(pe,oe.mode,Ne),Ne.return=oe,oe=Ne),A(oe)):f(oe,se)}return function(oe,se,pe,Ne){try{eh=0;var tt=Sn(oe,se,pe,Ne);return ou=null,tt}catch(Ke){if(Ke===lu||Ke===em)throw Ke;var Kt=$s(29,Ke,null,oe.mode);return Kt.lanes=Ne,Kt.return=oe,Kt}finally{}}}var Uo=O6(!0),k6=O6(!1),Ml=!1;function H1(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function U1(o,d){o=o.updateQueue,d.updateQueue===o&&(d.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function Al(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function El(o,d,f){var g=o.updateQueue;if(g===null)return null;if(g=g.shared,(sn&2)!==0){var y=g.pending;return y===null?d.next=d:(d.next=y.next,y.next=d),g.pending=d,d=G0(o),l6(o,null,f),d}return W0(o,g,d,f),G0(o)}function nh(o,d,f){if(d=d.updateQueue,d!==null&&(d=d.shared,(f&4194048)!==0)){var g=d.lanes;g&=o.pendingLanes,f|=g,d.lanes=f,p3(o,f)}}function V1(o,d){var f=o.updateQueue,g=o.alternate;if(g!==null&&(g=g.updateQueue,f===g)){var y=null,w=null;if(f=f.firstBaseUpdate,f!==null){do{var A={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};w===null?y=w=A:w=w.next=A,f=f.next}while(f!==null);w===null?y=w=d:w=w.next=d}else y=w=d;f={baseState:g.baseState,firstBaseUpdate:y,lastBaseUpdate:w,shared:g.shared,callbacks:g.callbacks},o.updateQueue=f;return}o=f.lastBaseUpdate,o===null?f.firstBaseUpdate=d:o.next=d,f.lastBaseUpdate=d}var W1=!1;function rh(){if(W1){var o=au;if(o!==null)throw o}}function sh(o,d,f,g){W1=!1;var y=o.updateQueue;Ml=!1;var w=y.firstBaseUpdate,A=y.lastBaseUpdate,I=y.shared.pending;if(I!==null){y.shared.pending=null;var Z=I,xe=Z.next;Z.next=null,A===null?w=xe:A.next=xe,A=Z;var je=o.alternate;je!==null&&(je=je.updateQueue,I=je.lastBaseUpdate,I!==A&&(I===null?je.firstBaseUpdate=xe:I.next=xe,je.lastBaseUpdate=Z))}if(w!==null){var Te=y.baseState;A=0,je=xe=Z=null,I=w;do{var be=I.lane&-536870913,Oe=be!==I.lane;if(Oe?(qt&be)===be:(g&be)===be){be!==0&&be===iu&&(W1=!0),je!==null&&(je=je.next={lane:0,tag:I.tag,payload:I.payload,callback:null,next:null});e:{var Ge=o,lt=I;be=d;var Sn=f;switch(lt.tag){case 1:if(Ge=lt.payload,typeof Ge=="function"){Te=Ge.call(Sn,Te,be);break e}Te=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=lt.payload,be=typeof Ge=="function"?Ge.call(Sn,Te,be):Ge,be==null)break e;Te=p({},Te,be);break e;case 2:Ml=!0}}be=I.callback,be!==null&&(o.flags|=64,Oe&&(o.flags|=8192),Oe=y.callbacks,Oe===null?y.callbacks=[be]:Oe.push(be))}else Oe={lane:be,tag:I.tag,payload:I.payload,callback:I.callback,next:null},je===null?(xe=je=Oe,Z=Te):je=je.next=Oe,A|=be;if(I=I.next,I===null){if(I=y.shared.pending,I===null)break;Oe=I,I=Oe.next,Oe.next=null,y.lastBaseUpdate=Oe,y.shared.pending=null}}while(!0);je===null&&(Z=Te),y.baseState=Z,y.firstBaseUpdate=xe,y.lastBaseUpdate=je,w===null&&(y.shared.lanes=0),Pl|=A,o.lanes=A,o.memoizedState=Te}}function j6(o,d){if(typeof o!="function")throw Error(r(191,o));o.call(d)}function N6(o,d){var f=o.callbacks;if(f!==null)for(o.callbacks=null,o=0;o<f.length;o++)j6(f[o],d)}var cu=me(null),sm=me(0);function C6(o,d){o=Ua,P(sm,o),P(cu,d),Ua=o|d.baseLanes}function G1(){P(sm,Ua),P(cu,cu.current)}function X1(){Ua=sm.current,Y(cu),Y(sm)}var Hs=me(null),mi=null;function _l(o){var d=o.alternate;P(rr,rr.current&1),P(Hs,o),mi===null&&(d===null||cu.current!==null||d.memoizedState!==null)&&(mi=o)}function Y1(o){P(rr,rr.current),P(Hs,o),mi===null&&(mi=o)}function T6(o){o.tag===22?(P(rr,rr.current),P(Hs,o),mi===null&&(mi=o)):Dl()}function Dl(){P(rr,rr.current),P(Hs,Hs.current)}function Us(o){Y(Hs),mi===o&&(mi=null),Y(rr)}var rr=me(0);function im(o){for(var d=o;d!==null;){if(d.tag===13){var f=d.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||ny(f)||ry(f)))return d}else if(d.tag===19&&(d.memoizedProps.revealOrder==="forwards"||d.memoizedProps.revealOrder==="backwards"||d.memoizedProps.revealOrder==="unstable_legacy-backwards"||d.memoizedProps.revealOrder==="together")){if((d.flags&128)!==0)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===o)break;for(;d.sibling===null;){if(d.return===null||d.return===o)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var La=0,wt=null,bn=null,dr=null,am=!1,uu=!1,Vo=!1,lm=0,ih=0,du=null,NB=0;function er(){throw Error(r(321))}function K1(o,d){if(d===null)return!1;for(var f=0;f<d.length&&f<o.length;f++)if(!Qs(o[f],d[f]))return!1;return!0}function Z1(o,d,f,g,y,w){return La=w,wt=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,H.H=o===null||o.memoizedState===null?dS:fv,Vo=!1,w=f(g,y),Vo=!1,uu&&(w=A6(d,f,g,y)),M6(o),w}function M6(o){H.H=oh;var d=bn!==null&&bn.next!==null;if(La=0,dr=bn=wt=null,am=!1,ih=0,du=null,d)throw Error(r(300));o===null||hr||(o=o.dependencies,o!==null&&K0(o)&&(hr=!0))}function A6(o,d,f,g){wt=o;var y=0;do{if(uu&&(du=null),ih=0,uu=!1,25<=y)throw Error(r(301));if(y+=1,dr=bn=null,o.updateQueue!=null){var w=o.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}H.H=hS,w=d(f,g)}while(uu);return w}function CB(){var o=H.H,d=o.useState()[0];return d=typeof d.then=="function"?ah(d):d,o=o.useState()[0],(bn!==null?bn.memoizedState:null)!==o&&(wt.flags|=1024),d}function J1(){var o=lm!==0;return lm=0,o}function ev(o,d,f){d.updateQueue=o.updateQueue,d.flags&=-2053,o.lanes&=~f}function tv(o){if(am){for(o=o.memoizedState;o!==null;){var d=o.queue;d!==null&&(d.pending=null),o=o.next}am=!1}La=0,dr=bn=wt=null,uu=!1,ih=lm=0,du=null}function os(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dr===null?wt.memoizedState=dr=o:dr=dr.next=o,dr}function sr(){if(bn===null){var o=wt.alternate;o=o!==null?o.memoizedState:null}else o=bn.next;var d=dr===null?wt.memoizedState:dr.next;if(d!==null)dr=d,bn=o;else{if(o===null)throw wt.alternate===null?Error(r(467)):Error(r(310));bn=o,o={memoizedState:bn.memoizedState,baseState:bn.baseState,baseQueue:bn.baseQueue,queue:bn.queue,next:null},dr===null?wt.memoizedState=dr=o:dr=dr.next=o}return dr}function om(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ah(o){var d=ih;return ih+=1,du===null&&(du=[]),o=b6(du,o,d),d=wt,(dr===null?d.memoizedState:dr.next)===null&&(d=d.alternate,H.H=d===null||d.memoizedState===null?dS:fv),o}function cm(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return ah(o);if(o.$$typeof===M)return Fr(o)}throw Error(r(438,String(o)))}function nv(o){var d=null,f=wt.updateQueue;if(f!==null&&(d=f.memoCache),d==null){var g=wt.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(d={data:g.data.map(function(y){return y.slice()}),index:0})))}if(d==null&&(d={data:[],index:0}),f===null&&(f=om(),wt.updateQueue=f),f.memoCache=d,f=d.data[d.index],f===void 0)for(f=d.data[d.index]=Array(o),g=0;g<o;g++)f[g]=B;return d.index++,f}function Ba(o,d){return typeof d=="function"?d(o):d}function um(o){var d=sr();return rv(d,bn,o)}function rv(o,d,f){var g=o.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=f;var y=o.baseQueue,w=g.pending;if(w!==null){if(y!==null){var A=y.next;y.next=w.next,w.next=A}d.baseQueue=y=w,g.pending=null}if(w=o.baseState,y===null)o.memoizedState=w;else{d=y.next;var I=A=null,Z=null,xe=d,je=!1;do{var Te=xe.lane&-536870913;if(Te!==xe.lane?(qt&Te)===Te:(La&Te)===Te){var be=xe.revertLane;if(be===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null}),Te===iu&&(je=!0);else if((La&be)===be){xe=xe.next,be===iu&&(je=!0);continue}else Te={lane:0,revertLane:xe.revertLane,gesture:null,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null},Z===null?(I=Z=Te,A=w):Z=Z.next=Te,wt.lanes|=be,Pl|=be;Te=xe.action,Vo&&f(w,Te),w=xe.hasEagerState?xe.eagerState:f(w,Te)}else be={lane:Te,revertLane:xe.revertLane,gesture:xe.gesture,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null},Z===null?(I=Z=be,A=w):Z=Z.next=be,wt.lanes|=Te,Pl|=Te;xe=xe.next}while(xe!==null&&xe!==d);if(Z===null?A=w:Z.next=I,!Qs(w,o.memoizedState)&&(hr=!0,je&&(f=au,f!==null)))throw f;o.memoizedState=w,o.baseState=A,o.baseQueue=Z,g.lastRenderedState=w}return y===null&&(g.lanes=0),[o.memoizedState,g.dispatch]}function sv(o){var d=sr(),f=d.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=o;var g=f.dispatch,y=f.pending,w=d.memoizedState;if(y!==null){f.pending=null;var A=y=y.next;do w=o(w,A.action),A=A.next;while(A!==y);Qs(w,d.memoizedState)||(hr=!0),d.memoizedState=w,d.baseQueue===null&&(d.baseState=w),f.lastRenderedState=w}return[w,g]}function E6(o,d,f){var g=wt,y=sr(),w=Ut;if(w){if(f===void 0)throw Error(r(407));f=f()}else f=d();var A=!Qs((bn||y).memoizedState,f);if(A&&(y.memoizedState=f,hr=!0),y=y.queue,lv(R6.bind(null,g,y,o),[o]),y.getSnapshot!==d||A||dr!==null&&dr.memoizedState.tag&1){if(g.flags|=2048,hu(9,{destroy:void 0},D6.bind(null,g,y,f,d),null),Mn===null)throw Error(r(349));w||(La&127)!==0||_6(g,d,f)}return f}function _6(o,d,f){o.flags|=16384,o={getSnapshot:d,value:f},d=wt.updateQueue,d===null?(d=om(),wt.updateQueue=d,d.stores=[o]):(f=d.stores,f===null?d.stores=[o]:f.push(o))}function D6(o,d,f,g){d.value=f,d.getSnapshot=g,z6(d)&&P6(o)}function R6(o,d,f){return f(function(){z6(d)&&P6(o)})}function z6(o){var d=o.getSnapshot;o=o.value;try{var f=d();return!Qs(o,f)}catch{return!0}}function P6(o){var d=Lo(o,2);d!==null&&js(d,o,2)}function iv(o){var d=os();if(typeof o=="function"){var f=o;if(o=f(),Vo){pt(!0);try{f()}finally{pt(!1)}}}return d.memoizedState=d.baseState=o,d.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ba,lastRenderedState:o},d}function L6(o,d,f,g){return o.baseState=f,rv(o,bn,typeof g=="function"?g:Ba)}function TB(o,d,f,g,y){if(fm(o))throw Error(r(485));if(o=d.action,o!==null){var w={payload:y,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){w.listeners.push(A)}};H.T!==null?f(!0):w.isTransition=!1,g(w),f=d.pending,f===null?(w.next=d.pending=w,B6(d,w)):(w.next=f.next,d.pending=f.next=w)}}function B6(o,d){var f=d.action,g=d.payload,y=o.state;if(d.isTransition){var w=H.T,A={};H.T=A;try{var I=f(y,g),Z=H.S;Z!==null&&Z(A,I),I6(o,d,I)}catch(xe){av(o,d,xe)}finally{w!==null&&A.types!==null&&(w.types=A.types),H.T=w}}else try{w=f(y,g),I6(o,d,w)}catch(xe){av(o,d,xe)}}function I6(o,d,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(g){F6(o,d,g)},function(g){return av(o,d,g)}):F6(o,d,f)}function F6(o,d,f){d.status="fulfilled",d.value=f,q6(d),o.state=f,d=o.pending,d!==null&&(f=d.next,f===d?o.pending=null:(f=f.next,d.next=f,B6(o,f)))}function av(o,d,f){var g=o.pending;if(o.pending=null,g!==null){g=g.next;do d.status="rejected",d.reason=f,q6(d),d=d.next;while(d!==g)}o.action=null}function q6(o){o=o.listeners;for(var d=0;d<o.length;d++)(0,o[d])()}function Q6(o,d){return d}function $6(o,d){if(Ut){var f=Mn.formState;if(f!==null){e:{var g=wt;if(Ut){if(Fn){t:{for(var y=Fn,w=fi;y.nodeType!==8;){if(!w){y=null;break t}if(y=pi(y.nextSibling),y===null){y=null;break t}}w=y.data,y=w==="F!"||w==="F"?y:null}if(y){Fn=pi(y.nextSibling),g=y.data==="F!";break e}}Cl(g)}g=!1}g&&(d=f[0])}}return f=os(),f.memoizedState=f.baseState=d,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Q6,lastRenderedState:d},f.queue=g,f=oS.bind(null,wt,g),g.dispatch=f,g=iv(!1),w=hv.bind(null,wt,!1,g.queue),g=os(),y={state:d,dispatch:null,action:o,pending:null},g.queue=y,f=TB.bind(null,wt,y,w,f),y.dispatch=f,g.memoizedState=o,[d,f,!1]}function H6(o){var d=sr();return U6(d,bn,o)}function U6(o,d,f){if(d=rv(o,d,Q6)[0],o=um(Ba)[0],typeof d=="object"&&d!==null&&typeof d.then=="function")try{var g=ah(d)}catch(A){throw A===lu?em:A}else g=d;d=sr();var y=d.queue,w=y.dispatch;return f!==d.memoizedState&&(wt.flags|=2048,hu(9,{destroy:void 0},MB.bind(null,y,f),null)),[g,w,o]}function MB(o,d){o.action=d}function V6(o){var d=sr(),f=bn;if(f!==null)return U6(d,f,o);sr(),d=d.memoizedState,f=sr();var g=f.queue.dispatch;return f.memoizedState=o,[d,g,!1]}function hu(o,d,f,g){return o={tag:o,create:f,deps:g,inst:d,next:null},d=wt.updateQueue,d===null&&(d=om(),wt.updateQueue=d),f=d.lastEffect,f===null?d.lastEffect=o.next=o:(g=f.next,f.next=o,o.next=g,d.lastEffect=o),o}function W6(){return sr().memoizedState}function dm(o,d,f,g){var y=os();wt.flags|=o,y.memoizedState=hu(1|d,{destroy:void 0},f,g===void 0?null:g)}function hm(o,d,f,g){var y=sr();g=g===void 0?null:g;var w=y.memoizedState.inst;bn!==null&&g!==null&&K1(g,bn.memoizedState.deps)?y.memoizedState=hu(d,w,f,g):(wt.flags|=o,y.memoizedState=hu(1|d,w,f,g))}function G6(o,d){dm(8390656,8,o,d)}function lv(o,d){hm(2048,8,o,d)}function AB(o){wt.flags|=4;var d=wt.updateQueue;if(d===null)d=om(),wt.updateQueue=d,d.events=[o];else{var f=d.events;f===null?d.events=[o]:f.push(o)}}function X6(o){var d=sr().memoizedState;return AB({ref:d,nextImpl:o}),function(){if((sn&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}function Y6(o,d){return hm(4,2,o,d)}function K6(o,d){return hm(4,4,o,d)}function Z6(o,d){if(typeof d=="function"){o=o();var f=d(o);return function(){typeof f=="function"?f():d(null)}}if(d!=null)return o=o(),d.current=o,function(){d.current=null}}function J6(o,d,f){f=f!=null?f.concat([o]):null,hm(4,4,Z6.bind(null,d,o),f)}function ov(){}function eS(o,d){var f=sr();d=d===void 0?null:d;var g=f.memoizedState;return d!==null&&K1(d,g[1])?g[0]:(f.memoizedState=[o,d],o)}function tS(o,d){var f=sr();d=d===void 0?null:d;var g=f.memoizedState;if(d!==null&&K1(d,g[1]))return g[0];if(g=o(),Vo){pt(!0);try{o()}finally{pt(!1)}}return f.memoizedState=[g,d],g}function cv(o,d,f){return f===void 0||(La&1073741824)!==0&&(qt&261930)===0?o.memoizedState=d:(o.memoizedState=f,o=nO(),wt.lanes|=o,Pl|=o,f)}function nS(o,d,f,g){return Qs(f,d)?f:cu.current!==null?(o=cv(o,f,g),Qs(o,d)||(hr=!0),o):(La&42)===0||(La&1073741824)!==0&&(qt&261930)===0?(hr=!0,o.memoizedState=f):(o=nO(),wt.lanes|=o,Pl|=o,d)}function rS(o,d,f,g,y){var w=ae.p;ae.p=w!==0&&8>w?w:8;var A=H.T,I={};H.T=I,hv(o,!1,d,f);try{var Z=y(),xe=H.S;if(xe!==null&&xe(I,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var je=jB(Z,g);lh(o,d,je,Gs(o))}else lh(o,d,g,Gs(o))}catch(Te){lh(o,d,{then:function(){},status:"rejected",reason:Te},Gs())}finally{ae.p=w,A!==null&&I.types!==null&&(A.types=I.types),H.T=A}}function EB(){}function uv(o,d,f,g){if(o.tag!==5)throw Error(r(476));var y=sS(o).queue;rS(o,y,d,ne,f===null?EB:function(){return iS(o),f(g)})}function sS(o){var d=o.memoizedState;if(d!==null)return d;d={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ba,lastRenderedState:ne},next:null};var f={};return d.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ba,lastRenderedState:f},next:null},o.memoizedState=d,o=o.alternate,o!==null&&(o.memoizedState=d),d}function iS(o){var d=sS(o);d.next===null&&(d=o.alternate.memoizedState),lh(o,d.next.queue,{},Gs())}function dv(){return Fr(kh)}function aS(){return sr().memoizedState}function lS(){return sr().memoizedState}function _B(o){for(var d=o.return;d!==null;){switch(d.tag){case 24:case 3:var f=Gs();o=Al(f);var g=El(d,o,f);g!==null&&(js(g,d,f),nh(g,d,f)),d={cache:F1()},o.payload=d;return}d=d.return}}function DB(o,d,f){var g=Gs();f={lane:g,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},fm(o)?cS(d,f):(f=M1(o,d,f,g),f!==null&&(js(f,o,g),uS(f,d,g)))}function oS(o,d,f){var g=Gs();lh(o,d,f,g)}function lh(o,d,f,g){var y={lane:g,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(fm(o))cS(d,y);else{var w=o.alternate;if(o.lanes===0&&(w===null||w.lanes===0)&&(w=d.lastRenderedReducer,w!==null))try{var A=d.lastRenderedState,I=w(A,f);if(y.hasEagerState=!0,y.eagerState=I,Qs(I,A))return W0(o,d,y,0),Mn===null&&V0(),!1}catch{}finally{}if(f=M1(o,d,y,g),f!==null)return js(f,o,g),uS(f,d,g),!0}return!1}function hv(o,d,f,g){if(g={lane:2,revertLane:Hv(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},fm(o)){if(d)throw Error(r(479))}else d=M1(o,f,g,2),d!==null&&js(d,o,2)}function fm(o){var d=o.alternate;return o===wt||d!==null&&d===wt}function cS(o,d){uu=am=!0;var f=o.pending;f===null?d.next=d:(d.next=f.next,f.next=d),o.pending=d}function uS(o,d,f){if((f&4194048)!==0){var g=d.lanes;g&=o.pendingLanes,f|=g,d.lanes=f,p3(o,f)}}var oh={readContext:Fr,use:cm,useCallback:er,useContext:er,useEffect:er,useImperativeHandle:er,useLayoutEffect:er,useInsertionEffect:er,useMemo:er,useReducer:er,useRef:er,useState:er,useDebugValue:er,useDeferredValue:er,useTransition:er,useSyncExternalStore:er,useId:er,useHostTransitionStatus:er,useFormState:er,useActionState:er,useOptimistic:er,useMemoCache:er,useCacheRefresh:er};oh.useEffectEvent=er;var dS={readContext:Fr,use:cm,useCallback:function(o,d){return os().memoizedState=[o,d===void 0?null:d],o},useContext:Fr,useEffect:G6,useImperativeHandle:function(o,d,f){f=f!=null?f.concat([o]):null,dm(4194308,4,Z6.bind(null,d,o),f)},useLayoutEffect:function(o,d){return dm(4194308,4,o,d)},useInsertionEffect:function(o,d){dm(4,2,o,d)},useMemo:function(o,d){var f=os();d=d===void 0?null:d;var g=o();if(Vo){pt(!0);try{o()}finally{pt(!1)}}return f.memoizedState=[g,d],g},useReducer:function(o,d,f){var g=os();if(f!==void 0){var y=f(d);if(Vo){pt(!0);try{f(d)}finally{pt(!1)}}}else y=d;return g.memoizedState=g.baseState=y,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:y},g.queue=o,o=o.dispatch=DB.bind(null,wt,o),[g.memoizedState,o]},useRef:function(o){var d=os();return o={current:o},d.memoizedState=o},useState:function(o){o=iv(o);var d=o.queue,f=oS.bind(null,wt,d);return d.dispatch=f,[o.memoizedState,f]},useDebugValue:ov,useDeferredValue:function(o,d){var f=os();return cv(f,o,d)},useTransition:function(){var o=iv(!1);return o=rS.bind(null,wt,o.queue,!0,!1),os().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,d,f){var g=wt,y=os();if(Ut){if(f===void 0)throw Error(r(407));f=f()}else{if(f=d(),Mn===null)throw Error(r(349));(qt&127)!==0||_6(g,d,f)}y.memoizedState=f;var w={value:f,getSnapshot:d};return y.queue=w,G6(R6.bind(null,g,w,o),[o]),g.flags|=2048,hu(9,{destroy:void 0},D6.bind(null,g,w,f,d),null),f},useId:function(){var o=os(),d=Mn.identifierPrefix;if(Ut){var f=Xi,g=Gi;f=(g&~(1<<32-vt(g)-1)).toString(32)+f,d="_"+d+"R_"+f,f=lm++,0<f&&(d+="H"+f.toString(32)),d+="_"}else f=NB++,d="_"+d+"r_"+f.toString(32)+"_";return o.memoizedState=d},useHostTransitionStatus:dv,useFormState:$6,useActionState:$6,useOptimistic:function(o){var d=os();d.memoizedState=d.baseState=o;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return d.queue=f,d=hv.bind(null,wt,!0,f),f.dispatch=d,[o,d]},useMemoCache:nv,useCacheRefresh:function(){return os().memoizedState=_B.bind(null,wt)},useEffectEvent:function(o){var d=os(),f={impl:o};return d.memoizedState=f,function(){if((sn&2)!==0)throw Error(r(440));return f.impl.apply(void 0,arguments)}}},fv={readContext:Fr,use:cm,useCallback:eS,useContext:Fr,useEffect:lv,useImperativeHandle:J6,useInsertionEffect:Y6,useLayoutEffect:K6,useMemo:tS,useReducer:um,useRef:W6,useState:function(){return um(Ba)},useDebugValue:ov,useDeferredValue:function(o,d){var f=sr();return nS(f,bn.memoizedState,o,d)},useTransition:function(){var o=um(Ba)[0],d=sr().memoizedState;return[typeof o=="boolean"?o:ah(o),d]},useSyncExternalStore:E6,useId:aS,useHostTransitionStatus:dv,useFormState:H6,useActionState:H6,useOptimistic:function(o,d){var f=sr();return L6(f,bn,o,d)},useMemoCache:nv,useCacheRefresh:lS};fv.useEffectEvent=X6;var hS={readContext:Fr,use:cm,useCallback:eS,useContext:Fr,useEffect:lv,useImperativeHandle:J6,useInsertionEffect:Y6,useLayoutEffect:K6,useMemo:tS,useReducer:sv,useRef:W6,useState:function(){return sv(Ba)},useDebugValue:ov,useDeferredValue:function(o,d){var f=sr();return bn===null?cv(f,o,d):nS(f,bn.memoizedState,o,d)},useTransition:function(){var o=sv(Ba)[0],d=sr().memoizedState;return[typeof o=="boolean"?o:ah(o),d]},useSyncExternalStore:E6,useId:aS,useHostTransitionStatus:dv,useFormState:V6,useActionState:V6,useOptimistic:function(o,d){var f=sr();return bn!==null?L6(f,bn,o,d):(f.baseState=o,[o,f.queue.dispatch])},useMemoCache:nv,useCacheRefresh:lS};hS.useEffectEvent=X6;function mv(o,d,f,g){d=o.memoizedState,f=f(g,d),f=f==null?d:p({},d,f),o.memoizedState=f,o.lanes===0&&(o.updateQueue.baseState=f)}var pv={enqueueSetState:function(o,d,f){o=o._reactInternals;var g=Gs(),y=Al(g);y.payload=d,f!=null&&(y.callback=f),d=El(o,y,g),d!==null&&(js(d,o,g),nh(d,o,g))},enqueueReplaceState:function(o,d,f){o=o._reactInternals;var g=Gs(),y=Al(g);y.tag=1,y.payload=d,f!=null&&(y.callback=f),d=El(o,y,g),d!==null&&(js(d,o,g),nh(d,o,g))},enqueueForceUpdate:function(o,d){o=o._reactInternals;var f=Gs(),g=Al(f);g.tag=2,d!=null&&(g.callback=d),d=El(o,g,f),d!==null&&(js(d,o,f),nh(d,o,f))}};function fS(o,d,f,g,y,w,A){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(g,w,A):d.prototype&&d.prototype.isPureReactComponent?!Gd(f,g)||!Gd(y,w):!0}function mS(o,d,f,g){o=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(f,g),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(f,g),d.state!==o&&pv.enqueueReplaceState(d,d.state,null)}function Wo(o,d){var f=d;if("ref"in d){f={};for(var g in d)g!=="ref"&&(f[g]=d[g])}if(o=o.defaultProps){f===d&&(f=p({},f));for(var y in o)f[y]===void 0&&(f[y]=o[y])}return f}function pS(o){U0(o)}function gS(o){console.error(o)}function xS(o){U0(o)}function mm(o,d){try{var f=o.onUncaughtError;f(d.value,{componentStack:d.stack})}catch(g){setTimeout(function(){throw g})}}function vS(o,d,f){try{var g=o.onCaughtError;g(f.value,{componentStack:f.stack,errorBoundary:d.tag===1?d.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function gv(o,d,f){return f=Al(f),f.tag=3,f.payload={element:null},f.callback=function(){mm(o,d)},f}function yS(o){return o=Al(o),o.tag=3,o}function bS(o,d,f,g){var y=f.type.getDerivedStateFromError;if(typeof y=="function"){var w=g.value;o.payload=function(){return y(w)},o.callback=function(){vS(d,f,g)}}var A=f.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(o.callback=function(){vS(d,f,g),typeof y!="function"&&(Ll===null?Ll=new Set([this]):Ll.add(this));var I=g.stack;this.componentDidCatch(g.value,{componentStack:I!==null?I:""})})}function RB(o,d,f,g,y){if(f.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(d=f.alternate,d!==null&&su(d,f,y,!0),f=Hs.current,f!==null){switch(f.tag){case 31:case 13:return mi===null?Nm():f.alternate===null&&tr===0&&(tr=3),f.flags&=-257,f.flags|=65536,f.lanes=y,g===tm?f.flags|=16384:(d=f.updateQueue,d===null?f.updateQueue=new Set([g]):d.add(g),qv(o,g,y)),!1;case 22:return f.flags|=65536,g===tm?f.flags|=16384:(d=f.updateQueue,d===null?(d={transitions:null,markerInstances:null,retryQueue:new Set([g])},f.updateQueue=d):(f=d.retryQueue,f===null?d.retryQueue=new Set([g]):f.add(g)),qv(o,g,y)),!1}throw Error(r(435,f.tag))}return qv(o,g,y),Nm(),!1}if(Ut)return d=Hs.current,d!==null?((d.flags&65536)===0&&(d.flags|=256),d.flags|=65536,d.lanes=y,g!==z1&&(o=Error(r(422),{cause:g}),Kd(ui(o,f)))):(g!==z1&&(d=Error(r(423),{cause:g}),Kd(ui(d,f))),o=o.current.alternate,o.flags|=65536,y&=-y,o.lanes|=y,g=ui(g,f),y=gv(o.stateNode,g,y),V1(o,y),tr!==4&&(tr=2)),!1;var w=Error(r(520),{cause:g});if(w=ui(w,f),gh===null?gh=[w]:gh.push(w),tr!==4&&(tr=2),d===null)return!0;g=ui(g,f),f=d;do{switch(f.tag){case 3:return f.flags|=65536,o=y&-y,f.lanes|=o,o=gv(f.stateNode,g,o),V1(f,o),!1;case 1:if(d=f.type,w=f.stateNode,(f.flags&128)===0&&(typeof d.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Ll===null||!Ll.has(w))))return f.flags|=65536,y&=-y,f.lanes|=y,y=yS(y),bS(y,o,f,g),V1(f,y),!1}f=f.return}while(f!==null);return!1}var xv=Error(r(461)),hr=!1;function qr(o,d,f,g){d.child=o===null?k6(d,null,f,g):Uo(d,o.child,f,g)}function wS(o,d,f,g,y){f=f.render;var w=d.ref;if("ref"in g){var A={};for(var I in g)I!=="ref"&&(A[I]=g[I])}else A=g;return qo(d),g=Z1(o,d,f,A,w,y),I=J1(),o!==null&&!hr?(ev(o,d,y),Ia(o,d,y)):(Ut&&I&&D1(d),d.flags|=1,qr(o,d,g,y),d.child)}function SS(o,d,f,g,y){if(o===null){var w=f.type;return typeof w=="function"&&!A1(w)&&w.defaultProps===void 0&&f.compare===null?(d.tag=15,d.type=w,OS(o,d,w,g,y)):(o=X0(f.type,null,g,d,d.mode,y),o.ref=d.ref,o.return=d,d.child=o)}if(w=o.child,!jv(o,y)){var A=w.memoizedProps;if(f=f.compare,f=f!==null?f:Gd,f(A,g)&&o.ref===d.ref)return Ia(o,d,y)}return d.flags|=1,o=Da(w,g),o.ref=d.ref,o.return=d,d.child=o}function OS(o,d,f,g,y){if(o!==null){var w=o.memoizedProps;if(Gd(w,g)&&o.ref===d.ref)if(hr=!1,d.pendingProps=g=w,jv(o,y))(o.flags&131072)!==0&&(hr=!0);else return d.lanes=o.lanes,Ia(o,d,y)}return vv(o,d,f,g,y)}function kS(o,d,f,g){var y=g.children,w=o!==null?o.memoizedState:null;if(o===null&&d.stateNode===null&&(d.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((d.flags&128)!==0){if(w=w!==null?w.baseLanes|f:f,o!==null){for(g=d.child=o.child,y=0;g!==null;)y=y|g.lanes|g.childLanes,g=g.sibling;g=y&~w}else g=0,d.child=null;return jS(o,d,w,f,g)}if((f&536870912)!==0)d.memoizedState={baseLanes:0,cachePool:null},o!==null&&J0(d,w!==null?w.cachePool:null),w!==null?C6(d,w):G1(),T6(d);else return g=d.lanes=536870912,jS(o,d,w!==null?w.baseLanes|f:f,f,g)}else w!==null?(J0(d,w.cachePool),C6(d,w),Dl(),d.memoizedState=null):(o!==null&&J0(d,null),G1(),Dl());return qr(o,d,y,f),d.child}function ch(o,d){return o!==null&&o.tag===22||d.stateNode!==null||(d.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.sibling}function jS(o,d,f,g,y){var w=Q1();return w=w===null?null:{parent:ur._currentValue,pool:w},d.memoizedState={baseLanes:f,cachePool:w},o!==null&&J0(d,null),G1(),T6(d),o!==null&&su(o,d,g,!0),d.childLanes=y,null}function pm(o,d){return d=xm({mode:d.mode,children:d.children},o.mode),d.ref=o.ref,o.child=d,d.return=o,d}function NS(o,d,f){return Uo(d,o.child,null,f),o=pm(d,d.pendingProps),o.flags|=2,Us(d),d.memoizedState=null,o}function zB(o,d,f){var g=d.pendingProps,y=(d.flags&128)!==0;if(d.flags&=-129,o===null){if(Ut){if(g.mode==="hidden")return o=pm(d,g),d.lanes=536870912,ch(null,o);if(Y1(d),(o=Fn)?(o=BO(o,fi),o=o!==null&&o.data==="&"?o:null,o!==null&&(d.memoizedState={dehydrated:o,treeContext:jl!==null?{id:Gi,overflow:Xi}:null,retryLane:536870912,hydrationErrors:null},f=c6(o),f.return=d,d.child=f,Ir=d,Fn=null)):o=null,o===null)throw Cl(d);return d.lanes=536870912,null}return pm(d,g)}var w=o.memoizedState;if(w!==null){var A=w.dehydrated;if(Y1(d),y)if(d.flags&256)d.flags&=-257,d=NS(o,d,f);else if(d.memoizedState!==null)d.child=o.child,d.flags|=128,d=null;else throw Error(r(558));else if(hr||su(o,d,f,!1),y=(f&o.childLanes)!==0,hr||y){if(g=Mn,g!==null&&(A=g3(g,f),A!==0&&A!==w.retryLane))throw w.retryLane=A,Lo(o,A),js(g,o,A),xv;Nm(),d=NS(o,d,f)}else o=w.treeContext,Fn=pi(A.nextSibling),Ir=d,Ut=!0,Nl=null,fi=!1,o!==null&&h6(d,o),d=pm(d,g),d.flags|=4096;return d}return o=Da(o.child,{mode:g.mode,children:g.children}),o.ref=d.ref,d.child=o,o.return=d,o}function gm(o,d){var f=d.ref;if(f===null)o!==null&&o.ref!==null&&(d.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(r(284));(o===null||o.ref!==f)&&(d.flags|=4194816)}}function vv(o,d,f,g,y){return qo(d),f=Z1(o,d,f,g,void 0,y),g=J1(),o!==null&&!hr?(ev(o,d,y),Ia(o,d,y)):(Ut&&g&&D1(d),d.flags|=1,qr(o,d,f,y),d.child)}function CS(o,d,f,g,y,w){return qo(d),d.updateQueue=null,f=A6(d,g,f,y),M6(o),g=J1(),o!==null&&!hr?(ev(o,d,w),Ia(o,d,w)):(Ut&&g&&D1(d),d.flags|=1,qr(o,d,f,w),d.child)}function TS(o,d,f,g,y){if(qo(d),d.stateNode===null){var w=eu,A=f.contextType;typeof A=="object"&&A!==null&&(w=Fr(A)),w=new f(g,w),d.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=pv,d.stateNode=w,w._reactInternals=d,w=d.stateNode,w.props=g,w.state=d.memoizedState,w.refs={},H1(d),A=f.contextType,w.context=typeof A=="object"&&A!==null?Fr(A):eu,w.state=d.memoizedState,A=f.getDerivedStateFromProps,typeof A=="function"&&(mv(d,f,A,g),w.state=d.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(A=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),A!==w.state&&pv.enqueueReplaceState(w,w.state,null),sh(d,g,w,y),rh(),w.state=d.memoizedState),typeof w.componentDidMount=="function"&&(d.flags|=4194308),g=!0}else if(o===null){w=d.stateNode;var I=d.memoizedProps,Z=Wo(f,I);w.props=Z;var xe=w.context,je=f.contextType;A=eu,typeof je=="object"&&je!==null&&(A=Fr(je));var Te=f.getDerivedStateFromProps;je=typeof Te=="function"||typeof w.getSnapshotBeforeUpdate=="function",I=d.pendingProps!==I,je||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(I||xe!==A)&&mS(d,w,g,A),Ml=!1;var be=d.memoizedState;w.state=be,sh(d,g,w,y),rh(),xe=d.memoizedState,I||be!==xe||Ml?(typeof Te=="function"&&(mv(d,f,Te,g),xe=d.memoizedState),(Z=Ml||fS(d,f,Z,g,be,xe,A))?(je||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(d.flags|=4194308)):(typeof w.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=g,d.memoizedState=xe),w.props=g,w.state=xe,w.context=A,g=Z):(typeof w.componentDidMount=="function"&&(d.flags|=4194308),g=!1)}else{w=d.stateNode,U1(o,d),A=d.memoizedProps,je=Wo(f,A),w.props=je,Te=d.pendingProps,be=w.context,xe=f.contextType,Z=eu,typeof xe=="object"&&xe!==null&&(Z=Fr(xe)),I=f.getDerivedStateFromProps,(xe=typeof I=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(A!==Te||be!==Z)&&mS(d,w,g,Z),Ml=!1,be=d.memoizedState,w.state=be,sh(d,g,w,y),rh();var Oe=d.memoizedState;A!==Te||be!==Oe||Ml||o!==null&&o.dependencies!==null&&K0(o.dependencies)?(typeof I=="function"&&(mv(d,f,I,g),Oe=d.memoizedState),(je=Ml||fS(d,f,je,g,be,Oe,Z)||o!==null&&o.dependencies!==null&&K0(o.dependencies))?(xe||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(g,Oe,Z),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(g,Oe,Z)),typeof w.componentDidUpdate=="function"&&(d.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof w.componentDidUpdate!="function"||A===o.memoizedProps&&be===o.memoizedState||(d.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||A===o.memoizedProps&&be===o.memoizedState||(d.flags|=1024),d.memoizedProps=g,d.memoizedState=Oe),w.props=g,w.state=Oe,w.context=Z,g=je):(typeof w.componentDidUpdate!="function"||A===o.memoizedProps&&be===o.memoizedState||(d.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||A===o.memoizedProps&&be===o.memoizedState||(d.flags|=1024),g=!1)}return w=g,gm(o,d),g=(d.flags&128)!==0,w||g?(w=d.stateNode,f=g&&typeof f.getDerivedStateFromError!="function"?null:w.render(),d.flags|=1,o!==null&&g?(d.child=Uo(d,o.child,null,y),d.child=Uo(d,null,f,y)):qr(o,d,f,y),d.memoizedState=w.state,o=d.child):o=Ia(o,d,y),o}function MS(o,d,f,g){return Io(),d.flags|=256,qr(o,d,f,g),d.child}var yv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bv(o){return{baseLanes:o,cachePool:v6()}}function wv(o,d,f){return o=o!==null?o.childLanes&~f:0,d&&(o|=Ws),o}function AS(o,d,f){var g=d.pendingProps,y=!1,w=(d.flags&128)!==0,A;if((A=w)||(A=o!==null&&o.memoizedState===null?!1:(rr.current&2)!==0),A&&(y=!0,d.flags&=-129),A=(d.flags&32)!==0,d.flags&=-33,o===null){if(Ut){if(y?_l(d):Dl(),(o=Fn)?(o=BO(o,fi),o=o!==null&&o.data!=="&"?o:null,o!==null&&(d.memoizedState={dehydrated:o,treeContext:jl!==null?{id:Gi,overflow:Xi}:null,retryLane:536870912,hydrationErrors:null},f=c6(o),f.return=d,d.child=f,Ir=d,Fn=null)):o=null,o===null)throw Cl(d);return ry(o)?d.lanes=32:d.lanes=536870912,null}var I=g.children;return g=g.fallback,y?(Dl(),y=d.mode,I=xm({mode:"hidden",children:I},y),g=Bo(g,y,f,null),I.return=d,g.return=d,I.sibling=g,d.child=I,g=d.child,g.memoizedState=bv(f),g.childLanes=wv(o,A,f),d.memoizedState=yv,ch(null,g)):(_l(d),Sv(d,I))}var Z=o.memoizedState;if(Z!==null&&(I=Z.dehydrated,I!==null)){if(w)d.flags&256?(_l(d),d.flags&=-257,d=Ov(o,d,f)):d.memoizedState!==null?(Dl(),d.child=o.child,d.flags|=128,d=null):(Dl(),I=g.fallback,y=d.mode,g=xm({mode:"visible",children:g.children},y),I=Bo(I,y,f,null),I.flags|=2,g.return=d,I.return=d,g.sibling=I,d.child=g,Uo(d,o.child,null,f),g=d.child,g.memoizedState=bv(f),g.childLanes=wv(o,A,f),d.memoizedState=yv,d=ch(null,g));else if(_l(d),ry(I)){if(A=I.nextSibling&&I.nextSibling.dataset,A)var xe=A.dgst;A=xe,g=Error(r(419)),g.stack="",g.digest=A,Kd({value:g,source:null,stack:null}),d=Ov(o,d,f)}else if(hr||su(o,d,f,!1),A=(f&o.childLanes)!==0,hr||A){if(A=Mn,A!==null&&(g=g3(A,f),g!==0&&g!==Z.retryLane))throw Z.retryLane=g,Lo(o,g),js(A,o,g),xv;ny(I)||Nm(),d=Ov(o,d,f)}else ny(I)?(d.flags|=192,d.child=o.child,d=null):(o=Z.treeContext,Fn=pi(I.nextSibling),Ir=d,Ut=!0,Nl=null,fi=!1,o!==null&&h6(d,o),d=Sv(d,g.children),d.flags|=4096);return d}return y?(Dl(),I=g.fallback,y=d.mode,Z=o.child,xe=Z.sibling,g=Da(Z,{mode:"hidden",children:g.children}),g.subtreeFlags=Z.subtreeFlags&65011712,xe!==null?I=Da(xe,I):(I=Bo(I,y,f,null),I.flags|=2),I.return=d,g.return=d,g.sibling=I,d.child=g,ch(null,g),g=d.child,I=o.child.memoizedState,I===null?I=bv(f):(y=I.cachePool,y!==null?(Z=ur._currentValue,y=y.parent!==Z?{parent:Z,pool:Z}:y):y=v6(),I={baseLanes:I.baseLanes|f,cachePool:y}),g.memoizedState=I,g.childLanes=wv(o,A,f),d.memoizedState=yv,ch(o.child,g)):(_l(d),f=o.child,o=f.sibling,f=Da(f,{mode:"visible",children:g.children}),f.return=d,f.sibling=null,o!==null&&(A=d.deletions,A===null?(d.deletions=[o],d.flags|=16):A.push(o)),d.child=f,d.memoizedState=null,f)}function Sv(o,d){return d=xm({mode:"visible",children:d},o.mode),d.return=o,o.child=d}function xm(o,d){return o=$s(22,o,null,d),o.lanes=0,o}function Ov(o,d,f){return Uo(d,o.child,null,f),o=Sv(d,d.pendingProps.children),o.flags|=2,d.memoizedState=null,o}function ES(o,d,f){o.lanes|=d;var g=o.alternate;g!==null&&(g.lanes|=d),B1(o.return,d,f)}function kv(o,d,f,g,y,w){var A=o.memoizedState;A===null?o.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:g,tail:f,tailMode:y,treeForkCount:w}:(A.isBackwards=d,A.rendering=null,A.renderingStartTime=0,A.last=g,A.tail=f,A.tailMode=y,A.treeForkCount=w)}function _S(o,d,f){var g=d.pendingProps,y=g.revealOrder,w=g.tail;g=g.children;var A=rr.current,I=(A&2)!==0;if(I?(A=A&1|2,d.flags|=128):A&=1,P(rr,A),qr(o,d,g,f),g=Ut?Yd:0,!I&&o!==null&&(o.flags&128)!==0)e:for(o=d.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&ES(o,f,d);else if(o.tag===19)ES(o,f,d);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===d)break e;for(;o.sibling===null;){if(o.return===null||o.return===d)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(y){case"forwards":for(f=d.child,y=null;f!==null;)o=f.alternate,o!==null&&im(o)===null&&(y=f),f=f.sibling;f=y,f===null?(y=d.child,d.child=null):(y=f.sibling,f.sibling=null),kv(d,!1,y,f,w,g);break;case"backwards":case"unstable_legacy-backwards":for(f=null,y=d.child,d.child=null;y!==null;){if(o=y.alternate,o!==null&&im(o)===null){d.child=y;break}o=y.sibling,y.sibling=f,f=y,y=o}kv(d,!0,f,null,w,g);break;case"together":kv(d,!1,null,null,void 0,g);break;default:d.memoizedState=null}return d.child}function Ia(o,d,f){if(o!==null&&(d.dependencies=o.dependencies),Pl|=d.lanes,(f&d.childLanes)===0)if(o!==null){if(su(o,d,f,!1),(f&d.childLanes)===0)return null}else return null;if(o!==null&&d.child!==o.child)throw Error(r(153));if(d.child!==null){for(o=d.child,f=Da(o,o.pendingProps),d.child=f,f.return=d;o.sibling!==null;)o=o.sibling,f=f.sibling=Da(o,o.pendingProps),f.return=d;f.sibling=null}return d.child}function jv(o,d){return(o.lanes&d)!==0?!0:(o=o.dependencies,!!(o!==null&&K0(o)))}function PB(o,d,f){switch(d.tag){case 3:Re(d,d.stateNode.containerInfo),Tl(d,ur,o.memoizedState.cache),Io();break;case 27:case 5:We(d);break;case 4:Re(d,d.stateNode.containerInfo);break;case 10:Tl(d,d.type,d.memoizedProps.value);break;case 31:if(d.memoizedState!==null)return d.flags|=128,Y1(d),null;break;case 13:var g=d.memoizedState;if(g!==null)return g.dehydrated!==null?(_l(d),d.flags|=128,null):(f&d.child.childLanes)!==0?AS(o,d,f):(_l(d),o=Ia(o,d,f),o!==null?o.sibling:null);_l(d);break;case 19:var y=(o.flags&128)!==0;if(g=(f&d.childLanes)!==0,g||(su(o,d,f,!1),g=(f&d.childLanes)!==0),y){if(g)return _S(o,d,f);d.flags|=128}if(y=d.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),P(rr,rr.current),g)break;return null;case 22:return d.lanes=0,kS(o,d,f,d.pendingProps);case 24:Tl(d,ur,o.memoizedState.cache)}return Ia(o,d,f)}function DS(o,d,f){if(o!==null)if(o.memoizedProps!==d.pendingProps)hr=!0;else{if(!jv(o,f)&&(d.flags&128)===0)return hr=!1,PB(o,d,f);hr=(o.flags&131072)!==0}else hr=!1,Ut&&(d.flags&1048576)!==0&&d6(d,Yd,d.index);switch(d.lanes=0,d.tag){case 16:e:{var g=d.pendingProps;if(o=$o(d.elementType),d.type=o,typeof o=="function")A1(o)?(g=Wo(o,g),d.tag=1,d=TS(null,d,o,g,f)):(d.tag=0,d=vv(null,d,o,g,f));else{if(o!=null){var y=o.$$typeof;if(y===_){d.tag=11,d=wS(null,d,o,g,f);break e}else if(y===z){d.tag=14,d=SS(null,d,o,g,f);break e}}throw d=W(o)||o,Error(r(306,d,""))}}return d;case 0:return vv(o,d,d.type,d.pendingProps,f);case 1:return g=d.type,y=Wo(g,d.pendingProps),TS(o,d,g,y,f);case 3:e:{if(Re(d,d.stateNode.containerInfo),o===null)throw Error(r(387));g=d.pendingProps;var w=d.memoizedState;y=w.element,U1(o,d),sh(d,g,null,f);var A=d.memoizedState;if(g=A.cache,Tl(d,ur,g),g!==w.cache&&I1(d,[ur],f,!0),rh(),g=A.element,w.isDehydrated)if(w={element:g,isDehydrated:!1,cache:A.cache},d.updateQueue.baseState=w,d.memoizedState=w,d.flags&256){d=MS(o,d,g,f);break e}else if(g!==y){y=ui(Error(r(424)),d),Kd(y),d=MS(o,d,g,f);break e}else{switch(o=d.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for(Fn=pi(o.firstChild),Ir=d,Ut=!0,Nl=null,fi=!0,f=k6(d,null,g,f),d.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling}else{if(Io(),g===y){d=Ia(o,d,f);break e}qr(o,d,g,f)}d=d.child}return d;case 26:return gm(o,d),o===null?(f=HO(d.type,null,d.pendingProps,null))?d.memoizedState=f:Ut||(f=d.type,o=d.pendingProps,g=Dm(fe.current).createElement(f),g[Br]=d,g[ys]=o,Qr(g,f,o),Er(g),d.stateNode=g):d.memoizedState=HO(d.type,o.memoizedProps,d.pendingProps,o.memoizedState),null;case 27:return We(d),o===null&&Ut&&(g=d.stateNode=qO(d.type,d.pendingProps,fe.current),Ir=d,fi=!0,y=Fn,ql(d.type)?(sy=y,Fn=pi(g.firstChild)):Fn=y),qr(o,d,d.pendingProps.children,f),gm(o,d),o===null&&(d.flags|=4194304),d.child;case 5:return o===null&&Ut&&((y=g=Fn)&&(g=hI(g,d.type,d.pendingProps,fi),g!==null?(d.stateNode=g,Ir=d,Fn=pi(g.firstChild),fi=!1,y=!0):y=!1),y||Cl(d)),We(d),y=d.type,w=d.pendingProps,A=o!==null?o.memoizedProps:null,g=w.children,Jv(y,w)?g=null:A!==null&&Jv(y,A)&&(d.flags|=32),d.memoizedState!==null&&(y=Z1(o,d,CB,null,null,f),kh._currentValue=y),gm(o,d),qr(o,d,g,f),d.child;case 6:return o===null&&Ut&&((o=f=Fn)&&(f=fI(f,d.pendingProps,fi),f!==null?(d.stateNode=f,Ir=d,Fn=null,o=!0):o=!1),o||Cl(d)),null;case 13:return AS(o,d,f);case 4:return Re(d,d.stateNode.containerInfo),g=d.pendingProps,o===null?d.child=Uo(d,null,g,f):qr(o,d,g,f),d.child;case 11:return wS(o,d,d.type,d.pendingProps,f);case 7:return qr(o,d,d.pendingProps,f),d.child;case 8:return qr(o,d,d.pendingProps.children,f),d.child;case 12:return qr(o,d,d.pendingProps.children,f),d.child;case 10:return g=d.pendingProps,Tl(d,d.type,g.value),qr(o,d,g.children,f),d.child;case 9:return y=d.type._context,g=d.pendingProps.children,qo(d),y=Fr(y),g=g(y),d.flags|=1,qr(o,d,g,f),d.child;case 14:return SS(o,d,d.type,d.pendingProps,f);case 15:return OS(o,d,d.type,d.pendingProps,f);case 19:return _S(o,d,f);case 31:return zB(o,d,f);case 22:return kS(o,d,f,d.pendingProps);case 24:return qo(d),g=Fr(ur),o===null?(y=Q1(),y===null&&(y=Mn,w=F1(),y.pooledCache=w,w.refCount++,w!==null&&(y.pooledCacheLanes|=f),y=w),d.memoizedState={parent:g,cache:y},H1(d),Tl(d,ur,y)):((o.lanes&f)!==0&&(U1(o,d),sh(d,null,null,f),rh()),y=o.memoizedState,w=d.memoizedState,y.parent!==g?(y={parent:g,cache:g},d.memoizedState=y,d.lanes===0&&(d.memoizedState=d.updateQueue.baseState=y),Tl(d,ur,g)):(g=w.cache,Tl(d,ur,g),g!==y.cache&&I1(d,[ur],f,!0))),qr(o,d,d.pendingProps.children,f),d.child;case 29:throw d.pendingProps}throw Error(r(156,d.tag))}function Fa(o){o.flags|=4}function Nv(o,d,f,g,y){if((d=(o.mode&32)!==0)&&(d=!1),d){if(o.flags|=16777216,(y&335544128)===y)if(o.stateNode.complete)o.flags|=8192;else if(aO())o.flags|=8192;else throw Ho=tm,$1}else o.flags&=-16777217}function RS(o,d){if(d.type!=="stylesheet"||(d.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!XO(d))if(aO())o.flags|=8192;else throw Ho=tm,$1}function vm(o,d){d!==null&&(o.flags|=4),o.flags&16384&&(d=o.tag!==22?Fc():536870912,o.lanes|=d,gu|=d)}function uh(o,d){if(!Ut)switch(o.tailMode){case"hidden":d=o.tail;for(var f=null;d!==null;)d.alternate!==null&&(f=d),d=d.sibling;f===null?o.tail=null:f.sibling=null;break;case"collapsed":f=o.tail;for(var g=null;f!==null;)f.alternate!==null&&(g=f),f=f.sibling;g===null?d||o.tail===null?o.tail=null:o.tail.sibling=null:g.sibling=null}}function qn(o){var d=o.alternate!==null&&o.alternate.child===o.child,f=0,g=0;if(d)for(var y=o.child;y!==null;)f|=y.lanes|y.childLanes,g|=y.subtreeFlags&65011712,g|=y.flags&65011712,y.return=o,y=y.sibling;else for(y=o.child;y!==null;)f|=y.lanes|y.childLanes,g|=y.subtreeFlags,g|=y.flags,y.return=o,y=y.sibling;return o.subtreeFlags|=g,o.childLanes=f,d}function LB(o,d,f){var g=d.pendingProps;switch(R1(d),d.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qn(d),null;case 1:return qn(d),null;case 3:return f=d.stateNode,g=null,o!==null&&(g=o.memoizedState.cache),d.memoizedState.cache!==g&&(d.flags|=2048),Pa(ur),de(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(o===null||o.child===null)&&(ru(d)?Fa(d):o===null||o.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,P1())),qn(d),null;case 26:var y=d.type,w=d.memoizedState;return o===null?(Fa(d),w!==null?(qn(d),RS(d,w)):(qn(d),Nv(d,y,null,g,f))):w?w!==o.memoizedState?(Fa(d),qn(d),RS(d,w)):(qn(d),d.flags&=-16777217):(o=o.memoizedProps,o!==g&&Fa(d),qn(d),Nv(d,y,o,g,f)),null;case 27:if(ct(d),f=fe.current,y=d.type,o!==null&&d.stateNode!=null)o.memoizedProps!==g&&Fa(d);else{if(!g){if(d.stateNode===null)throw Error(r(166));return qn(d),null}o=K.current,ru(d)?f6(d):(o=qO(y,g,f),d.stateNode=o,Fa(d))}return qn(d),null;case 5:if(ct(d),y=d.type,o!==null&&d.stateNode!=null)o.memoizedProps!==g&&Fa(d);else{if(!g){if(d.stateNode===null)throw Error(r(166));return qn(d),null}if(w=K.current,ru(d))f6(d);else{var A=Dm(fe.current);switch(w){case 1:w=A.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:w=A.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":w=A.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":w=A.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":w=A.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof g.is=="string"?A.createElement("select",{is:g.is}):A.createElement("select"),g.multiple?w.multiple=!0:g.size&&(w.size=g.size);break;default:w=typeof g.is=="string"?A.createElement(y,{is:g.is}):A.createElement(y)}}w[Br]=d,w[ys]=g;e:for(A=d.child;A!==null;){if(A.tag===5||A.tag===6)w.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===d)break e;for(;A.sibling===null;){if(A.return===null||A.return===d)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}d.stateNode=w;e:switch(Qr(w,y,g),y){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Fa(d)}}return qn(d),Nv(d,d.type,o===null?null:o.memoizedProps,d.pendingProps,f),null;case 6:if(o&&d.stateNode!=null)o.memoizedProps!==g&&Fa(d);else{if(typeof g!="string"&&d.stateNode===null)throw Error(r(166));if(o=fe.current,ru(d)){if(o=d.stateNode,f=d.memoizedProps,g=null,y=Ir,y!==null)switch(y.tag){case 27:case 5:g=y.memoizedProps}o[Br]=d,o=!!(o.nodeValue===f||g!==null&&g.suppressHydrationWarning===!0||AO(o.nodeValue,f)),o||Cl(d,!0)}else o=Dm(o).createTextNode(g),o[Br]=d,d.stateNode=o}return qn(d),null;case 31:if(f=d.memoizedState,o===null||o.memoizedState!==null){if(g=ru(d),f!==null){if(o===null){if(!g)throw Error(r(318));if(o=d.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[Br]=d}else Io(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;qn(d),o=!1}else f=P1(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=f),o=!0;if(!o)return d.flags&256?(Us(d),d):(Us(d),null);if((d.flags&128)!==0)throw Error(r(558))}return qn(d),null;case 13:if(g=d.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(y=ru(d),g!==null&&g.dehydrated!==null){if(o===null){if(!y)throw Error(r(318));if(y=d.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[Br]=d}else Io(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;qn(d),y=!1}else y=P1(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=y),y=!0;if(!y)return d.flags&256?(Us(d),d):(Us(d),null)}return Us(d),(d.flags&128)!==0?(d.lanes=f,d):(f=g!==null,o=o!==null&&o.memoizedState!==null,f&&(g=d.child,y=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(y=g.alternate.memoizedState.cachePool.pool),w=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(w=g.memoizedState.cachePool.pool),w!==y&&(g.flags|=2048)),f!==o&&f&&(d.child.flags|=8192),vm(d,d.updateQueue),qn(d),null);case 4:return de(),o===null&&Gv(d.stateNode.containerInfo),qn(d),null;case 10:return Pa(d.type),qn(d),null;case 19:if(Y(rr),g=d.memoizedState,g===null)return qn(d),null;if(y=(d.flags&128)!==0,w=g.rendering,w===null)if(y)uh(g,!1);else{if(tr!==0||o!==null&&(o.flags&128)!==0)for(o=d.child;o!==null;){if(w=im(o),w!==null){for(d.flags|=128,uh(g,!1),o=w.updateQueue,d.updateQueue=o,vm(d,o),d.subtreeFlags=0,o=f,f=d.child;f!==null;)o6(f,o),f=f.sibling;return P(rr,rr.current&1|2),Ut&&Ra(d,g.treeForkCount),d.child}o=o.sibling}g.tail!==null&&yn()>Om&&(d.flags|=128,y=!0,uh(g,!1),d.lanes=4194304)}else{if(!y)if(o=im(w),o!==null){if(d.flags|=128,y=!0,o=o.updateQueue,d.updateQueue=o,vm(d,o),uh(g,!0),g.tail===null&&g.tailMode==="hidden"&&!w.alternate&&!Ut)return qn(d),null}else 2*yn()-g.renderingStartTime>Om&&f!==536870912&&(d.flags|=128,y=!0,uh(g,!1),d.lanes=4194304);g.isBackwards?(w.sibling=d.child,d.child=w):(o=g.last,o!==null?o.sibling=w:d.child=w,g.last=w)}return g.tail!==null?(o=g.tail,g.rendering=o,g.tail=o.sibling,g.renderingStartTime=yn(),o.sibling=null,f=rr.current,P(rr,y?f&1|2:f&1),Ut&&Ra(d,g.treeForkCount),o):(qn(d),null);case 22:case 23:return Us(d),X1(),g=d.memoizedState!==null,o!==null?o.memoizedState!==null!==g&&(d.flags|=8192):g&&(d.flags|=8192),g?(f&536870912)!==0&&(d.flags&128)===0&&(qn(d),d.subtreeFlags&6&&(d.flags|=8192)):qn(d),f=d.updateQueue,f!==null&&vm(d,f.retryQueue),f=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),g=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(g=d.memoizedState.cachePool.pool),g!==f&&(d.flags|=2048),o!==null&&Y(Qo),null;case 24:return f=null,o!==null&&(f=o.memoizedState.cache),d.memoizedState.cache!==f&&(d.flags|=2048),Pa(ur),qn(d),null;case 25:return null;case 30:return null}throw Error(r(156,d.tag))}function BB(o,d){switch(R1(d),d.tag){case 1:return o=d.flags,o&65536?(d.flags=o&-65537|128,d):null;case 3:return Pa(ur),de(),o=d.flags,(o&65536)!==0&&(o&128)===0?(d.flags=o&-65537|128,d):null;case 26:case 27:case 5:return ct(d),null;case 31:if(d.memoizedState!==null){if(Us(d),d.alternate===null)throw Error(r(340));Io()}return o=d.flags,o&65536?(d.flags=o&-65537|128,d):null;case 13:if(Us(d),o=d.memoizedState,o!==null&&o.dehydrated!==null){if(d.alternate===null)throw Error(r(340));Io()}return o=d.flags,o&65536?(d.flags=o&-65537|128,d):null;case 19:return Y(rr),null;case 4:return de(),null;case 10:return Pa(d.type),null;case 22:case 23:return Us(d),X1(),o!==null&&Y(Qo),o=d.flags,o&65536?(d.flags=o&-65537|128,d):null;case 24:return Pa(ur),null;case 25:return null;default:return null}}function zS(o,d){switch(R1(d),d.tag){case 3:Pa(ur),de();break;case 26:case 27:case 5:ct(d);break;case 4:de();break;case 31:d.memoizedState!==null&&Us(d);break;case 13:Us(d);break;case 19:Y(rr);break;case 10:Pa(d.type);break;case 22:case 23:Us(d),X1(),o!==null&&Y(Qo);break;case 24:Pa(ur)}}function dh(o,d){try{var f=d.updateQueue,g=f!==null?f.lastEffect:null;if(g!==null){var y=g.next;f=y;do{if((f.tag&o)===o){g=void 0;var w=f.create,A=f.inst;g=w(),A.destroy=g}f=f.next}while(f!==y)}}catch(I){gn(d,d.return,I)}}function Rl(o,d,f){try{var g=d.updateQueue,y=g!==null?g.lastEffect:null;if(y!==null){var w=y.next;g=w;do{if((g.tag&o)===o){var A=g.inst,I=A.destroy;if(I!==void 0){A.destroy=void 0,y=d;var Z=f,xe=I;try{xe()}catch(je){gn(y,Z,je)}}}g=g.next}while(g!==w)}}catch(je){gn(d,d.return,je)}}function PS(o){var d=o.updateQueue;if(d!==null){var f=o.stateNode;try{N6(d,f)}catch(g){gn(o,o.return,g)}}}function LS(o,d,f){f.props=Wo(o.type,o.memoizedProps),f.state=o.memoizedState;try{f.componentWillUnmount()}catch(g){gn(o,d,g)}}function hh(o,d){try{var f=o.ref;if(f!==null){switch(o.tag){case 26:case 27:case 5:var g=o.stateNode;break;case 30:g=o.stateNode;break;default:g=o.stateNode}typeof f=="function"?o.refCleanup=f(g):f.current=g}}catch(y){gn(o,d,y)}}function Yi(o,d){var f=o.ref,g=o.refCleanup;if(f!==null)if(typeof g=="function")try{g()}catch(y){gn(o,d,y)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(y){gn(o,d,y)}else f.current=null}function BS(o){var d=o.type,f=o.memoizedProps,g=o.stateNode;try{e:switch(d){case"button":case"input":case"select":case"textarea":f.autoFocus&&g.focus();break e;case"img":f.src?g.src=f.src:f.srcSet&&(g.srcset=f.srcSet)}}catch(y){gn(o,o.return,y)}}function Cv(o,d,f){try{var g=o.stateNode;aI(g,o.type,f,d),g[ys]=d}catch(y){gn(o,o.return,y)}}function IS(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&ql(o.type)||o.tag===4}function Tv(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||IS(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&ql(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Mv(o,d,f){var g=o.tag;if(g===5||g===6)o=o.stateNode,d?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(o,d):(d=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,d.appendChild(o),f=f._reactRootContainer,f!=null||d.onclick!==null||(d.onclick=Ea));else if(g!==4&&(g===27&&ql(o.type)&&(f=o.stateNode,d=null),o=o.child,o!==null))for(Mv(o,d,f),o=o.sibling;o!==null;)Mv(o,d,f),o=o.sibling}function ym(o,d,f){var g=o.tag;if(g===5||g===6)o=o.stateNode,d?f.insertBefore(o,d):f.appendChild(o);else if(g!==4&&(g===27&&ql(o.type)&&(f=o.stateNode),o=o.child,o!==null))for(ym(o,d,f),o=o.sibling;o!==null;)ym(o,d,f),o=o.sibling}function FS(o){var d=o.stateNode,f=o.memoizedProps;try{for(var g=o.type,y=d.attributes;y.length;)d.removeAttributeNode(y[0]);Qr(d,g,f),d[Br]=o,d[ys]=f}catch(w){gn(o,o.return,w)}}var qa=!1,fr=!1,Av=!1,qS=typeof WeakSet=="function"?WeakSet:Set,_r=null;function IB(o,d){if(o=o.containerInfo,Kv=Fm,o=J3(o),O1(o)){if("selectionStart"in o)var f={start:o.selectionStart,end:o.selectionEnd};else e:{f=(f=o.ownerDocument)&&f.defaultView||window;var g=f.getSelection&&f.getSelection();if(g&&g.rangeCount!==0){f=g.anchorNode;var y=g.anchorOffset,w=g.focusNode;g=g.focusOffset;try{f.nodeType,w.nodeType}catch{f=null;break e}var A=0,I=-1,Z=-1,xe=0,je=0,Te=o,be=null;t:for(;;){for(var Oe;Te!==f||y!==0&&Te.nodeType!==3||(I=A+y),Te!==w||g!==0&&Te.nodeType!==3||(Z=A+g),Te.nodeType===3&&(A+=Te.nodeValue.length),(Oe=Te.firstChild)!==null;)be=Te,Te=Oe;for(;;){if(Te===o)break t;if(be===f&&++xe===y&&(I=A),be===w&&++je===g&&(Z=A),(Oe=Te.nextSibling)!==null)break;Te=be,be=Te.parentNode}Te=Oe}f=I===-1||Z===-1?null:{start:I,end:Z}}else f=null}f=f||{start:0,end:0}}else f=null;for(Zv={focusedElem:o,selectionRange:f},Fm=!1,_r=d;_r!==null;)if(d=_r,o=d.child,(d.subtreeFlags&1028)!==0&&o!==null)o.return=d,_r=o;else for(;_r!==null;){switch(d=_r,w=d.alternate,o=d.flags,d.tag){case 0:if((o&4)!==0&&(o=d.updateQueue,o=o!==null?o.events:null,o!==null))for(f=0;f<o.length;f++)y=o[f],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&w!==null){o=void 0,f=d,y=w.memoizedProps,w=w.memoizedState,g=f.stateNode;try{var Ge=Wo(f.type,y);o=g.getSnapshotBeforeUpdate(Ge,w),g.__reactInternalSnapshotBeforeUpdate=o}catch(lt){gn(f,f.return,lt)}}break;case 3:if((o&1024)!==0){if(o=d.stateNode.containerInfo,f=o.nodeType,f===9)ty(o);else if(f===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":ty(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=d.sibling,o!==null){o.return=d.return,_r=o;break}_r=d.return}}function QS(o,d,f){var g=f.flags;switch(f.tag){case 0:case 11:case 15:$a(o,f),g&4&&dh(5,f);break;case 1:if($a(o,f),g&4)if(o=f.stateNode,d===null)try{o.componentDidMount()}catch(A){gn(f,f.return,A)}else{var y=Wo(f.type,d.memoizedProps);d=d.memoizedState;try{o.componentDidUpdate(y,d,o.__reactInternalSnapshotBeforeUpdate)}catch(A){gn(f,f.return,A)}}g&64&&PS(f),g&512&&hh(f,f.return);break;case 3:if($a(o,f),g&64&&(o=f.updateQueue,o!==null)){if(d=null,f.child!==null)switch(f.child.tag){case 27:case 5:d=f.child.stateNode;break;case 1:d=f.child.stateNode}try{N6(o,d)}catch(A){gn(f,f.return,A)}}break;case 27:d===null&&g&4&&FS(f);case 26:case 5:$a(o,f),d===null&&g&4&&BS(f),g&512&&hh(f,f.return);break;case 12:$a(o,f);break;case 31:$a(o,f),g&4&&US(o,f);break;case 13:$a(o,f),g&4&&VS(o,f),g&64&&(o=f.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(f=GB.bind(null,f),mI(o,f))));break;case 22:if(g=f.memoizedState!==null||qa,!g){d=d!==null&&d.memoizedState!==null||fr,y=qa;var w=fr;qa=g,(fr=d)&&!w?Ha(o,f,(f.subtreeFlags&8772)!==0):$a(o,f),qa=y,fr=w}break;case 30:break;default:$a(o,f)}}function $S(o){var d=o.alternate;d!==null&&(o.alternate=null,$S(d)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(d=o.stateNode,d!==null&&a1(d)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var Un=null,ws=!1;function Qa(o,d,f){for(f=f.child;f!==null;)HS(o,d,f),f=f.sibling}function HS(o,d,f){if(Me&&typeof Me.onCommitFiberUnmount=="function")try{Me.onCommitFiberUnmount(re,f)}catch{}switch(f.tag){case 26:fr||Yi(f,d),Qa(o,d,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:fr||Yi(f,d);var g=Un,y=ws;ql(f.type)&&(Un=f.stateNode,ws=!1),Qa(o,d,f),wh(f.stateNode),Un=g,ws=y;break;case 5:fr||Yi(f,d);case 6:if(g=Un,y=ws,Un=null,Qa(o,d,f),Un=g,ws=y,Un!==null)if(ws)try{(Un.nodeType===9?Un.body:Un.nodeName==="HTML"?Un.ownerDocument.body:Un).removeChild(f.stateNode)}catch(w){gn(f,d,w)}else try{Un.removeChild(f.stateNode)}catch(w){gn(f,d,w)}break;case 18:Un!==null&&(ws?(o=Un,PO(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,f.stateNode),ku(o)):PO(Un,f.stateNode));break;case 4:g=Un,y=ws,Un=f.stateNode.containerInfo,ws=!0,Qa(o,d,f),Un=g,ws=y;break;case 0:case 11:case 14:case 15:Rl(2,f,d),fr||Rl(4,f,d),Qa(o,d,f);break;case 1:fr||(Yi(f,d),g=f.stateNode,typeof g.componentWillUnmount=="function"&&LS(f,d,g)),Qa(o,d,f);break;case 21:Qa(o,d,f);break;case 22:fr=(g=fr)||f.memoizedState!==null,Qa(o,d,f),fr=g;break;default:Qa(o,d,f)}}function US(o,d){if(d.memoizedState===null&&(o=d.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{ku(o)}catch(f){gn(d,d.return,f)}}}function VS(o,d){if(d.memoizedState===null&&(o=d.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{ku(o)}catch(f){gn(d,d.return,f)}}function FB(o){switch(o.tag){case 31:case 13:case 19:var d=o.stateNode;return d===null&&(d=o.stateNode=new qS),d;case 22:return o=o.stateNode,d=o._retryCache,d===null&&(d=o._retryCache=new qS),d;default:throw Error(r(435,o.tag))}}function bm(o,d){var f=FB(o);d.forEach(function(g){if(!f.has(g)){f.add(g);var y=XB.bind(null,o,g);g.then(y,y)}})}function Ss(o,d){var f=d.deletions;if(f!==null)for(var g=0;g<f.length;g++){var y=f[g],w=o,A=d,I=A;e:for(;I!==null;){switch(I.tag){case 27:if(ql(I.type)){Un=I.stateNode,ws=!1;break e}break;case 5:Un=I.stateNode,ws=!1;break e;case 3:case 4:Un=I.stateNode.containerInfo,ws=!0;break e}I=I.return}if(Un===null)throw Error(r(160));HS(w,A,y),Un=null,ws=!1,w=y.alternate,w!==null&&(w.return=null),y.return=null}if(d.subtreeFlags&13886)for(d=d.child;d!==null;)WS(d,o),d=d.sibling}var Di=null;function WS(o,d){var f=o.alternate,g=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:Ss(d,o),Os(o),g&4&&(Rl(3,o,o.return),dh(3,o),Rl(5,o,o.return));break;case 1:Ss(d,o),Os(o),g&512&&(fr||f===null||Yi(f,f.return)),g&64&&qa&&(o=o.updateQueue,o!==null&&(g=o.callbacks,g!==null&&(f=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=f===null?g:f.concat(g))));break;case 26:var y=Di;if(Ss(d,o),Os(o),g&512&&(fr||f===null||Yi(f,f.return)),g&4){var w=f!==null?f.memoizedState:null;if(g=o.memoizedState,f===null)if(g===null)if(o.stateNode===null){e:{g=o.type,f=o.memoizedProps,y=y.ownerDocument||y;t:switch(g){case"title":w=y.getElementsByTagName("title")[0],(!w||w[Id]||w[Br]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=y.createElement(g),y.head.insertBefore(w,y.querySelector("head > title"))),Qr(w,g,f),w[Br]=o,Er(w),g=w;break e;case"link":var A=WO("link","href",y).get(g+(f.href||""));if(A){for(var I=0;I<A.length;I++)if(w=A[I],w.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&w.getAttribute("rel")===(f.rel==null?null:f.rel)&&w.getAttribute("title")===(f.title==null?null:f.title)&&w.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){A.splice(I,1);break t}}w=y.createElement(g),Qr(w,g,f),y.head.appendChild(w);break;case"meta":if(A=WO("meta","content",y).get(g+(f.content||""))){for(I=0;I<A.length;I++)if(w=A[I],w.getAttribute("content")===(f.content==null?null:""+f.content)&&w.getAttribute("name")===(f.name==null?null:f.name)&&w.getAttribute("property")===(f.property==null?null:f.property)&&w.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&w.getAttribute("charset")===(f.charSet==null?null:f.charSet)){A.splice(I,1);break t}}w=y.createElement(g),Qr(w,g,f),y.head.appendChild(w);break;default:throw Error(r(468,g))}w[Br]=o,Er(w),g=w}o.stateNode=g}else GO(y,o.type,o.stateNode);else o.stateNode=VO(y,g,o.memoizedProps);else w!==g?(w===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):w.count--,g===null?GO(y,o.type,o.stateNode):VO(y,g,o.memoizedProps)):g===null&&o.stateNode!==null&&Cv(o,o.memoizedProps,f.memoizedProps)}break;case 27:Ss(d,o),Os(o),g&512&&(fr||f===null||Yi(f,f.return)),f!==null&&g&4&&Cv(o,o.memoizedProps,f.memoizedProps);break;case 5:if(Ss(d,o),Os(o),g&512&&(fr||f===null||Yi(f,f.return)),o.flags&32){y=o.stateNode;try{Wc(y,"")}catch(Ge){gn(o,o.return,Ge)}}g&4&&o.stateNode!=null&&(y=o.memoizedProps,Cv(o,y,f!==null?f.memoizedProps:y)),g&1024&&(Av=!0);break;case 6:if(Ss(d,o),Os(o),g&4){if(o.stateNode===null)throw Error(r(162));g=o.memoizedProps,f=o.stateNode;try{f.nodeValue=g}catch(Ge){gn(o,o.return,Ge)}}break;case 3:if(Pm=null,y=Di,Di=Rm(d.containerInfo),Ss(d,o),Di=y,Os(o),g&4&&f!==null&&f.memoizedState.isDehydrated)try{ku(d.containerInfo)}catch(Ge){gn(o,o.return,Ge)}Av&&(Av=!1,GS(o));break;case 4:g=Di,Di=Rm(o.stateNode.containerInfo),Ss(d,o),Os(o),Di=g;break;case 12:Ss(d,o),Os(o);break;case 31:Ss(d,o),Os(o),g&4&&(g=o.updateQueue,g!==null&&(o.updateQueue=null,bm(o,g)));break;case 13:Ss(d,o),Os(o),o.child.flags&8192&&o.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(Sm=yn()),g&4&&(g=o.updateQueue,g!==null&&(o.updateQueue=null,bm(o,g)));break;case 22:y=o.memoizedState!==null;var Z=f!==null&&f.memoizedState!==null,xe=qa,je=fr;if(qa=xe||y,fr=je||Z,Ss(d,o),fr=je,qa=xe,Os(o),g&8192)e:for(d=o.stateNode,d._visibility=y?d._visibility&-2:d._visibility|1,y&&(f===null||Z||qa||fr||Go(o)),f=null,d=o;;){if(d.tag===5||d.tag===26){if(f===null){Z=f=d;try{if(w=Z.stateNode,y)A=w.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{I=Z.stateNode;var Te=Z.memoizedProps.style,be=Te!=null&&Te.hasOwnProperty("display")?Te.display:null;I.style.display=be==null||typeof be=="boolean"?"":(""+be).trim()}}catch(Ge){gn(Z,Z.return,Ge)}}}else if(d.tag===6){if(f===null){Z=d;try{Z.stateNode.nodeValue=y?"":Z.memoizedProps}catch(Ge){gn(Z,Z.return,Ge)}}}else if(d.tag===18){if(f===null){Z=d;try{var Oe=Z.stateNode;y?LO(Oe,!0):LO(Z.stateNode,!1)}catch(Ge){gn(Z,Z.return,Ge)}}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===o)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===o)break e;for(;d.sibling===null;){if(d.return===null||d.return===o)break e;f===d&&(f=null),d=d.return}f===d&&(f=null),d.sibling.return=d.return,d=d.sibling}g&4&&(g=o.updateQueue,g!==null&&(f=g.retryQueue,f!==null&&(g.retryQueue=null,bm(o,f))));break;case 19:Ss(d,o),Os(o),g&4&&(g=o.updateQueue,g!==null&&(o.updateQueue=null,bm(o,g)));break;case 30:break;case 21:break;default:Ss(d,o),Os(o)}}function Os(o){var d=o.flags;if(d&2){try{for(var f,g=o.return;g!==null;){if(IS(g)){f=g;break}g=g.return}if(f==null)throw Error(r(160));switch(f.tag){case 27:var y=f.stateNode,w=Tv(o);ym(o,w,y);break;case 5:var A=f.stateNode;f.flags&32&&(Wc(A,""),f.flags&=-33);var I=Tv(o);ym(o,I,A);break;case 3:case 4:var Z=f.stateNode.containerInfo,xe=Tv(o);Mv(o,xe,Z);break;default:throw Error(r(161))}}catch(je){gn(o,o.return,je)}o.flags&=-3}d&4096&&(o.flags&=-4097)}function GS(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var d=o;GS(d),d.tag===5&&d.flags&1024&&d.stateNode.reset(),o=o.sibling}}function $a(o,d){if(d.subtreeFlags&8772)for(d=d.child;d!==null;)QS(o,d.alternate,d),d=d.sibling}function Go(o){for(o=o.child;o!==null;){var d=o;switch(d.tag){case 0:case 11:case 14:case 15:Rl(4,d,d.return),Go(d);break;case 1:Yi(d,d.return);var f=d.stateNode;typeof f.componentWillUnmount=="function"&&LS(d,d.return,f),Go(d);break;case 27:wh(d.stateNode);case 26:case 5:Yi(d,d.return),Go(d);break;case 22:d.memoizedState===null&&Go(d);break;case 30:Go(d);break;default:Go(d)}o=o.sibling}}function Ha(o,d,f){for(f=f&&(d.subtreeFlags&8772)!==0,d=d.child;d!==null;){var g=d.alternate,y=o,w=d,A=w.flags;switch(w.tag){case 0:case 11:case 15:Ha(y,w,f),dh(4,w);break;case 1:if(Ha(y,w,f),g=w,y=g.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(xe){gn(g,g.return,xe)}if(g=w,y=g.updateQueue,y!==null){var I=g.stateNode;try{var Z=y.shared.hiddenCallbacks;if(Z!==null)for(y.shared.hiddenCallbacks=null,y=0;y<Z.length;y++)j6(Z[y],I)}catch(xe){gn(g,g.return,xe)}}f&&A&64&&PS(w),hh(w,w.return);break;case 27:FS(w);case 26:case 5:Ha(y,w,f),f&&g===null&&A&4&&BS(w),hh(w,w.return);break;case 12:Ha(y,w,f);break;case 31:Ha(y,w,f),f&&A&4&&US(y,w);break;case 13:Ha(y,w,f),f&&A&4&&VS(y,w);break;case 22:w.memoizedState===null&&Ha(y,w,f),hh(w,w.return);break;case 30:break;default:Ha(y,w,f)}d=d.sibling}}function Ev(o,d){var f=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),o=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(o=d.memoizedState.cachePool.pool),o!==f&&(o!=null&&o.refCount++,f!=null&&Zd(f))}function _v(o,d){o=null,d.alternate!==null&&(o=d.alternate.memoizedState.cache),d=d.memoizedState.cache,d!==o&&(d.refCount++,o!=null&&Zd(o))}function Ri(o,d,f,g){if(d.subtreeFlags&10256)for(d=d.child;d!==null;)XS(o,d,f,g),d=d.sibling}function XS(o,d,f,g){var y=d.flags;switch(d.tag){case 0:case 11:case 15:Ri(o,d,f,g),y&2048&&dh(9,d);break;case 1:Ri(o,d,f,g);break;case 3:Ri(o,d,f,g),y&2048&&(o=null,d.alternate!==null&&(o=d.alternate.memoizedState.cache),d=d.memoizedState.cache,d!==o&&(d.refCount++,o!=null&&Zd(o)));break;case 12:if(y&2048){Ri(o,d,f,g),o=d.stateNode;try{var w=d.memoizedProps,A=w.id,I=w.onPostCommit;typeof I=="function"&&I(A,d.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(Z){gn(d,d.return,Z)}}else Ri(o,d,f,g);break;case 31:Ri(o,d,f,g);break;case 13:Ri(o,d,f,g);break;case 23:break;case 22:w=d.stateNode,A=d.alternate,d.memoizedState!==null?w._visibility&2?Ri(o,d,f,g):fh(o,d):w._visibility&2?Ri(o,d,f,g):(w._visibility|=2,fu(o,d,f,g,(d.subtreeFlags&10256)!==0||!1)),y&2048&&Ev(A,d);break;case 24:Ri(o,d,f,g),y&2048&&_v(d.alternate,d);break;default:Ri(o,d,f,g)}}function fu(o,d,f,g,y){for(y=y&&((d.subtreeFlags&10256)!==0||!1),d=d.child;d!==null;){var w=o,A=d,I=f,Z=g,xe=A.flags;switch(A.tag){case 0:case 11:case 15:fu(w,A,I,Z,y),dh(8,A);break;case 23:break;case 22:var je=A.stateNode;A.memoizedState!==null?je._visibility&2?fu(w,A,I,Z,y):fh(w,A):(je._visibility|=2,fu(w,A,I,Z,y)),y&&xe&2048&&Ev(A.alternate,A);break;case 24:fu(w,A,I,Z,y),y&&xe&2048&&_v(A.alternate,A);break;default:fu(w,A,I,Z,y)}d=d.sibling}}function fh(o,d){if(d.subtreeFlags&10256)for(d=d.child;d!==null;){var f=o,g=d,y=g.flags;switch(g.tag){case 22:fh(f,g),y&2048&&Ev(g.alternate,g);break;case 24:fh(f,g),y&2048&&_v(g.alternate,g);break;default:fh(f,g)}d=d.sibling}}var mh=8192;function mu(o,d,f){if(o.subtreeFlags&mh)for(o=o.child;o!==null;)YS(o,d,f),o=o.sibling}function YS(o,d,f){switch(o.tag){case 26:mu(o,d,f),o.flags&mh&&o.memoizedState!==null&&NI(f,Di,o.memoizedState,o.memoizedProps);break;case 5:mu(o,d,f);break;case 3:case 4:var g=Di;Di=Rm(o.stateNode.containerInfo),mu(o,d,f),Di=g;break;case 22:o.memoizedState===null&&(g=o.alternate,g!==null&&g.memoizedState!==null?(g=mh,mh=16777216,mu(o,d,f),mh=g):mu(o,d,f));break;default:mu(o,d,f)}}function KS(o){var d=o.alternate;if(d!==null&&(o=d.child,o!==null)){d.child=null;do d=o.sibling,o.sibling=null,o=d;while(o!==null)}}function ph(o){var d=o.deletions;if((o.flags&16)!==0){if(d!==null)for(var f=0;f<d.length;f++){var g=d[f];_r=g,JS(g,o)}KS(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)ZS(o),o=o.sibling}function ZS(o){switch(o.tag){case 0:case 11:case 15:ph(o),o.flags&2048&&Rl(9,o,o.return);break;case 3:ph(o);break;case 12:ph(o);break;case 22:var d=o.stateNode;o.memoizedState!==null&&d._visibility&2&&(o.return===null||o.return.tag!==13)?(d._visibility&=-3,wm(o)):ph(o);break;default:ph(o)}}function wm(o){var d=o.deletions;if((o.flags&16)!==0){if(d!==null)for(var f=0;f<d.length;f++){var g=d[f];_r=g,JS(g,o)}KS(o)}for(o=o.child;o!==null;){switch(d=o,d.tag){case 0:case 11:case 15:Rl(8,d,d.return),wm(d);break;case 22:f=d.stateNode,f._visibility&2&&(f._visibility&=-3,wm(d));break;default:wm(d)}o=o.sibling}}function JS(o,d){for(;_r!==null;){var f=_r;switch(f.tag){case 0:case 11:case 15:Rl(8,f,d);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var g=f.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:Zd(f.memoizedState.cache)}if(g=f.child,g!==null)g.return=f,_r=g;else e:for(f=o;_r!==null;){g=_r;var y=g.sibling,w=g.return;if($S(g),g===f){_r=null;break e}if(y!==null){y.return=w,_r=y;break e}_r=w}}}var qB={getCacheForType:function(o){var d=Fr(ur),f=d.data.get(o);return f===void 0&&(f=o(),d.data.set(o,f)),f},cacheSignal:function(){return Fr(ur).controller.signal}},QB=typeof WeakMap=="function"?WeakMap:Map,sn=0,Mn=null,Pt=null,qt=0,pn=0,Vs=null,zl=!1,pu=!1,Dv=!1,Ua=0,tr=0,Pl=0,Xo=0,Rv=0,Ws=0,gu=0,gh=null,ks=null,zv=!1,Sm=0,eO=0,Om=1/0,km=null,Ll=null,br=0,Bl=null,xu=null,Va=0,Pv=0,Lv=null,tO=null,xh=0,Bv=null;function Gs(){return(sn&2)!==0&&qt!==0?qt&-qt:H.T!==null?Hv():x3()}function nO(){if(Ws===0)if((qt&536870912)===0||Ut){var o=rn;rn<<=1,(rn&3932160)===0&&(rn=262144),Ws=o}else Ws=536870912;return o=Hs.current,o!==null&&(o.flags|=32),Ws}function js(o,d,f){(o===Mn&&(pn===2||pn===9)||o.cancelPendingCommit!==null)&&(vu(o,0),Il(o,qt,Ws,!1)),Bd(o,f),((sn&2)===0||o!==Mn)&&(o===Mn&&((sn&2)===0&&(Xo|=f),tr===4&&Il(o,qt,Ws,!1)),Ki(o))}function rO(o,d,f){if((sn&6)!==0)throw Error(r(327));var g=!f&&(d&127)===0&&(d&o.expiredLanes)===0||Eo(o,d),y=g?UB(o,d):Fv(o,d,!0),w=g;do{if(y===0){pu&&!g&&Il(o,d,0,!1);break}else{if(f=o.current.alternate,w&&!$B(f)){y=Fv(o,d,!1),w=!1;continue}if(y===2){if(w=d,o.errorRecoveryDisabledLanes&w)var A=0;else A=o.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){d=A;e:{var I=o;y=gh;var Z=I.current.memoizedState.isDehydrated;if(Z&&(vu(I,A).flags|=256),A=Fv(I,A,!1),A!==2){if(Dv&&!Z){I.errorRecoveryDisabledLanes|=w,Xo|=w,y=4;break e}w=ks,ks=y,w!==null&&(ks===null?ks=w:ks.push.apply(ks,w))}y=A}if(w=!1,y!==2)continue}}if(y===1){vu(o,0),Il(o,d,0,!0);break}e:{switch(g=o,w=y,w){case 0:case 1:throw Error(r(345));case 4:if((d&4194048)!==d)break;case 6:Il(g,d,Ws,!zl);break e;case 2:ks=null;break;case 3:case 5:break;default:throw Error(r(329))}if((d&62914560)===d&&(y=Sm+300-yn(),10<y)){if(Il(g,d,Ws,!zl),Ic(g,0,!0)!==0)break e;Va=d,g.timeoutHandle=RO(sO.bind(null,g,f,ks,km,zv,d,Ws,Xo,gu,zl,w,"Throttled",-0,0),y);break e}sO(g,f,ks,km,zv,d,Ws,Xo,gu,zl,w,null,-0,0)}}break}while(!0);Ki(o)}function sO(o,d,f,g,y,w,A,I,Z,xe,je,Te,be,Oe){if(o.timeoutHandle=-1,Te=d.subtreeFlags,Te&8192||(Te&16785408)===16785408){Te={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ea},YS(d,w,Te);var Ge=(w&62914560)===w?Sm-yn():(w&4194048)===w?eO-yn():0;if(Ge=CI(Te,Ge),Ge!==null){Va=w,o.cancelPendingCommit=Ge(hO.bind(null,o,d,w,f,g,y,A,I,Z,je,Te,null,be,Oe)),Il(o,w,A,!xe);return}}hO(o,d,w,f,g,y,A,I,Z)}function $B(o){for(var d=o;;){var f=d.tag;if((f===0||f===11||f===15)&&d.flags&16384&&(f=d.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var g=0;g<f.length;g++){var y=f[g],w=y.getSnapshot;y=y.value;try{if(!Qs(w(),y))return!1}catch{return!1}}if(f=d.child,d.subtreeFlags&16384&&f!==null)f.return=d,d=f;else{if(d===o)break;for(;d.sibling===null;){if(d.return===null||d.return===o)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function Il(o,d,f,g){d&=~Rv,d&=~Xo,o.suspendedLanes|=d,o.pingedLanes&=~d,g&&(o.warmLanes|=d),g=o.expirationTimes;for(var y=d;0<y;){var w=31-vt(y),A=1<<w;g[w]=-1,y&=~A}f!==0&&m3(o,f,d)}function jm(){return(sn&6)===0?(vh(0),!1):!0}function Iv(){if(Pt!==null){if(pn===0)var o=Pt.return;else o=Pt,za=Fo=null,tv(o),ou=null,eh=0,o=Pt;for(;o!==null;)zS(o.alternate,o),o=o.return;Pt=null}}function vu(o,d){var f=o.timeoutHandle;f!==-1&&(o.timeoutHandle=-1,cI(f)),f=o.cancelPendingCommit,f!==null&&(o.cancelPendingCommit=null,f()),Va=0,Iv(),Mn=o,Pt=f=Da(o.current,null),qt=d,pn=0,Vs=null,zl=!1,pu=Eo(o,d),Dv=!1,gu=Ws=Rv=Xo=Pl=tr=0,ks=gh=null,zv=!1,(d&8)!==0&&(d|=d&32);var g=o.entangledLanes;if(g!==0)for(o=o.entanglements,g&=d;0<g;){var y=31-vt(g),w=1<<y;d|=o[y],g&=~w}return Ua=d,V0(),f}function iO(o,d){wt=null,H.H=oh,d===lu||d===em?(d=w6(),pn=3):d===$1?(d=w6(),pn=4):pn=d===xv?8:d!==null&&typeof d=="object"&&typeof d.then=="function"?6:1,Vs=d,Pt===null&&(tr=1,mm(o,ui(d,o.current)))}function aO(){var o=Hs.current;return o===null?!0:(qt&4194048)===qt?mi===null:(qt&62914560)===qt||(qt&536870912)!==0?o===mi:!1}function lO(){var o=H.H;return H.H=oh,o===null?oh:o}function oO(){var o=H.A;return H.A=qB,o}function Nm(){tr=4,zl||(qt&4194048)!==qt&&Hs.current!==null||(pu=!0),(Pl&134217727)===0&&(Xo&134217727)===0||Mn===null||Il(Mn,qt,Ws,!1)}function Fv(o,d,f){var g=sn;sn|=2;var y=lO(),w=oO();(Mn!==o||qt!==d)&&(km=null,vu(o,d)),d=!1;var A=tr;e:do try{if(pn!==0&&Pt!==null){var I=Pt,Z=Vs;switch(pn){case 8:Iv(),A=6;break e;case 3:case 2:case 9:case 6:Hs.current===null&&(d=!0);var xe=pn;if(pn=0,Vs=null,yu(o,I,Z,xe),f&&pu){A=0;break e}break;default:xe=pn,pn=0,Vs=null,yu(o,I,Z,xe)}}HB(),A=tr;break}catch(je){iO(o,je)}while(!0);return d&&o.shellSuspendCounter++,za=Fo=null,sn=g,H.H=y,H.A=w,Pt===null&&(Mn=null,qt=0,V0()),A}function HB(){for(;Pt!==null;)cO(Pt)}function UB(o,d){var f=sn;sn|=2;var g=lO(),y=oO();Mn!==o||qt!==d?(km=null,Om=yn()+500,vu(o,d)):pu=Eo(o,d);e:do try{if(pn!==0&&Pt!==null){d=Pt;var w=Vs;t:switch(pn){case 1:pn=0,Vs=null,yu(o,d,w,1);break;case 2:case 9:if(y6(w)){pn=0,Vs=null,uO(d);break}d=function(){pn!==2&&pn!==9||Mn!==o||(pn=7),Ki(o)},w.then(d,d);break e;case 3:pn=7;break e;case 4:pn=5;break e;case 7:y6(w)?(pn=0,Vs=null,uO(d)):(pn=0,Vs=null,yu(o,d,w,7));break;case 5:var A=null;switch(Pt.tag){case 26:A=Pt.memoizedState;case 5:case 27:var I=Pt;if(A?XO(A):I.stateNode.complete){pn=0,Vs=null;var Z=I.sibling;if(Z!==null)Pt=Z;else{var xe=I.return;xe!==null?(Pt=xe,Cm(xe)):Pt=null}break t}}pn=0,Vs=null,yu(o,d,w,5);break;case 6:pn=0,Vs=null,yu(o,d,w,6);break;case 8:Iv(),tr=6;break e;default:throw Error(r(462))}}VB();break}catch(je){iO(o,je)}while(!0);return za=Fo=null,H.H=g,H.A=y,sn=f,Pt!==null?0:(Mn=null,qt=0,V0(),tr)}function VB(){for(;Pt!==null&&!In();)cO(Pt)}function cO(o){var d=DS(o.alternate,o,Ua);o.memoizedProps=o.pendingProps,d===null?Cm(o):Pt=d}function uO(o){var d=o,f=d.alternate;switch(d.tag){case 15:case 0:d=CS(f,d,d.pendingProps,d.type,void 0,qt);break;case 11:d=CS(f,d,d.pendingProps,d.type.render,d.ref,qt);break;case 5:tv(d);default:zS(f,d),d=Pt=o6(d,Ua),d=DS(f,d,Ua)}o.memoizedProps=o.pendingProps,d===null?Cm(o):Pt=d}function yu(o,d,f,g){za=Fo=null,tv(d),ou=null,eh=0;var y=d.return;try{if(RB(o,y,d,f,qt)){tr=1,mm(o,ui(f,o.current)),Pt=null;return}}catch(w){if(y!==null)throw Pt=y,w;tr=1,mm(o,ui(f,o.current)),Pt=null;return}d.flags&32768?(Ut||g===1?o=!0:pu||(qt&536870912)!==0?o=!1:(zl=o=!0,(g===2||g===9||g===3||g===6)&&(g=Hs.current,g!==null&&g.tag===13&&(g.flags|=16384))),dO(d,o)):Cm(d)}function Cm(o){var d=o;do{if((d.flags&32768)!==0){dO(d,zl);return}o=d.return;var f=LB(d.alternate,d,Ua);if(f!==null){Pt=f;return}if(d=d.sibling,d!==null){Pt=d;return}Pt=d=o}while(d!==null);tr===0&&(tr=5)}function dO(o,d){do{var f=BB(o.alternate,o);if(f!==null){f.flags&=32767,Pt=f;return}if(f=o.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!d&&(o=o.sibling,o!==null)){Pt=o;return}Pt=o=f}while(o!==null);tr=6,Pt=null}function hO(o,d,f,g,y,w,A,I,Z){o.cancelPendingCommit=null;do Tm();while(br!==0);if((sn&6)!==0)throw Error(r(327));if(d!==null){if(d===o.current)throw Error(r(177));if(w=d.lanes|d.childLanes,w|=T1,jL(o,f,w,A,I,Z),o===Mn&&(Pt=Mn=null,qt=0),xu=d,Bl=o,Va=f,Pv=w,Lv=y,tO=g,(d.subtreeFlags&10256)!==0||(d.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,YB(Le,function(){return xO(),null})):(o.callbackNode=null,o.callbackPriority=0),g=(d.flags&13878)!==0,(d.subtreeFlags&13878)!==0||g){g=H.T,H.T=null,y=ae.p,ae.p=2,A=sn,sn|=4;try{IB(o,d,f)}finally{sn=A,ae.p=y,H.T=g}}br=1,fO(),mO(),pO()}}function fO(){if(br===1){br=0;var o=Bl,d=xu,f=(d.flags&13878)!==0;if((d.subtreeFlags&13878)!==0||f){f=H.T,H.T=null;var g=ae.p;ae.p=2;var y=sn;sn|=4;try{WS(d,o);var w=Zv,A=J3(o.containerInfo),I=w.focusedElem,Z=w.selectionRange;if(A!==I&&I&&I.ownerDocument&&Z3(I.ownerDocument.documentElement,I)){if(Z!==null&&O1(I)){var xe=Z.start,je=Z.end;if(je===void 0&&(je=xe),"selectionStart"in I)I.selectionStart=xe,I.selectionEnd=Math.min(je,I.value.length);else{var Te=I.ownerDocument||document,be=Te&&Te.defaultView||window;if(be.getSelection){var Oe=be.getSelection(),Ge=I.textContent.length,lt=Math.min(Z.start,Ge),Sn=Z.end===void 0?lt:Math.min(Z.end,Ge);!Oe.extend&<>Sn&&(A=Sn,Sn=lt,lt=A);var oe=K3(I,lt),se=K3(I,Sn);if(oe&&se&&(Oe.rangeCount!==1||Oe.anchorNode!==oe.node||Oe.anchorOffset!==oe.offset||Oe.focusNode!==se.node||Oe.focusOffset!==se.offset)){var pe=Te.createRange();pe.setStart(oe.node,oe.offset),Oe.removeAllRanges(),lt>Sn?(Oe.addRange(pe),Oe.extend(se.node,se.offset)):(pe.setEnd(se.node,se.offset),Oe.addRange(pe))}}}}for(Te=[],Oe=I;Oe=Oe.parentNode;)Oe.nodeType===1&&Te.push({element:Oe,left:Oe.scrollLeft,top:Oe.scrollTop});for(typeof I.focus=="function"&&I.focus(),I=0;I<Te.length;I++){var Ne=Te[I];Ne.element.scrollLeft=Ne.left,Ne.element.scrollTop=Ne.top}}Fm=!!Kv,Zv=Kv=null}finally{sn=y,ae.p=g,H.T=f}}o.current=d,br=2}}function mO(){if(br===2){br=0;var o=Bl,d=xu,f=(d.flags&8772)!==0;if((d.subtreeFlags&8772)!==0||f){f=H.T,H.T=null;var g=ae.p;ae.p=2;var y=sn;sn|=4;try{QS(o,d.alternate,d)}finally{sn=y,ae.p=g,H.T=f}}br=3}}function pO(){if(br===4||br===3){br=0,or();var o=Bl,d=xu,f=Va,g=tO;(d.subtreeFlags&10256)!==0||(d.flags&10256)!==0?br=5:(br=0,xu=Bl=null,gO(o,o.pendingLanes));var y=o.pendingLanes;if(y===0&&(Ll=null),s1(f),d=d.stateNode,Me&&typeof Me.onCommitFiberRoot=="function")try{Me.onCommitFiberRoot(re,d,void 0,(d.current.flags&128)===128)}catch{}if(g!==null){d=H.T,y=ae.p,ae.p=2,H.T=null;try{for(var w=o.onRecoverableError,A=0;A<g.length;A++){var I=g[A];w(I.value,{componentStack:I.stack})}}finally{H.T=d,ae.p=y}}(Va&3)!==0&&Tm(),Ki(o),y=o.pendingLanes,(f&261930)!==0&&(y&42)!==0?o===Bv?xh++:(xh=0,Bv=o):xh=0,vh(0)}}function gO(o,d){(o.pooledCacheLanes&=d)===0&&(d=o.pooledCache,d!=null&&(o.pooledCache=null,Zd(d)))}function Tm(){return fO(),mO(),pO(),xO()}function xO(){if(br!==5)return!1;var o=Bl,d=Pv;Pv=0;var f=s1(Va),g=H.T,y=ae.p;try{ae.p=32>f?32:f,H.T=null,f=Lv,Lv=null;var w=Bl,A=Va;if(br=0,xu=Bl=null,Va=0,(sn&6)!==0)throw Error(r(331));var I=sn;if(sn|=4,ZS(w.current),XS(w,w.current,A,f),sn=I,vh(0,!1),Me&&typeof Me.onPostCommitFiberRoot=="function")try{Me.onPostCommitFiberRoot(re,w)}catch{}return!0}finally{ae.p=y,H.T=g,gO(o,d)}}function vO(o,d,f){d=ui(f,d),d=gv(o.stateNode,d,2),o=El(o,d,2),o!==null&&(Bd(o,2),Ki(o))}function gn(o,d,f){if(o.tag===3)vO(o,o,f);else for(;d!==null;){if(d.tag===3){vO(d,o,f);break}else if(d.tag===1){var g=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Ll===null||!Ll.has(g))){o=ui(f,o),f=yS(2),g=El(d,f,2),g!==null&&(bS(f,g,d,o),Bd(g,2),Ki(g));break}}d=d.return}}function qv(o,d,f){var g=o.pingCache;if(g===null){g=o.pingCache=new QB;var y=new Set;g.set(d,y)}else y=g.get(d),y===void 0&&(y=new Set,g.set(d,y));y.has(f)||(Dv=!0,y.add(f),o=WB.bind(null,o,d,f),d.then(o,o))}function WB(o,d,f){var g=o.pingCache;g!==null&&g.delete(d),o.pingedLanes|=o.suspendedLanes&f,o.warmLanes&=~f,Mn===o&&(qt&f)===f&&(tr===4||tr===3&&(qt&62914560)===qt&&300>yn()-Sm?(sn&2)===0&&vu(o,0):Rv|=f,gu===qt&&(gu=0)),Ki(o)}function yO(o,d){d===0&&(d=Fc()),o=Lo(o,d),o!==null&&(Bd(o,d),Ki(o))}function GB(o){var d=o.memoizedState,f=0;d!==null&&(f=d.retryLane),yO(o,f)}function XB(o,d){var f=0;switch(o.tag){case 31:case 13:var g=o.stateNode,y=o.memoizedState;y!==null&&(f=y.retryLane);break;case 19:g=o.stateNode;break;case 22:g=o.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(d),yO(o,f)}function YB(o,d){return _t(o,d)}var Mm=null,bu=null,Qv=!1,Am=!1,$v=!1,Fl=0;function Ki(o){o!==bu&&o.next===null&&(bu===null?Mm=bu=o:bu=bu.next=o),Am=!0,Qv||(Qv=!0,ZB())}function vh(o,d){if(!$v&&Am){$v=!0;do for(var f=!1,g=Mm;g!==null;){if(o!==0){var y=g.pendingLanes;if(y===0)var w=0;else{var A=g.suspendedLanes,I=g.pingedLanes;w=(1<<31-vt(42|o)+1)-1,w&=y&~(A&~I),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(f=!0,OO(g,w))}else w=qt,w=Ic(g,g===Mn?w:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(w&3)===0||Eo(g,w)||(f=!0,OO(g,w));g=g.next}while(f);$v=!1}}function KB(){bO()}function bO(){Am=Qv=!1;var o=0;Fl!==0&&oI()&&(o=Fl);for(var d=yn(),f=null,g=Mm;g!==null;){var y=g.next,w=wO(g,d);w===0?(g.next=null,f===null?Mm=y:f.next=y,y===null&&(bu=f)):(f=g,(o!==0||(w&3)!==0)&&(Am=!0)),g=y}br!==0&&br!==5||vh(o),Fl!==0&&(Fl=0)}function wO(o,d){for(var f=o.suspendedLanes,g=o.pingedLanes,y=o.expirationTimes,w=o.pendingLanes&-62914561;0<w;){var A=31-vt(w),I=1<<A,Z=y[A];Z===-1?((I&f)===0||(I&g)!==0)&&(y[A]=n1(I,d)):Z<=d&&(o.expiredLanes|=I),w&=~I}if(d=Mn,f=qt,f=Ic(o,o===d?f:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),g=o.callbackNode,f===0||o===d&&(pn===2||pn===9)||o.cancelPendingCommit!==null)return g!==null&&g!==null&&Yr(g),o.callbackNode=null,o.callbackPriority=0;if((f&3)===0||Eo(o,f)){if(d=f&-f,d===o.callbackPriority)return d;switch(g!==null&&Yr(g),s1(f)){case 2:case 8:f=Se;break;case 32:f=Le;break;case 268435456:f=Tt;break;default:f=Le}return g=SO.bind(null,o),f=_t(f,g),o.callbackPriority=d,o.callbackNode=f,d}return g!==null&&g!==null&&Yr(g),o.callbackPriority=2,o.callbackNode=null,2}function SO(o,d){if(br!==0&&br!==5)return o.callbackNode=null,o.callbackPriority=0,null;var f=o.callbackNode;if(Tm()&&o.callbackNode!==f)return null;var g=qt;return g=Ic(o,o===Mn?g:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),g===0?null:(rO(o,g,d),wO(o,yn()),o.callbackNode!=null&&o.callbackNode===f?SO.bind(null,o):null)}function OO(o,d){if(Tm())return null;rO(o,d,!0)}function ZB(){uI(function(){(sn&6)!==0?_t(ee,KB):bO()})}function Hv(){if(Fl===0){var o=iu;o===0&&(o=mt,mt<<=1,(mt&261888)===0&&(mt=256)),Fl=o}return Fl}function kO(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:B0(""+o)}function jO(o,d){var f=d.ownerDocument.createElement("input");return f.name=d.name,f.value=d.value,o.id&&f.setAttribute("form",o.id),d.parentNode.insertBefore(f,d),o=new FormData(o),f.parentNode.removeChild(f),o}function JB(o,d,f,g,y){if(d==="submit"&&f&&f.stateNode===y){var w=kO((y[ys]||null).action),A=g.submitter;A&&(d=(d=A[ys]||null)?kO(d.formAction):A.getAttribute("formAction"),d!==null&&(w=d,A=null));var I=new Q0("action","action",null,g,y);o.push({event:I,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(Fl!==0){var Z=A?jO(y,A):new FormData(y);uv(f,{pending:!0,data:Z,method:y.method,action:w},null,Z)}}else typeof w=="function"&&(I.preventDefault(),Z=A?jO(y,A):new FormData(y),uv(f,{pending:!0,data:Z,method:y.method,action:w},w,Z))},currentTarget:y}]})}}for(var Uv=0;Uv<C1.length;Uv++){var Vv=C1[Uv],eI=Vv.toLowerCase(),tI=Vv[0].toUpperCase()+Vv.slice(1);_i(eI,"on"+tI)}_i(n6,"onAnimationEnd"),_i(r6,"onAnimationIteration"),_i(s6,"onAnimationStart"),_i("dblclick","onDoubleClick"),_i("focusin","onFocus"),_i("focusout","onBlur"),_i(xB,"onTransitionRun"),_i(vB,"onTransitionStart"),_i(yB,"onTransitionCancel"),_i(i6,"onTransitionEnd"),Uc("onMouseEnter",["mouseout","mouseover"]),Uc("onMouseLeave",["mouseout","mouseover"]),Uc("onPointerEnter",["pointerout","pointerover"]),Uc("onPointerLeave",["pointerout","pointerover"]),Do("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Do("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Do("onBeforeInput",["compositionend","keypress","textInput","paste"]),Do("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Do("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Do("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var yh="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(" "),nI=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(yh));function NO(o,d){d=(d&4)!==0;for(var f=0;f<o.length;f++){var g=o[f],y=g.event;g=g.listeners;e:{var w=void 0;if(d)for(var A=g.length-1;0<=A;A--){var I=g[A],Z=I.instance,xe=I.currentTarget;if(I=I.listener,Z!==w&&y.isPropagationStopped())break e;w=I,y.currentTarget=xe;try{w(y)}catch(je){U0(je)}y.currentTarget=null,w=Z}else for(A=0;A<g.length;A++){if(I=g[A],Z=I.instance,xe=I.currentTarget,I=I.listener,Z!==w&&y.isPropagationStopped())break e;w=I,y.currentTarget=xe;try{w(y)}catch(je){U0(je)}y.currentTarget=null,w=Z}}}}function Lt(o,d){var f=d[i1];f===void 0&&(f=d[i1]=new Set);var g=o+"__bubble";f.has(g)||(CO(d,o,2,!1),f.add(g))}function Wv(o,d,f){var g=0;d&&(g|=4),CO(f,o,g,d)}var Em="_reactListening"+Math.random().toString(36).slice(2);function Gv(o){if(!o[Em]){o[Em]=!0,b3.forEach(function(f){f!=="selectionchange"&&(nI.has(f)||Wv(f,!1,o),Wv(f,!0,o))});var d=o.nodeType===9?o:o.ownerDocument;d===null||d[Em]||(d[Em]=!0,Wv("selectionchange",!1,d))}}function CO(o,d,f,g){switch(nk(d)){case 2:var y=AI;break;case 8:y=EI;break;default:y=cy}f=y.bind(null,d,f,o),y=void 0,!m1||d!=="touchstart"&&d!=="touchmove"&&d!=="wheel"||(y=!0),g?y!==void 0?o.addEventListener(d,f,{capture:!0,passive:y}):o.addEventListener(d,f,!0):y!==void 0?o.addEventListener(d,f,{passive:y}):o.addEventListener(d,f,!1)}function Xv(o,d,f,g,y){var w=g;if((d&1)===0&&(d&2)===0&&g!==null)e:for(;;){if(g===null)return;var A=g.tag;if(A===3||A===4){var I=g.stateNode.containerInfo;if(I===y)break;if(A===4)for(A=g.return;A!==null;){var Z=A.tag;if((Z===3||Z===4)&&A.stateNode.containerInfo===y)return;A=A.return}for(;I!==null;){if(A=Qc(I),A===null)return;if(Z=A.tag,Z===5||Z===6||Z===26||Z===27){g=w=A;continue e}I=I.parentNode}}g=g.return}_3(function(){var xe=w,je=h1(f),Te=[];e:{var be=a6.get(o);if(be!==void 0){var Oe=Q0,Ge=o;switch(o){case"keypress":if(F0(f)===0)break e;case"keydown":case"keyup":Oe=XL;break;case"focusin":Ge="focus",Oe=v1;break;case"focusout":Ge="blur",Oe=v1;break;case"beforeblur":case"afterblur":Oe=v1;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Oe=z3;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Oe=LL;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Oe=ZL;break;case n6:case r6:case s6:Oe=FL;break;case i6:Oe=eB;break;case"scroll":case"scrollend":Oe=zL;break;case"wheel":Oe=nB;break;case"copy":case"cut":case"paste":Oe=QL;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Oe=L3;break;case"toggle":case"beforetoggle":Oe=sB}var lt=(d&4)!==0,Sn=!lt&&(o==="scroll"||o==="scrollend"),oe=lt?be!==null?be+"Capture":null:be;lt=[];for(var se=xe,pe;se!==null;){var Ne=se;if(pe=Ne.stateNode,Ne=Ne.tag,Ne!==5&&Ne!==26&&Ne!==27||pe===null||oe===null||(Ne=qd(se,oe),Ne!=null&<.push(bh(se,Ne,pe))),Sn)break;se=se.return}0<lt.length&&(be=new Oe(be,Ge,null,f,je),Te.push({event:be,listeners:lt}))}}if((d&7)===0){e:{if(be=o==="mouseover"||o==="pointerover",Oe=o==="mouseout"||o==="pointerout",be&&f!==d1&&(Ge=f.relatedTarget||f.fromElement)&&(Qc(Ge)||Ge[qc]))break e;if((Oe||be)&&(be=je.window===je?je:(be=je.ownerDocument)?be.defaultView||be.parentWindow:window,Oe?(Ge=f.relatedTarget||f.toElement,Oe=xe,Ge=Ge?Qc(Ge):null,Ge!==null&&(Sn=i(Ge),lt=Ge.tag,Ge!==Sn||lt!==5&<!==27&<!==6)&&(Ge=null)):(Oe=null,Ge=xe),Oe!==Ge)){if(lt=z3,Ne="onMouseLeave",oe="onMouseEnter",se="mouse",(o==="pointerout"||o==="pointerover")&&(lt=L3,Ne="onPointerLeave",oe="onPointerEnter",se="pointer"),Sn=Oe==null?be:Fd(Oe),pe=Ge==null?be:Fd(Ge),be=new lt(Ne,se+"leave",Oe,f,je),be.target=Sn,be.relatedTarget=pe,Ne=null,Qc(je)===xe&&(lt=new lt(oe,se+"enter",Ge,f,je),lt.target=pe,lt.relatedTarget=Sn,Ne=lt),Sn=Ne,Oe&&Ge)t:{for(lt=rI,oe=Oe,se=Ge,pe=0,Ne=oe;Ne;Ne=lt(Ne))pe++;Ne=0;for(var tt=se;tt;tt=lt(tt))Ne++;for(;0<pe-Ne;)oe=lt(oe),pe--;for(;0<Ne-pe;)se=lt(se),Ne--;for(;pe--;){if(oe===se||se!==null&&oe===se.alternate){lt=oe;break t}oe=lt(oe),se=lt(se)}lt=null}else lt=null;Oe!==null&&TO(Te,be,Oe,lt,!1),Ge!==null&&Sn!==null&&TO(Te,Sn,Ge,lt,!0)}}e:{if(be=xe?Fd(xe):window,Oe=be.nodeName&&be.nodeName.toLowerCase(),Oe==="select"||Oe==="input"&&be.type==="file")var Kt=U3;else if($3(be))if(V3)Kt=mB;else{Kt=hB;var Ke=dB}else Oe=be.nodeName,!Oe||Oe.toLowerCase()!=="input"||be.type!=="checkbox"&&be.type!=="radio"?xe&&u1(xe.elementType)&&(Kt=U3):Kt=fB;if(Kt&&(Kt=Kt(o,xe))){H3(Te,Kt,f,je);break e}Ke&&Ke(o,be,xe),o==="focusout"&&xe&&be.type==="number"&&xe.memoizedProps.value!=null&&c1(be,"number",be.value)}switch(Ke=xe?Fd(xe):window,o){case"focusin":($3(Ke)||Ke.contentEditable==="true")&&(Kc=Ke,k1=xe,Xd=null);break;case"focusout":Xd=k1=Kc=null;break;case"mousedown":j1=!0;break;case"contextmenu":case"mouseup":case"dragend":j1=!1,e6(Te,f,je);break;case"selectionchange":if(gB)break;case"keydown":case"keyup":e6(Te,f,je)}var Ot;if(b1)e:{switch(o){case"compositionstart":var Qt="onCompositionStart";break e;case"compositionend":Qt="onCompositionEnd";break e;case"compositionupdate":Qt="onCompositionUpdate";break e}Qt=void 0}else Yc?q3(o,f)&&(Qt="onCompositionEnd"):o==="keydown"&&f.keyCode===229&&(Qt="onCompositionStart");Qt&&(B3&&f.locale!=="ko"&&(Yc||Qt!=="onCompositionStart"?Qt==="onCompositionEnd"&&Yc&&(Ot=D3()):(kl=je,p1="value"in kl?kl.value:kl.textContent,Yc=!0)),Ke=_m(xe,Qt),0<Ke.length&&(Qt=new P3(Qt,o,null,f,je),Te.push({event:Qt,listeners:Ke}),Ot?Qt.data=Ot:(Ot=Q3(f),Ot!==null&&(Qt.data=Ot)))),(Ot=aB?lB(o,f):oB(o,f))&&(Qt=_m(xe,"onBeforeInput"),0<Qt.length&&(Ke=new P3("onBeforeInput","beforeinput",null,f,je),Te.push({event:Ke,listeners:Qt}),Ke.data=Ot)),JB(Te,o,xe,f,je)}NO(Te,d)})}function bh(o,d,f){return{instance:o,listener:d,currentTarget:f}}function _m(o,d){for(var f=d+"Capture",g=[];o!==null;){var y=o,w=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||w===null||(y=qd(o,f),y!=null&&g.unshift(bh(o,y,w)),y=qd(o,d),y!=null&&g.push(bh(o,y,w))),o.tag===3)return g;o=o.return}return[]}function rI(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function TO(o,d,f,g,y){for(var w=d._reactName,A=[];f!==null&&f!==g;){var I=f,Z=I.alternate,xe=I.stateNode;if(I=I.tag,Z!==null&&Z===g)break;I!==5&&I!==26&&I!==27||xe===null||(Z=xe,y?(xe=qd(f,w),xe!=null&&A.unshift(bh(f,xe,Z))):y||(xe=qd(f,w),xe!=null&&A.push(bh(f,xe,Z)))),f=f.return}A.length!==0&&o.push({event:d,listeners:A})}var sI=/\r\n?/g,iI=/\u0000|\uFFFD/g;function MO(o){return(typeof o=="string"?o:""+o).replace(sI,`
|
||
`).replace(iI,"")}function AO(o,d){return d=MO(d),MO(o)===d}function wn(o,d,f,g,y,w){switch(f){case"children":typeof g=="string"?d==="body"||d==="textarea"&&g===""||Wc(o,g):(typeof g=="number"||typeof g=="bigint")&&d!=="body"&&Wc(o,""+g);break;case"className":P0(o,"class",g);break;case"tabIndex":P0(o,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":P0(o,f,g);break;case"style":A3(o,g,w);break;case"data":if(d!=="object"){P0(o,"data",g);break}case"src":case"href":if(g===""&&(d!=="a"||f!=="href")){o.removeAttribute(f);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){o.removeAttribute(f);break}g=B0(""+g),o.setAttribute(f,g);break;case"action":case"formAction":if(typeof g=="function"){o.setAttribute(f,"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 w=="function"&&(f==="formAction"?(d!=="input"&&wn(o,d,"name",y.name,y,null),wn(o,d,"formEncType",y.formEncType,y,null),wn(o,d,"formMethod",y.formMethod,y,null),wn(o,d,"formTarget",y.formTarget,y,null)):(wn(o,d,"encType",y.encType,y,null),wn(o,d,"method",y.method,y,null),wn(o,d,"target",y.target,y,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){o.removeAttribute(f);break}g=B0(""+g),o.setAttribute(f,g);break;case"onClick":g!=null&&(o.onclick=Ea);break;case"onScroll":g!=null&&Lt("scroll",o);break;case"onScrollEnd":g!=null&&Lt("scrollend",o);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(f=g.__html,f!=null){if(y.children!=null)throw Error(r(60));o.innerHTML=f}}break;case"multiple":o.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":o.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"){o.removeAttribute("xlink:href");break}f=B0(""+g),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);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"?o.setAttribute(f,""+g):o.removeAttribute(f);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"?o.setAttribute(f,""):o.removeAttribute(f);break;case"capture":case"download":g===!0?o.setAttribute(f,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?o.setAttribute(f,g):o.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?o.setAttribute(f,g):o.removeAttribute(f);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?o.removeAttribute(f):o.setAttribute(f,g);break;case"popover":Lt("beforetoggle",o),Lt("toggle",o),z0(o,"popover",g);break;case"xlinkActuate":Aa(o,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Aa(o,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Aa(o,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Aa(o,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Aa(o,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Aa(o,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Aa(o,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Aa(o,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Aa(o,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":z0(o,"is",g);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=DL.get(f)||f,z0(o,f,g))}}function Yv(o,d,f,g,y,w){switch(f){case"style":A3(o,g,w);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(f=g.__html,f!=null){if(y.children!=null)throw Error(r(60));o.innerHTML=f}}break;case"children":typeof g=="string"?Wc(o,g):(typeof g=="number"||typeof g=="bigint")&&Wc(o,""+g);break;case"onScroll":g!=null&&Lt("scroll",o);break;case"onScrollEnd":g!=null&&Lt("scrollend",o);break;case"onClick":g!=null&&(o.onclick=Ea);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!w3.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(y=f.endsWith("Capture"),d=f.slice(2,y?f.length-7:void 0),w=o[ys]||null,w=w!=null?w[f]:null,typeof w=="function"&&o.removeEventListener(d,w,y),typeof g=="function")){typeof w!="function"&&w!==null&&(f in o?o[f]=null:o.hasAttribute(f)&&o.removeAttribute(f)),o.addEventListener(d,g,y);break e}f in o?o[f]=g:g===!0?o.setAttribute(f,""):z0(o,f,g)}}}function Qr(o,d,f){switch(d){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Lt("error",o),Lt("load",o);var g=!1,y=!1,w;for(w in f)if(f.hasOwnProperty(w)){var A=f[w];if(A!=null)switch(w){case"src":g=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,d));default:wn(o,d,w,A,f,null)}}y&&wn(o,d,"srcSet",f.srcSet,f,null),g&&wn(o,d,"src",f.src,f,null);return;case"input":Lt("invalid",o);var I=w=A=y=null,Z=null,xe=null;for(g in f)if(f.hasOwnProperty(g)){var je=f[g];if(je!=null)switch(g){case"name":y=je;break;case"type":A=je;break;case"checked":Z=je;break;case"defaultChecked":xe=je;break;case"value":w=je;break;case"defaultValue":I=je;break;case"children":case"dangerouslySetInnerHTML":if(je!=null)throw Error(r(137,d));break;default:wn(o,d,g,je,f,null)}}N3(o,w,I,Z,xe,A,y,!1);return;case"select":Lt("invalid",o),g=A=w=null;for(y in f)if(f.hasOwnProperty(y)&&(I=f[y],I!=null))switch(y){case"value":w=I;break;case"defaultValue":A=I;break;case"multiple":g=I;default:wn(o,d,y,I,f,null)}d=w,f=A,o.multiple=!!g,d!=null?Vc(o,!!g,d,!1):f!=null&&Vc(o,!!g,f,!0);return;case"textarea":Lt("invalid",o),w=y=g=null;for(A in f)if(f.hasOwnProperty(A)&&(I=f[A],I!=null))switch(A){case"value":g=I;break;case"defaultValue":y=I;break;case"children":w=I;break;case"dangerouslySetInnerHTML":if(I!=null)throw Error(r(91));break;default:wn(o,d,A,I,f,null)}T3(o,g,y,w);return;case"option":for(Z in f)if(f.hasOwnProperty(Z)&&(g=f[Z],g!=null))switch(Z){case"selected":o.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:wn(o,d,Z,g,f,null)}return;case"dialog":Lt("beforetoggle",o),Lt("toggle",o),Lt("cancel",o),Lt("close",o);break;case"iframe":case"object":Lt("load",o);break;case"video":case"audio":for(g=0;g<yh.length;g++)Lt(yh[g],o);break;case"image":Lt("error",o),Lt("load",o);break;case"details":Lt("toggle",o);break;case"embed":case"source":case"link":Lt("error",o),Lt("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(xe in f)if(f.hasOwnProperty(xe)&&(g=f[xe],g!=null))switch(xe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,d));default:wn(o,d,xe,g,f,null)}return;default:if(u1(d)){for(je in f)f.hasOwnProperty(je)&&(g=f[je],g!==void 0&&Yv(o,d,je,g,f,void 0));return}}for(I in f)f.hasOwnProperty(I)&&(g=f[I],g!=null&&wn(o,d,I,g,f,null))}function aI(o,d,f,g){switch(d){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,w=null,A=null,I=null,Z=null,xe=null,je=null;for(Oe in f){var Te=f[Oe];if(f.hasOwnProperty(Oe)&&Te!=null)switch(Oe){case"checked":break;case"value":break;case"defaultValue":Z=Te;default:g.hasOwnProperty(Oe)||wn(o,d,Oe,null,g,Te)}}for(var be in g){var Oe=g[be];if(Te=f[be],g.hasOwnProperty(be)&&(Oe!=null||Te!=null))switch(be){case"type":w=Oe;break;case"name":y=Oe;break;case"checked":xe=Oe;break;case"defaultChecked":je=Oe;break;case"value":A=Oe;break;case"defaultValue":I=Oe;break;case"children":case"dangerouslySetInnerHTML":if(Oe!=null)throw Error(r(137,d));break;default:Oe!==Te&&wn(o,d,be,Oe,g,Te)}}o1(o,A,I,Z,xe,je,w,y);return;case"select":Oe=A=I=be=null;for(w in f)if(Z=f[w],f.hasOwnProperty(w)&&Z!=null)switch(w){case"value":break;case"multiple":Oe=Z;default:g.hasOwnProperty(w)||wn(o,d,w,null,g,Z)}for(y in g)if(w=g[y],Z=f[y],g.hasOwnProperty(y)&&(w!=null||Z!=null))switch(y){case"value":be=w;break;case"defaultValue":I=w;break;case"multiple":A=w;default:w!==Z&&wn(o,d,y,w,g,Z)}d=I,f=A,g=Oe,be!=null?Vc(o,!!f,be,!1):!!g!=!!f&&(d!=null?Vc(o,!!f,d,!0):Vc(o,!!f,f?[]:"",!1));return;case"textarea":Oe=be=null;for(I in f)if(y=f[I],f.hasOwnProperty(I)&&y!=null&&!g.hasOwnProperty(I))switch(I){case"value":break;case"children":break;default:wn(o,d,I,null,g,y)}for(A in g)if(y=g[A],w=f[A],g.hasOwnProperty(A)&&(y!=null||w!=null))switch(A){case"value":be=y;break;case"defaultValue":Oe=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==w&&wn(o,d,A,y,g,w)}C3(o,be,Oe);return;case"option":for(var Ge in f)if(be=f[Ge],f.hasOwnProperty(Ge)&&be!=null&&!g.hasOwnProperty(Ge))switch(Ge){case"selected":o.selected=!1;break;default:wn(o,d,Ge,null,g,be)}for(Z in g)if(be=g[Z],Oe=f[Z],g.hasOwnProperty(Z)&&be!==Oe&&(be!=null||Oe!=null))switch(Z){case"selected":o.selected=be&&typeof be!="function"&&typeof be!="symbol";break;default:wn(o,d,Z,be,g,Oe)}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 lt in f)be=f[lt],f.hasOwnProperty(lt)&&be!=null&&!g.hasOwnProperty(lt)&&wn(o,d,lt,null,g,be);for(xe in g)if(be=g[xe],Oe=f[xe],g.hasOwnProperty(xe)&&be!==Oe&&(be!=null||Oe!=null))switch(xe){case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(r(137,d));break;default:wn(o,d,xe,be,g,Oe)}return;default:if(u1(d)){for(var Sn in f)be=f[Sn],f.hasOwnProperty(Sn)&&be!==void 0&&!g.hasOwnProperty(Sn)&&Yv(o,d,Sn,void 0,g,be);for(je in g)be=g[je],Oe=f[je],!g.hasOwnProperty(je)||be===Oe||be===void 0&&Oe===void 0||Yv(o,d,je,be,g,Oe);return}}for(var oe in f)be=f[oe],f.hasOwnProperty(oe)&&be!=null&&!g.hasOwnProperty(oe)&&wn(o,d,oe,null,g,be);for(Te in g)be=g[Te],Oe=f[Te],!g.hasOwnProperty(Te)||be===Oe||be==null&&Oe==null||wn(o,d,Te,be,g,Oe)}function EO(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function lI(){if(typeof performance.getEntriesByType=="function"){for(var o=0,d=0,f=performance.getEntriesByType("resource"),g=0;g<f.length;g++){var y=f[g],w=y.transferSize,A=y.initiatorType,I=y.duration;if(w&&I&&EO(A)){for(A=0,I=y.responseEnd,g+=1;g<f.length;g++){var Z=f[g],xe=Z.startTime;if(xe>I)break;var je=Z.transferSize,Te=Z.initiatorType;je&&EO(Te)&&(Z=Z.responseEnd,A+=je*(Z<I?1:(I-xe)/(Z-xe)))}if(--g,d+=8*(w+A)/(y.duration/1e3),o++,10<o)break}}if(0<o)return d/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var Kv=null,Zv=null;function Dm(o){return o.nodeType===9?o:o.ownerDocument}function _O(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function DO(o,d){if(o===0)switch(d){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&d==="foreignObject"?0:o}function Jv(o,d){return o==="textarea"||o==="noscript"||typeof d.children=="string"||typeof d.children=="number"||typeof d.children=="bigint"||typeof d.dangerouslySetInnerHTML=="object"&&d.dangerouslySetInnerHTML!==null&&d.dangerouslySetInnerHTML.__html!=null}var ey=null;function oI(){var o=window.event;return o&&o.type==="popstate"?o===ey?!1:(ey=o,!0):(ey=null,!1)}var RO=typeof setTimeout=="function"?setTimeout:void 0,cI=typeof clearTimeout=="function"?clearTimeout:void 0,zO=typeof Promise=="function"?Promise:void 0,uI=typeof queueMicrotask=="function"?queueMicrotask:typeof zO<"u"?function(o){return zO.resolve(null).then(o).catch(dI)}:RO;function dI(o){setTimeout(function(){throw o})}function ql(o){return o==="head"}function PO(o,d){var f=d,g=0;do{var y=f.nextSibling;if(o.removeChild(f),y&&y.nodeType===8)if(f=y.data,f==="/$"||f==="/&"){if(g===0){o.removeChild(y),ku(d);return}g--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")g++;else if(f==="html")wh(o.ownerDocument.documentElement);else if(f==="head"){f=o.ownerDocument.head,wh(f);for(var w=f.firstChild;w;){var A=w.nextSibling,I=w.nodeName;w[Id]||I==="SCRIPT"||I==="STYLE"||I==="LINK"&&w.rel.toLowerCase()==="stylesheet"||f.removeChild(w),w=A}}else f==="body"&&wh(o.ownerDocument.body);f=y}while(f);ku(d)}function LO(o,d){var f=o;o=0;do{var g=f.nextSibling;if(f.nodeType===1?d?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(d?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),g&&g.nodeType===8)if(f=g.data,f==="/$"){if(o===0)break;o--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||o++;f=g}while(f)}function ty(o){var d=o.firstChild;for(d&&d.nodeType===10&&(d=d.nextSibling);d;){var f=d;switch(d=d.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":ty(f),a1(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}o.removeChild(f)}}function hI(o,d,f,g){for(;o.nodeType===1;){var y=f;if(o.nodeName.toLowerCase()!==d.toLowerCase()){if(!g&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(g){if(!o[Id])switch(d){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(w=o.getAttribute("rel"),w==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(w!==y.rel||o.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||o.getAttribute("title")!==(y.title==null?null:y.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(w=o.getAttribute("src"),(w!==(y.src==null?null:y.src)||o.getAttribute("type")!==(y.type==null?null:y.type)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&w&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(d==="input"&&o.type==="hidden"){var w=y.name==null?null:""+y.name;if(y.type==="hidden"&&o.getAttribute("name")===w)return o}else return o;if(o=pi(o.nextSibling),o===null)break}return null}function fI(o,d,f){if(d==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!f||(o=pi(o.nextSibling),o===null))return null;return o}function BO(o,d){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!d||(o=pi(o.nextSibling),o===null))return null;return o}function ny(o){return o.data==="$?"||o.data==="$~"}function ry(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function mI(o,d){var f=o.ownerDocument;if(o.data==="$~")o._reactRetry=d;else if(o.data!=="$?"||f.readyState!=="loading")d();else{var g=function(){d(),f.removeEventListener("DOMContentLoaded",g)};f.addEventListener("DOMContentLoaded",g),o._reactRetry=g}}function pi(o){for(;o!=null;o=o.nextSibling){var d=o.nodeType;if(d===1||d===3)break;if(d===8){if(d=o.data,d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"||d==="F!"||d==="F")break;if(d==="/$"||d==="/&")return null}}return o}var sy=null;function IO(o){o=o.nextSibling;for(var d=0;o;){if(o.nodeType===8){var f=o.data;if(f==="/$"||f==="/&"){if(d===0)return pi(o.nextSibling);d--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||d++}o=o.nextSibling}return null}function FO(o){o=o.previousSibling;for(var d=0;o;){if(o.nodeType===8){var f=o.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(d===0)return o;d--}else f!=="/$"&&f!=="/&"||d++}o=o.previousSibling}return null}function qO(o,d,f){switch(d=Dm(f),o){case"html":if(o=d.documentElement,!o)throw Error(r(452));return o;case"head":if(o=d.head,!o)throw Error(r(453));return o;case"body":if(o=d.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function wh(o){for(var d=o.attributes;d.length;)o.removeAttributeNode(d[0]);a1(o)}var gi=new Map,QO=new Set;function Rm(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var Wa=ae.d;ae.d={f:pI,r:gI,D:xI,C:vI,L:yI,m:bI,X:SI,S:wI,M:OI};function pI(){var o=Wa.f(),d=jm();return o||d}function gI(o){var d=$c(o);d!==null&&d.tag===5&&d.type==="form"?iS(d):Wa.r(o)}var wu=typeof document>"u"?null:document;function $O(o,d,f){var g=wu;if(g&&typeof d=="string"&&d){var y=oi(d);y='link[rel="'+o+'"][href="'+y+'"]',typeof f=="string"&&(y+='[crossorigin="'+f+'"]'),QO.has(y)||(QO.add(y),o={rel:o,crossOrigin:f,href:d},g.querySelector(y)===null&&(d=g.createElement("link"),Qr(d,"link",o),Er(d),g.head.appendChild(d)))}}function xI(o){Wa.D(o),$O("dns-prefetch",o,null)}function vI(o,d){Wa.C(o,d),$O("preconnect",o,d)}function yI(o,d,f){Wa.L(o,d,f);var g=wu;if(g&&o&&d){var y='link[rel="preload"][as="'+oi(d)+'"]';d==="image"&&f&&f.imageSrcSet?(y+='[imagesrcset="'+oi(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(y+='[imagesizes="'+oi(f.imageSizes)+'"]')):y+='[href="'+oi(o)+'"]';var w=y;switch(d){case"style":w=Su(o);break;case"script":w=Ou(o)}gi.has(w)||(o=p({rel:"preload",href:d==="image"&&f&&f.imageSrcSet?void 0:o,as:d},f),gi.set(w,o),g.querySelector(y)!==null||d==="style"&&g.querySelector(Sh(w))||d==="script"&&g.querySelector(Oh(w))||(d=g.createElement("link"),Qr(d,"link",o),Er(d),g.head.appendChild(d)))}}function bI(o,d){Wa.m(o,d);var f=wu;if(f&&o){var g=d&&typeof d.as=="string"?d.as:"script",y='link[rel="modulepreload"][as="'+oi(g)+'"][href="'+oi(o)+'"]',w=y;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=Ou(o)}if(!gi.has(w)&&(o=p({rel:"modulepreload",href:o},d),gi.set(w,o),f.querySelector(y)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(Oh(w)))return}g=f.createElement("link"),Qr(g,"link",o),Er(g),f.head.appendChild(g)}}}function wI(o,d,f){Wa.S(o,d,f);var g=wu;if(g&&o){var y=Hc(g).hoistableStyles,w=Su(o);d=d||"default";var A=y.get(w);if(!A){var I={loading:0,preload:null};if(A=g.querySelector(Sh(w)))I.loading=5;else{o=p({rel:"stylesheet",href:o,"data-precedence":d},f),(f=gi.get(w))&&iy(o,f);var Z=A=g.createElement("link");Er(Z),Qr(Z,"link",o),Z._p=new Promise(function(xe,je){Z.onload=xe,Z.onerror=je}),Z.addEventListener("load",function(){I.loading|=1}),Z.addEventListener("error",function(){I.loading|=2}),I.loading|=4,zm(A,d,g)}A={type:"stylesheet",instance:A,count:1,state:I},y.set(w,A)}}}function SI(o,d){Wa.X(o,d);var f=wu;if(f&&o){var g=Hc(f).hoistableScripts,y=Ou(o),w=g.get(y);w||(w=f.querySelector(Oh(y)),w||(o=p({src:o,async:!0},d),(d=gi.get(y))&&ay(o,d),w=f.createElement("script"),Er(w),Qr(w,"link",o),f.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},g.set(y,w))}}function OI(o,d){Wa.M(o,d);var f=wu;if(f&&o){var g=Hc(f).hoistableScripts,y=Ou(o),w=g.get(y);w||(w=f.querySelector(Oh(y)),w||(o=p({src:o,async:!0,type:"module"},d),(d=gi.get(y))&&ay(o,d),w=f.createElement("script"),Er(w),Qr(w,"link",o),f.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},g.set(y,w))}}function HO(o,d,f,g){var y=(y=fe.current)?Rm(y):null;if(!y)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(d=Su(f.href),f=Hc(y).hoistableStyles,g=f.get(d),g||(g={type:"style",instance:null,count:0,state:null},f.set(d,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){o=Su(f.href);var w=Hc(y).hoistableStyles,A=w.get(o);if(A||(y=y.ownerDocument||y,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(o,A),(w=y.querySelector(Sh(o)))&&!w._p&&(A.instance=w,A.state.loading=5),gi.has(o)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},gi.set(o,f),w||kI(y,o,f,A.state))),d&&g===null)throw Error(r(528,""));return A}if(d&&g!==null)throw Error(r(529,""));return null;case"script":return d=f.async,f=f.src,typeof f=="string"&&d&&typeof d!="function"&&typeof d!="symbol"?(d=Ou(f),f=Hc(y).hoistableScripts,g=f.get(d),g||(g={type:"script",instance:null,count:0,state:null},f.set(d,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function Su(o){return'href="'+oi(o)+'"'}function Sh(o){return'link[rel="stylesheet"]['+o+"]"}function UO(o){return p({},o,{"data-precedence":o.precedence,precedence:null})}function kI(o,d,f,g){o.querySelector('link[rel="preload"][as="style"]['+d+"]")?g.loading=1:(d=o.createElement("link"),g.preload=d,d.addEventListener("load",function(){return g.loading|=1}),d.addEventListener("error",function(){return g.loading|=2}),Qr(d,"link",f),Er(d),o.head.appendChild(d))}function Ou(o){return'[src="'+oi(o)+'"]'}function Oh(o){return"script[async]"+o}function VO(o,d,f){if(d.count++,d.instance===null)switch(d.type){case"style":var g=o.querySelector('style[data-href~="'+oi(f.href)+'"]');if(g)return d.instance=g,Er(g),g;var y=p({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return g=(o.ownerDocument||o).createElement("style"),Er(g),Qr(g,"style",y),zm(g,f.precedence,o),d.instance=g;case"stylesheet":y=Su(f.href);var w=o.querySelector(Sh(y));if(w)return d.state.loading|=4,d.instance=w,Er(w),w;g=UO(f),(y=gi.get(y))&&iy(g,y),w=(o.ownerDocument||o).createElement("link"),Er(w);var A=w;return A._p=new Promise(function(I,Z){A.onload=I,A.onerror=Z}),Qr(w,"link",g),d.state.loading|=4,zm(w,f.precedence,o),d.instance=w;case"script":return w=Ou(f.src),(y=o.querySelector(Oh(w)))?(d.instance=y,Er(y),y):(g=f,(y=gi.get(w))&&(g=p({},f),ay(g,y)),o=o.ownerDocument||o,y=o.createElement("script"),Er(y),Qr(y,"link",g),o.head.appendChild(y),d.instance=y);case"void":return null;default:throw Error(r(443,d.type))}else d.type==="stylesheet"&&(d.state.loading&4)===0&&(g=d.instance,d.state.loading|=4,zm(g,f.precedence,o));return d.instance}function zm(o,d,f){for(var g=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=g.length?g[g.length-1]:null,w=y,A=0;A<g.length;A++){var I=g[A];if(I.dataset.precedence===d)w=I;else if(w!==y)break}w?w.parentNode.insertBefore(o,w.nextSibling):(d=f.nodeType===9?f.head:f,d.insertBefore(o,d.firstChild))}function iy(o,d){o.crossOrigin==null&&(o.crossOrigin=d.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=d.referrerPolicy),o.title==null&&(o.title=d.title)}function ay(o,d){o.crossOrigin==null&&(o.crossOrigin=d.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=d.referrerPolicy),o.integrity==null&&(o.integrity=d.integrity)}var Pm=null;function WO(o,d,f){if(Pm===null){var g=new Map,y=Pm=new Map;y.set(f,g)}else y=Pm,g=y.get(f),g||(g=new Map,y.set(f,g));if(g.has(o))return g;for(g.set(o,null),f=f.getElementsByTagName(o),y=0;y<f.length;y++){var w=f[y];if(!(w[Id]||w[Br]||o==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var A=w.getAttribute(d)||"";A=o+A;var I=g.get(A);I?I.push(w):g.set(A,[w])}}return g}function GO(o,d,f){o=o.ownerDocument||o,o.head.insertBefore(f,d==="title"?o.querySelector("head > title"):null)}function jI(o,d,f){if(f===1||d.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof d.precedence!="string"||typeof d.href!="string"||d.href==="")break;return!0;case"link":if(typeof d.rel!="string"||typeof d.href!="string"||d.href===""||d.onLoad||d.onError)break;switch(d.rel){case"stylesheet":return o=d.disabled,typeof d.precedence=="string"&&o==null;default:return!0}case"script":if(d.async&&typeof d.async!="function"&&typeof d.async!="symbol"&&!d.onLoad&&!d.onError&&d.src&&typeof d.src=="string")return!0}return!1}function XO(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function NI(o,d,f,g){if(f.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var y=Su(g.href),w=d.querySelector(Sh(y));if(w){d=w._p,d!==null&&typeof d=="object"&&typeof d.then=="function"&&(o.count++,o=Lm.bind(o),d.then(o,o)),f.state.loading|=4,f.instance=w,Er(w);return}w=d.ownerDocument||d,g=UO(g),(y=gi.get(y))&&iy(g,y),w=w.createElement("link"),Er(w);var A=w;A._p=new Promise(function(I,Z){A.onload=I,A.onerror=Z}),Qr(w,"link",g),f.instance=w}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(f,d),(d=f.state.preload)&&(f.state.loading&3)===0&&(o.count++,f=Lm.bind(o),d.addEventListener("load",f),d.addEventListener("error",f))}}var ly=0;function CI(o,d){return o.stylesheets&&o.count===0&&Im(o,o.stylesheets),0<o.count||0<o.imgCount?function(f){var g=setTimeout(function(){if(o.stylesheets&&Im(o,o.stylesheets),o.unsuspend){var w=o.unsuspend;o.unsuspend=null,w()}},6e4+d);0<o.imgBytes&&ly===0&&(ly=62500*lI());var y=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&Im(o,o.stylesheets),o.unsuspend)){var w=o.unsuspend;o.unsuspend=null,w()}},(o.imgBytes>ly?50:800)+d);return o.unsuspend=f,function(){o.unsuspend=null,clearTimeout(g),clearTimeout(y)}}:null}function Lm(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Im(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Bm=null;function Im(o,d){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Bm=new Map,d.forEach(TI,o),Bm=null,Lm.call(o))}function TI(o,d){if(!(d.state.loading&4)){var f=Bm.get(o);if(f)var g=f.get(null);else{f=new Map,Bm.set(o,f);for(var y=o.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<y.length;w++){var A=y[w];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(f.set(A.dataset.precedence,A),g=A)}g&&f.set(null,g)}y=d.instance,A=y.getAttribute("data-precedence"),w=f.get(A)||g,w===g&&f.set(null,y),f.set(A,y),this.count++,g=Lm.bind(this),y.addEventListener("load",g),y.addEventListener("error",g),w?w.parentNode.insertBefore(y,w.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(y,o.firstChild)),d.state.loading|=4}}var kh={$$typeof:M,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function MI(o,d,f,g,y,w,A,I,Z){this.tag=1,this.containerInfo=o,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=_o(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_o(0),this.hiddenUpdates=_o(null),this.identifierPrefix=g,this.onUncaughtError=y,this.onCaughtError=w,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function YO(o,d,f,g,y,w,A,I,Z,xe,je,Te){return o=new MI(o,d,f,A,Z,xe,je,Te,I),d=1,w===!0&&(d|=24),w=$s(3,null,null,d),o.current=w,w.stateNode=o,d=F1(),d.refCount++,o.pooledCache=d,d.refCount++,w.memoizedState={element:g,isDehydrated:f,cache:d},H1(w),o}function KO(o){return o?(o=eu,o):eu}function ZO(o,d,f,g,y,w){y=KO(y),g.context===null?g.context=y:g.pendingContext=y,g=Al(d),g.payload={element:f},w=w===void 0?null:w,w!==null&&(g.callback=w),f=El(o,g,d),f!==null&&(js(f,o,d),nh(f,o,d))}function JO(o,d){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var f=o.retryLane;o.retryLane=f!==0&&f<d?f:d}}function oy(o,d){JO(o,d),(o=o.alternate)&&JO(o,d)}function ek(o){if(o.tag===13||o.tag===31){var d=Lo(o,67108864);d!==null&&js(d,o,67108864),oy(o,67108864)}}function tk(o){if(o.tag===13||o.tag===31){var d=Gs();d=r1(d);var f=Lo(o,d);f!==null&&js(f,o,d),oy(o,d)}}var Fm=!0;function AI(o,d,f,g){var y=H.T;H.T=null;var w=ae.p;try{ae.p=2,cy(o,d,f,g)}finally{ae.p=w,H.T=y}}function EI(o,d,f,g){var y=H.T;H.T=null;var w=ae.p;try{ae.p=8,cy(o,d,f,g)}finally{ae.p=w,H.T=y}}function cy(o,d,f,g){if(Fm){var y=uy(g);if(y===null)Xv(o,d,g,qm,f),rk(o,g);else if(DI(y,o,d,f,g))g.stopPropagation();else if(rk(o,g),d&4&&-1<_I.indexOf(o)){for(;y!==null;){var w=$c(y);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var A=Mt(w.pendingLanes);if(A!==0){var I=w;for(I.pendingLanes|=2,I.entangledLanes|=2;A;){var Z=1<<31-vt(A);I.entanglements[1]|=Z,A&=~Z}Ki(w),(sn&6)===0&&(Om=yn()+500,vh(0))}}break;case 31:case 13:I=Lo(w,2),I!==null&&js(I,w,2),jm(),oy(w,2)}if(w=uy(g),w===null&&Xv(o,d,g,qm,f),w===y)break;y=w}y!==null&&g.stopPropagation()}else Xv(o,d,g,null,f)}}function uy(o){return o=h1(o),dy(o)}var qm=null;function dy(o){if(qm=null,o=Qc(o),o!==null){var d=i(o);if(d===null)o=null;else{var f=d.tag;if(f===13){if(o=l(d),o!==null)return o;o=null}else if(f===31){if(o=c(d),o!==null)return o;o=null}else if(f===3){if(d.stateNode.current.memoizedState.isDehydrated)return d.tag===3?d.stateNode.containerInfo:null;o=null}else d!==o&&(o=null)}}return qm=o,null}function nk(o){switch(o){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(ft()){case ee:return 2;case Se:return 8;case Le:case rt:return 32;case Tt:return 268435456;default:return 32}default:return 32}}var hy=!1,Ql=null,$l=null,Hl=null,jh=new Map,Nh=new Map,Ul=[],_I="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 rk(o,d){switch(o){case"focusin":case"focusout":Ql=null;break;case"dragenter":case"dragleave":$l=null;break;case"mouseover":case"mouseout":Hl=null;break;case"pointerover":case"pointerout":jh.delete(d.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nh.delete(d.pointerId)}}function Ch(o,d,f,g,y,w){return o===null||o.nativeEvent!==w?(o={blockedOn:d,domEventName:f,eventSystemFlags:g,nativeEvent:w,targetContainers:[y]},d!==null&&(d=$c(d),d!==null&&ek(d)),o):(o.eventSystemFlags|=g,d=o.targetContainers,y!==null&&d.indexOf(y)===-1&&d.push(y),o)}function DI(o,d,f,g,y){switch(d){case"focusin":return Ql=Ch(Ql,o,d,f,g,y),!0;case"dragenter":return $l=Ch($l,o,d,f,g,y),!0;case"mouseover":return Hl=Ch(Hl,o,d,f,g,y),!0;case"pointerover":var w=y.pointerId;return jh.set(w,Ch(jh.get(w)||null,o,d,f,g,y)),!0;case"gotpointercapture":return w=y.pointerId,Nh.set(w,Ch(Nh.get(w)||null,o,d,f,g,y)),!0}return!1}function sk(o){var d=Qc(o.target);if(d!==null){var f=i(d);if(f!==null){if(d=f.tag,d===13){if(d=l(f),d!==null){o.blockedOn=d,v3(o.priority,function(){tk(f)});return}}else if(d===31){if(d=c(f),d!==null){o.blockedOn=d,v3(o.priority,function(){tk(f)});return}}else if(d===3&&f.stateNode.current.memoizedState.isDehydrated){o.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Qm(o){if(o.blockedOn!==null)return!1;for(var d=o.targetContainers;0<d.length;){var f=uy(o.nativeEvent);if(f===null){f=o.nativeEvent;var g=new f.constructor(f.type,f);d1=g,f.target.dispatchEvent(g),d1=null}else return d=$c(f),d!==null&&ek(d),o.blockedOn=f,!1;d.shift()}return!0}function ik(o,d,f){Qm(o)&&f.delete(d)}function RI(){hy=!1,Ql!==null&&Qm(Ql)&&(Ql=null),$l!==null&&Qm($l)&&($l=null),Hl!==null&&Qm(Hl)&&(Hl=null),jh.forEach(ik),Nh.forEach(ik)}function $m(o,d){o.blockedOn===d&&(o.blockedOn=null,hy||(hy=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,RI)))}var Hm=null;function ak(o){Hm!==o&&(Hm=o,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Hm===o&&(Hm=null);for(var d=0;d<o.length;d+=3){var f=o[d],g=o[d+1],y=o[d+2];if(typeof g!="function"){if(dy(g||f)===null)continue;break}var w=$c(f);w!==null&&(o.splice(d,3),d-=3,uv(w,{pending:!0,data:y,method:f.method,action:g},g,y))}}))}function ku(o){function d(Z){return $m(Z,o)}Ql!==null&&$m(Ql,o),$l!==null&&$m($l,o),Hl!==null&&$m(Hl,o),jh.forEach(d),Nh.forEach(d);for(var f=0;f<Ul.length;f++){var g=Ul[f];g.blockedOn===o&&(g.blockedOn=null)}for(;0<Ul.length&&(f=Ul[0],f.blockedOn===null);)sk(f),f.blockedOn===null&&Ul.shift();if(f=(o.ownerDocument||o).$$reactFormReplay,f!=null)for(g=0;g<f.length;g+=3){var y=f[g],w=f[g+1],A=y[ys]||null;if(typeof w=="function")A||ak(f);else if(A){var I=null;if(w&&w.hasAttribute("formAction")){if(y=w,A=w[ys]||null)I=A.formAction;else if(dy(y)!==null)continue}else I=A.action;typeof I=="function"?f[g+1]=I:(f.splice(g,3),g-=3),ak(f)}}}function lk(){function o(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(A){return y=A})},focusReset:"manual",scroll:"manual"})}function d(){y!==null&&(y(),y=null),g||setTimeout(f,20)}function f(){if(!g&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,y=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",d),navigation.addEventListener("navigateerror",d),setTimeout(f,100),function(){g=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",d),navigation.removeEventListener("navigateerror",d),y!==null&&(y(),y=null)}}}function fy(o){this._internalRoot=o}Um.prototype.render=fy.prototype.render=function(o){var d=this._internalRoot;if(d===null)throw Error(r(409));var f=d.current,g=Gs();ZO(f,g,o,d,null,null)},Um.prototype.unmount=fy.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var d=o.containerInfo;ZO(o.current,2,null,o,null,null),jm(),d[qc]=null}};function Um(o){this._internalRoot=o}Um.prototype.unstable_scheduleHydration=function(o){if(o){var d=x3();o={blockedOn:null,target:o,priority:d};for(var f=0;f<Ul.length&&d!==0&&d<Ul[f].priority;f++);Ul.splice(f,0,o),f===0&&sk(o)}};var ok=e.version;if(ok!=="19.2.0")throw Error(r(527,ok,"19.2.0"));ae.findDOMNode=function(o){var d=o._reactInternals;if(d===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=h(d),o=o!==null?m(o):null,o=o===null?null:o.stateNode,o};var zI={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vm.isDisabled&&Vm.supportsFiber)try{re=Vm.inject(zI),Me=Vm}catch{}}return Mh.createRoot=function(o,d){if(!s(o))throw Error(r(299));var f=!1,g="",y=pS,w=gS,A=xS;return d!=null&&(d.unstable_strictMode===!0&&(f=!0),d.identifierPrefix!==void 0&&(g=d.identifierPrefix),d.onUncaughtError!==void 0&&(y=d.onUncaughtError),d.onCaughtError!==void 0&&(w=d.onCaughtError),d.onRecoverableError!==void 0&&(A=d.onRecoverableError)),d=YO(o,1,!1,null,null,f,g,null,y,w,A,lk),o[qc]=d.current,Gv(o),new fy(d)},Mh.hydrateRoot=function(o,d,f){if(!s(o))throw Error(r(299));var g=!1,y="",w=pS,A=gS,I=xS,Z=null;return f!=null&&(f.unstable_strictMode===!0&&(g=!0),f.identifierPrefix!==void 0&&(y=f.identifierPrefix),f.onUncaughtError!==void 0&&(w=f.onUncaughtError),f.onCaughtError!==void 0&&(A=f.onCaughtError),f.onRecoverableError!==void 0&&(I=f.onRecoverableError),f.formState!==void 0&&(Z=f.formState)),d=YO(o,1,!0,d,f??null,g,y,Z,w,A,I,lk),d.context=KO(null),f=d.current,g=Gs(),g=r1(g),y=Al(g),y.callback=null,El(f,y,g),f=g,d.current.lanes=f,Bd(d,f),Ki(d),o[qc]=d.current,Gv(o),new Um(d)},Mh.version="19.2.0",Mh}var yk;function $F(){if(yk)return gy.exports;yk=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),gy.exports=QF(),gy.exports}var HF=$F();function V9(n,e){return function(){return n.apply(e,arguments)}}const{toString:UF}=Object.prototype,{getPrototypeOf:tw}=Object,{iterator:cx,toStringTag:W9}=Symbol,ux=(n=>e=>{const t=UF.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Ui=n=>(n=n.toLowerCase(),e=>ux(e)===n),dx=n=>e=>typeof e===n,{isArray:Od}=Array,id=dx("undefined");function Zf(n){return n!==null&&!id(n)&&n.constructor!==null&&!id(n.constructor)&&Ds(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const G9=Ui("ArrayBuffer");function VF(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&G9(n.buffer),e}const WF=dx("string"),Ds=dx("function"),X9=dx("number"),Jf=n=>n!==null&&typeof n=="object",GF=n=>n===!0||n===!1,Hp=n=>{if(ux(n)!=="object")return!1;const e=tw(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(W9 in n)&&!(cx in n)},XF=n=>{if(!Jf(n)||Zf(n))return!1;try{return Object.keys(n).length===0&&Object.getPrototypeOf(n)===Object.prototype}catch{return!1}},YF=Ui("Date"),KF=Ui("File"),ZF=Ui("Blob"),JF=Ui("FileList"),eq=n=>Jf(n)&&Ds(n.pipe),tq=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||Ds(n.append)&&((e=ux(n))==="formdata"||e==="object"&&Ds(n.toString)&&n.toString()==="[object FormData]"))},nq=Ui("URLSearchParams"),[rq,sq,iq,aq]=["ReadableStream","Request","Response","Headers"].map(Ui),lq=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function e0(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let r,s;if(typeof n!="object"&&(n=[n]),Od(n))for(r=0,s=n.length;r<s;r++)e.call(null,n[r],r,n);else{if(Zf(n))return;const i=t?Object.getOwnPropertyNames(n):Object.keys(n),l=i.length;let c;for(r=0;r<l;r++)c=i[r],e.call(null,n[c],c,n)}}function Y9(n,e){if(Zf(n))return null;e=e.toLowerCase();const t=Object.keys(n);let r=t.length,s;for(;r-- >0;)if(s=t[r],e===s.toLowerCase())return s;return null}const ic=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,K9=n=>!id(n)&&n!==ic;function r2(){const{caseless:n,skipUndefined:e}=K9(this)&&this||{},t={},r=(s,i)=>{const l=n&&Y9(t,i)||i;Hp(t[l])&&Hp(s)?t[l]=r2(t[l],s):Hp(s)?t[l]=r2({},s):Od(s)?t[l]=s.slice():(!e||!id(s))&&(t[l]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&e0(arguments[s],r);return t}const oq=(n,e,t,{allOwnKeys:r}={})=>(e0(e,(s,i)=>{t&&Ds(s)?n[i]=V9(s,t):n[i]=s},{allOwnKeys:r}),n),cq=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),uq=(n,e,t,r)=>{n.prototype=Object.create(e.prototype,r),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:e.prototype}),t&&Object.assign(n.prototype,t)},dq=(n,e,t,r)=>{let s,i,l;const c={};if(e=e||{},n==null)return e;do{for(s=Object.getOwnPropertyNames(n),i=s.length;i-- >0;)l=s[i],(!r||r(l,n,e))&&!c[l]&&(e[l]=n[l],c[l]=!0);n=t!==!1&&tw(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},hq=(n,e,t)=>{n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;const r=n.indexOf(e,t);return r!==-1&&r===t},fq=n=>{if(!n)return null;if(Od(n))return n;let e=n.length;if(!X9(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},mq=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&tw(Uint8Array)),pq=(n,e)=>{const r=(n&&n[cx]).call(n);let s;for(;(s=r.next())&&!s.done;){const i=s.value;e.call(n,i[0],i[1])}},gq=(n,e)=>{let t;const r=[];for(;(t=n.exec(e))!==null;)r.push(t);return r},xq=Ui("HTMLFormElement"),vq=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,s){return r.toUpperCase()+s}),bk=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),yq=Ui("RegExp"),Z9=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),r={};e0(t,(s,i)=>{let l;(l=e(s,i,n))!==!1&&(r[i]=l||s)}),Object.defineProperties(n,r)},bq=n=>{Z9(n,(e,t)=>{if(Ds(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const r=n[t];if(Ds(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},wq=(n,e)=>{const t={},r=s=>{s.forEach(i=>{t[i]=!0})};return Od(n)?r(n):r(String(n).split(e)),t},Sq=()=>{},Oq=(n,e)=>n!=null&&Number.isFinite(n=+n)?n:e;function kq(n){return!!(n&&Ds(n.append)&&n[W9]==="FormData"&&n[cx])}const jq=n=>{const e=new Array(10),t=(r,s)=>{if(Jf(r)){if(e.indexOf(r)>=0)return;if(Zf(r))return r;if(!("toJSON"in r)){e[s]=r;const i=Od(r)?[]:{};return e0(r,(l,c)=>{const u=t(l,s+1);!id(u)&&(i[c]=u)}),e[s]=void 0,i}}return r};return t(n,0)},Nq=Ui("AsyncFunction"),Cq=n=>n&&(Jf(n)||Ds(n))&&Ds(n.then)&&Ds(n.catch),J9=((n,e)=>n?setImmediate:e?((t,r)=>(ic.addEventListener("message",({source:s,data:i})=>{s===ic&&i===t&&r.length&&r.shift()()},!1),s=>{r.push(s),ic.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",Ds(ic.postMessage)),Tq=typeof queueMicrotask<"u"?queueMicrotask.bind(ic):typeof process<"u"&&process.nextTick||J9,Mq=n=>n!=null&&Ds(n[cx]),we={isArray:Od,isArrayBuffer:G9,isBuffer:Zf,isFormData:tq,isArrayBufferView:VF,isString:WF,isNumber:X9,isBoolean:GF,isObject:Jf,isPlainObject:Hp,isEmptyObject:XF,isReadableStream:rq,isRequest:sq,isResponse:iq,isHeaders:aq,isUndefined:id,isDate:YF,isFile:KF,isBlob:ZF,isRegExp:yq,isFunction:Ds,isStream:eq,isURLSearchParams:nq,isTypedArray:mq,isFileList:JF,forEach:e0,merge:r2,extend:oq,trim:lq,stripBOM:cq,inherits:uq,toFlatObject:dq,kindOf:ux,kindOfTest:Ui,endsWith:hq,toArray:fq,forEachEntry:pq,matchAll:gq,isHTMLForm:xq,hasOwnProperty:bk,hasOwnProp:bk,reduceDescriptors:Z9,freezeMethods:bq,toObjectSet:wq,toCamelCase:vq,noop:Sq,toFiniteNumber:Oq,findKey:Y9,global:ic,isContextDefined:K9,isSpecCompliantForm:kq,toJSONObject:jq,isAsyncFn:Nq,isThenable:Cq,setImmediate:J9,asap:Tq,isIterable:Mq};function St(n,e,t,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}we.inherits(St,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:we.toJSONObject(this.config),code:this.code,status:this.status}}});const eC=St.prototype,tC={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{tC[n]={value:n}});Object.defineProperties(St,tC);Object.defineProperty(eC,"isAxiosError",{value:!0});St.from=(n,e,t,r,s,i)=>{const l=Object.create(eC);we.toFlatObject(n,l,function(m){return m!==Error.prototype},h=>h!=="isAxiosError");const c=n&&n.message?n.message:"Error",u=e==null&&n?n.code:e;return St.call(l,c,u,t,r,s),n&&l.cause==null&&Object.defineProperty(l,"cause",{value:n,configurable:!0}),l.name=n&&n.name||"Error",i&&Object.assign(l,i),l};const Aq=null;function s2(n){return we.isPlainObject(n)||we.isArray(n)}function nC(n){return we.endsWith(n,"[]")?n.slice(0,-2):n}function wk(n,e,t){return n?n.concat(e).map(function(s,i){return s=nC(s),!t&&i?"["+s+"]":s}).join(t?".":""):e}function Eq(n){return we.isArray(n)&&!n.some(s2)}const _q=we.toFlatObject(we,{},null,function(e){return/^is[A-Z]/.test(e)});function hx(n,e,t){if(!we.isObject(n))throw new TypeError("target must be an object");e=e||new FormData,t=we.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(O,k){return!we.isUndefined(k[O])});const r=t.metaTokens,s=t.visitor||m,i=t.dots,l=t.indexes,u=(t.Blob||typeof Blob<"u"&&Blob)&&we.isSpecCompliantForm(e);if(!we.isFunction(s))throw new TypeError("visitor must be a function");function h(b){if(b===null)return"";if(we.isDate(b))return b.toISOString();if(we.isBoolean(b))return b.toString();if(!u&&we.isBlob(b))throw new St("Blob is not supported. Use a Buffer instead.");return we.isArrayBuffer(b)||we.isTypedArray(b)?u&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function m(b,O,k){let j=b;if(b&&!k&&typeof b=="object"){if(we.endsWith(O,"{}"))O=r?O:O.slice(0,-2),b=JSON.stringify(b);else if(we.isArray(b)&&Eq(b)||(we.isFileList(b)||we.endsWith(O,"[]"))&&(j=we.toArray(b)))return O=nC(O),j.forEach(function(M,_){!(we.isUndefined(M)||M===null)&&e.append(l===!0?wk([O],_,i):l===null?O:O+"[]",h(M))}),!1}return s2(b)?!0:(e.append(wk(k,O,i),h(b)),!1)}const p=[],x=Object.assign(_q,{defaultVisitor:m,convertValue:h,isVisitable:s2});function v(b,O){if(!we.isUndefined(b)){if(p.indexOf(b)!==-1)throw Error("Circular reference detected in "+O.join("."));p.push(b),we.forEach(b,function(j,T){(!(we.isUndefined(j)||j===null)&&s.call(e,j,we.isString(T)?T.trim():T,O,x))===!0&&v(j,O?O.concat(T):[T])}),p.pop()}}if(!we.isObject(n))throw new TypeError("data must be an object");return v(n),e}function Sk(n){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function nw(n,e){this._pairs=[],n&&hx(n,this,e)}const rC=nw.prototype;rC.append=function(e,t){this._pairs.push([e,t])};rC.toString=function(e){const t=e?function(r){return e.call(this,r,Sk)}:Sk;return this._pairs.map(function(s){return t(s[0])+"="+t(s[1])},"").join("&")};function Dq(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function sC(n,e,t){if(!e)return n;const r=t&&t.encode||Dq;we.isFunction(t)&&(t={serialize:t});const s=t&&t.serialize;let i;if(s?i=s(e,t):i=we.isURLSearchParams(e)?e.toString():new nw(e,t).toString(r),i){const l=n.indexOf("#");l!==-1&&(n=n.slice(0,l)),n+=(n.indexOf("?")===-1?"?":"&")+i}return n}class Ok{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){we.forEach(this.handlers,function(r){r!==null&&e(r)})}}const iC={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Rq=typeof URLSearchParams<"u"?URLSearchParams:nw,zq=typeof FormData<"u"?FormData:null,Pq=typeof Blob<"u"?Blob:null,Lq={isBrowser:!0,classes:{URLSearchParams:Rq,FormData:zq,Blob:Pq},protocols:["http","https","file","blob","url","data"]},rw=typeof window<"u"&&typeof document<"u",i2=typeof navigator=="object"&&navigator||void 0,Bq=rw&&(!i2||["ReactNative","NativeScript","NS"].indexOf(i2.product)<0),Iq=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Fq=rw&&window.location.href||"http://localhost",qq=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:rw,hasStandardBrowserEnv:Bq,hasStandardBrowserWebWorkerEnv:Iq,navigator:i2,origin:Fq},Symbol.toStringTag,{value:"Module"})),ts={...qq,...Lq};function Qq(n,e){return hx(n,new ts.classes.URLSearchParams,{visitor:function(t,r,s,i){return ts.isNode&&we.isBuffer(t)?(this.append(r,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function $q(n){return we.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Hq(n){const e={},t=Object.keys(n);let r;const s=t.length;let i;for(r=0;r<s;r++)i=t[r],e[i]=n[i];return e}function aC(n){function e(t,r,s,i){let l=t[i++];if(l==="__proto__")return!0;const c=Number.isFinite(+l),u=i>=t.length;return l=!l&&we.isArray(s)?s.length:l,u?(we.hasOwnProp(s,l)?s[l]=[s[l],r]:s[l]=r,!c):((!s[l]||!we.isObject(s[l]))&&(s[l]=[]),e(t,r,s[l],i)&&we.isArray(s[l])&&(s[l]=Hq(s[l])),!c)}if(we.isFormData(n)&&we.isFunction(n.entries)){const t={};return we.forEachEntry(n,(r,s)=>{e($q(r),s,t,0)}),t}return null}function Uq(n,e,t){if(we.isString(n))try{return(e||JSON.parse)(n),we.trim(n)}catch(r){if(r.name!=="SyntaxError")throw r}return(t||JSON.stringify)(n)}const t0={transitional:iC,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",s=r.indexOf("application/json")>-1,i=we.isObject(e);if(i&&we.isHTMLForm(e)&&(e=new FormData(e)),we.isFormData(e))return s?JSON.stringify(aC(e)):e;if(we.isArrayBuffer(e)||we.isBuffer(e)||we.isStream(e)||we.isFile(e)||we.isBlob(e)||we.isReadableStream(e))return e;if(we.isArrayBufferView(e))return e.buffer;if(we.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Qq(e,this.formSerializer).toString();if((c=we.isFileList(e))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return hx(c?{"files[]":e}:e,u&&new u,this.formSerializer)}}return i||s?(t.setContentType("application/json",!1),Uq(e)):e}],transformResponse:[function(e){const t=this.transitional||t0.transitional,r=t&&t.forcedJSONParsing,s=this.responseType==="json";if(we.isResponse(e)||we.isReadableStream(e))return e;if(e&&we.isString(e)&&(r&&!this.responseType||s)){const l=!(t&&t.silentJSONParsing)&&s;try{return JSON.parse(e,this.parseReviver)}catch(c){if(l)throw c.name==="SyntaxError"?St.from(c,St.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ts.classes.FormData,Blob:ts.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};we.forEach(["delete","get","head","post","put","patch"],n=>{t0.headers[n]={}});const Vq=we.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Wq=n=>{const e={};let t,r,s;return n&&n.split(`
|
||
`).forEach(function(l){s=l.indexOf(":"),t=l.substring(0,s).trim().toLowerCase(),r=l.substring(s+1).trim(),!(!t||e[t]&&Vq[t])&&(t==="set-cookie"?e[t]?e[t].push(r):e[t]=[r]:e[t]=e[t]?e[t]+", "+r:r)}),e},kk=Symbol("internals");function Ah(n){return n&&String(n).trim().toLowerCase()}function Up(n){return n===!1||n==null?n:we.isArray(n)?n.map(Up):String(n)}function Gq(n){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=t.exec(n);)e[r[1]]=r[2];return e}const Xq=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function yy(n,e,t,r,s){if(we.isFunction(r))return r.call(this,e,t);if(s&&(e=t),!!we.isString(e)){if(we.isString(r))return e.indexOf(r)!==-1;if(we.isRegExp(r))return r.test(e)}}function Yq(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}function Kq(n,e){const t=we.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(n,r+t,{value:function(s,i,l){return this[r].call(this,e,s,i,l)},configurable:!0})})}let Rs=class{constructor(e){e&&this.set(e)}set(e,t,r){const s=this;function i(c,u,h){const m=Ah(u);if(!m)throw new Error("header name must be a non-empty string");const p=we.findKey(s,m);(!p||s[p]===void 0||h===!0||h===void 0&&s[p]!==!1)&&(s[p||u]=Up(c))}const l=(c,u)=>we.forEach(c,(h,m)=>i(h,m,u));if(we.isPlainObject(e)||e instanceof this.constructor)l(e,t);else if(we.isString(e)&&(e=e.trim())&&!Xq(e))l(Wq(e),t);else if(we.isObject(e)&&we.isIterable(e)){let c={},u,h;for(const m of e){if(!we.isArray(m))throw TypeError("Object iterator must return a key-value pair");c[h=m[0]]=(u=c[h])?we.isArray(u)?[...u,m[1]]:[u,m[1]]:m[1]}l(c,t)}else e!=null&&i(t,e,r);return this}get(e,t){if(e=Ah(e),e){const r=we.findKey(this,e);if(r){const s=this[r];if(!t)return s;if(t===!0)return Gq(s);if(we.isFunction(t))return t.call(this,s,r);if(we.isRegExp(t))return t.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ah(e),e){const r=we.findKey(this,e);return!!(r&&this[r]!==void 0&&(!t||yy(this,this[r],r,t)))}return!1}delete(e,t){const r=this;let s=!1;function i(l){if(l=Ah(l),l){const c=we.findKey(r,l);c&&(!t||yy(r,r[c],c,t))&&(delete r[c],s=!0)}}return we.isArray(e)?e.forEach(i):i(e),s}clear(e){const t=Object.keys(this);let r=t.length,s=!1;for(;r--;){const i=t[r];(!e||yy(this,this[i],i,e,!0))&&(delete this[i],s=!0)}return s}normalize(e){const t=this,r={};return we.forEach(this,(s,i)=>{const l=we.findKey(r,i);if(l){t[l]=Up(s),delete t[i];return}const c=e?Yq(i):String(i).trim();c!==i&&delete t[i],t[c]=Up(s),r[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return we.forEach(this,(r,s)=>{r!=null&&r!==!1&&(t[s]=e&&we.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
|
||
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(s=>r.set(s)),r}static accessor(e){const r=(this[kk]=this[kk]={accessors:{}}).accessors,s=this.prototype;function i(l){const c=Ah(l);r[c]||(Kq(s,l),r[c]=!0)}return we.isArray(e)?e.forEach(i):i(e),this}};Rs.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);we.reduceDescriptors(Rs.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(r){this[t]=r}}});we.freezeMethods(Rs);function by(n,e){const t=this||t0,r=e||t,s=Rs.from(r.headers);let i=r.data;return we.forEach(n,function(c){i=c.call(t,i,s.normalize(),e?e.status:void 0)}),s.normalize(),i}function lC(n){return!!(n&&n.__CANCEL__)}function kd(n,e,t){St.call(this,n??"canceled",St.ERR_CANCELED,e,t),this.name="CanceledError"}we.inherits(kd,St,{__CANCEL__:!0});function oC(n,e,t){const r=t.config.validateStatus;!t.status||!r||r(t.status)?n(t):e(new St("Request failed with status code "+t.status,[St.ERR_BAD_REQUEST,St.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function Zq(n){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function Jq(n,e){n=n||10;const t=new Array(n),r=new Array(n);let s=0,i=0,l;return e=e!==void 0?e:1e3,function(u){const h=Date.now(),m=r[i];l||(l=h),t[s]=u,r[s]=h;let p=i,x=0;for(;p!==s;)x+=t[p++],p=p%n;if(s=(s+1)%n,s===i&&(i=(i+1)%n),h-l<e)return;const v=m&&h-m;return v?Math.round(x*1e3/v):void 0}}function eQ(n,e){let t=0,r=1e3/e,s,i;const l=(h,m=Date.now())=>{t=m,s=null,i&&(clearTimeout(i),i=null),n(...h)};return[(...h)=>{const m=Date.now(),p=m-t;p>=r?l(h,m):(s=h,i||(i=setTimeout(()=>{i=null,l(s)},r-p)))},()=>s&&l(s)]}const xg=(n,e,t=3)=>{let r=0;const s=Jq(50,250);return eQ(i=>{const l=i.loaded,c=i.lengthComputable?i.total:void 0,u=l-r,h=s(u),m=l<=c;r=l;const p={loaded:l,total:c,progress:c?l/c:void 0,bytes:u,rate:h||void 0,estimated:h&&c&&m?(c-l)/h:void 0,event:i,lengthComputable:c!=null,[e?"download":"upload"]:!0};n(p)},t)},jk=(n,e)=>{const t=n!=null;return[r=>e[0]({lengthComputable:t,total:n,loaded:r}),e[1]]},Nk=n=>(...e)=>we.asap(()=>n(...e)),tQ=ts.hasStandardBrowserEnv?((n,e)=>t=>(t=new URL(t,ts.origin),n.protocol===t.protocol&&n.host===t.host&&(e||n.port===t.port)))(new URL(ts.origin),ts.navigator&&/(msie|trident)/i.test(ts.navigator.userAgent)):()=>!0,nQ=ts.hasStandardBrowserEnv?{write(n,e,t,r,s,i,l){if(typeof document>"u")return;const c=[`${n}=${encodeURIComponent(e)}`];we.isNumber(t)&&c.push(`expires=${new Date(t).toUTCString()}`),we.isString(r)&&c.push(`path=${r}`),we.isString(s)&&c.push(`domain=${s}`),i===!0&&c.push("secure"),we.isString(l)&&c.push(`SameSite=${l}`),document.cookie=c.join("; ")},read(n){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+n+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(n){this.write(n,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function rQ(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function sQ(n,e){return e?n.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):n}function cC(n,e,t){let r=!rQ(e);return n&&(r||t==!1)?sQ(n,e):e}const Ck=n=>n instanceof Rs?{...n}:n;function vc(n,e){e=e||{};const t={};function r(h,m,p,x){return we.isPlainObject(h)&&we.isPlainObject(m)?we.merge.call({caseless:x},h,m):we.isPlainObject(m)?we.merge({},m):we.isArray(m)?m.slice():m}function s(h,m,p,x){if(we.isUndefined(m)){if(!we.isUndefined(h))return r(void 0,h,p,x)}else return r(h,m,p,x)}function i(h,m){if(!we.isUndefined(m))return r(void 0,m)}function l(h,m){if(we.isUndefined(m)){if(!we.isUndefined(h))return r(void 0,h)}else return r(void 0,m)}function c(h,m,p){if(p in e)return r(h,m);if(p in n)return r(void 0,h)}const u={url:i,method:i,data:i,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:c,headers:(h,m,p)=>s(Ck(h),Ck(m),p,!0)};return we.forEach(Object.keys({...n,...e}),function(m){const p=u[m]||s,x=p(n[m],e[m],m);we.isUndefined(x)&&p!==c||(t[m]=x)}),t}const uC=n=>{const e=vc({},n);let{data:t,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:l,auth:c}=e;if(e.headers=l=Rs.from(l),e.url=sC(cC(e.baseURL,e.url,e.allowAbsoluteUrls),n.params,n.paramsSerializer),c&&l.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),we.isFormData(t)){if(ts.hasStandardBrowserEnv||ts.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if(we.isFunction(t.getHeaders)){const u=t.getHeaders(),h=["content-type","content-length"];Object.entries(u).forEach(([m,p])=>{h.includes(m.toLowerCase())&&l.set(m,p)})}}if(ts.hasStandardBrowserEnv&&(r&&we.isFunction(r)&&(r=r(e)),r||r!==!1&&tQ(e.url))){const u=s&&i&&nQ.read(i);u&&l.set(s,u)}return e},iQ=typeof XMLHttpRequest<"u",aQ=iQ&&function(n){return new Promise(function(t,r){const s=uC(n);let i=s.data;const l=Rs.from(s.headers).normalize();let{responseType:c,onUploadProgress:u,onDownloadProgress:h}=s,m,p,x,v,b;function O(){v&&v(),b&&b(),s.cancelToken&&s.cancelToken.unsubscribe(m),s.signal&&s.signal.removeEventListener("abort",m)}let k=new XMLHttpRequest;k.open(s.method.toUpperCase(),s.url,!0),k.timeout=s.timeout;function j(){if(!k)return;const M=Rs.from("getAllResponseHeaders"in k&&k.getAllResponseHeaders()),D={data:!c||c==="text"||c==="json"?k.responseText:k.response,status:k.status,statusText:k.statusText,headers:M,config:n,request:k};oC(function(z){t(z),O()},function(z){r(z),O()},D),k=null}"onloadend"in k?k.onloadend=j:k.onreadystatechange=function(){!k||k.readyState!==4||k.status===0&&!(k.responseURL&&k.responseURL.indexOf("file:")===0)||setTimeout(j)},k.onabort=function(){k&&(r(new St("Request aborted",St.ECONNABORTED,n,k)),k=null)},k.onerror=function(_){const D=_&&_.message?_.message:"Network Error",E=new St(D,St.ERR_NETWORK,n,k);E.event=_||null,r(E),k=null},k.ontimeout=function(){let _=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const D=s.transitional||iC;s.timeoutErrorMessage&&(_=s.timeoutErrorMessage),r(new St(_,D.clarifyTimeoutError?St.ETIMEDOUT:St.ECONNABORTED,n,k)),k=null},i===void 0&&l.setContentType(null),"setRequestHeader"in k&&we.forEach(l.toJSON(),function(_,D){k.setRequestHeader(D,_)}),we.isUndefined(s.withCredentials)||(k.withCredentials=!!s.withCredentials),c&&c!=="json"&&(k.responseType=s.responseType),h&&([x,b]=xg(h,!0),k.addEventListener("progress",x)),u&&k.upload&&([p,v]=xg(u),k.upload.addEventListener("progress",p),k.upload.addEventListener("loadend",v)),(s.cancelToken||s.signal)&&(m=M=>{k&&(r(!M||M.type?new kd(null,n,k):M),k.abort(),k=null)},s.cancelToken&&s.cancelToken.subscribe(m),s.signal&&(s.signal.aborted?m():s.signal.addEventListener("abort",m)));const T=Zq(s.url);if(T&&ts.protocols.indexOf(T)===-1){r(new St("Unsupported protocol "+T+":",St.ERR_BAD_REQUEST,n));return}k.send(i||null)})},lQ=(n,e)=>{const{length:t}=n=n?n.filter(Boolean):[];if(e||t){let r=new AbortController,s;const i=function(h){if(!s){s=!0,c();const m=h instanceof Error?h:this.reason;r.abort(m instanceof St?m:new kd(m instanceof Error?m.message:m))}};let l=e&&setTimeout(()=>{l=null,i(new St(`timeout ${e} of ms exceeded`,St.ETIMEDOUT))},e);const c=()=>{n&&(l&&clearTimeout(l),l=null,n.forEach(h=>{h.unsubscribe?h.unsubscribe(i):h.removeEventListener("abort",i)}),n=null)};n.forEach(h=>h.addEventListener("abort",i));const{signal:u}=r;return u.unsubscribe=()=>we.asap(c),u}},oQ=function*(n,e){let t=n.byteLength;if(t<e){yield n;return}let r=0,s;for(;r<t;)s=r+e,yield n.slice(r,s),r=s},cQ=async function*(n,e){for await(const t of uQ(n))yield*oQ(t,e)},uQ=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const e=n.getReader();try{for(;;){const{done:t,value:r}=await e.read();if(t)break;yield r}}finally{await e.cancel()}},Tk=(n,e,t,r)=>{const s=cQ(n,e);let i=0,l,c=u=>{l||(l=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:h,value:m}=await s.next();if(h){c(),u.close();return}let p=m.byteLength;if(t){let x=i+=p;t(x)}u.enqueue(new Uint8Array(m))}catch(h){throw c(h),h}},cancel(u){return c(u),s.return()}},{highWaterMark:2})},Mk=64*1024,{isFunction:Ym}=we,dQ=(({Request:n,Response:e})=>({Request:n,Response:e}))(we.global),{ReadableStream:Ak,TextEncoder:Ek}=we.global,_k=(n,...e)=>{try{return!!n(...e)}catch{return!1}},hQ=n=>{n=we.merge.call({skipUndefined:!0},dQ,n);const{fetch:e,Request:t,Response:r}=n,s=e?Ym(e):typeof fetch=="function",i=Ym(t),l=Ym(r);if(!s)return!1;const c=s&&Ym(Ak),u=s&&(typeof Ek=="function"?(b=>O=>b.encode(O))(new Ek):async b=>new Uint8Array(await new t(b).arrayBuffer())),h=i&&c&&_k(()=>{let b=!1;const O=new t(ts.origin,{body:new Ak,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!O}),m=l&&c&&_k(()=>we.isReadableStream(new r("").body)),p={stream:m&&(b=>b.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!p[b]&&(p[b]=(O,k)=>{let j=O&&O[b];if(j)return j.call(O);throw new St(`Response type '${b}' is not supported`,St.ERR_NOT_SUPPORT,k)})});const x=async b=>{if(b==null)return 0;if(we.isBlob(b))return b.size;if(we.isSpecCompliantForm(b))return(await new t(ts.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(we.isArrayBufferView(b)||we.isArrayBuffer(b))return b.byteLength;if(we.isURLSearchParams(b)&&(b=b+""),we.isString(b))return(await u(b)).byteLength},v=async(b,O)=>{const k=we.toFiniteNumber(b.getContentLength());return k??x(O)};return async b=>{let{url:O,method:k,data:j,signal:T,cancelToken:M,timeout:_,onDownloadProgress:D,onUploadProgress:E,responseType:z,headers:Q,withCredentials:q="same-origin",fetchOptions:B}=uC(b),U=e||fetch;z=z?(z+"").toLowerCase():"text";let V=lQ([T,M&&M.toAbortSignal()],_),ce=null;const W=V&&V.unsubscribe&&(()=>{V.unsubscribe()});let J;try{if(E&&h&&k!=="get"&&k!=="head"&&(J=await v(Q,j))!==0){let me=new t(O,{method:"POST",body:j,duplex:"half"}),Y;if(we.isFormData(j)&&(Y=me.headers.get("content-type"))&&Q.setContentType(Y),me.body){const[P,K]=jk(J,xg(Nk(E)));j=Tk(me.body,Mk,P,K)}}we.isString(q)||(q=q?"include":"omit");const H=i&&"credentials"in t.prototype,ae={...B,signal:V,method:k.toUpperCase(),headers:Q.normalize().toJSON(),body:j,duplex:"half",credentials:H?q:void 0};ce=i&&new t(O,ae);let ne=await(i?U(ce,B):U(O,ae));const ue=m&&(z==="stream"||z==="response");if(m&&(D||ue&&W)){const me={};["status","statusText","headers"].forEach($=>{me[$]=ne[$]});const Y=we.toFiniteNumber(ne.headers.get("content-length")),[P,K]=D&&jk(Y,xg(Nk(D),!0))||[];ne=new r(Tk(ne.body,Mk,P,()=>{K&&K(),W&&W()}),me)}z=z||"text";let R=await p[we.findKey(p,z)||"text"](ne,b);return!ue&&W&&W(),await new Promise((me,Y)=>{oC(me,Y,{data:R,headers:Rs.from(ne.headers),status:ne.status,statusText:ne.statusText,config:b,request:ce})})}catch(H){throw W&&W(),H&&H.name==="TypeError"&&/Load failed|fetch/i.test(H.message)?Object.assign(new St("Network Error",St.ERR_NETWORK,b,ce),{cause:H.cause||H}):St.from(H,H&&H.code,b,ce)}}},fQ=new Map,dC=n=>{let e=n&&n.env||{};const{fetch:t,Request:r,Response:s}=e,i=[r,s,t];let l=i.length,c=l,u,h,m=fQ;for(;c--;)u=i[c],h=m.get(u),h===void 0&&m.set(u,h=c?new Map:hQ(e)),m=h;return h};dC();const sw={http:Aq,xhr:aQ,fetch:{get:dC}};we.forEach(sw,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});const Dk=n=>`- ${n}`,mQ=n=>we.isFunction(n)||n===null||n===!1;function pQ(n,e){n=we.isArray(n)?n:[n];const{length:t}=n;let r,s;const i={};for(let l=0;l<t;l++){r=n[l];let c;if(s=r,!mQ(r)&&(s=sw[(c=String(r)).toLowerCase()],s===void 0))throw new St(`Unknown adapter '${c}'`);if(s&&(we.isFunction(s)||(s=s.get(e))))break;i[c||"#"+l]=s}if(!s){const l=Object.entries(i).map(([u,h])=>`adapter ${u} `+(h===!1?"is not supported by the environment":"is not available in the build"));let c=t?l.length>1?`since :
|
||
`+l.map(Dk).join(`
|
||
`):" "+Dk(l[0]):"as no adapter specified";throw new St("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const hC={getAdapter:pQ,adapters:sw};function wy(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new kd(null,n)}function Rk(n){return wy(n),n.headers=Rs.from(n.headers),n.data=by.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),hC.getAdapter(n.adapter||t0.adapter,n)(n).then(function(r){return wy(n),r.data=by.call(n,n.transformResponse,r),r.headers=Rs.from(r.headers),r},function(r){return lC(r)||(wy(n),r&&r.response&&(r.response.data=by.call(n,n.transformResponse,r.response),r.response.headers=Rs.from(r.response.headers))),Promise.reject(r)})}const fC="1.13.2",fx={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{fx[n]=function(r){return typeof r===n||"a"+(e<1?"n ":" ")+n}});const zk={};fx.transitional=function(e,t,r){function s(i,l){return"[Axios v"+fC+"] Transitional option '"+i+"'"+l+(r?". "+r:"")}return(i,l,c)=>{if(e===!1)throw new St(s(l," has been removed"+(t?" in "+t:"")),St.ERR_DEPRECATED);return t&&!zk[l]&&(zk[l]=!0,console.warn(s(l," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,l,c):!0}};fx.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function gQ(n,e,t){if(typeof n!="object")throw new St("options must be an object",St.ERR_BAD_OPTION_VALUE);const r=Object.keys(n);let s=r.length;for(;s-- >0;){const i=r[s],l=e[i];if(l){const c=n[i],u=c===void 0||l(c,i,n);if(u!==!0)throw new St("option "+i+" must be "+u,St.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new St("Unknown option "+i,St.ERR_BAD_OPTION)}}const Vp={assertOptions:gQ,validators:fx},Zi=Vp.validators;let mc=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Ok,response:new Ok}}async request(e,t){try{return await this._request(e,t)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
||
`+i):r.stack=i}catch{}}throw r}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=vc(this.defaults,t);const{transitional:r,paramsSerializer:s,headers:i}=t;r!==void 0&&Vp.assertOptions(r,{silentJSONParsing:Zi.transitional(Zi.boolean),forcedJSONParsing:Zi.transitional(Zi.boolean),clarifyTimeoutError:Zi.transitional(Zi.boolean)},!1),s!=null&&(we.isFunction(s)?t.paramsSerializer={serialize:s}:Vp.assertOptions(s,{encode:Zi.function,serialize:Zi.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Vp.assertOptions(t,{baseUrl:Zi.spelling("baseURL"),withXsrfToken:Zi.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let l=i&&we.merge(i.common,i[t.method]);i&&we.forEach(["delete","get","head","post","put","patch","common"],b=>{delete i[b]}),t.headers=Rs.concat(l,i);const c=[];let u=!0;this.interceptors.request.forEach(function(O){typeof O.runWhen=="function"&&O.runWhen(t)===!1||(u=u&&O.synchronous,c.unshift(O.fulfilled,O.rejected))});const h=[];this.interceptors.response.forEach(function(O){h.push(O.fulfilled,O.rejected)});let m,p=0,x;if(!u){const b=[Rk.bind(this),void 0];for(b.unshift(...c),b.push(...h),x=b.length,m=Promise.resolve(t);p<x;)m=m.then(b[p++],b[p++]);return m}x=c.length;let v=t;for(;p<x;){const b=c[p++],O=c[p++];try{v=b(v)}catch(k){O.call(this,k);break}}try{m=Rk.call(this,v)}catch(b){return Promise.reject(b)}for(p=0,x=h.length;p<x;)m=m.then(h[p++],h[p++]);return m}getUri(e){e=vc(this.defaults,e);const t=cC(e.baseURL,e.url,e.allowAbsoluteUrls);return sC(t,e.params,e.paramsSerializer)}};we.forEach(["delete","get","head","options"],function(e){mc.prototype[e]=function(t,r){return this.request(vc(r||{},{method:e,url:t,data:(r||{}).data}))}});we.forEach(["post","put","patch"],function(e){function t(r){return function(i,l,c){return this.request(vc(c||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:l}))}}mc.prototype[e]=t(),mc.prototype[e+"Form"]=t(!0)});let xQ=class mC{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(i){t=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const l=new Promise(c=>{r.subscribe(c),i=c}).then(s);return l.cancel=function(){r.unsubscribe(i)},l},e(function(i,l,c){r.reason||(r.reason=new kd(i,l,c),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=r=>{e.abort(r)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new mC(function(s){e=s}),cancel:e}}};function vQ(n){return function(t){return n.apply(null,t)}}function yQ(n){return we.isObject(n)&&n.isAxiosError===!0}const a2={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(a2).forEach(([n,e])=>{a2[e]=n});function pC(n){const e=new mc(n),t=V9(mc.prototype.request,e);return we.extend(t,mc.prototype,e,{allOwnKeys:!0}),we.extend(t,e,null,{allOwnKeys:!0}),t.create=function(s){return pC(vc(n,s))},t}const Zn=pC(t0);Zn.Axios=mc;Zn.CanceledError=kd;Zn.CancelToken=xQ;Zn.isCancel=lC;Zn.VERSION=fC;Zn.toFormData=hx;Zn.AxiosError=St;Zn.Cancel=Zn.CanceledError;Zn.all=function(e){return Promise.all(e)};Zn.spread=vQ;Zn.isAxiosError=yQ;Zn.mergeConfig=vc;Zn.AxiosHeaders=Rs;Zn.formToJSON=n=>aC(we.isHTMLForm(n)?new FormData(n):n);Zn.getAdapter=hC.getAdapter;Zn.HttpStatusCode=a2;Zn.default=Zn;const{Axios:Uxe,AxiosError:Vxe,CanceledError:Wxe,isCancel:Gxe,CancelToken:Xxe,VERSION:Yxe,all:Kxe,Cancel:Zxe,isAxiosError:Jxe,spread:e1e,toFormData:t1e,AxiosHeaders:n1e,HttpStatusCode:r1e,formToJSON:s1e,getAdapter:i1e,mergeConfig:a1e}=Zn,bQ=(n,e)=>{const t=new Array(n.length+e.length);for(let r=0;r<n.length;r++)t[r]=n[r];for(let r=0;r<e.length;r++)t[n.length+r]=e[r];return t},wQ=(n,e)=>({classGroupId:n,validator:e}),gC=(n=new Map,e=null,t)=>({nextPart:n,validators:e,classGroupId:t}),vg="-",Pk=[],SQ="arbitrary..",OQ=n=>{const e=jQ(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=n;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return kQ(l);const c=l.split(vg),u=c[0]===""&&c.length>1?1:0;return xC(c,u,e)},getConflictingClassGroupIds:(l,c)=>{if(c){const u=r[l],h=t[l];return u?h?bQ(h,u):u:h||Pk}return t[l]||Pk}}},xC=(n,e,t)=>{if(n.length-e===0)return t.classGroupId;const s=n[e],i=t.nextPart.get(s);if(i){const h=xC(n,e+1,i);if(h)return h}const l=t.validators;if(l===null)return;const c=e===0?n.join(vg):n.slice(e).join(vg),u=l.length;for(let h=0;h<u;h++){const m=l[h];if(m.validator(c))return m.classGroupId}},kQ=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=n.slice(1,-1),t=e.indexOf(":"),r=e.slice(0,t);return r?SQ+r:void 0})(),jQ=n=>{const{theme:e,classGroups:t}=n;return NQ(t,e)},NQ=(n,e)=>{const t=gC();for(const r in n){const s=n[r];iw(s,t,r,e)}return t},iw=(n,e,t,r)=>{const s=n.length;for(let i=0;i<s;i++){const l=n[i];CQ(l,e,t,r)}},CQ=(n,e,t,r)=>{if(typeof n=="string"){TQ(n,e,t);return}if(typeof n=="function"){MQ(n,e,t,r);return}AQ(n,e,t,r)},TQ=(n,e,t)=>{const r=n===""?e:vC(e,n);r.classGroupId=t},MQ=(n,e,t,r)=>{if(EQ(n)){iw(n(r),e,t,r);return}e.validators===null&&(e.validators=[]),e.validators.push(wQ(t,n))},AQ=(n,e,t,r)=>{const s=Object.entries(n),i=s.length;for(let l=0;l<i;l++){const[c,u]=s[l];iw(u,vC(e,c),t,r)}},vC=(n,e)=>{let t=n;const r=e.split(vg),s=r.length;for(let i=0;i<s;i++){const l=r[i];let c=t.nextPart.get(l);c||(c=gC(),t.nextPart.set(l,c)),t=c}return t},EQ=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,_Q=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=Object.create(null),r=Object.create(null);const s=(i,l)=>{t[i]=l,e++,e>n&&(e=0,r=t,t=Object.create(null))};return{get(i){let l=t[i];if(l!==void 0)return l;if((l=r[i])!==void 0)return s(i,l),l},set(i,l){i in t?t[i]=l:s(i,l)}}},l2="!",Lk=":",DQ=[],Bk=(n,e,t,r,s)=>({modifiers:n,hasImportantModifier:e,baseClassName:t,maybePostfixModifierPosition:r,isExternal:s}),RQ=n=>{const{prefix:e,experimentalParseClassName:t}=n;let r=s=>{const i=[];let l=0,c=0,u=0,h;const m=s.length;for(let O=0;O<m;O++){const k=s[O];if(l===0&&c===0){if(k===Lk){i.push(s.slice(u,O)),u=O+1;continue}if(k==="/"){h=O;continue}}k==="["?l++:k==="]"?l--:k==="("?c++:k===")"&&c--}const p=i.length===0?s:s.slice(u);let x=p,v=!1;p.endsWith(l2)?(x=p.slice(0,-1),v=!0):p.startsWith(l2)&&(x=p.slice(1),v=!0);const b=h&&h>u?h-u:void 0;return Bk(i,v,x,b)};if(e){const s=e+Lk,i=r;r=l=>l.startsWith(s)?i(l.slice(s.length)):Bk(DQ,!1,l,void 0,!0)}if(t){const s=r;r=i=>t({className:i,parseClassName:s})}return r},zQ=n=>{const e=new Map;return n.orderSensitiveModifiers.forEach((t,r)=>{e.set(t,1e6+r)}),t=>{const r=[];let s=[];for(let i=0;i<t.length;i++){const l=t[i],c=l[0]==="[",u=e.has(l);c||u?(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}},PQ=n=>({cache:_Q(n.cacheSize),parseClassName:RQ(n),sortModifiers:zQ(n),...OQ(n)}),LQ=/\s+/,BQ=(n,e)=>{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i}=e,l=[],c=n.trim().split(LQ);let u="";for(let h=c.length-1;h>=0;h-=1){const m=c[h],{isExternal:p,modifiers:x,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:O}=t(m);if(p){u=m+(u.length>0?" "+u:u);continue}let k=!!O,j=r(k?b.substring(0,O):b);if(!j){if(!k){u=m+(u.length>0?" "+u:u);continue}if(j=r(b),!j){u=m+(u.length>0?" "+u:u);continue}k=!1}const T=x.length===0?"":x.length===1?x[0]:i(x).join(":"),M=v?T+l2:T,_=M+j;if(l.indexOf(_)>-1)continue;l.push(_);const D=s(j,k);for(let E=0;E<D.length;++E){const z=D[E];l.push(M+z)}u=m+(u.length>0?" "+u:u)}return u},IQ=(...n)=>{let e=0,t,r,s="";for(;e<n.length;)(t=n[e++])&&(r=yC(t))&&(s&&(s+=" "),s+=r);return s},yC=n=>{if(typeof n=="string")return n;let e,t="";for(let r=0;r<n.length;r++)n[r]&&(e=yC(n[r]))&&(t&&(t+=" "),t+=e);return t},FQ=(n,...e)=>{let t,r,s,i;const l=u=>{const h=e.reduce((m,p)=>p(m),n());return t=PQ(h),r=t.cache.get,s=t.cache.set,i=c,c(u)},c=u=>{const h=r(u);if(h)return h;const m=BQ(u,t);return s(u,m),m};return i=l,(...u)=>i(IQ(...u))},qQ=[],wr=n=>{const e=t=>t[n]||qQ;return e.isThemeGetter=!0,e},bC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,wC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,QQ=/^\d+\/\d+$/,$Q=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,HQ=/\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$/,UQ=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,VQ=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,WQ=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ju=n=>QQ.test(n),At=n=>!!n&&!Number.isNaN(Number(n)),Wl=n=>!!n&&Number.isInteger(Number(n)),Sy=n=>n.endsWith("%")&&At(n.slice(0,-1)),Ga=n=>$Q.test(n),GQ=()=>!0,XQ=n=>HQ.test(n)&&!UQ.test(n),SC=()=>!1,YQ=n=>VQ.test(n),KQ=n=>WQ.test(n),ZQ=n=>!Xe(n)&&!Ye(n),JQ=n=>jd(n,jC,SC),Xe=n=>bC.test(n),Yo=n=>jd(n,NC,XQ),Oy=n=>jd(n,s$,At),Ik=n=>jd(n,OC,SC),e$=n=>jd(n,kC,KQ),Km=n=>jd(n,CC,YQ),Ye=n=>wC.test(n),Eh=n=>Nd(n,NC),t$=n=>Nd(n,i$),Fk=n=>Nd(n,OC),n$=n=>Nd(n,jC),r$=n=>Nd(n,kC),Zm=n=>Nd(n,CC,!0),jd=(n,e,t)=>{const r=bC.exec(n);return r?r[1]?e(r[1]):t(r[2]):!1},Nd=(n,e,t=!1)=>{const r=wC.exec(n);return r?r[1]?e(r[1]):t:!1},OC=n=>n==="position"||n==="percentage",kC=n=>n==="image"||n==="url",jC=n=>n==="length"||n==="size"||n==="bg-size",NC=n=>n==="length",s$=n=>n==="number",i$=n=>n==="family-name",CC=n=>n==="shadow",a$=()=>{const n=wr("color"),e=wr("font"),t=wr("text"),r=wr("font-weight"),s=wr("tracking"),i=wr("leading"),l=wr("breakpoint"),c=wr("container"),u=wr("spacing"),h=wr("radius"),m=wr("shadow"),p=wr("inset-shadow"),x=wr("text-shadow"),v=wr("drop-shadow"),b=wr("blur"),O=wr("perspective"),k=wr("aspect"),j=wr("ease"),T=wr("animate"),M=()=>["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"],D=()=>[..._(),Ye,Xe],E=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],Q=()=>[Ye,Xe,u],q=()=>[ju,"full","auto",...Q()],B=()=>[Wl,"none","subgrid",Ye,Xe],U=()=>["auto",{span:["full",Wl,Ye,Xe]},Wl,Ye,Xe],V=()=>[Wl,"auto",Ye,Xe],ce=()=>["auto","min","max","fr",Ye,Xe],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],J=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...Q()],ae=()=>[ju,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Q()],ne=()=>[n,Ye,Xe],ue=()=>[..._(),Fk,Ik,{position:[Ye,Xe]}],R=()=>["no-repeat",{repeat:["","x","y","space","round"]}],me=()=>["auto","cover","contain",n$,JQ,{size:[Ye,Xe]}],Y=()=>[Sy,Eh,Yo],P=()=>["","none","full",h,Ye,Xe],K=()=>["",At,Eh,Yo],$=()=>["solid","dashed","dotted","double"],fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>[At,Sy,Fk,Ik],Re=()=>["","none",b,Ye,Xe],de=()=>["none",At,Ye,Xe],We=()=>["none",At,Ye,Xe],ct=()=>[At,Ye,Xe],ke=()=>[ju,"full",...Q()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ga],breakpoint:[Ga],color:[GQ],container:[Ga],"drop-shadow":[Ga],ease:["in","out","in-out"],font:[ZQ],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ga],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ga],shadow:[Ga],spacing:["px",At],text:[Ga],"text-shadow":[Ga],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ju,Xe,Ye,k]}],container:["container"],columns:[{columns:[At,Xe,Ye,c]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"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:D()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:q()}],"inset-x":[{"inset-x":q()}],"inset-y":[{"inset-y":q()}],start:[{start:q()}],end:[{end:q()}],top:[{top:q()}],right:[{right:q()}],bottom:[{bottom:q()}],left:[{left:q()}],visibility:["visible","invisible","collapse"],z:[{z:[Wl,"auto",Ye,Xe]}],basis:[{basis:[ju,"full","auto",c,...Q()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[At,ju,"auto","initial","none",Xe]}],grow:[{grow:["",At,Ye,Xe]}],shrink:[{shrink:["",At,Ye,Xe]}],order:[{order:[Wl,"first","last","none",Ye,Xe]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ce()}],"auto-rows":[{"auto-rows":ce()}],gap:[{gap:Q()}],"gap-x":[{"gap-x":Q()}],"gap-y":[{"gap-y":Q()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...J(),"normal"]}],"justify-self":[{"justify-self":["auto",...J()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...J(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...J(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...J(),"baseline"]}],"place-self":[{"place-self":["auto",...J()]}],p:[{p:Q()}],px:[{px:Q()}],py:[{py:Q()}],ps:[{ps:Q()}],pe:[{pe:Q()}],pt:[{pt:Q()}],pr:[{pr:Q()}],pb:[{pb:Q()}],pl:[{pl:Q()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":Q()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Q()}],"space-y-reverse":["space-y-reverse"],size:[{size:ae()}],w:[{w:[c,"screen",...ae()]}],"min-w":[{"min-w":[c,"screen","none",...ae()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...ae()]}],h:[{h:["screen","lh",...ae()]}],"min-h":[{"min-h":["screen","lh","none",...ae()]}],"max-h":[{"max-h":["screen","lh",...ae()]}],"font-size":[{text:["base",t,Eh,Yo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ye,Oy]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Sy,Xe]}],"font-family":[{font:[t$,Xe,e]}],"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,Ye,Xe]}],"line-clamp":[{"line-clamp":[At,"none",Ye,Oy]}],leading:[{leading:[i,...Q()]}],"list-image":[{"list-image":["none",Ye,Xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ye,Xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ne()}],"text-color":[{text:ne()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:[At,"from-font","auto",Ye,Yo]}],"text-decoration-color":[{decoration:ne()}],"underline-offset":[{"underline-offset":[At,"auto",Ye,Xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Q()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye,Xe]}],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",Ye,Xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ue()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:me()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Wl,Ye,Xe],radial:["",Ye,Xe],conic:[Wl,Ye,Xe]},r$,e$]}],"bg-color":[{bg:ne()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:ne()}],"gradient-via":[{via:ne()}],"gradient-to":[{to:ne()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...$(),"hidden","none"]}],"divide-style":[{divide:[...$(),"hidden","none"]}],"border-color":[{border:ne()}],"border-color-x":[{"border-x":ne()}],"border-color-y":[{"border-y":ne()}],"border-color-s":[{"border-s":ne()}],"border-color-e":[{"border-e":ne()}],"border-color-t":[{"border-t":ne()}],"border-color-r":[{"border-r":ne()}],"border-color-b":[{"border-b":ne()}],"border-color-l":[{"border-l":ne()}],"divide-color":[{divide:ne()}],"outline-style":[{outline:[...$(),"none","hidden"]}],"outline-offset":[{"outline-offset":[At,Ye,Xe]}],"outline-w":[{outline:["",At,Eh,Yo]}],"outline-color":[{outline:ne()}],shadow:[{shadow:["","none",m,Zm,Km]}],"shadow-color":[{shadow:ne()}],"inset-shadow":[{"inset-shadow":["none",p,Zm,Km]}],"inset-shadow-color":[{"inset-shadow":ne()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ne()}],"ring-offset-w":[{"ring-offset":[At,Yo]}],"ring-offset-color":[{"ring-offset":ne()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":ne()}],"text-shadow":[{"text-shadow":["none",x,Zm,Km]}],"text-shadow-color":[{"text-shadow":ne()}],opacity:[{opacity:[At,Ye,Xe]}],"mix-blend":[{"mix-blend":[...fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":fe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[At]}],"mask-image-linear-from-pos":[{"mask-linear-from":ye()}],"mask-image-linear-to-pos":[{"mask-linear-to":ye()}],"mask-image-linear-from-color":[{"mask-linear-from":ne()}],"mask-image-linear-to-color":[{"mask-linear-to":ne()}],"mask-image-t-from-pos":[{"mask-t-from":ye()}],"mask-image-t-to-pos":[{"mask-t-to":ye()}],"mask-image-t-from-color":[{"mask-t-from":ne()}],"mask-image-t-to-color":[{"mask-t-to":ne()}],"mask-image-r-from-pos":[{"mask-r-from":ye()}],"mask-image-r-to-pos":[{"mask-r-to":ye()}],"mask-image-r-from-color":[{"mask-r-from":ne()}],"mask-image-r-to-color":[{"mask-r-to":ne()}],"mask-image-b-from-pos":[{"mask-b-from":ye()}],"mask-image-b-to-pos":[{"mask-b-to":ye()}],"mask-image-b-from-color":[{"mask-b-from":ne()}],"mask-image-b-to-color":[{"mask-b-to":ne()}],"mask-image-l-from-pos":[{"mask-l-from":ye()}],"mask-image-l-to-pos":[{"mask-l-to":ye()}],"mask-image-l-from-color":[{"mask-l-from":ne()}],"mask-image-l-to-color":[{"mask-l-to":ne()}],"mask-image-x-from-pos":[{"mask-x-from":ye()}],"mask-image-x-to-pos":[{"mask-x-to":ye()}],"mask-image-x-from-color":[{"mask-x-from":ne()}],"mask-image-x-to-color":[{"mask-x-to":ne()}],"mask-image-y-from-pos":[{"mask-y-from":ye()}],"mask-image-y-to-pos":[{"mask-y-to":ye()}],"mask-image-y-from-color":[{"mask-y-from":ne()}],"mask-image-y-to-color":[{"mask-y-to":ne()}],"mask-image-radial":[{"mask-radial":[Ye,Xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ye()}],"mask-image-radial-to-pos":[{"mask-radial-to":ye()}],"mask-image-radial-from-color":[{"mask-radial-from":ne()}],"mask-image-radial-to-color":[{"mask-radial-to":ne()}],"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":[At]}],"mask-image-conic-from-pos":[{"mask-conic-from":ye()}],"mask-image-conic-to-pos":[{"mask-conic-to":ye()}],"mask-image-conic-from-color":[{"mask-conic-from":ne()}],"mask-image-conic-to-color":[{"mask-conic-to":ne()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ue()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:me()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ye,Xe]}],filter:[{filter:["","none",Ye,Xe]}],blur:[{blur:Re()}],brightness:[{brightness:[At,Ye,Xe]}],contrast:[{contrast:[At,Ye,Xe]}],"drop-shadow":[{"drop-shadow":["","none",v,Zm,Km]}],"drop-shadow-color":[{"drop-shadow":ne()}],grayscale:[{grayscale:["",At,Ye,Xe]}],"hue-rotate":[{"hue-rotate":[At,Ye,Xe]}],invert:[{invert:["",At,Ye,Xe]}],saturate:[{saturate:[At,Ye,Xe]}],sepia:[{sepia:["",At,Ye,Xe]}],"backdrop-filter":[{"backdrop-filter":["","none",Ye,Xe]}],"backdrop-blur":[{"backdrop-blur":Re()}],"backdrop-brightness":[{"backdrop-brightness":[At,Ye,Xe]}],"backdrop-contrast":[{"backdrop-contrast":[At,Ye,Xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",At,Ye,Xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[At,Ye,Xe]}],"backdrop-invert":[{"backdrop-invert":["",At,Ye,Xe]}],"backdrop-opacity":[{"backdrop-opacity":[At,Ye,Xe]}],"backdrop-saturate":[{"backdrop-saturate":[At,Ye,Xe]}],"backdrop-sepia":[{"backdrop-sepia":["",At,Ye,Xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Q()}],"border-spacing-x":[{"border-spacing-x":Q()}],"border-spacing-y":[{"border-spacing-y":Q()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ye,Xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[At,"initial",Ye,Xe]}],ease:[{ease:["linear","initial",j,Ye,Xe]}],delay:[{delay:[At,Ye,Xe]}],animate:[{animate:["none",T,Ye,Xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[O,Ye,Xe]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:We()}],"scale-x":[{"scale-x":We()}],"scale-y":[{"scale-y":We()}],"scale-z":[{"scale-z":We()}],"scale-3d":["scale-3d"],skew:[{skew:ct()}],"skew-x":[{"skew-x":ct()}],"skew-y":[{"skew-y":ct()}],transform:[{transform:[Ye,Xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ke()}],"translate-x":[{"translate-x":ke()}],"translate-y":[{"translate-y":ke()}],"translate-z":[{"translate-z":ke()}],"translate-none":["translate-none"],accent:[{accent:ne()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ne()}],"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",Ye,Xe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Q()}],"scroll-mx":[{"scroll-mx":Q()}],"scroll-my":[{"scroll-my":Q()}],"scroll-ms":[{"scroll-ms":Q()}],"scroll-me":[{"scroll-me":Q()}],"scroll-mt":[{"scroll-mt":Q()}],"scroll-mr":[{"scroll-mr":Q()}],"scroll-mb":[{"scroll-mb":Q()}],"scroll-ml":[{"scroll-ml":Q()}],"scroll-p":[{"scroll-p":Q()}],"scroll-px":[{"scroll-px":Q()}],"scroll-py":[{"scroll-py":Q()}],"scroll-ps":[{"scroll-ps":Q()}],"scroll-pe":[{"scroll-pe":Q()}],"scroll-pt":[{"scroll-pt":Q()}],"scroll-pr":[{"scroll-pr":Q()}],"scroll-pb":[{"scroll-pb":Q()}],"scroll-pl":[{"scroll-pl":Q()}],"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",Ye,Xe]}],fill:[{fill:["none",...ne()]}],"stroke-w":[{stroke:[At,Eh,Yo,Oy]}],stroke:[{stroke:["none",...ne()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-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-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-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-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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},l$=FQ(a$);function ve(...n){return l$(y9(n))}const yt=S.forwardRef(({className:n,...e},t)=>a.jsx("div",{ref:t,className:ve("rounded-xl border bg-card text-card-foreground shadow",n),...e}));yt.displayName="Card";const Jt=S.forwardRef(({className:n,...e},t)=>a.jsx("div",{ref:t,className:ve("flex flex-col space-y-1.5 p-6",n),...e}));Jt.displayName="CardHeader";const en=S.forwardRef(({className:n,...e},t)=>a.jsx("div",{ref:t,className:ve("font-semibold leading-none tracking-tight",n),...e}));en.displayName="CardTitle";const Sr=S.forwardRef(({className:n,...e},t)=>a.jsx("div",{ref:t,className:ve("text-sm text-muted-foreground",n),...e}));Sr.displayName="CardDescription";const vn=S.forwardRef(({className:n,...e},t)=>a.jsx("div",{ref:t,className:ve("p-6 pt-0",n),...e}));vn.displayName="CardContent";const TC=S.forwardRef(({className:n,...e},t)=>a.jsx("div",{ref:t,className:ve("flex items-center p-6 pt-0",n),...e}));TC.displayName="CardFooter";var ky="rovingFocusGroup.onEntryFocus",o$={bubbles:!1,cancelable:!0},n0="RovingFocusGroup",[o2,MC,c$]=nx(n0),[u$,mx]=Hi(n0,[c$]),[d$,h$]=u$(n0),AC=S.forwardRef((n,e)=>a.jsx(o2.Provider,{scope:n.__scopeRovingFocusGroup,children:a.jsx(o2.Slot,{scope:n.__scopeRovingFocusGroup,children:a.jsx(f$,{...n,ref:e})})}));AC.displayName=n0;var f$=S.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,orientation:r,loop:s=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:h,preventScrollOnEntryFocus:m=!1,...p}=n,x=S.useRef(null),v=Cn(e,x),b=Wf(i),[O,k]=So({prop:l,defaultProp:c??null,onChange:u,caller:n0}),[j,T]=S.useState(!1),M=es(h),_=MC(t),D=S.useRef(!1),[E,z]=S.useState(0);return S.useEffect(()=>{const Q=x.current;if(Q)return Q.addEventListener(ky,M),()=>Q.removeEventListener(ky,M)},[M]),a.jsx(d$,{scope:t,orientation:r,dir:b,loop:s,currentTabStopId:O,onItemFocus:S.useCallback(Q=>k(Q),[k]),onItemShiftTab:S.useCallback(()=>T(!0),[]),onFocusableItemAdd:S.useCallback(()=>z(Q=>Q+1),[]),onFocusableItemRemove:S.useCallback(()=>z(Q=>Q-1),[]),children:a.jsx(Yt.div,{tabIndex:j||E===0?-1:0,"data-orientation":r,...p,ref:v,style:{outline:"none",...n.style},onMouseDown:$e(n.onMouseDown,()=>{D.current=!0}),onFocus:$e(n.onFocus,Q=>{const q=!D.current;if(Q.target===Q.currentTarget&&q&&!j){const B=new CustomEvent(ky,o$);if(Q.currentTarget.dispatchEvent(B),!B.defaultPrevented){const U=_().filter(H=>H.focusable),V=U.find(H=>H.active),ce=U.find(H=>H.id===O),J=[V,ce,...U].filter(Boolean).map(H=>H.ref.current);DC(J,m)}}D.current=!1}),onBlur:$e(n.onBlur,()=>T(!1))})})}),EC="RovingFocusGroupItem",_C=S.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,focusable:r=!0,active:s=!1,tabStopId:i,children:l,...c}=n,u=ki(),h=i||u,m=h$(EC,t),p=m.currentTabStopId===h,x=MC(t),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:O}=m;return S.useEffect(()=>{if(r)return v(),()=>b()},[r,v,b]),a.jsx(o2.ItemSlot,{scope:t,id:h,focusable:r,active:s,children:a.jsx(Yt.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...c,ref:e,onMouseDown:$e(n.onMouseDown,k=>{r?m.onItemFocus(h):k.preventDefault()}),onFocus:$e(n.onFocus,()=>m.onItemFocus(h)),onKeyDown:$e(n.onKeyDown,k=>{if(k.key==="Tab"&&k.shiftKey){m.onItemShiftTab();return}if(k.target!==k.currentTarget)return;const j=g$(k,m.orientation,m.dir);if(j!==void 0){if(k.metaKey||k.ctrlKey||k.altKey||k.shiftKey)return;k.preventDefault();let M=x().filter(_=>_.focusable).map(_=>_.ref.current);if(j==="last")M.reverse();else if(j==="prev"||j==="next"){j==="prev"&&M.reverse();const _=M.indexOf(k.currentTarget);M=m.loop?x$(M,_+1):M.slice(_+1)}setTimeout(()=>DC(M))}}),children:typeof l=="function"?l({isCurrentTabStop:p,hasTabStop:O!=null}):l})})});_C.displayName=EC;var m$={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function p$(n,e){return e!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}function g$(n,e,t){const r=p$(n.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return m$[r]}function DC(n,e=!1){const t=document.activeElement;for(const r of n)if(r===t||(r.focus({preventScroll:e}),document.activeElement!==t))return}function x$(n,e){return n.map((t,r)=>n[(e+r)%n.length])}var RC=AC,zC=_C,px="Tabs",[v$]=Hi(px,[mx]),PC=mx(),[y$,aw]=v$(px),LC=S.forwardRef((n,e)=>{const{__scopeTabs:t,value:r,onValueChange:s,defaultValue:i,orientation:l="horizontal",dir:c,activationMode:u="automatic",...h}=n,m=Wf(c),[p,x]=So({prop:r,onChange:s,defaultProp:i??"",caller:px});return a.jsx(y$,{scope:t,baseId:ki(),value:p,onValueChange:x,orientation:l,dir:m,activationMode:u,children:a.jsx(Yt.div,{dir:m,"data-orientation":l,...h,ref:e})})});LC.displayName=px;var BC="TabsList",IC=S.forwardRef((n,e)=>{const{__scopeTabs:t,loop:r=!0,...s}=n,i=aw(BC,t),l=PC(t);return a.jsx(RC,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:a.jsx(Yt.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:e})})});IC.displayName=BC;var FC="TabsTrigger",qC=S.forwardRef((n,e)=>{const{__scopeTabs:t,value:r,disabled:s=!1,...i}=n,l=aw(FC,t),c=PC(t),u=HC(l.baseId,r),h=UC(l.baseId,r),m=r===l.value;return a.jsx(zC,{asChild:!0,...c,focusable:!s,active:m,children:a.jsx(Yt.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":h,"data-state":m?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:u,...i,ref:e,onMouseDown:$e(n.onMouseDown,p=>{!s&&p.button===0&&p.ctrlKey===!1?l.onValueChange(r):p.preventDefault()}),onKeyDown:$e(n.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&l.onValueChange(r)}),onFocus:$e(n.onFocus,()=>{const p=l.activationMode!=="manual";!m&&!s&&p&&l.onValueChange(r)})})})});qC.displayName=FC;var QC="TabsContent",$C=S.forwardRef((n,e)=>{const{__scopeTabs:t,value:r,forceMount:s,children:i,...l}=n,c=aw(QC,t),u=HC(c.baseId,r),h=UC(c.baseId,r),m=r===c.value,p=S.useRef(m);return S.useEffect(()=>{const x=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(x)},[]),a.jsx(Ls,{present:s||m,children:({present:x})=>a.jsx(Yt.div,{"data-state":m?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!x,id:h,tabIndex:0,...l,ref:e,style:{...n.style,animationDuration:p.current?"0s":void 0},children:x&&i})})});$C.displayName=QC;function HC(n,e){return`${n}-trigger-${e}`}function UC(n,e){return`${n}-content-${e}`}var b$=LC,VC=IC,WC=qC,GC=$C;const dl=b$,va=S.forwardRef(({className:n,...e},t)=>a.jsx(VC,{ref:t,className:ve("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",n),...e}));va.displayName=VC.displayName;const $t=S.forwardRef(({className:n,...e},t)=>a.jsx(WC,{ref:t,className:ve("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",n),...e}));$t.displayName=WC.displayName;const On=S.forwardRef(({className:n,...e},t)=>a.jsx(GC,{ref:t,className:ve("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=active]:animate-in data-[state=active]:fade-in data-[state=active]:duration-300",n),...e}));On.displayName=GC.displayName;function w$(n,e){return S.useReducer((t,r)=>e[t][r]??t,n)}var lw="ScrollArea",[XC]=Hi(lw),[S$,Ai]=XC(lw),YC=S.forwardRef((n,e)=>{const{__scopeScrollArea:t,type:r="hover",dir:s,scrollHideDelay:i=600,...l}=n,[c,u]=S.useState(null),[h,m]=S.useState(null),[p,x]=S.useState(null),[v,b]=S.useState(null),[O,k]=S.useState(null),[j,T]=S.useState(0),[M,_]=S.useState(0),[D,E]=S.useState(!1),[z,Q]=S.useState(!1),q=Cn(e,U=>u(U)),B=Wf(s);return a.jsx(S$,{scope:t,type:r,dir:B,scrollHideDelay:i,scrollArea:c,viewport:h,onViewportChange:m,content:p,onContentChange:x,scrollbarX:v,onScrollbarXChange:b,scrollbarXEnabled:D,onScrollbarXEnabledChange:E,scrollbarY:O,onScrollbarYChange:k,scrollbarYEnabled:z,onScrollbarYEnabledChange:Q,onCornerWidthChange:T,onCornerHeightChange:_,children:a.jsx(Yt.div,{dir:B,...l,ref:q,style:{position:"relative","--radix-scroll-area-corner-width":j+"px","--radix-scroll-area-corner-height":M+"px",...n.style}})})});YC.displayName=lw;var KC="ScrollAreaViewport",ZC=S.forwardRef((n,e)=>{const{__scopeScrollArea:t,children:r,nonce:s,...i}=n,l=Ai(KC,t),c=S.useRef(null),u=Cn(e,c,l.onViewportChange);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),a.jsx(Yt.div,{"data-radix-scroll-area-viewport":"",...i,ref:u,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...n.style},children:a.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});ZC.displayName=KC;var wa="ScrollAreaScrollbar",ow=S.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=Ai(wa,n.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:l}=s,c=n.orientation==="horizontal";return S.useEffect(()=>(c?i(!0):l(!0),()=>{c?i(!1):l(!1)}),[c,i,l]),s.type==="hover"?a.jsx(O$,{...r,ref:e,forceMount:t}):s.type==="scroll"?a.jsx(k$,{...r,ref:e,forceMount:t}):s.type==="auto"?a.jsx(JC,{...r,ref:e,forceMount:t}):s.type==="always"?a.jsx(cw,{...r,ref:e}):null});ow.displayName=wa;var O$=S.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=Ai(wa,n.__scopeScrollArea),[i,l]=S.useState(!1);return S.useEffect(()=>{const c=s.scrollArea;let u=0;if(c){const h=()=>{window.clearTimeout(u),l(!0)},m=()=>{u=window.setTimeout(()=>l(!1),s.scrollHideDelay)};return c.addEventListener("pointerenter",h),c.addEventListener("pointerleave",m),()=>{window.clearTimeout(u),c.removeEventListener("pointerenter",h),c.removeEventListener("pointerleave",m)}}},[s.scrollArea,s.scrollHideDelay]),a.jsx(Ls,{present:t||i,children:a.jsx(JC,{"data-state":i?"visible":"hidden",...r,ref:e})})}),k$=S.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=Ai(wa,n.__scopeScrollArea),i=n.orientation==="horizontal",l=xx(()=>u("SCROLL_END"),100),[c,u]=w$("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return S.useEffect(()=>{if(c==="idle"){const h=window.setTimeout(()=>u("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(h)}},[c,s.scrollHideDelay,u]),S.useEffect(()=>{const h=s.viewport,m=i?"scrollLeft":"scrollTop";if(h){let p=h[m];const x=()=>{const v=h[m];p!==v&&(u("SCROLL"),l()),p=v};return h.addEventListener("scroll",x),()=>h.removeEventListener("scroll",x)}},[s.viewport,i,u,l]),a.jsx(Ls,{present:t||c!=="hidden",children:a.jsx(cw,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:$e(n.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:$e(n.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),JC=S.forwardRef((n,e)=>{const t=Ai(wa,n.__scopeScrollArea),{forceMount:r,...s}=n,[i,l]=S.useState(!1),c=n.orientation==="horizontal",u=xx(()=>{if(t.viewport){const h=t.viewport.offsetWidth<t.viewport.scrollWidth,m=t.viewport.offsetHeight<t.viewport.scrollHeight;l(c?h:m)}},10);return ad(t.viewport,u),ad(t.content,u),a.jsx(Ls,{present:r||i,children:a.jsx(cw,{"data-state":i?"visible":"hidden",...s,ref:e})})}),cw=S.forwardRef((n,e)=>{const{orientation:t="vertical",...r}=n,s=Ai(wa,n.__scopeScrollArea),i=S.useRef(null),l=S.useRef(0),[c,u]=S.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=sT(c.viewport,c.content),m={...r,sizes:c,onSizesChange:u,hasThumb:h>0&&h<1,onThumbChange:x=>i.current=x,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:x=>l.current=x};function p(x,v){return A$(x,l.current,c,v)}return t==="horizontal"?a.jsx(j$,{...m,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const x=s.viewport.scrollLeft,v=qk(x,c,s.dir);i.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:x=>{s.viewport&&(s.viewport.scrollLeft=x)},onDragScroll:x=>{s.viewport&&(s.viewport.scrollLeft=p(x,s.dir))}}):t==="vertical"?a.jsx(N$,{...m,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const x=s.viewport.scrollTop,v=qk(x,c);i.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:x=>{s.viewport&&(s.viewport.scrollTop=x)},onDragScroll:x=>{s.viewport&&(s.viewport.scrollTop=p(x))}}):null}),j$=S.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,i=Ai(wa,n.__scopeScrollArea),[l,c]=S.useState(),u=S.useRef(null),h=Cn(e,u,i.onScrollbarXChange);return S.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),a.jsx(tT,{"data-orientation":"horizontal",...s,ref:h,sizes:t,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":gx(t)+"px",...n.style},onThumbPointerDown:m=>n.onThumbPointerDown(m.x),onDragScroll:m=>n.onDragScroll(m.x),onWheelScroll:(m,p)=>{if(i.viewport){const x=i.viewport.scrollLeft+m.deltaX;n.onWheelScroll(x),aT(x,p)&&m.preventDefault()}},onResize:()=>{u.current&&i.viewport&&l&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:bg(l.paddingLeft),paddingEnd:bg(l.paddingRight)}})}})}),N$=S.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,i=Ai(wa,n.__scopeScrollArea),[l,c]=S.useState(),u=S.useRef(null),h=Cn(e,u,i.onScrollbarYChange);return S.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),a.jsx(tT,{"data-orientation":"vertical",...s,ref:h,sizes:t,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":gx(t)+"px",...n.style},onThumbPointerDown:m=>n.onThumbPointerDown(m.y),onDragScroll:m=>n.onDragScroll(m.y),onWheelScroll:(m,p)=>{if(i.viewport){const x=i.viewport.scrollTop+m.deltaY;n.onWheelScroll(x),aT(x,p)&&m.preventDefault()}},onResize:()=>{u.current&&i.viewport&&l&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:bg(l.paddingTop),paddingEnd:bg(l.paddingBottom)}})}})}),[C$,eT]=XC(wa),tT=S.forwardRef((n,e)=>{const{__scopeScrollArea:t,sizes:r,hasThumb:s,onThumbChange:i,onThumbPointerUp:l,onThumbPointerDown:c,onThumbPositionChange:u,onDragScroll:h,onWheelScroll:m,onResize:p,...x}=n,v=Ai(wa,t),[b,O]=S.useState(null),k=Cn(e,q=>O(q)),j=S.useRef(null),T=S.useRef(""),M=v.viewport,_=r.content-r.viewport,D=es(m),E=es(u),z=xx(p,10);function Q(q){if(j.current){const B=q.clientX-j.current.left,U=q.clientY-j.current.top;h({x:B,y:U})}}return S.useEffect(()=>{const q=B=>{const U=B.target;b?.contains(U)&&D(B,_)};return document.addEventListener("wheel",q,{passive:!1}),()=>document.removeEventListener("wheel",q,{passive:!1})},[M,b,_,D]),S.useEffect(E,[r,E]),ad(b,z),ad(v.content,z),a.jsx(C$,{scope:t,scrollbar:b,hasThumb:s,onThumbChange:es(i),onThumbPointerUp:es(l),onThumbPositionChange:E,onThumbPointerDown:es(c),children:a.jsx(Yt.div,{...x,ref:k,style:{position:"absolute",...x.style},onPointerDown:$e(n.onPointerDown,q=>{q.button===0&&(q.target.setPointerCapture(q.pointerId),j.current=b.getBoundingClientRect(),T.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),Q(q))}),onPointerMove:$e(n.onPointerMove,Q),onPointerUp:$e(n.onPointerUp,q=>{const B=q.target;B.hasPointerCapture(q.pointerId)&&B.releasePointerCapture(q.pointerId),document.body.style.webkitUserSelect=T.current,v.viewport&&(v.viewport.style.scrollBehavior=""),j.current=null})})})}),yg="ScrollAreaThumb",nT=S.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=eT(yg,n.__scopeScrollArea);return a.jsx(Ls,{present:t||s.hasThumb,children:a.jsx(T$,{ref:e,...r})})}),T$=S.forwardRef((n,e)=>{const{__scopeScrollArea:t,style:r,...s}=n,i=Ai(yg,t),l=eT(yg,t),{onThumbPositionChange:c}=l,u=Cn(e,p=>l.onThumbChange(p)),h=S.useRef(void 0),m=xx(()=>{h.current&&(h.current(),h.current=void 0)},100);return S.useEffect(()=>{const p=i.viewport;if(p){const x=()=>{if(m(),!h.current){const v=E$(p,c);h.current=v,c()}};return c(),p.addEventListener("scroll",x),()=>p.removeEventListener("scroll",x)}},[i.viewport,m,c]),a.jsx(Yt.div,{"data-state":l.hasThumb?"visible":"hidden",...s,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:$e(n.onPointerDownCapture,p=>{const v=p.target.getBoundingClientRect(),b=p.clientX-v.left,O=p.clientY-v.top;l.onThumbPointerDown({x:b,y:O})}),onPointerUp:$e(n.onPointerUp,l.onThumbPointerUp)})});nT.displayName=yg;var uw="ScrollAreaCorner",rT=S.forwardRef((n,e)=>{const t=Ai(uw,n.__scopeScrollArea),r=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&r?a.jsx(M$,{...n,ref:e}):null});rT.displayName=uw;var M$=S.forwardRef((n,e)=>{const{__scopeScrollArea:t,...r}=n,s=Ai(uw,t),[i,l]=S.useState(0),[c,u]=S.useState(0),h=!!(i&&c);return ad(s.scrollbarX,()=>{const m=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(m),u(m)}),ad(s.scrollbarY,()=>{const m=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(m),l(m)}),h?a.jsx(Yt.div,{...r,ref:e,style:{width:i,height:c,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...n.style}}):null});function bg(n){return n?parseInt(n,10):0}function sT(n,e){const t=n/e;return isNaN(t)?0:t}function gx(n){const e=sT(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,r=(n.scrollbar.size-t)*e;return Math.max(r,18)}function A$(n,e,t,r="ltr"){const s=gx(t),i=s/2,l=e||i,c=s-l,u=t.scrollbar.paddingStart+l,h=t.scrollbar.size-t.scrollbar.paddingEnd-c,m=t.content-t.viewport,p=r==="ltr"?[0,m]:[m*-1,0];return iT([u,h],p)(n)}function qk(n,e,t="ltr"){const r=gx(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-s,l=e.content-e.viewport,c=i-r,u=t==="ltr"?[0,l]:[l*-1,0],h=$4(n,u);return iT([0,l],[0,c])(h)}function iT(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(n[1]-n[0]);return e[0]+r*(t-n[0])}}function aT(n,e){return n>0&&n<e}var E$=(n,e=()=>{})=>{let t={left:n.scrollLeft,top:n.scrollTop},r=0;return(function s(){const i={left:n.scrollLeft,top:n.scrollTop},l=t.left!==i.left,c=t.top!==i.top;(l||c)&&e(),t=i,r=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(r)};function xx(n,e){const t=es(n),r=S.useRef(0);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),S.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(t,e)},[t,e])}function ad(n,e){const t=es(e);b9(()=>{let r=0;if(n){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(t)});return s.observe(n),()=>{window.cancelAnimationFrame(r),s.unobserve(n)}}},[n,t])}var lT=YC,_$=ZC,D$=rT;const fn=S.forwardRef(({className:n,children:e,viewportRef:t,...r},s)=>a.jsxs(lT,{ref:s,className:ve("relative overflow-hidden",n),...r,children:[a.jsx(_$,{ref:t,className:"h-full w-full rounded-[inherit]",children:e}),a.jsx(c2,{}),a.jsx(c2,{orientation:"horizontal"}),a.jsx(D$,{})]}));fn.displayName=lT.displayName;const c2=S.forwardRef(({className:n,orientation:e="vertical",...t},r)=>a.jsx(ow,{ref:r,orientation:e,className:ve("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",n),...t,children:a.jsx(nT,{className:"relative flex-1 rounded-full bg-border"})}));c2.displayName=ow.displayName;function Qk({className:n,...e}){return a.jsx("div",{className:ve("animate-pulse rounded-md bg-primary/10",n),...e})}function R$(n,e=[]){let t=[];function r(i,l){const c=S.createContext(l);c.displayName=i+"Context";const u=t.length;t=[...t,l];const h=p=>{const{scope:x,children:v,...b}=p,O=x?.[n]?.[u]||c,k=S.useMemo(()=>b,Object.values(b));return a.jsx(O.Provider,{value:k,children:v})};h.displayName=i+"Provider";function m(p,x){const v=x?.[n]?.[u]||c,b=S.useContext(v);if(b)return b;if(l!==void 0)return l;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[h,m]}const s=()=>{const i=t.map(l=>S.createContext(l));return function(c){const u=c?.[n]||i;return S.useMemo(()=>({[`__scope${n}`]:{...c,[n]:u}}),[c,u])}};return s.scopeName=n,[r,z$(s,...e)]}function z$(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const l=r.reduce((c,{useScope:u,scopeName:h})=>{const p=u(i)[`__scope${h}`];return{...c,...p}},{});return S.useMemo(()=>({[`__scope${e.scopeName}`]:l}),[l])}};return t.scopeName=e.scopeName,t}var P$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],oT=P$.reduce((n,e)=>{const t=H4(`Primitive.${e}`),r=S.forwardRef((s,i)=>{const{asChild:l,...c}=s,u=l?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...c,ref:i})});return r.displayName=`Primitive.${e}`,{...n,[e]:r}},{}),dw="Progress",hw=100,[L$]=R$(dw),[B$,I$]=L$(dw),cT=S.forwardRef((n,e)=>{const{__scopeProgress:t,value:r=null,max:s,getValueLabel:i=F$,...l}=n;(s||s===0)&&!$k(s)&&console.error(q$(`${s}`,"Progress"));const c=$k(s)?s:hw;r!==null&&!Hk(r,c)&&console.error(Q$(`${r}`,"Progress"));const u=Hk(r,c)?r:null,h=wg(u)?i(u,c):void 0;return a.jsx(B$,{scope:t,value:u,max:c,children:a.jsx(oT.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":wg(u)?u:void 0,"aria-valuetext":h,role:"progressbar","data-state":hT(u,c),"data-value":u??void 0,"data-max":c,...l,ref:e})})});cT.displayName=dw;var uT="ProgressIndicator",dT=S.forwardRef((n,e)=>{const{__scopeProgress:t,...r}=n,s=I$(uT,t);return a.jsx(oT.div,{"data-state":hT(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:e})});dT.displayName=uT;function F$(n,e){return`${Math.round(n/e*100)}%`}function hT(n,e){return n==null?"indeterminate":n===e?"complete":"loading"}function wg(n){return typeof n=="number"}function $k(n){return wg(n)&&!isNaN(n)&&n>0}function Hk(n,e){return wg(n)&&!isNaN(n)&&n<=e&&n>=0}function q$(n,e){return`Invalid prop \`max\` of value \`${n}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${hw}\`.`}function Q$(n,e){return`Invalid prop \`value\` of value \`${n}\` supplied to \`${e}\`. The \`value\` prop must be:
|
||
- a positive number
|
||
- less than the value passed to \`max\` (or ${hw} if no \`max\` prop is set)
|
||
- \`null\` or \`undefined\` if the progress is indeterminate.
|
||
|
||
Defaulting to \`null\`.`}var fT=cT,$$=dT;const r0=S.forwardRef(({className:n,value:e,...t},r)=>a.jsx(fT,{ref:r,className:ve("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",n),...t,children:a.jsx($$,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));r0.displayName=fT.displayName;const H$={light:"",dark:".dark"},mT=S.createContext(null);function pT(){const n=S.useContext(mT);if(!n)throw new Error("useChart must be used within a <ChartContainer />");return n}const _u=S.forwardRef(({id:n,className:e,children:t,config:r,...s},i)=>{const l=S.useId(),c=`chart-${n||l.replace(/:/g,"")}`;return a.jsx(mT.Provider,{value:{config:r},children:a.jsxs("div",{"data-chart":c,ref:i,className:ve("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",e),...s,children:[a.jsx(U$,{id:c,config:r}),a.jsx(UI,{children:t})]})})});_u.displayName="Chart";const U$=({id:n,config:e})=>{const t=Object.entries(e).filter(([,r])=>r.theme||r.color);return t.length?a.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(H$).map(([r,s])=>`
|
||
${s} [data-chart=${n}] {
|
||
${t.map(([i,l])=>{const c=l.theme?.[r]||l.color;return c?` --color-${i}: ${c};`:null}).join(`
|
||
`)}
|
||
}
|
||
`).join(`
|
||
`)}}):null},_h=VI,Du=S.forwardRef(({active:n,payload:e,className:t,indicator:r="dot",hideLabel:s=!1,hideIndicator:i=!1,label:l,labelFormatter:c,labelClassName:u,formatter:h,color:m,nameKey:p,labelKey:x},v)=>{const{config:b}=pT(),O=S.useMemo(()=>{if(s||!e?.length)return null;const[j]=e,T=`${x||j?.dataKey||j?.name||"value"}`,M=u2(b,j,T),_=!x&&typeof l=="string"?b[l]?.label||l:M?.label;return c?a.jsx("div",{className:ve("font-medium",u),children:c(_,e)}):_?a.jsx("div",{className:ve("font-medium",u),children:_}):null},[l,c,e,s,u,b,x]);if(!n||!e?.length)return null;const k=e.length===1&&r!=="dot";return a.jsxs("div",{ref:v,className:ve("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",t),children:[k?null:O,a.jsx("div",{className:"grid gap-1.5",children:e.filter(j=>j.type!=="none").map((j,T)=>{const M=`${p||j.name||j.dataKey||"value"}`,_=u2(b,j,M),D=m||j.payload.fill||j.color;return a.jsx("div",{className:ve("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",r==="dot"&&"items-center"),children:h&&j?.value!==void 0&&j.name?h(j.value,j.name,j,T,j.payload):a.jsxs(a.Fragment,{children:[_?.icon?a.jsx(_.icon,{}):!i&&a.jsx("div",{className:ve("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":r==="dot","w-1":r==="line","w-0 border-[1.5px] border-dashed bg-transparent":r==="dashed","my-0.5":k&&r==="dashed"}),style:{"--color-bg":D,"--color-border":D}}),a.jsxs("div",{className:ve("flex flex-1 justify-between leading-none",k?"items-end":"items-center"),children:[a.jsxs("div",{className:"grid gap-1.5",children:[k?O:null,a.jsx("span",{className:"text-muted-foreground",children:_?.label||j.name})]}),j.value&&a.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:j.value.toLocaleString()})]})]})},j.dataKey)})})]})});Du.displayName="ChartTooltip";const V$=WI,gT=S.forwardRef(({className:n,hideIcon:e=!1,payload:t,verticalAlign:r="bottom",nameKey:s},i)=>{const{config:l}=pT();return t?.length?a.jsx("div",{ref:i,className:ve("flex items-center justify-center gap-4",r==="top"?"pb-3":"pt-3",n),children:t.filter(c=>c.type!=="none").map(c=>{const u=`${s||c.dataKey||"value"}`,h=u2(l,c,u);return a.jsxs("div",{className:ve("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[h?.icon&&!e?a.jsx(h.icon,{}):a.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:c.color}}),h?.label]},c.value)})}):null});gT.displayName="ChartLegend";function u2(n,e,t){if(typeof e!="object"||e===null)return;const r="payload"in e&&typeof e.payload=="object"&&e.payload!==null?e.payload:void 0;let s=t;return t in e&&typeof e[t]=="string"?s=e[t]:r&&t in r&&typeof r[t]=="string"&&(s=r[t]),s in n?n[s]:n[t]}const Uk=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,Vk=y9,Cd=(n,e)=>t=>{var r;if(e?.variants==null)return Vk(n,t?.class,t?.className);const{variants:s,defaultVariants:i}=e,l=Object.keys(s).map(h=>{const m=t?.[h],p=i?.[h];if(m===null)return null;const x=Uk(m)||Uk(p);return s[h][x]}),c=t&&Object.entries(t).reduce((h,m)=>{let[p,x]=m;return x===void 0||(h[p]=x),h},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((h,m)=>{let{class:p,className:x,...v}=m;return Object.entries(v).every(b=>{let[O,k]=b;return Array.isArray(k)?k.includes({...i,...c}[O]):{...i,...c}[O]===k})?[...h,p,x]:h},[]);return Vk(n,l,u,t?.class,t?.className)},mf=Cd("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),ie=S.forwardRef(({className:n,variant:e,size:t,asChild:r=!1,...s},i)=>{const l=r?tF:"button";return a.jsx(l,{className:ve(mf({variant:e,size:t,className:n})),ref:i,...s})});ie.displayName="Button";function W$(){const[n,e]=S.useState(null),[t,r]=S.useState(!0),[s,i]=S.useState(0),[l,c]=S.useState(24),[u,h]=S.useState(!0),[m,p]=S.useState(null),[x,v]=S.useState(!0),b=S.useCallback(async()=>{try{v(!0);const q=await Zn.get("https://v1.hitokoto.cn/?c=a&c=b&c=c&c=d&c=h&c=i&c=k");p({hitokoto:q.data.hitokoto,from:q.data.from||q.data.from_who||"未知"})}catch(q){console.error("获取一言失败:",q),p({hitokoto:"人生就像一盒巧克力,你永远不知道下一颗是什么味道。",from:"阿甘正传"})}finally{v(!1)}},[]),O=S.useCallback(async()=>{try{const q=localStorage.getItem("access-token"),B=await Zn.get(`/api/webui/statistics/dashboard?hours=${l}`,{headers:{Authorization:`Bearer ${q}`}});e(B.data),r(!1),i(100)}catch(q){console.error("Failed to fetch dashboard data:",q),r(!1),i(100)}},[l]);if(S.useEffect(()=>{if(!t)return;i(0);const q=setTimeout(()=>i(15),200),B=setTimeout(()=>i(30),800),U=setTimeout(()=>i(45),2e3),V=setTimeout(()=>i(60),4e3),ce=setTimeout(()=>i(75),6500),W=setTimeout(()=>i(85),9e3),J=setTimeout(()=>i(92),11e3);return()=>{clearTimeout(q),clearTimeout(B),clearTimeout(U),clearTimeout(V),clearTimeout(ce),clearTimeout(W),clearTimeout(J)}},[t]),S.useEffect(()=>{O(),b()},[O,b]),S.useEffect(()=>{if(!u)return;const q=setInterval(()=>{O()},3e4);return()=>clearInterval(q)},[u,O]),t||!n)return a.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:a.jsxs("div",{className:"text-center space-y-6 w-full max-w-md px-4",children:[a.jsx(Ii,{className:"h-12 w-12 animate-spin mx-auto text-primary"}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-lg font-medium",children:"加载统计数据中..."}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"正在获取麦麦运行数据"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(r0,{value:s,className:"h-2"}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[s,"%"]})]})]})});const{summary:k,model_stats:j,hourly_data:T,daily_data:M,recent_activity:_}=n,D=q=>{const B=Math.floor(q/3600),U=Math.floor(q%3600/60);return`${B}小时${U}分钟`},E=q=>new Date(q).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),z=j.slice(0,6).map(q=>({name:q.model_name,value:q.request_count,fill:`hsl(var(--chart-${j.indexOf(q)%5+1}))`})),Q={requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"},tokens:{label:"Tokens",color:"hsl(var(--chart-3))"}};return a.jsx(fn,{className:"h-full",children:a.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"实时监控面板"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"麦麦运行状态和统计数据一览"})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(dl,{value:l.toString(),onValueChange:q=>c(Number(q)),children:a.jsxs(va,{className:"grid grid-cols-3 w-full sm:w-auto",children:[a.jsx($t,{value:"24",children:"24小时"}),a.jsx($t,{value:"168",children:"7天"}),a.jsx($t,{value:"720",children:"30天"})]})}),a.jsxs(ie,{variant:u?"default":"outline",size:"sm",onClick:()=>h(!u),className:"gap-2",children:[a.jsx(Ii,{className:`h-4 w-4 ${u?"animate-spin":""}`}),a.jsx("span",{className:"hidden sm:inline",children:"自动刷新"})]}),a.jsx(ie,{variant:"outline",size:"sm",onClick:O,children:a.jsx(Ii,{className:"h-4 w-4"})})]})]}),a.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[a.jsxs(yt,{children:[a.jsxs(Jt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(en,{className:"text-sm font-medium",children:"总请求数"}),a.jsx(mF,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs(vn,{children:[a.jsx("div",{className:"text-2xl font-bold",children:k.total_requests.toLocaleString()}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["最近",l<48?l+"小时":Math.floor(l/24)+"天"]})]})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(en,{className:"text-sm font-medium",children:"总花费"}),a.jsx(pF,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs(vn,{children:[a.jsxs("div",{className:"text-2xl font-bold",children:["¥",k.total_cost.toFixed(2)]}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:k.cost_per_hour>0?`¥${k.cost_per_hour.toFixed(2)}/小时`:"暂无数据"})]})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(en,{className:"text-sm font-medium",children:"Token消耗"}),a.jsx(gF,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs(vn,{children:[a.jsxs("div",{className:"text-2xl font-bold",children:[(k.total_tokens/1e3).toFixed(1),"K"]}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:k.tokens_per_hour>0?`${(k.tokens_per_hour/1e3).toFixed(1)}K/小时`:"暂无数据"})]})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(en,{className:"text-sm font-medium",children:"平均响应"}),a.jsx(df,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs(vn,{children:[a.jsxs("div",{className:"text-2xl font-bold",children:[k.avg_response_time.toFixed(2),"s"]}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"API平均耗时"})]})]})]}),a.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-3",children:[a.jsxs(yt,{children:[a.jsxs(Jt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(en,{className:"text-sm font-medium",children:"在线时长"}),a.jsx(uc,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsx(vn,{children:a.jsx("div",{className:"text-xl font-bold",children:D(k.online_time)})})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(en,{className:"text-sm font-medium",children:"消息处理"}),a.jsx(Gf,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs(vn,{children:[a.jsx("div",{className:"text-xl font-bold",children:k.total_messages.toLocaleString()}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["回复 ",k.total_replies.toLocaleString()," 条"]})]})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(en,{className:"text-sm font-medium",children:"成本效率"}),a.jsx(xF,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs(vn,{children:[a.jsx("div",{className:"text-xl font-bold",children:k.total_messages>0?`¥${(k.total_cost/k.total_messages*100).toFixed(2)}`:"¥0.00"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"每100条消息"})]})]})]}),a.jsxs(dl,{defaultValue:"trends",className:"space-y-4",children:[a.jsxs(va,{className:"grid w-full grid-cols-2 sm:grid-cols-4",children:[a.jsx($t,{value:"trends",children:"趋势"}),a.jsx($t,{value:"models",children:"模型"}),a.jsx($t,{value:"activity",children:"活动"}),a.jsx($t,{value:"daily",children:"日统计"})]}),a.jsxs(On,{value:"trends",className:"space-y-4",children:[a.jsxs(yt,{children:[a.jsxs(Jt,{children:[a.jsx(en,{children:"请求趋势"}),a.jsxs(Sr,{children:["最近",l,"小时的请求量变化"]})]}),a.jsx(vn,{children:a.jsx(_u,{config:Q,className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:a.jsxs(GI,{data:T,children:[a.jsx(Wm,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),a.jsx(Gm,{dataKey:"timestamp",tickFormatter:q=>E(q),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(Th,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(_h,{content:a.jsx(Du,{labelFormatter:q=>E(q)})}),a.jsx(XI,{type:"monotone",dataKey:"requests",stroke:"var(--color-requests)",strokeWidth:2})]})})})]}),a.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[a.jsxs(yt,{children:[a.jsxs(Jt,{children:[a.jsx(en,{children:"花费趋势"}),a.jsx(Sr,{children:"API调用成本变化"})]}),a.jsx(vn,{children:a.jsx(_u,{config:Q,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:a.jsxs(my,{data:T,children:[a.jsx(Wm,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),a.jsx(Gm,{dataKey:"timestamp",tickFormatter:q=>E(q),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(Th,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(_h,{content:a.jsx(Du,{labelFormatter:q=>E(q)})}),a.jsx(Xm,{dataKey:"cost",fill:"var(--color-cost)"})]})})})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{children:[a.jsx(en,{children:"Token消耗"}),a.jsx(Sr,{children:"Token使用量变化"})]}),a.jsx(vn,{children:a.jsx(_u,{config:Q,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:a.jsxs(my,{data:T,children:[a.jsx(Wm,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),a.jsx(Gm,{dataKey:"timestamp",tickFormatter:q=>E(q),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(Th,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(_h,{content:a.jsx(Du,{labelFormatter:q=>E(q)})}),a.jsx(Xm,{dataKey:"tokens",fill:"var(--color-tokens)"})]})})})]})]})]}),a.jsx(On,{value:"models",className:"space-y-4",children:a.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[a.jsxs(yt,{children:[a.jsxs(Jt,{children:[a.jsx(en,{children:"模型请求分布"}),a.jsx(Sr,{children:"各模型使用占比"})]}),a.jsx(vn,{children:a.jsx(_u,{config:Object.fromEntries(j.slice(0,6).map((q,B)=>[q.model_name,{label:q.model_name,color:`hsl(var(--chart-${B%5+1}))`}])),className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:a.jsxs(YI,{children:[a.jsx(_h,{content:a.jsx(Du,{})}),a.jsx(KI,{data:z,cx:"50%",cy:"50%",labelLine:!1,label:({name:q,percent:B})=>`${q} ${B?(B*100).toFixed(0):0}%`,outerRadius:100,dataKey:"value",children:z.map((q,B)=>a.jsx(ZI,{fill:q.fill},`cell-${B}`))})]})})})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{children:[a.jsx(en,{children:"模型详细统计"}),a.jsx(Sr,{children:"请求数、花费和性能"})]}),a.jsx(vn,{children:a.jsx(fn,{className:"h-[300px] sm:h-[400px]",children:a.jsx("div",{className:"space-y-3",children:j.map((q,B)=>a.jsxs("div",{className:"p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("h4",{className:"font-semibold text-sm truncate flex-1 min-w-0",children:q.model_name}),a.jsx("div",{className:"w-3 h-3 rounded-full ml-2 flex-shrink-0",style:{backgroundColor:`hsl(var(--chart-${B%5+1}))`}})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"请求数:"}),a.jsx("span",{className:"ml-1 font-medium",children:q.request_count.toLocaleString()})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"花费:"}),a.jsxs("span",{className:"ml-1 font-medium",children:["¥",q.total_cost.toFixed(2)]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),a.jsxs("span",{className:"ml-1 font-medium",children:[(q.total_tokens/1e3).toFixed(1),"K"]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"平均耗时:"}),a.jsxs("span",{className:"ml-1 font-medium",children:[q.avg_response_time.toFixed(2),"s"]})]})]})]},B))})})})]})]})}),a.jsx(On,{value:"activity",children:a.jsxs(yt,{children:[a.jsxs(Jt,{children:[a.jsx(en,{children:"最近活动"}),a.jsx(Sr,{children:"最新的API调用记录"})]}),a.jsx(vn,{children:a.jsx(fn,{className:"h-[400px] sm:h-[500px]",children:a.jsx("div",{className:"space-y-2",children:_.map((q,B)=>a.jsxs("div",{className:"p-3 sm:p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"font-medium text-sm truncate",children:q.model}),a.jsx("div",{className:"text-xs text-muted-foreground",children:q.request_type})]}),a.jsx("div",{className:"text-xs text-muted-foreground flex-shrink-0",children:E(q.timestamp)})]}),a.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),a.jsx("span",{className:"ml-1",children:q.tokens})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"花费:"}),a.jsxs("span",{className:"ml-1",children:["¥",q.cost.toFixed(4)]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"耗时:"}),a.jsxs("span",{className:"ml-1",children:[q.time_cost.toFixed(2),"s"]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"状态:"}),a.jsx("span",{className:`ml-1 ${q.status==="success"?"text-green-600":"text-red-600"}`,children:q.status})]})]})]},B))})})})]})}),a.jsx(On,{value:"daily",children:a.jsxs(yt,{children:[a.jsxs(Jt,{children:[a.jsx(en,{children:"每日统计"}),a.jsx(Sr,{children:"最近7天的数据汇总"})]}),a.jsx(vn,{children:a.jsx(_u,{config:{requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"}},className:"h-[400px] sm:h-[500px] w-full aspect-auto",children:a.jsxs(my,{data:M,children:[a.jsx(Wm,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),a.jsx(Gm,{dataKey:"timestamp",tickFormatter:q=>{const B=new Date(q);return`${B.getMonth()+1}/${B.getDate()}`},stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(Th,{yAxisId:"left",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(Th,{yAxisId:"right",orientation:"right",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(_h,{content:a.jsx(Du,{labelFormatter:q=>new Date(q).toLocaleDateString("zh-CN")})}),a.jsx(V$,{content:a.jsx(gT,{})}),a.jsx(Xm,{yAxisId:"left",dataKey:"requests",fill:"var(--color-requests)"}),a.jsx(Xm,{yAxisId:"right",dataKey:"cost",fill:"var(--color-cost)"})]})})})]})})]}),a.jsxs(yt,{className:"border-2 border-primary/20",children:[a.jsx(Jt,{className:"pb-3",children:a.jsx(en,{className:"text-lg",children:"每日一言"})}),a.jsx(vn,{children:x?a.jsxs("div",{className:"space-y-2",children:[a.jsx(Qk,{className:"h-6 w-3/4"}),a.jsx(Qk,{className:"h-4 w-1/4"})]}):m?a.jsxs("div",{className:"space-y-2",children:[a.jsxs("p",{className:"text-lg font-medium leading-relaxed italic",children:['"',m.hitokoto,'"']}),a.jsxs("p",{className:"text-sm text-muted-foreground text-right",children:["—— ",m.from]})]}):null})]})]})})}const G$={theme:"system",setTheme:()=>null},xT=S.createContext(G$),fw=()=>{const n=S.useContext(xT);if(n===void 0)throw new Error("useTheme must be used within a ThemeProvider");return n},X$=(n,e,t)=>{const r=document.documentElement.classList.contains("no-animations");if(!document.startViewTransition||r){e(n);return}const s=t.clientX,i=t.clientY,l=Math.hypot(Math.max(s,innerWidth-s),Math.max(i,innerHeight-i));document.startViewTransition(()=>{e(n)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${s}px ${i}px)`,`circle(${l}px at ${s}px ${i}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},vT=S.createContext(void 0),yT=()=>{const n=S.useContext(vT);if(n===void 0)throw new Error("useAnimation must be used within an AnimationProvider");return n};var vx="Switch",[Y$]=Hi(vx),[K$,Z$]=Y$(vx),bT=S.forwardRef((n,e)=>{const{__scopeSwitch:t,name:r,checked:s,defaultChecked:i,required:l,disabled:c,value:u="on",onCheckedChange:h,form:m,...p}=n,[x,v]=S.useState(null),b=Cn(e,M=>v(M)),O=S.useRef(!1),k=x?m||!!x.closest("form"):!0,[j,T]=So({prop:s,defaultProp:i??!1,onChange:h,caller:vx});return a.jsxs(K$,{scope:t,checked:j,disabled:c,children:[a.jsx(Yt.button,{type:"button",role:"switch","aria-checked":j,"aria-required":l,"data-state":kT(j),"data-disabled":c?"":void 0,disabled:c,value:u,...p,ref:b,onClick:$e(n.onClick,M=>{T(_=>!_),k&&(O.current=M.isPropagationStopped(),O.current||M.stopPropagation())})}),k&&a.jsx(OT,{control:x,bubbles:!O.current,name:r,value:u,checked:j,required:l,disabled:c,form:m,style:{transform:"translateX(-100%)"}})]})});bT.displayName=vx;var wT="SwitchThumb",ST=S.forwardRef((n,e)=>{const{__scopeSwitch:t,...r}=n,s=Z$(wT,t);return a.jsx(Yt.span,{"data-state":kT(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e})});ST.displayName=wT;var J$="SwitchBubbleInput",OT=S.forwardRef(({__scopeSwitch:n,control:e,checked:t,bubbles:r=!0,...s},i)=>{const l=S.useRef(null),c=Cn(l,i),u=w9(t),h=S9(e);return S.useEffect(()=>{const m=l.current;if(!m)return;const p=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(p,"checked").set;if(u!==t&&v){const b=new Event("click",{bubbles:r});v.call(m,t),m.dispatchEvent(b)}},[u,t,r]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...s,tabIndex:-1,ref:c,style:{...s.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});OT.displayName=J$;function kT(n){return n?"checked":"unchecked"}var jT=bT,eH=ST;const jt=S.forwardRef(({className:n,...e},t)=>a.jsx(jT,{className:ve("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",n),...e,ref:t,children:a.jsx(eH,{className:ve("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));jt.displayName=jT.displayName;const tH=Cd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),te=S.forwardRef(({className:n,...e},t)=>a.jsx(O9,{ref:t,className:ve(tH(),n),...e}));te.displayName=O9.displayName;const Ae=S.forwardRef(({className:n,type:e,...t},r)=>a.jsx("input",{type:e,className:ve("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",n),ref:r,...t}));Ae.displayName="Input";const nH=1,rH=1e6;let jy=0;function sH(){return jy=(jy+1)%Number.MAX_SAFE_INTEGER,jy.toString()}const Ny=new Map,Wk=n=>{if(Ny.has(n))return;const e=setTimeout(()=>{Ny.delete(n),Zh({type:"REMOVE_TOAST",toastId:n})},rH);Ny.set(n,e)},iH=(n,e)=>{switch(e.type){case"ADD_TOAST":return{...n,toasts:[e.toast,...n.toasts].slice(0,nH)};case"UPDATE_TOAST":return{...n,toasts:n.toasts.map(t=>t.id===e.toast.id?{...t,...e.toast}:t)};case"DISMISS_TOAST":{const{toastId:t}=e;return t?Wk(t):n.toasts.forEach(r=>{Wk(r.id)}),{...n,toasts:n.toasts.map(r=>r.id===t||t===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...n,toasts:[]}:{...n,toasts:n.toasts.filter(t=>t.id!==e.toastId)}}},Wp=[];let Gp={toasts:[]};function Zh(n){Gp=iH(Gp,n),Wp.forEach(e=>{e(Gp)})}function aH({...n}){const e=sH(),t=s=>Zh({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>Zh({type:"DISMISS_TOAST",toastId:e});return Zh({type:"ADD_TOAST",toast:{...n,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:t}}function Pr(){const[n,e]=S.useState(Gp);return S.useEffect(()=>(Wp.push(e),()=>{const t=Wp.indexOf(e);t>-1&&Wp.splice(t,1)}),[n]),{...n,toast:aH,dismiss:t=>Zh({type:"DISMISS_TOAST",toastId:t})}}const lH=[{id:"minLength",label:"长度至少 10 位",description:"Token 长度必须大于等于 10 个字符",validate:n=>n.length>=10},{id:"hasUppercase",label:"包含大写字母",description:"至少包含一个大写字母 (A-Z)",validate:n=>/[A-Z]/.test(n)},{id:"hasLowercase",label:"包含小写字母",description:"至少包含一个小写字母 (a-z)",validate:n=>/[a-z]/.test(n)},{id:"hasSpecialChar",label:"包含特殊符号",description:"至少包含一个特殊符号 (!@#$%^&*()_+-=[]{}|;:,.<>?/)",validate:n=>/[!@#$%^&*()_+\-=[\]{}|;:,.<>?/]/.test(n)}];function oH(n){const e=lH.map(r=>({id:r.id,label:r.label,description:r.description,passed:r.validate(n)}));return{isValid:e.every(r=>r.passed),rules:e}}const mw="0.11.5",pw="MaiBot Dashboard",cH=`${pw} v${mw}`,uH=(n="v")=>`${n}${mw}`,Rr=X4,gw=k9,dH=U4,NT=S.forwardRef(({className:n,...e},t)=>a.jsx(rx,{ref:t,className:ve("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n),...e}));NT.displayName=rx.displayName;const Nr=S.forwardRef(({className:n,children:e,...t},r)=>a.jsxs(dH,{children:[a.jsx(NT,{}),a.jsxs(sx,{ref:r,className:ve("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n),...t,children:[e,a.jsxs(V4,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(Xf,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Nr.displayName=sx.displayName;const Cr=({className:n,...e})=>a.jsx("div",{className:ve("flex flex-col space-y-1.5 text-center sm:text-left",n),...e});Cr.displayName="DialogHeader";const ps=({className:n,...e})=>a.jsx("div",{className:ve("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...e});ps.displayName="DialogFooter";const Tr=S.forwardRef(({className:n,...e},t)=>a.jsx(W4,{ref:t,className:ve("text-lg font-semibold leading-none tracking-tight",n),...e}));Tr.displayName=W4.displayName;const Gr=S.forwardRef(({className:n,...e},t)=>a.jsx(G4,{ref:t,className:ve("text-sm text-muted-foreground",n),...e}));Gr.displayName=G4.displayName;var hH=Symbol("radix.slottable");function fH(n){const e=({children:t})=>a.jsx(a.Fragment,{children:t});return e.displayName=`${n}.Slottable`,e.__radixId=hH,e}var CT="AlertDialog",[mH]=Hi(CT,[j9]),yl=j9(),TT=n=>{const{__scopeAlertDialog:e,...t}=n,r=yl(e);return a.jsx(X4,{...r,...t,modal:!0})};TT.displayName=CT;var pH="AlertDialogTrigger",MT=S.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,s=yl(t);return a.jsx(k9,{...s,...r,ref:e})});MT.displayName=pH;var gH="AlertDialogPortal",AT=n=>{const{__scopeAlertDialog:e,...t}=n,r=yl(e);return a.jsx(U4,{...r,...t})};AT.displayName=gH;var xH="AlertDialogOverlay",ET=S.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,s=yl(t);return a.jsx(rx,{...s,...r,ref:e})});ET.displayName=xH;var Vu="AlertDialogContent",[vH,yH]=mH(Vu),bH=fH("AlertDialogContent"),_T=S.forwardRef((n,e)=>{const{__scopeAlertDialog:t,children:r,...s}=n,i=yl(t),l=S.useRef(null),c=Cn(e,l),u=S.useRef(null);return a.jsx(nF,{contentName:Vu,titleName:DT,docsSlug:"alert-dialog",children:a.jsx(vH,{scope:t,cancelRef:u,children:a.jsxs(sx,{role:"alertdialog",...i,...s,ref:c,onOpenAutoFocus:$e(s.onOpenAutoFocus,h=>{h.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault(),children:[a.jsx(bH,{children:r}),a.jsx(SH,{contentRef:l})]})})})});_T.displayName=Vu;var DT="AlertDialogTitle",RT=S.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,s=yl(t);return a.jsx(W4,{...s,...r,ref:e})});RT.displayName=DT;var zT="AlertDialogDescription",PT=S.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,s=yl(t);return a.jsx(G4,{...s,...r,ref:e})});PT.displayName=zT;var wH="AlertDialogAction",LT=S.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,s=yl(t);return a.jsx(V4,{...s,...r,ref:e})});LT.displayName=wH;var BT="AlertDialogCancel",IT=S.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,{cancelRef:s}=yH(BT,t),i=yl(t),l=Cn(e,s);return a.jsx(V4,{...i,...r,ref:l})});IT.displayName=BT;var SH=({contentRef:n})=>{const e=`\`${Vu}\` requires a description for the component to be accessible for screen reader users.
|
||
|
||
You can add a description to the \`${Vu}\` by passing a \`${zT}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
||
|
||
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Vu}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
||
|
||
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return S.useEffect(()=>{document.getElementById(n.current?.getAttribute("aria-describedby"))||console.warn(e)},[e,n]),null},OH=TT,kH=MT,jH=AT,FT=ET,qT=_T,QT=LT,$T=IT,HT=RT,UT=PT;const mn=OH,jr=kH,NH=jH,VT=S.forwardRef(({className:n,...e},t)=>a.jsx(FT,{className:ve("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n),...e,ref:t}));VT.displayName=FT.displayName;const an=S.forwardRef(({className:n,...e},t)=>a.jsxs(NH,{children:[a.jsx(VT,{}),a.jsx(qT,{ref:t,className:ve("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n),...e})]}));an.displayName=qT.displayName;const ln=({className:n,...e})=>a.jsx("div",{className:ve("flex flex-col space-y-2 text-center sm:text-left",n),...e});ln.displayName="AlertDialogHeader";const on=({className:n,...e})=>a.jsx("div",{className:ve("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...e});on.displayName="AlertDialogFooter";const cn=S.forwardRef(({className:n,...e},t)=>a.jsx(HT,{ref:t,className:ve("text-lg font-semibold",n),...e}));cn.displayName=HT.displayName;const un=S.forwardRef(({className:n,...e},t)=>a.jsx(UT,{ref:t,className:ve("text-sm text-muted-foreground",n),...e}));un.displayName=UT.displayName;const dn=S.forwardRef(({className:n,...e},t)=>a.jsx(QT,{ref:t,className:ve(mf(),n),...e}));dn.displayName=QT.displayName;const hn=S.forwardRef(({className:n,...e},t)=>a.jsx($T,{ref:t,className:ve(mf({variant:"outline"}),"mt-2 sm:mt-0",n),...e}));hn.displayName=$T.displayName;function CH(){return a.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[a.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"系统设置"}),a.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理您的应用偏好设置"})]})}),a.jsxs(dl,{defaultValue:"appearance",className:"w-full",children:[a.jsxs(va,{className:"grid w-full grid-cols-2 sm:grid-cols-4 gap-0.5 sm:gap-1 h-auto p-1",children:[a.jsxs($t,{value:"appearance",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[a.jsx(F9,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),a.jsx("span",{children:"外观"})]}),a.jsxs($t,{value:"security",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[a.jsx(vF,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),a.jsx("span",{children:"安全"})]}),a.jsxs($t,{value:"other",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[a.jsx(dc,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),a.jsx("span",{children:"其他"})]}),a.jsxs($t,{value:"about",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[a.jsx(oo,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),a.jsx("span",{children:"关于"})]})]}),a.jsxs(fn,{className:"h-[calc(100vh-240px)] sm:h-[calc(100vh-280px)] mt-4 sm:mt-6",children:[a.jsx(On,{value:"appearance",className:"mt-0",children:a.jsx(TH,{})}),a.jsx(On,{value:"security",className:"mt-0",children:a.jsx(MH,{})}),a.jsx(On,{value:"other",className:"mt-0",children:a.jsx(AH,{})}),a.jsx(On,{value:"about",className:"mt-0",children:a.jsx(EH,{})})]})]})]})}function Gk(n){const e=document.documentElement,r={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%",gradient:null},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%",gradient:null},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%",gradient:null},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%",gradient:null},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%",gradient:null},red:{hsl:"0 84% 60%",darkHsl:"0 90% 70%",gradient:null},"gradient-sunset":{hsl:"15 95% 60%",darkHsl:"15 95% 65%",gradient:"linear-gradient(135deg, hsl(25 95% 53%) 0%, hsl(330 81% 60%) 100%)"},"gradient-ocean":{hsl:"200 90% 55%",darkHsl:"200 90% 60%",gradient:"linear-gradient(135deg, hsl(221.2 83.2% 53.3%) 0%, hsl(189 94% 43%) 100%)"},"gradient-forest":{hsl:"150 70% 45%",darkHsl:"150 75% 40%",gradient:"linear-gradient(135deg, hsl(142 71% 45%) 0%, hsl(158 64% 52%) 100%)"},"gradient-aurora":{hsl:"310 85% 65%",darkHsl:"310 90% 70%",gradient:"linear-gradient(135deg, hsl(271 91% 65%) 0%, hsl(330 81% 60%) 100%)"},"gradient-fire":{hsl:"15 95% 55%",darkHsl:"15 95% 60%",gradient:"linear-gradient(135deg, hsl(0 84% 60%) 0%, hsl(25 95% 53%) 100%)"},"gradient-twilight":{hsl:"250 90% 60%",darkHsl:"250 95% 65%",gradient:"linear-gradient(135deg, hsl(239 84% 67%) 0%, hsl(271 91% 65%) 100%)"}}[n];if(r)e.style.setProperty("--primary",r.hsl),r.gradient?(e.style.setProperty("--primary-gradient",r.gradient),e.classList.add("has-gradient")):(e.style.removeProperty("--primary-gradient"),e.classList.remove("has-gradient"));else if(n.startsWith("#")){const s=i=>{i=i.replace("#","");const l=parseInt(i.substring(0,2),16)/255,c=parseInt(i.substring(2,4),16)/255,u=parseInt(i.substring(4,6),16)/255,h=Math.max(l,c,u),m=Math.min(l,c,u);let p=0,x=0;const v=(h+m)/2;if(h!==m){const b=h-m;switch(x=v>.5?b/(2-h-m):b/(h+m),h){case l:p=((c-u)/b+(c<u?6:0))/6;break;case c:p=((u-l)/b+2)/6;break;case u:p=((l-c)/b+4)/6;break}}return`${Math.round(p*360)} ${Math.round(x*100)}% ${Math.round(v*100)}%`};e.style.setProperty("--primary",s(n)),e.style.removeProperty("--primary-gradient"),e.classList.remove("has-gradient")}}function TH(){const{theme:n,setTheme:e}=fw(),{enableAnimations:t,setEnableAnimations:r,enableWavesBackground:s,setEnableWavesBackground:i}=yT(),[l,c]=S.useState(()=>localStorage.getItem("accent-color")||"blue");S.useEffect(()=>{const h=localStorage.getItem("accent-color")||"blue";Gk(h)},[]);const u=h=>{c(h),localStorage.setItem("accent-color",h),Gk(h)};return a.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题模式"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4",children:[a.jsx(Cy,{value:"light",current:n,onChange:e,label:"浅色",description:"始终使用浅色主题"}),a.jsx(Cy,{value:"dark",current:n,onChange:e,label:"深色",description:"始终使用深色主题"}),a.jsx(Cy,{value:"system",current:n,onChange:e,label:"跟随系统",description:"根据系统设置自动切换"})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题色"}),a.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"单色"}),a.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[a.jsx(xi,{value:"blue",current:l,onChange:u,label:"蓝色",colorClass:"bg-blue-500"}),a.jsx(xi,{value:"purple",current:l,onChange:u,label:"紫色",colorClass:"bg-purple-500"}),a.jsx(xi,{value:"green",current:l,onChange:u,label:"绿色",colorClass:"bg-green-500"}),a.jsx(xi,{value:"orange",current:l,onChange:u,label:"橙色",colorClass:"bg-orange-500"}),a.jsx(xi,{value:"pink",current:l,onChange:u,label:"粉色",colorClass:"bg-pink-500"}),a.jsx(xi,{value:"red",current:l,onChange:u,label:"红色",colorClass:"bg-red-500"})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"渐变色"}),a.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[a.jsx(xi,{value:"gradient-sunset",current:l,onChange:u,label:"日落",colorClass:"bg-gradient-to-r from-orange-500 to-pink-500"}),a.jsx(xi,{value:"gradient-ocean",current:l,onChange:u,label:"海洋",colorClass:"bg-gradient-to-r from-blue-500 to-cyan-500"}),a.jsx(xi,{value:"gradient-forest",current:l,onChange:u,label:"森林",colorClass:"bg-gradient-to-r from-green-500 to-emerald-500"}),a.jsx(xi,{value:"gradient-aurora",current:l,onChange:u,label:"极光",colorClass:"bg-gradient-to-r from-purple-500 to-pink-500"}),a.jsx(xi,{value:"gradient-fire",current:l,onChange:u,label:"烈焰",colorClass:"bg-gradient-to-r from-red-500 to-orange-500"}),a.jsx(xi,{value:"gradient-twilight",current:l,onChange:u,label:"暮光",colorClass:"bg-gradient-to-r from-indigo-500 to-purple-500"})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"自定义颜色"}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[a.jsx("div",{className:"flex-1",children:a.jsx("input",{type:"color",value:l.startsWith("#")?l:"#3b82f6",onChange:h=>u(h.target.value),className:"h-10 sm:h-12 w-full rounded-lg border-2 border-border cursor-pointer",title:"选择自定义颜色"})}),a.jsx("div",{className:"flex-1",children:a.jsx(Ae,{type:"text",value:l,onChange:h=>u(h.target.value),placeholder:"#3b82f6",className:"font-mono text-sm"})})]}),a.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground mt-2",children:"点击色块选择颜色,或手动输入 HEX 颜色代码"})]})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"动画效果"}),a.jsxs("div",{className:"space-y-2 sm:space-y-3",children:[a.jsx("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5 flex-1",children:[a.jsx(te,{htmlFor:"animations",className:"text-base font-medium cursor-pointer",children:"启用动画效果"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后将禁用所有过渡动画和特效,提升性能"})]}),a.jsx(jt,{id:"animations",checked:t,onCheckedChange:r})]})}),a.jsx("div",{className:"rounded-lg border bg-card p-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5 flex-1",children:[a.jsx(te,{htmlFor:"waves-background",className:"text-base font-medium cursor-pointer",children:"登录页波浪背景"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后登录页将使用纯色背景,适合低性能设备"})]}),a.jsx(jt,{id:"waves-background",checked:s,onCheckedChange:i})]})})]})]})]})}function MH(){const n=ba(),[e,t]=S.useState(""),[r,s]=S.useState(""),[i,l]=S.useState(!1),[c,u]=S.useState(!1),[h,m]=S.useState(!1),[p,x]=S.useState(!1),[v,b]=S.useState(!1),[O,k]=S.useState(!1),[j,T]=S.useState(""),[M,_]=S.useState(!1),{toast:D}=Pr(),E=S.useMemo(()=>oH(r),[r]),z=()=>localStorage.getItem("access-token")||"",Q=async W=>{try{await navigator.clipboard.writeText(W),b(!0),D({title:"复制成功",description:"Token 已复制到剪贴板"}),setTimeout(()=>b(!1),2e3)}catch{D({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},q=async()=>{if(!r.trim()){D({title:"输入错误",description:"请输入新的 Token",variant:"destructive"});return}if(!E.isValid){const W=E.rules.filter(J=>!J.passed).map(J=>J.label).join(", ");D({title:"格式错误",description:`Token 不符合要求: ${W}`,variant:"destructive"});return}m(!0);try{const W=z(),J=await fetch("/api/webui/auth/update",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${W}`},body:JSON.stringify({new_token:r.trim()})}),H=await J.json();J.ok&&H.success?(localStorage.setItem("access-token",r.trim()),s(""),e&&t(r.trim()),D({title:"更新成功",description:"Access Token 已更新,即将跳转到登录页"}),setTimeout(()=>{localStorage.removeItem("access-token"),n({to:"/auth"})},1500)):D({title:"更新失败",description:H.message||"无法更新 Token",variant:"destructive"})}catch(W){console.error("更新 Token 错误:",W),D({title:"更新失败",description:"连接服务器失败",variant:"destructive"})}finally{m(!1)}},B=async()=>{x(!0);try{const W=z(),J=await fetch("/api/webui/auth/regenerate",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${W}`}}),H=await J.json();J.ok&&H.success?(localStorage.setItem("access-token",H.token),t(H.token),T(H.token),k(!0),_(!1),D({title:"生成成功",description:"新的 Access Token 已生成,请及时保存"})):D({title:"生成失败",description:H.message||"无法生成新 Token",variant:"destructive"})}catch(W){console.error("生成 Token 错误:",W),D({title:"生成失败",description:"连接服务器失败",variant:"destructive"})}finally{x(!1)}},U=async()=>{try{await navigator.clipboard.writeText(j),_(!0),D({title:"复制成功",description:"Token 已复制到剪贴板"})}catch{D({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},V=()=>{k(!1),setTimeout(()=>{T(""),_(!1)},300),setTimeout(()=>{localStorage.removeItem("access-token"),n({to:"/auth"})},500)},ce=W=>{W||V()};return a.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[a.jsx(Rr,{open:O,onOpenChange:ce,children:a.jsxs(Nr,{className:"sm:max-w-md",children:[a.jsxs(Cr,{children:[a.jsxs(Tr,{className:"flex items-center gap-2",children:[a.jsx(Uu,{className:"h-5 w-5 text-yellow-500"}),"新的 Access Token"]}),a.jsx(Gr,{children:"这是您的新 Token,请立即保存。关闭此窗口后将跳转到登录页面。"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"rounded-lg border-2 border-primary/20 bg-primary/5 p-4",children:[a.jsx(te,{className:"text-xs text-muted-foreground mb-2 block",children:"您的新 Token (64位安全令牌)"}),a.jsx("div",{className:"font-mono text-sm break-all select-all bg-background p-3 rounded border",children:j})]}),a.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:a.jsxs("div",{className:"flex gap-2",children:[a.jsx(Uu,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5"}),a.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[a.jsx("p",{className:"font-semibold",children:"重要提示"}),a.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[a.jsx("li",{children:"此 Token 仅显示一次,关闭后无法再查看"}),a.jsx("li",{children:"请立即复制并保存到安全的位置"}),a.jsx("li",{children:"关闭窗口后将自动跳转到登录页面"}),a.jsx("li",{children:"请使用新 Token 重新登录系统"})]})]})]})})]}),a.jsxs(ps,{className:"gap-2 sm:gap-0",children:[a.jsx(ie,{variant:"outline",onClick:U,className:"gap-2",children:M?a.jsxs(a.Fragment,{children:[a.jsx(hc,{className:"h-4 w-4 text-green-500"}),"已复制"]}):a.jsxs(a.Fragment,{children:[a.jsx(Yb,{className:"h-4 w-4"}),"复制 Token"]})}),a.jsx(ie,{onClick:V,children:"我已保存,关闭"})]})]})}),a.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[a.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"当前 Access Token"}),a.jsx("div",{className:"space-y-3 sm:space-y-4",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"current-token",className:"text-sm",children:"您的访问令牌"}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(Ae,{id:"current-token",type:i?"text":"password",value:e||z(),readOnly:!0,className:"pr-10 font-mono text-sm",placeholder:"点击查看按钮显示 Token"}),a.jsx("button",{onClick:()=>{e||t(z()),l(!i)},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:i?"隐藏":"显示",children:i?a.jsx(Kb,{className:"h-4 w-4 text-muted-foreground"}):a.jsx(qi,{className:"h-4 w-4 text-muted-foreground"})})]}),a.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[a.jsx(ie,{variant:"outline",size:"icon",onClick:()=>Q(z()),title:"复制到剪贴板",className:"flex-shrink-0",children:v?a.jsx(hc,{className:"h-4 w-4 text-green-500"}):a.jsx(Yb,{className:"h-4 w-4"})}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsxs(ie,{variant:"outline",disabled:p,className:"gap-2 flex-1 sm:flex-none",children:[a.jsx(Ii,{className:ve("h-4 w-4",p&&"animate-spin")}),a.jsx("span",{className:"hidden sm:inline",children:"重新生成"}),a.jsx("span",{className:"sm:hidden",children:"生成"})]})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认重新生成 Token"}),a.jsx(un,{children:"这将生成一个新的 64 位安全令牌,并使当前 Token 立即失效。 您需要使用新 Token 重新登录系统。此操作不可撤销,确定要继续吗?"})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:B,children:"确认生成"})]})]})]})]})]}),a.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:"请妥善保管您的 Access Token,不要泄露给他人"})]})})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[a.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"自定义 Access Token"}),a.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"new-token",className:"text-sm",children:"新的访问令牌"}),a.jsxs("div",{className:"relative",children:[a.jsx(Ae,{id:"new-token",type:c?"text":"password",value:r,onChange:W=>s(W.target.value),className:"pr-10 font-mono text-sm",placeholder:"输入自定义 Token"}),a.jsx("button",{onClick:()=>u(!c),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:c?"隐藏":"显示",children:c?a.jsx(Kb,{className:"h-4 w-4 text-muted-foreground"}):a.jsx(qi,{className:"h-4 w-4 text-muted-foreground"})})]}),r&&a.jsxs("div",{className:"mt-3 space-y-2 p-3 rounded-lg bg-muted/50",children:[a.jsx("p",{className:"text-sm font-medium text-foreground",children:"Token 安全要求:"}),a.jsx("div",{className:"space-y-1.5",children:E.rules.map(W=>a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[W.passed?a.jsx(ua,{className:"h-4 w-4 text-green-500 flex-shrink-0"}):a.jsx(Zb,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),a.jsx("span",{className:ve(W.passed?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:W.label})]},W.id))}),E.isValid&&a.jsx("div",{className:"mt-2 pt-2 border-t border-border",children:a.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[a.jsx(hc,{className:"h-4 w-4"}),a.jsx("span",{className:"font-medium",children:"Token 格式正确,可以使用"})]})})]})]}),a.jsx(ie,{onClick:q,disabled:h||!E.isValid||!r,className:"w-full sm:w-auto",children:h?"更新中...":"更新自定义 Token"})]})]}),a.jsxs("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3 sm:p-4",children:[a.jsx("h4",{className:"text-sm sm:text-base font-semibold text-yellow-900 dark:text-yellow-200 mb-2",children:"安全提示"}),a.jsxs("ul",{className:"text-xs sm:text-sm text-yellow-800 dark:text-yellow-300 space-y-1 list-disc list-inside",children:[a.jsx("li",{children:"重新生成 Token 会创建系统随机生成的 64 位安全令牌"}),a.jsx("li",{children:"自定义 Token 必须满足所有安全要求才能使用"}),a.jsx("li",{children:"更新 Token 后,旧的 Token 将立即失效"}),a.jsx("li",{children:"请在安全的环境下查看和复制 Token"}),a.jsx("li",{children:"如果怀疑 Token 泄露,请立即重新生成或更新"}),a.jsx("li",{children:"建议使用系统生成的 Token 以获得最高安全性"})]})]})]})}function AH(){const n=ba(),{toast:e}=Pr(),[t,r]=S.useState(!1),s=async()=>{r(!0);try{const i=localStorage.getItem("access-token"),l=await fetch("/api/webui/setup/reset",{method:"POST",headers:{Authorization:`Bearer ${i}`}}),c=await l.json();l.ok&&c.success?(e({title:"重置成功",description:"即将进入初次配置向导"}),setTimeout(()=>{n({to:"/setup"})},1e3)):e({title:"重置失败",description:c.message||"无法重置配置状态",variant:"destructive"})}catch(i){console.error("重置配置状态错误:",i),e({title:"重置失败",description:"连接服务器失败",variant:"destructive"})}finally{r(!1)}};return a.jsx("div",{className:"space-y-4 sm:space-y-6",children:a.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[a.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"配置向导"}),a.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[a.jsx("div",{className:"space-y-2",children:a.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"重新进行初次配置向导,可以帮助您重新设置系统的基础配置。"})}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsxs(ie,{variant:"outline",disabled:t,className:"gap-2",children:[a.jsx(yF,{className:ve("h-4 w-4",t&&"animate-spin")}),"重新进行初次配置"]})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认重新配置"}),a.jsx(un,{children:"这将带您重新进入初次配置向导。您可以重新设置系统的基础配置项。确定要继续吗?"})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:s,children:"确认重置"})]})]})]})]})]})})}function EH(){return a.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[a.jsx("div",{className:"rounded-lg border-2 border-primary/30 bg-gradient-to-r from-primary/5 to-primary/10 p-4 sm:p-6",children:a.jsxs("div",{className:"flex items-start gap-3 sm:gap-4",children:[a.jsx("div",{className:"flex-shrink-0 rounded-lg bg-primary/10 p-2 sm:p-3",children:a.jsx("svg",{className:"h-6 w-6 sm:h-8 sm:w-8 text-primary",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:a.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h3",{className:"text-lg sm:text-xl font-bold text-foreground mb-2",children:"开源项目"}),a.jsx("p",{className:"text-sm sm:text-base text-muted-foreground mb-3",children:"本项目在 GitHub 开源,欢迎 Star ⭐ 支持!"}),a.jsxs("a",{href:"https://github.com/Mai-with-u/MaiBot-Dashboard",target:"_blank",rel:"noopener noreferrer",className:ve("inline-flex items-center gap-2 px-4 py-2 rounded-lg","bg-primary text-primary-foreground font-medium text-sm","hover:bg-primary/90 transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),children:[a.jsx("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:a.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})}),"前往 GitHub",a.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]})]})}),a.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[a.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:["关于 ",pw]}),a.jsxs("div",{className:"space-y-2 text-xs sm:text-sm text-muted-foreground",children:[a.jsxs("p",{children:["版本: ",mw]}),a.jsx("p",{children:"麦麦(MaiBot)的现代化 Web 管理界面"})]})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[a.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"作者"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium",children:"MaiBot 核心"}),a.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Mai-with-u"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium",children:"WebUI"}),a.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground",children:["Mai-with-u ",a.jsx("a",{href:"https://github.com/DrSmoothl",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"@MotricSeven"})]})]})]})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[a.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"技术栈"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs sm:text-sm text-muted-foreground",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("p",{className:"font-medium text-foreground",children:"前端框架"}),a.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[a.jsx("li",{children:"React 19.2.0"}),a.jsx("li",{children:"TypeScript 5.7.2"}),a.jsx("li",{children:"Vite 6.0.7"}),a.jsx("li",{children:"TanStack Router 1.94.2"})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("p",{className:"font-medium text-foreground",children:"UI 组件"}),a.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[a.jsx("li",{children:"shadcn/ui"}),a.jsx("li",{children:"Radix UI"}),a.jsx("li",{children:"Tailwind CSS 3.4.17"}),a.jsx("li",{children:"Lucide Icons"})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("p",{className:"font-medium text-foreground",children:"后端"}),a.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[a.jsx("li",{children:"Python 3.12+"}),a.jsx("li",{children:"FastAPI"}),a.jsx("li",{children:"Uvicorn"}),a.jsx("li",{children:"WebSocket"})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("p",{className:"font-medium text-foreground",children:"构建工具"}),a.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[a.jsx("li",{children:"Bun / npm"}),a.jsx("li",{children:"ESLint 9.17.0"}),a.jsx("li",{children:"PostCSS"})]})]})]})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[a.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源库感谢"}),a.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mb-3",children:"本项目使用了以下优秀的开源库,感谢他们的贡献:"}),a.jsx(fn,{className:"h-[300px] sm:h-[400px]",children:a.jsxs("div",{className:"space-y-4 pr-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-sm font-medium text-foreground",children:"UI 框架与组件"}),a.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[a.jsx(Gn,{name:"React",description:"用户界面构建库",license:"MIT"}),a.jsx(Gn,{name:"shadcn/ui",description:"优雅的 React 组件库",license:"MIT"}),a.jsx(Gn,{name:"Radix UI",description:"无样式的可访问组件库",license:"MIT"}),a.jsx(Gn,{name:"Tailwind CSS",description:"实用优先的 CSS 框架",license:"MIT"}),a.jsx(Gn,{name:"Lucide React",description:"精美的图标库",license:"ISC"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-sm font-medium text-foreground",children:"路由与状态管理"}),a.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[a.jsx(Gn,{name:"TanStack Router",description:"类型安全的路由库",license:"MIT"}),a.jsx(Gn,{name:"Zustand",description:"轻量级状态管理",license:"MIT"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-sm font-medium text-foreground",children:"表单处理"}),a.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[a.jsx(Gn,{name:"React Hook Form",description:"高性能表单库",license:"MIT"}),a.jsx(Gn,{name:"Zod",description:"TypeScript 优先的 schema 验证",license:"MIT"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-sm font-medium text-foreground",children:"工具库"}),a.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[a.jsx(Gn,{name:"clsx",description:"条件 className 构建工具",license:"MIT"}),a.jsx(Gn,{name:"tailwind-merge",description:"Tailwind 类名合并工具",license:"MIT"}),a.jsx(Gn,{name:"class-variance-authority",description:"组件变体管理",license:"Apache-2.0"}),a.jsx(Gn,{name:"date-fns",description:"现代化日期处理库",license:"MIT"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-sm font-medium text-foreground",children:"动画效果"}),a.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[a.jsx(Gn,{name:"Framer Motion",description:"React 动画库",license:"MIT"}),a.jsx(Gn,{name:"vaul",description:"抽屉组件动画",license:"MIT"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-sm font-medium text-foreground",children:"后端框架"}),a.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[a.jsx(Gn,{name:"FastAPI",description:"现代化 Python Web 框架",license:"MIT"}),a.jsx(Gn,{name:"Uvicorn",description:"ASGI 服务器",license:"BSD-3-Clause"}),a.jsx(Gn,{name:"Pydantic",description:"数据验证库",license:"MIT"}),a.jsx(Gn,{name:"python-multipart",description:"文件上传支持",license:"Apache-2.0"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-sm font-medium text-foreground",children:"开发工具"}),a.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[a.jsx(Gn,{name:"TypeScript",description:"JavaScript 的超集",license:"Apache-2.0"}),a.jsx(Gn,{name:"Vite",description:"下一代前端构建工具",license:"MIT"}),a.jsx(Gn,{name:"ESLint",description:"JavaScript 代码检查工具",license:"MIT"}),a.jsx(Gn,{name:"PostCSS",description:"CSS 转换工具",license:"MIT"})]})]})]})})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[a.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源许可"}),a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{className:"rounded-lg bg-primary/5 border border-primary/20 p-3 sm:p-4",children:a.jsxs("div",{className:"flex items-start gap-2 sm:gap-3",children:[a.jsx("div",{className:"flex-shrink-0 mt-0.5",children:a.jsx("div",{className:"rounded-md bg-primary/10 px-2 py-1",children:a.jsx("span",{className:"text-xs sm:text-sm font-bold text-primary",children:"GPLv3"})})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm sm:text-base font-semibold text-foreground mb-1",children:"MaiBot WebUI"}),a.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目采用 GNU General Public License v3.0 开源许可证。 您可以自由地使用、修改和分发本软件,但必须保持相同的开源许可。"})]})]})}),a.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目依赖的所有开源库均遵循各自的开源许可证(MIT、Apache-2.0、BSD 等)。 感谢所有开源贡献者的无私奉献。"})]})]})]})}function Gn({name:n,description:e,license:t}){return a.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-lg border bg-muted/30 p-2.5 sm:p-3",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"font-medium text-foreground truncate",children:n}),a.jsx("p",{className:"text-muted-foreground text-xs mt-0.5",children:e})]}),a.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary flex-shrink-0",children:t})]})}function Cy({value:n,current:e,onChange:t,label:r,description:s}){const i=e===n;return a.jsxs("button",{onClick:()=>t(n),className:ve("relative rounded-lg border-2 p-3 sm:p-4 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",i?"border-primary bg-accent":"border-border"),children:[i&&a.jsx("div",{className:"absolute top-2 right-2 sm:top-3 sm:right-3 h-2 w-2 rounded-full bg-primary"}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-sm sm:text-base font-medium",children:r}),a.jsx("div",{className:"text-[10px] sm:text-xs text-muted-foreground",children:s})]}),a.jsxs("div",{className:"mt-2 sm:mt-3 flex gap-1",children:[n==="light"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-200"}),a.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-300"}),a.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-400"})]}),n==="dark"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-700"}),a.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-800"}),a.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-900"})]}),n==="system"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-200 to-slate-700"}),a.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-300 to-slate-800"}),a.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-400 to-slate-900"})]})]})]})}function xi({value:n,current:e,onChange:t,label:r,colorClass:s}){const i=e===n;return a.jsxs("button",{onClick:()=>t(n),className:ve("relative rounded-lg border-2 p-2 sm:p-3 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",i?"border-primary bg-accent":"border-border"),children:[i&&a.jsx("div",{className:"absolute top-1.5 right-1.5 sm:top-2 sm:right-2 h-1.5 w-1.5 sm:h-2 sm:w-2 rounded-full bg-primary"}),a.jsxs("div",{className:"flex flex-col items-center gap-1.5 sm:gap-2",children:[a.jsx("div",{className:ve("h-8 w-8 sm:h-10 sm:w-10 rounded-full",s)}),a.jsx("div",{className:"text-[10px] sm:text-xs font-medium text-center",children:r})]})]})}class _H{grad3;p;perm;constructor(e=0){this.grad3=[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]],this.p=[];for(let t=0;t<256;t++)this.p[t]=Math.floor(Math.random()*256);this.perm=[];for(let t=0;t<512;t++)this.perm[t]=this.p[t&255]}dot(e,t,r){return e[0]*t+e[1]*r}mix(e,t,r){return(1-r)*e+r*t}fade(e){return e*e*e*(e*(e*6-15)+10)}perlin2(e,t){const r=Math.floor(e)&255,s=Math.floor(t)&255;e-=Math.floor(e),t-=Math.floor(t);const i=this.fade(e),l=this.fade(t),c=this.perm[r]+s,u=this.perm[c],h=this.perm[c+1],m=this.perm[r+1]+s,p=this.perm[m],x=this.perm[m+1];return this.mix(this.mix(this.dot(this.grad3[u%12],e,t),this.dot(this.grad3[p%12],e-1,t),i),this.mix(this.dot(this.grad3[h%12],e,t-1),this.dot(this.grad3[x%12],e-1,t-1),i),l)}}function DH(){const n=S.useRef(null),e=S.useRef(null),t=S.useRef(void 0),r=S.useRef({mouse:{x:-10,y:0,lx:0,ly:0,sx:0,sy:0,v:0,vs:0,a:0,set:!1},lines:[],paths:[],noise:new _H(Math.random()),bounding:null});return S.useEffect(()=>{const s=e.current,i=n.current;if(!s||!i)return;const l=r.current,c=()=>{const O=s.getBoundingClientRect();l.bounding=O,i.style.width=`${O.width}px`,i.style.height=`${O.height}px`},u=()=>{if(!l.bounding)return;const{width:O,height:k}=l.bounding;l.lines=[],l.paths.forEach(q=>q.remove()),l.paths=[];const j=10,T=32,M=O+200,_=k+30,D=Math.ceil(M/j),E=Math.ceil(_/T),z=(O-j*D)/2,Q=(k-T*E)/2;for(let q=0;q<=D;q++){const B=[];for(let V=0;V<=E;V++){const ce={x:z+j*q,y:Q+T*V,wave:{x:0,y:0},cursor:{x:0,y:0,vx:0,vy:0}};B.push(ce)}const U=document.createElementNS("http://www.w3.org/2000/svg","path");i.appendChild(U),l.paths.push(U),l.lines.push(B)}},h=O=>{const{lines:k,mouse:j,noise:T}=l;k.forEach(M=>{M.forEach(_=>{const D=T.perlin2((_.x+O*.0125)*.002,(_.y+O*.005)*.0015)*12;_.wave.x=Math.cos(D)*32,_.wave.y=Math.sin(D)*16;const E=_.x-j.sx,z=_.y-j.sy,Q=Math.hypot(E,z),q=Math.max(175,j.vs);if(Q<q){const B=1-Q/q,U=Math.cos(Q*.001)*B;_.cursor.vx+=Math.cos(j.a)*U*q*j.vs*65e-5,_.cursor.vy+=Math.sin(j.a)*U*q*j.vs*65e-5}_.cursor.vx+=(0-_.cursor.x)*.005,_.cursor.vy+=(0-_.cursor.y)*.005,_.cursor.vx*=.925,_.cursor.vy*=.925,_.cursor.x+=_.cursor.vx*2,_.cursor.y+=_.cursor.vy*2,_.cursor.x=Math.min(100,Math.max(-100,_.cursor.x)),_.cursor.y=Math.min(100,Math.max(-100,_.cursor.y))})})},m=(O,k=!0)=>{const j={x:O.x+O.wave.x+(k?O.cursor.x:0),y:O.y+O.wave.y+(k?O.cursor.y:0)};return j.x=Math.round(j.x*10)/10,j.y=Math.round(j.y*10)/10,j},p=()=>{const{lines:O,paths:k}=l;O.forEach((j,T)=>{let M=m(j[0],!1),_=`M ${M.x} ${M.y}`;j.forEach((D,E)=>{const z=E===j.length-1;M=m(D,!z),_+=`L ${M.x} ${M.y}`}),k[T].setAttribute("d",_)})},x=O=>{const{mouse:k}=l;k.sx+=(k.x-k.sx)*.1,k.sy+=(k.y-k.sy)*.1;const j=k.x-k.lx,T=k.y-k.ly,M=Math.hypot(j,T);k.v=M,k.vs+=(M-k.vs)*.1,k.vs=Math.min(100,k.vs),k.lx=k.x,k.ly=k.y,k.a=Math.atan2(T,j),s&&(s.style.setProperty("--x",`${k.sx}px`),s.style.setProperty("--y",`${k.sy}px`)),h(O),p(),t.current=requestAnimationFrame(x)},v=O=>{if(!l.bounding)return;const{mouse:k}=l;k.x=O.pageX-l.bounding.left,k.y=O.pageY-l.bounding.top+window.scrollY,k.set||(k.sx=k.x,k.sy=k.y,k.lx=k.x,k.ly=k.y,k.set=!0)},b=()=>{c(),u()};return c(),u(),window.addEventListener("resize",b),window.addEventListener("mousemove",v),t.current=requestAnimationFrame(x),()=>{window.removeEventListener("resize",b),window.removeEventListener("mousemove",v),t.current&&cancelAnimationFrame(t.current)}},[]),a.jsxs("div",{ref:e,className:"waves-background",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",pointerEvents:"none"},children:[a.jsx("div",{className:"waves-cursor",style:{position:"absolute",top:0,left:0,width:"0.5rem",height:"0.5rem",background:"hsl(var(--primary) / 0.3)",borderRadius:"50%",transform:"translate3d(calc(var(--x, -0.5rem) - 50%), calc(var(--y, 50%) - 50%), 0)",willChange:"transform",pointerEvents:"none"}}),a.jsx("svg",{ref:n,style:{display:"block",width:"100%",height:"100%"},children:a.jsx("style",{children:`
|
||
path {
|
||
fill: none;
|
||
stroke: hsl(var(--primary) / 0.20);
|
||
stroke-width: 1px;
|
||
}
|
||
`})})]})}function RH(){const n=ba();S.useEffect(()=>{localStorage.getItem("access-token")||n({to:"/auth"})},[n])}function WT(){return!!localStorage.getItem("access-token")}function zH(){const[n,e]=S.useState(""),[t,r]=S.useState(!1),[s,i]=S.useState(""),l=ba(),{enableWavesBackground:c,setEnableWavesBackground:u}=yT(),{theme:h,setTheme:m}=fw();S.useEffect(()=>{WT()&&l({to:"/"})},[l]);const x=h==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":h,v=()=>{m(x==="dark"?"light":"dark")},b=async O=>{if(O.preventDefault(),i(""),!n.trim()){i("请输入 Access Token");return}r(!0);try{const k=await fetch("/api/webui/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:n.trim()})}),j=await k.json();if(k.ok&&j.valid){localStorage.setItem("access-token",n.trim());const T=await fetch("/api/webui/setup/status",{method:"GET",headers:{Authorization:`Bearer ${n.trim()}`}}),M=await T.json();T.ok&&M.is_first_setup?l({to:"/setup"}):l({to:"/"})}else i(j.message||"Token 验证失败,请检查后重试")}catch(k){console.error("Token 验证错误:",k),i("连接服务器失败,请检查网络连接")}finally{r(!1)}};return a.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[c&&a.jsx(DH,{}),a.jsxs(yt,{className:"relative z-10 w-full max-w-md shadow-2xl backdrop-blur-xl bg-card/80 border-border/50",children:[a.jsx("button",{onClick:v,className:"absolute right-4 top-4 rounded-lg p-2 hover:bg-accent transition-colors z-10 text-foreground",title:x==="dark"?"切换到浅色模式":"切换到深色模式",children:x==="dark"?a.jsx(Jb,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"}):a.jsx(e2,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"})}),a.jsxs(Jt,{className:"space-y-4 text-center",children:[a.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10",children:a.jsx(ck,{className:"h-8 w-8 text-primary",strokeWidth:2,fill:"none"})}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(en,{className:"text-2xl font-bold",children:"欢迎使用 MaiBot"}),a.jsx(Sr,{className:"text-base",children:"请输入您的 Access Token 以继续访问系统"})]})]}),a.jsx(vn,{children:a.jsxs("form",{onSubmit:b,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"token",className:"text-sm font-medium",children:"Access Token"}),a.jsxs("div",{className:"relative",children:[a.jsx(bF,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",strokeWidth:2,fill:"none"}),a.jsx(Ae,{id:"token",type:"password",placeholder:"请输入您的 Access Token",value:n,onChange:O=>e(O.target.value),className:ve("pl-10",s&&"border-red-500 focus-visible:ring-red-500"),disabled:t,autoFocus:!0,autoComplete:"off"})]})]}),s&&a.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-red-50 p-3 text-sm text-red-600 dark:bg-red-950/50 dark:text-red-400",children:[a.jsx(xc,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2,fill:"none"}),a.jsx("span",{children:s})]}),a.jsx(ie,{type:"submit",className:"w-full",disabled:t,children:t?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"验证中..."]}):"验证并进入"}),a.jsxs(Rr,{children:[a.jsx(gw,{asChild:!0,children:a.jsxs("button",{className:"w-full text-center text-sm text-primary hover:text-primary/80 transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[a.jsx(wF,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我没有 Token,我该去哪里获得 Token?"]})}),a.jsxs(Nr,{className:"sm:max-w-md",children:[a.jsxs(Cr,{children:[a.jsxs(Tr,{className:"flex items-center gap-2",children:[a.jsx(ck,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"如何获取 Access Token"]}),a.jsx(Gr,{children:"Access Token 是访问 MaiBot WebUI 的唯一凭证,请按以下方式获取"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(SF,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx("h4",{className:"font-semibold text-sm",children:"方式一:查看启动日志"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"在 MaiBot 启动时,控制台会显示 WebUI Access Token。"}),a.jsxs("div",{className:"rounded bg-background p-2 font-mono text-xs",children:[a.jsx("p",{className:"text-muted-foreground",children:"🔑 WebUI Access Token: abc123..."}),a.jsx("p",{className:"text-muted-foreground",children:"💡 请使用此 Token 登录 WebUI"})]})]})]})}),a.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(io,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx("h4",{className:"font-semibold text-sm",children:"方式二:查看配置文件"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Token 保存在项目根目录的配置文件中:"}),a.jsx("div",{className:"rounded bg-background p-2 font-mono text-xs break-all",children:a.jsx("code",{className:"text-primary",children:"data/webui.json"})}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["打开此文件,复制 ",a.jsx("code",{className:"px-1 py-0.5 bg-background rounded",children:"access_token"})," 字段的值"]})]})]})}),a.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:a.jsxs("div",{className:"flex gap-2",children:[a.jsx(xc,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),a.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[a.jsx("p",{className:"font-semibold",children:"安全提示"}),a.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[a.jsx("li",{children:"请妥善保管您的 Token,不要泄露给他人"}),a.jsx("li",{children:"如需重置 Token,请在登录后前往系统设置"})]})]})]})})]})]})]}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsxs("button",{className:"w-full text-center text-sm text-muted-foreground hover:text-foreground transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[a.jsx(df,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我觉得这个界面很卡怎么办?"]})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsxs(cn,{className:"flex items-center gap-2",children:[a.jsx(df,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"关闭背景动画"]}),a.jsx(un,{children:"背景动画可能会在低性能设备上造成卡顿。关闭动画可以显著提升界面流畅度。"})]}),a.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:a.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭动画后,背景将变为纯色,但不影响任何功能的使用。您可以随时在系统设置中重新开启动画。"})}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>u(!1),children:"关闭动画"})]})]})]})]})})]}),a.jsx("div",{className:"absolute bottom-4 left-0 right-0 text-center text-xs text-muted-foreground",children:a.jsx("p",{children:cH})})]})}const kn=S.forwardRef(({className:n,...e},t)=>a.jsx("textarea",{className:ve("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",n),ref:t,...e}));kn.displayName="Textarea";var PH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],LH=PH.reduce((n,e)=>{const t=H4(`Primitive.${e}`),r=S.forwardRef((s,i)=>{const{asChild:l,...c}=s,u=l?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...c,ref:i})});return r.displayName=`Primitive.${e}`,{...n,[e]:r}},{}),BH="Separator",Xk="horizontal",IH=["horizontal","vertical"],GT=S.forwardRef((n,e)=>{const{decorative:t,orientation:r=Xk,...s}=n,i=FH(r)?r:Xk,c=t?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(LH.div,{"data-orientation":i,...c,...s,ref:e})});GT.displayName=BH;function FH(n){return IH.includes(n)}var XT=GT;const pf=S.forwardRef(({className:n,orientation:e="horizontal",decorative:t=!0,...r},s)=>a.jsx(XT,{ref:s,decorative:t,orientation:e,className:ve("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",n),...r}));pf.displayName=XT.displayName;const qH=Cd("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function $n({className:n,variant:e,...t}){return a.jsx("div",{className:ve(qH({variant:e}),n),...t})}function QH({config:n,onChange:e}){const t=s=>{s.trim()&&!n.alias_names.includes(s.trim())&&e({...n,alias_names:[...n.alias_names,s.trim()]})},r=s=>{e({...n,alias_names:n.alias_names.filter((i,l)=>l!==s)})};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"qq_account",children:"QQ账号 *"}),a.jsx(Ae,{id:"qq_account",type:"number",placeholder:"请输入机器人的QQ账号",value:n.qq_account||"",onChange:s=>e({...n,qq_account:Number(s.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人登录使用的QQ账号"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"nickname",children:"昵称 *"}),a.jsx(Ae,{id:"nickname",placeholder:"请输入机器人的昵称",value:n.nickname,onChange:s=>e({...n,nickname:s.target.value})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的主要称呼名称"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{children:"别名"}),a.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:n.alias_names.map((s,i)=>a.jsxs($n,{variant:"secondary",className:"gap-1",children:[s,a.jsx("button",{type:"button",onClick:()=>r(i),className:"ml-1 hover:text-destructive",children:a.jsx(Xf,{className:"h-3 w-3"})})]},i))}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(Ae,{id:"alias_input",placeholder:"输入别名后按回车添加",onKeyPress:s=>{s.key==="Enter"&&(t(s.target.value),s.target.value="")}}),a.jsx(ie,{type:"button",variant:"outline",onClick:()=>{const s=document.getElementById("alias_input");s&&(t(s.value),s.value="")},children:"添加"})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的其他称呼,可以添加多个"})]})]})}function $H({config:n,onChange:e}){return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"personality",children:"人格特征 *"}),a.jsx(kn,{id:"personality",placeholder:"描述机器人的人格特质和身份特征(建议120字以内)",value:n.personality,onChange:t=>e({...n,personality:t.target.value}),rows:3}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:是一个女大学生,现在在读大二,会刷贴吧"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"reply_style",children:"表达风格 *"}),a.jsx(kn,{id:"reply_style",placeholder:"描述机器人说话的表达风格、表达习惯",value:n.reply_style,onChange:t=>e({...n,reply_style:t.target.value}),rows:3}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:回复平淡一些,简短一些,说中文,参考贴吧、知乎和微博的回复风格"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"interest",children:"兴趣 *"}),a.jsx(kn,{id:"interest",placeholder:"描述机器人感兴趣的话题",value:n.interest,onChange:t=>e({...n,interest:t.target.value}),rows:2}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"会影响机器人对什么话题进行回复"})]}),a.jsx(pf,{}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"plan_style",children:"群聊说话规则 *"}),a.jsx(kn,{id:"plan_style",placeholder:"机器人在群聊中的行为风格和规则",value:n.plan_style,onChange:t=>e({...n,plan_style:t.target.value}),rows:4}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在群聊中如何行动,例如回复频率、条件等"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"private_plan_style",children:"私聊说话规则 *"}),a.jsx(kn,{id:"private_plan_style",placeholder:"机器人在私聊中的行为风格和规则",value:n.private_plan_style,onChange:t=>e({...n,private_plan_style:t.target.value}),rows:3}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在私聊中的行为方式"})]})]})}function HH({config:n,onChange:e}){return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(te,{htmlFor:"emoji_chance",children:"表情包激活概率"}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:[(n.emoji_chance*100).toFixed(0),"%"]})]}),a.jsx(Ae,{id:"emoji_chance",type:"range",min:"0",max:"1",step:"0.1",value:n.emoji_chance,onChange:t=>e({...n,emoji_chance:Number(t.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人发送表情包的概率"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"max_reg_num",children:"最大表情包数量"}),a.jsx(Ae,{id:"max_reg_num",type:"number",min:"1",max:"200",value:n.max_reg_num,onChange:t=>e({...n,max_reg_num:Number(t.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人最多保存的表情包数量"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(te,{htmlFor:"do_replace",children:"达到最大数量时替换"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"开启后会删除旧表情包,关闭则不再收集新表情包"})]}),a.jsx(jt,{id:"do_replace",checked:n.do_replace,onCheckedChange:t=>e({...n,do_replace:t})})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),a.jsx(Ae,{id:"check_interval",type:"number",min:"1",max:"120",value:n.check_interval,onChange:t=>e({...n,check_interval:Number(t.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包注册、破损、删除的时间间隔"})]}),a.jsx(pf,{}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(te,{htmlFor:"steal_emoji",children:"偷取表情包"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人将一些表情包据为己有"})]}),a.jsx(jt,{id:"steal_emoji",checked:n.steal_emoji,onCheckedChange:t=>e({...n,steal_emoji:t})})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(te,{htmlFor:"content_filtration",children:"启用表情包过滤"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"只保存符合要求的表情包"})]}),a.jsx(jt,{id:"content_filtration",checked:n.content_filtration,onCheckedChange:t=>e({...n,content_filtration:t})})]}),n.content_filtration&&a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"filtration_prompt",children:"过滤要求"}),a.jsx(Ae,{id:"filtration_prompt",placeholder:"例如:符合公序良俗",value:n.filtration_prompt,onChange:t=>e({...n,filtration_prompt:t.target.value})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"描述表情包应该符合的要求"})]})]})}function UH({config:n,onChange:e}){return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(te,{htmlFor:"enable_tool",children:"启用工具系统"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人使用各种工具增强功能"})]}),a.jsx(jt,{id:"enable_tool",checked:n.enable_tool,onCheckedChange:t=>e({...n,enable_tool:t})})]}),a.jsx(pf,{}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(te,{htmlFor:"enable_mood",children:"启用情绪系统"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"让机器人具有情绪变化能力"})]}),a.jsx(jt,{id:"enable_mood",checked:n.enable_mood,onCheckedChange:t=>e({...n,enable_mood:t})})]}),n.enable_mood&&a.jsxs("div",{className:"ml-6 space-y-6 border-l-2 border-primary/20 pl-6",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"mood_update_threshold",children:"情绪更新阈值"}),a.jsx(Ae,{id:"mood_update_threshold",type:"number",min:"0.1",max:"10",step:"0.1",value:n.mood_update_threshold||1,onChange:t=>e({...n,mood_update_threshold:Number(t.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"值越高,情绪更新越慢"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(te,{htmlFor:"emotion_style",children:"情感特征"}),a.jsx(kn,{id:"emotion_style",placeholder:"描述情绪的变化情况,例如:情绪较为稳定,但遭遇特定事件时起伏较大",value:n.emotion_style||"",onChange:t=>e({...n,emotion_style:t.target.value}),rows:2}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"影响机器人的情绪变化方式"})]})]}),a.jsx(pf,{}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(te,{htmlFor:"all_global",children:"启用全局黑话模式"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人学习和使用群组黑话"})]}),a.jsx(jt,{id:"all_global",checked:n.all_global,onCheckedChange:t=>e({...n,all_global:t})})]})]})}async function ot(n,e){const t=await fetch(n,e);if(t.status===401)throw localStorage.removeItem("access-token"),window.location.href="/auth",new Error("认证失败,请重新登录");return t}function bt(){return{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("access-token")}`}}async function VH(){const n=await ot("/api/webui/config/bot",{method:"GET",headers:bt()});if(!n.ok)throw new Error("读取Bot配置失败");const t=(await n.json()).config.bot||{};return{qq_account:t.qq_account||0,nickname:t.nickname||"",alias_names:t.alias_names||[]}}async function WH(){const n=await ot("/api/webui/config/bot",{method:"GET",headers:bt()});if(!n.ok)throw new Error("读取人格配置失败");const t=(await n.json()).config.personality||{};return{personality:t.personality||"",reply_style:t.reply_style||"",interest:t.interest||"",plan_style:t.plan_style||"",private_plan_style:t.private_plan_style||""}}async function GH(){const n=await ot("/api/webui/config/bot",{method:"GET",headers:bt()});if(!n.ok)throw new Error("读取表情包配置失败");const t=(await n.json()).config.emoji||{};return{emoji_chance:t.emoji_chance??.4,max_reg_num:t.max_reg_num??40,do_replace:t.do_replace??!0,check_interval:t.check_interval??10,steal_emoji:t.steal_emoji??!0,content_filtration:t.content_filtration??!1,filtration_prompt:t.filtration_prompt||""}}async function XH(){const n=await ot("/api/webui/config/bot",{method:"GET",headers:bt()});if(!n.ok)throw new Error("读取其他配置失败");const t=(await n.json()).config,r=t.tool||{},s=t.mood||{},i=t.jargon||{};return{enable_tool:r.enable_tool??!0,enable_mood:s.enable_mood??!1,mood_update_threshold:s.mood_update_threshold,emotion_style:s.emotion_style,all_global:i.all_global??!0}}async function YH(n){const e=await ot("/api/webui/config/bot/section/bot",{method:"POST",headers:bt(),body:JSON.stringify(n)});if(!e.ok){const t=await e.json();throw new Error(t.detail||"保存Bot基础配置失败")}return await e.json()}async function KH(n){const e=await ot("/api/webui/config/bot/section/personality",{method:"POST",headers:bt(),body:JSON.stringify(n)});if(!e.ok){const t=await e.json();throw new Error(t.detail||"保存人格配置失败")}return await e.json()}async function ZH(n){const e=await ot("/api/webui/config/bot/section/emoji",{method:"POST",headers:bt(),body:JSON.stringify(n)});if(!e.ok){const t=await e.json();throw new Error(t.detail||"保存表情包配置失败")}return await e.json()}async function JH(n){const e=[];e.push(ot("/api/webui/config/bot/section/tool",{method:"POST",headers:bt(),body:JSON.stringify({enable_tool:n.enable_tool})})),e.push(ot("/api/webui/config/bot/section/jargon",{method:"POST",headers:bt(),body:JSON.stringify({all_global:n.all_global})}));const t={enable_mood:n.enable_mood};n.enable_mood&&(t.mood_update_threshold=n.mood_update_threshold||1,t.emotion_style=n.emotion_style||""),e.push(ot("/api/webui/config/bot/section/mood",{method:"POST",headers:bt(),body:JSON.stringify(t)}));const r=await Promise.all(e);for(const s of r)if(!s.ok){const i=await s.json();throw new Error(i.detail||"保存其他配置失败")}return{success:!0}}async function Yk(){const n=localStorage.getItem("access-token"),e=await ot("/api/webui/setup/complete",{method:"POST",headers:{Authorization:`Bearer ${n}`}});if(!e.ok){const t=await e.json();throw new Error(t.message||"标记配置完成失败")}return await e.json()}function eU(){const n=ba(),{toast:e}=Pr(),[t,r]=S.useState(0),[s,i]=S.useState(!1),[l,c]=S.useState(!1),[u,h]=S.useState(!0),[m,p]=S.useState({qq_account:0,nickname:"",alias_names:[]}),[x,v]=S.useState({personality:"是一个女大学生,现在在读大二,会刷贴吧。",reply_style:"请回复的平淡一些,简短一些,说中文,不要刻意突出自身学科背景。可以参考贴吧,知乎和微博的回复风格。",interest:"对技术相关话题,游戏和动漫相关话题感兴趣,也对日常话题感兴趣,不喜欢太过沉重严肃的话题",plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用
|
||
2.如果相同的内容已经被执行,请不要重复执行
|
||
3.请控制你的发言频率,不要太过频繁的发言
|
||
4.如果有人对你感到厌烦,请减少回复
|
||
5.如果有人对你进行攻击,或者情绪激动,请你以合适的方法应对`,private_plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用
|
||
2.如果相同的内容已经被执行,请不要重复执行
|
||
3.某句话如果已经被回复过,不要重复回复`}),[b,O]=S.useState({emoji_chance:.4,max_reg_num:40,do_replace:!0,check_interval:10,steal_emoji:!0,content_filtration:!1,filtration_prompt:"符合公序良俗"}),[k,j]=S.useState({enable_tool:!0,enable_mood:!1,mood_update_threshold:1,emotion_style:"情绪较为稳定,但遭遇特定事件的时候起伏较大",all_global:!0}),T=[{id:"bot-basic",title:"Bot基础",description:"配置机器人的基本信息",icon:kF},{id:"personality",title:"人格配置",description:"定义机器人的性格和说话风格",icon:q9},{id:"emoji",title:"表情包",description:"配置表情包相关设置",icon:J4},{id:"other",title:"其他设置",description:"工具、情绪系统等配置",icon:dc},{id:"complete",title:"完成设置",description:"后续配置提示",icon:df}],M=(t+1)/T.length*100;S.useEffect(()=>{(async()=>{try{h(!0);const[U,V,ce,W]=await Promise.all([VH(),WH(),GH(),XH()]);p(U),v(V),O(ce),j(W)}catch(U){e({title:"加载配置失败",description:U instanceof Error?U.message:"无法加载现有配置,将使用默认值",variant:"destructive"})}finally{h(!1)}})()},[e]);const _=async()=>{c(!0);try{switch(t){case 0:await YH(m);break;case 1:await KH(x);break;case 2:await ZH(b);break;case 3:await JH(k);break}return e({title:"保存成功",description:`${T[t].title}配置已保存`}),!0}catch(B){return e({title:"保存失败",description:B instanceof Error?B.message:"未知错误",variant:"destructive"}),!1}finally{c(!1)}},D=async()=>{await _()&&t<T.length-1&&r(t+1)},E=()=>{t>0&&r(t-1)},z=async()=>{i(!0);try{if(!await _()){i(!1);return}await Yk(),e({title:"配置完成",description:"所有配置已保存,正在跳转..."}),setTimeout(()=>{n({to:"/"})},500)}catch(B){e({title:"完成失败",description:B instanceof Error?B.message:"未知错误",variant:"destructive"})}finally{i(!1)}},Q=async()=>{try{await Yk(),n({to:"/"})}catch(B){e({title:"跳过失败",description:B instanceof Error?B.message:"未知错误",variant:"destructive"})}},q=()=>{switch(t){case 0:return a.jsx(QH,{config:m,onChange:p});case 1:return a.jsx($H,{config:x,onChange:v});case 2:return a.jsx(HH,{config:b,onChange:O});case 3:return a.jsx(UH,{config:k,onChange:j});case 4:return a.jsxs("div",{className:"space-y-6 text-center py-8",children:[a.jsx("div",{className:"mx-auto w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center",children:a.jsx(df,{className:"h-8 w-8 text-primary",strokeWidth:2})}),a.jsxs("div",{className:"space-y-3",children:[a.jsx("h3",{className:"text-xl font-semibold",children:"模型配置"}),a.jsx("p",{className:"text-muted-foreground max-w-md mx-auto",children:"为了让机器人正常工作,您需要配置 AI 模型提供商和模型。"})]}),a.jsxs("div",{className:"rounded-lg border bg-muted/50 p-6 max-w-md mx-auto text-left space-y-4",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"mt-0.5",children:a.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center text-primary text-sm font-semibold",children:"1"})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"配置 API 提供商"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → API 提供商"中添加您的 API 提供商信息'})]})]}),a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"mt-0.5",children:a.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center text-primary text-sm font-semibold",children:"2"})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"添加模型"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → 模型列表"中添加需要使用的模型'})]})]}),a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"mt-0.5",children:a.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center text-primary text-sm font-semibold",children:"3"})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"配置模型任务"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → 模型任务配置"中为不同任务分配模型'})]})]})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"💡 提示:完成向导后,您可以在系统设置中进行详细的模型配置"})]});default:return null}};return a.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-gradient-to-br from-primary/5 via-background to-secondary/5 p-4 md:p-6",children:[a.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[a.jsx("div",{className:"absolute left-1/4 top-1/4 h-64 w-64 md:h-96 md:w-96 rounded-full bg-primary/5 blur-3xl"}),a.jsx("div",{className:"absolute right-1/4 bottom-1/4 h-64 w-64 md:h-96 md:w-96 rounded-full bg-secondary/5 blur-3xl"})]}),u?a.jsxs("div",{className:"relative z-10 text-center",children:[a.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center",children:a.jsx("div",{className:"h-12 w-12 animate-spin rounded-full border-4 border-primary border-t-transparent"})}),a.jsx("p",{className:"text-lg font-medium",children:"加载配置中..."}),a.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"正在读取现有配置"})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"relative z-10 w-full max-w-4xl",children:[a.jsxs("div",{className:"mb-6 md:mb-8 text-center",children:[a.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 md:h-16 md:w-16 items-center justify-center rounded-2xl bg-primary/10",children:a.jsx(OF,{className:"h-6 w-6 md:h-8 md:w-8 text-primary",strokeWidth:2,fill:"none"})}),a.jsx("h1",{className:"mb-2 text-2xl md:text-3xl font-bold",children:"首次配置向导"}),a.jsxs("p",{className:"text-sm md:text-base text-muted-foreground",children:["让我们一起完成 ",pw," 的初始配置"]})]}),a.jsxs("div",{className:"mb-6 md:mb-8",children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between text-xs md:text-sm",children:[a.jsxs("span",{className:"text-muted-foreground",children:["步骤 ",t+1," / ",T.length]}),a.jsxs("span",{className:"font-medium text-primary",children:[Math.round(M),"%"]})]}),a.jsx(r0,{value:M,className:"h-2"})]}),a.jsx("div",{className:"mb-6 md:mb-8 flex justify-between",children:T.map((B,U)=>{const V=B.icon;return a.jsxs("div",{className:ve("flex flex-1 flex-col items-center gap-1 md:gap-2",U<T.length-1&&"relative"),children:[U<T.length-1&&a.jsx("div",{className:ve("absolute left-1/2 top-3 md:top-4 h-0.5 w-full",U<t?"bg-primary":"bg-border")}),a.jsx("div",{className:ve("relative z-10 flex h-6 w-6 md:h-8 md:w-8 items-center justify-center rounded-full border-2 transition-all",U===t||U<t?"border-primary bg-primary text-primary-foreground":"border-border bg-background text-muted-foreground"),children:U<t?a.jsx(ua,{className:"h-3 w-3 md:h-4 md:w-4",strokeWidth:2.5,fill:"none"}):a.jsx(V,{className:"h-3 w-3 md:h-4 md:w-4"})}),a.jsx("span",{className:ve("text-[10px] md:text-xs text-center max-w-[60px] md:max-w-none truncate md:whitespace-normal",U===t?"font-medium text-foreground":"text-muted-foreground"),title:B.title,children:B.title})]},B.id)})}),a.jsx(yt,{className:"mb-6 md:mb-8 shadow-lg",children:a.jsx(vn,{className:"p-4 md:p-8",children:a.jsxs("div",{className:"min-h-[300px] md:min-h-[400px]",children:[a.jsxs("div",{className:"mb-4 md:mb-6",children:[a.jsx("h2",{className:"mb-2 text-xl md:text-2xl font-semibold",children:T[t].title}),a.jsx("p",{className:"text-sm md:text-base text-muted-foreground",children:T[t].description})]}),a.jsx(fn,{className:"h-[400px] md:h-[500px]",children:a.jsx("div",{className:"pr-2",children:q()})})]})})}),a.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-3 sm:gap-0",children:[a.jsx(ie,{variant:"outline",onClick:E,disabled:t===0||l,className:"w-full sm:w-auto order-2 sm:order-1",children:"上一步"}),a.jsxs("div",{className:"flex gap-2 w-full sm:w-auto order-1 sm:order-2",children:[a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsxs(ie,{variant:"ghost",className:"flex-1 sm:flex-none gap-2",disabled:l||s,children:[a.jsx(jF,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"跳过向导"]})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认跳过配置向导"}),a.jsx(un,{children:"您可以随时在系统设置中重新进入配置向导。确定要跳过吗?"})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:Q,children:"确认跳过"})]})]})]}),t===T.length-1?a.jsx(ie,{onClick:z,disabled:s||l,className:"flex-1 sm:flex-none",children:s||l?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),l?"保存中...":"完成中..."]}):a.jsxs(a.Fragment,{children:["完成配置",a.jsx(ua,{className:"ml-2 h-4 w-4",strokeWidth:2,fill:"none"})]})}):a.jsx(ie,{onClick:D,disabled:l,className:"flex-1 sm:flex-none",children:l?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"保存中..."]}):a.jsxs(a.Fragment,{children:["下一步",a.jsx(NF,{className:"ml-2 h-4 w-4",strokeWidth:2,fill:"none"})]})})]})]})]}),a.jsx("div",{className:"relative z-10 mt-6 md:mt-8 text-center text-xs text-muted-foreground",children:a.jsx("p",{children:"您可以随时在设置中修改这些配置"})})]})]})}function YT(){const n=ba();return a.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:a.jsxs("div",{className:"w-full max-w-2xl text-center",children:[a.jsxs("div",{className:"relative mb-8",children:[a.jsx("h1",{className:"text-[150px] font-black leading-none text-primary/10 select-none sm:text-[200px]",children:"404"}),a.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a.jsx(Ps,{className:"h-20 w-20 text-primary/30 sm:h-24 sm:w-24"})})]}),a.jsxs("div",{className:"space-y-4 mb-8",children:[a.jsx("h2",{className:"text-2xl font-bold text-foreground sm:text-3xl",children:"页面未找到"}),a.jsx("p",{className:"text-base text-muted-foreground sm:text-lg max-w-md mx-auto",children:"抱歉,您访问的页面不存在或已被移除。请检查 URL 是否正确,或返回首页继续浏览。"})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4",children:[a.jsxs(ie,{size:"lg",onClick:()=>n({to:"/"}),className:"gap-2 w-full sm:w-auto",children:[a.jsx(fg,{className:"h-4 w-4"}),"返回首页"]}),a.jsxs(ie,{size:"lg",variant:"outline",onClick:()=>window.history.back(),className:"gap-2 w-full sm:w-auto",children:[a.jsx(Q9,{className:"h-4 w-4"}),"返回上一页"]})]}),a.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:a.jsx("p",{className:"text-sm text-muted-foreground",children:"如果您认为这是一个错误,请联系系统管理员"})})]})})}var KT=["PageUp","PageDown"],ZT=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],JT={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Td="Slider",[d2,tU,nU]=nx(Td),[eM]=Hi(Td,[nU]),[rU,yx]=eM(Td),tM=S.forwardRef((n,e)=>{const{name:t,min:r=0,max:s=100,step:i=1,orientation:l="horizontal",disabled:c=!1,minStepsBetweenThumbs:u=0,defaultValue:h=[r],value:m,onValueChange:p=()=>{},onValueCommit:x=()=>{},inverted:v=!1,form:b,...O}=n,k=S.useRef(new Set),j=S.useRef(0),M=l==="horizontal"?sU:iU,[_=[],D]=So({prop:m,defaultProp:h,onChange:U=>{[...k.current][j.current]?.focus(),p(U)}}),E=S.useRef(_);function z(U){const V=uU(_,U);B(U,V)}function Q(U){B(U,j.current)}function q(){const U=E.current[j.current];_[j.current]!==U&&x(_)}function B(U,V,{commit:ce}={commit:!1}){const W=mU(i),J=pU(Math.round((U-r)/i)*i+r,W),H=$4(J,[r,s]);D((ae=[])=>{const ne=oU(ae,H,V);if(fU(ne,u*i)){j.current=ne.indexOf(H);const ue=String(ne)!==String(ae);return ue&&ce&&x(ne),ue?ne:ae}else return ae})}return a.jsx(rU,{scope:n.__scopeSlider,name:t,disabled:c,min:r,max:s,valueIndexToChangeRef:j,thumbs:k.current,values:_,orientation:l,form:b,children:a.jsx(d2.Provider,{scope:n.__scopeSlider,children:a.jsx(d2.Slot,{scope:n.__scopeSlider,children:a.jsx(M,{"aria-disabled":c,"data-disabled":c?"":void 0,...O,ref:e,onPointerDown:$e(O.onPointerDown,()=>{c||(E.current=_)}),min:r,max:s,inverted:v,onSlideStart:c?void 0:z,onSlideMove:c?void 0:Q,onSlideEnd:c?void 0:q,onHomeKeyDown:()=>!c&&B(r,0,{commit:!0}),onEndKeyDown:()=>!c&&B(s,_.length-1,{commit:!0}),onStepKeyDown:({event:U,direction:V})=>{if(!c){const J=KT.includes(U.key)||U.shiftKey&&ZT.includes(U.key)?10:1,H=j.current,ae=_[H],ne=i*J*V;B(ae+ne,H,{commit:!0})}}})})})})});tM.displayName=Td;var[nM,rM]=eM(Td,{startEdge:"left",endEdge:"right",size:"width",direction:1}),sU=S.forwardRef((n,e)=>{const{min:t,max:r,dir:s,inverted:i,onSlideStart:l,onSlideMove:c,onSlideEnd:u,onStepKeyDown:h,...m}=n,[p,x]=S.useState(null),v=Cn(e,M=>x(M)),b=S.useRef(void 0),O=Wf(s),k=O==="ltr",j=k&&!i||!k&&i;function T(M){const _=b.current||p.getBoundingClientRect(),D=[0,_.width],z=xw(D,j?[t,r]:[r,t]);return b.current=_,z(M-_.left)}return a.jsx(nM,{scope:n.__scopeSlider,startEdge:j?"left":"right",endEdge:j?"right":"left",direction:j?1:-1,size:"width",children:a.jsx(sM,{dir:O,"data-orientation":"horizontal",...m,ref:v,style:{...m.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:M=>{const _=T(M.clientX);l?.(_)},onSlideMove:M=>{const _=T(M.clientX);c?.(_)},onSlideEnd:()=>{b.current=void 0,u?.()},onStepKeyDown:M=>{const D=JT[j?"from-left":"from-right"].includes(M.key);h?.({event:M,direction:D?-1:1})}})})}),iU=S.forwardRef((n,e)=>{const{min:t,max:r,inverted:s,onSlideStart:i,onSlideMove:l,onSlideEnd:c,onStepKeyDown:u,...h}=n,m=S.useRef(null),p=Cn(e,m),x=S.useRef(void 0),v=!s;function b(O){const k=x.current||m.current.getBoundingClientRect(),j=[0,k.height],M=xw(j,v?[r,t]:[t,r]);return x.current=k,M(O-k.top)}return a.jsx(nM,{scope:n.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:a.jsx(sM,{"data-orientation":"vertical",...h,ref:p,style:{...h.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:O=>{const k=b(O.clientY);i?.(k)},onSlideMove:O=>{const k=b(O.clientY);l?.(k)},onSlideEnd:()=>{x.current=void 0,c?.()},onStepKeyDown:O=>{const j=JT[v?"from-bottom":"from-top"].includes(O.key);u?.({event:O,direction:j?-1:1})}})})}),sM=S.forwardRef((n,e)=>{const{__scopeSlider:t,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:l,onEndKeyDown:c,onStepKeyDown:u,...h}=n,m=yx(Td,t);return a.jsx(Yt.span,{...h,ref:e,onKeyDown:$e(n.onKeyDown,p=>{p.key==="Home"?(l(p),p.preventDefault()):p.key==="End"?(c(p),p.preventDefault()):KT.concat(ZT).includes(p.key)&&(u(p),p.preventDefault())}),onPointerDown:$e(n.onPointerDown,p=>{const x=p.target;x.setPointerCapture(p.pointerId),p.preventDefault(),m.thumbs.has(x)?x.focus():r(p)}),onPointerMove:$e(n.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&s(p)}),onPointerUp:$e(n.onPointerUp,p=>{const x=p.target;x.hasPointerCapture(p.pointerId)&&(x.releasePointerCapture(p.pointerId),i(p))})})}),iM="SliderTrack",aM=S.forwardRef((n,e)=>{const{__scopeSlider:t,...r}=n,s=yx(iM,t);return a.jsx(Yt.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:e})});aM.displayName=iM;var h2="SliderRange",lM=S.forwardRef((n,e)=>{const{__scopeSlider:t,...r}=n,s=yx(h2,t),i=rM(h2,t),l=S.useRef(null),c=Cn(e,l),u=s.values.length,h=s.values.map(x=>uM(x,s.min,s.max)),m=u>1?Math.min(...h):0,p=100-Math.max(...h);return a.jsx(Yt.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:c,style:{...n.style,[i.startEdge]:m+"%",[i.endEdge]:p+"%"}})});lM.displayName=h2;var f2="SliderThumb",oM=S.forwardRef((n,e)=>{const t=tU(n.__scopeSlider),[r,s]=S.useState(null),i=Cn(e,c=>s(c)),l=S.useMemo(()=>r?t().findIndex(c=>c.ref.current===r):-1,[t,r]);return a.jsx(aU,{...n,ref:i,index:l})}),aU=S.forwardRef((n,e)=>{const{__scopeSlider:t,index:r,name:s,...i}=n,l=yx(f2,t),c=rM(f2,t),[u,h]=S.useState(null),m=Cn(e,T=>h(T)),p=u?l.form||!!u.closest("form"):!0,x=S9(u),v=l.values[r],b=v===void 0?0:uM(v,l.min,l.max),O=cU(r,l.values.length),k=x?.[c.size],j=k?dU(k,b,c.direction):0;return S.useEffect(()=>{if(u)return l.thumbs.add(u),()=>{l.thumbs.delete(u)}},[u,l.thumbs]),a.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${b}% + ${j}px)`},children:[a.jsx(d2.ItemSlot,{scope:n.__scopeSlider,children:a.jsx(Yt.span,{role:"slider","aria-label":n["aria-label"]||O,"aria-valuemin":l.min,"aria-valuenow":v,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...i,ref:m,style:v===void 0?{display:"none"}:n.style,onFocus:$e(n.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),p&&a.jsx(cM,{name:s??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:v},r)]})});oM.displayName=f2;var lU="RadioBubbleInput",cM=S.forwardRef(({__scopeSlider:n,value:e,...t},r)=>{const s=S.useRef(null),i=Cn(s,r),l=w9(e);return S.useEffect(()=>{const c=s.current;if(!c)return;const u=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(u,"value").set;if(l!==e&&m){const p=new Event("input",{bubbles:!0});m.call(c,e),c.dispatchEvent(p)}},[l,e]),a.jsx(Yt.input,{style:{display:"none"},...t,ref:i,defaultValue:e})});cM.displayName=lU;function oU(n=[],e,t){const r=[...n];return r[t]=e,r.sort((s,i)=>s-i)}function uM(n,e,t){const i=100/(t-e)*(n-e);return $4(i,[0,100])}function cU(n,e){return e>2?`Value ${n+1} of ${e}`:e===2?["Minimum","Maximum"][n]:void 0}function uU(n,e){if(n.length===1)return 0;const t=n.map(s=>Math.abs(s-e)),r=Math.min(...t);return t.indexOf(r)}function dU(n,e,t){const r=n/2,i=xw([0,50],[0,r]);return(r-i(e)*t)*t}function hU(n){return n.slice(0,-1).map((e,t)=>n[t+1]-e)}function fU(n,e){if(e>0){const t=hU(n);return Math.min(...t)>=e}return!0}function xw(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(n[1]-n[0]);return e[0]+r*(t-n[0])}}function mU(n){return(String(n).split(".")[1]||"").length}function pU(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}var dM=tM,gU=aM,xU=lM,vU=oM;const bx=S.forwardRef(({className:n,...e},t)=>a.jsxs(dM,{ref:t,className:ve("relative flex w-full touch-none select-none items-center",n),...e,children:[a.jsx(gU,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:a.jsx(xU,{className:"absolute h-full bg-primary"})}),a.jsx(vU,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"})]}));bx.displayName=dM.displayName;const Bt=oF,It=cF,Dt=S.forwardRef(({className:n,children:e,...t},r)=>a.jsxs(N9,{ref:r,className:ve("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",n),...t,children:[e,a.jsx(rF,{asChild:!0,children:a.jsx(hf,{className:"h-4 w-4 opacity-50"})})]}));Dt.displayName=N9.displayName;const hM=S.forwardRef(({className:n,...e},t)=>a.jsx(C9,{ref:t,className:ve("flex cursor-default items-center justify-center py-1",n),...e,children:a.jsx(t2,{className:"h-4 w-4"})}));hM.displayName=C9.displayName;const fM=S.forwardRef(({className:n,...e},t)=>a.jsx(T9,{ref:t,className:ve("flex cursor-default items-center justify-center py-1",n),...e,children:a.jsx(hf,{className:"h-4 w-4"})}));fM.displayName=T9.displayName;const Rt=S.forwardRef(({className:n,children:e,position:t="popper",...r},s)=>a.jsx(sF,{children:a.jsxs(M9,{ref:s,className:ve("relative z-[100] max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-hidden rounded-md border border-border bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",t==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:t,...r,children:[a.jsx(hM,{}),a.jsx(iF,{className:ve("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),a.jsx(fM,{})]})}));Rt.displayName=M9.displayName;const yU=S.forwardRef(({className:n,...e},t)=>a.jsx(A9,{ref:t,className:ve("px-2 py-1.5 text-sm font-semibold",n),...e}));yU.displayName=A9.displayName;const Pe=S.forwardRef(({className:n,children:e,...t},r)=>a.jsxs(E9,{ref:r,className:ve("relative flex w-full cursor-default select-none items-center rounded-sm py-2 pl-2 pr-8 text-sm outline-none bg-white dark:bg-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 focus:bg-gray-100 dark:focus:bg-gray-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),...t,children:[a.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(aF,{children:a.jsx(hc,{className:"h-4 w-4"})})}),a.jsx(lF,{children:e})]}));Pe.displayName=E9.displayName;const bU=S.forwardRef(({className:n,...e},t)=>a.jsx(_9,{ref:t,className:ve("-mx-1 my-1 h-px bg-muted",n),...e}));bU.displayName=_9.displayName;function wU(n){const e=SU(n),t=S.forwardRef((r,s)=>{const{children:i,...l}=r,c=S.Children.toArray(i),u=c.find(kU);if(u){const h=u.props.children,m=c.map(p=>p===u?S.Children.count(h)>1?S.Children.only(null):S.isValidElement(h)?h.props.children:null:p);return a.jsx(e,{...l,ref:s,children:S.isValidElement(h)?S.cloneElement(h,void 0,m):null})}return a.jsx(e,{...l,ref:s,children:i})});return t.displayName=`${n}.Slot`,t}function SU(n){const e=S.forwardRef((t,r)=>{const{children:s,...i}=t;if(S.isValidElement(s)){const l=NU(s),c=jU(i,s.props);return s.type!==S.Fragment&&(c.ref=r?lo(r,l):l),S.cloneElement(s,c)}return S.Children.count(s)>1?S.Children.only(null):null});return e.displayName=`${n}.SlotClone`,e}var OU=Symbol("radix.slottable");function kU(n){return S.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===OU}function jU(n,e){const t={...e};for(const r in e){const s=n[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?t[r]=(...c)=>{const u=i(...c);return s(...c),u}:s&&(t[r]=s):r==="style"?t[r]={...s,...i}:r==="className"&&(t[r]=[s,i].filter(Boolean).join(" "))}return{...n,...t}}function NU(n){let e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}var wx="Popover",[mM]=Hi(wx,[Sd]),s0=Sd(),[CU,Oo]=mM(wx),pM=n=>{const{__scopePopover:e,children:t,open:r,defaultOpen:s,onOpenChange:i,modal:l=!1}=n,c=s0(e),u=S.useRef(null),[h,m]=S.useState(!1),[p,x]=So({prop:r,defaultProp:s??!1,onChange:i,caller:wx});return a.jsx(ax,{...c,children:a.jsx(CU,{scope:e,contentId:ki(),triggerRef:u,open:p,onOpenChange:x,onOpenToggle:S.useCallback(()=>x(v=>!v),[x]),hasCustomAnchor:h,onCustomAnchorAdd:S.useCallback(()=>m(!0),[]),onCustomAnchorRemove:S.useCallback(()=>m(!1),[]),modal:l,children:t})})};pM.displayName=wx;var gM="PopoverAnchor",TU=S.forwardRef((n,e)=>{const{__scopePopover:t,...r}=n,s=Oo(gM,t),i=s0(t),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=s;return S.useEffect(()=>(l(),()=>c()),[l,c]),a.jsx(lx,{...i,...r,ref:e})});TU.displayName=gM;var xM="PopoverTrigger",vM=S.forwardRef((n,e)=>{const{__scopePopover:t,...r}=n,s=Oo(xM,t),i=s0(t),l=Cn(e,s.triggerRef),c=a.jsx(Yt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":OM(s.open),...r,ref:l,onClick:$e(n.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:a.jsx(lx,{asChild:!0,...i,children:c})});vM.displayName=xM;var vw="PopoverPortal",[MU,AU]=mM(vw,{forceMount:void 0}),yM=n=>{const{__scopePopover:e,forceMount:t,children:r,container:s}=n,i=Oo(vw,e);return a.jsx(MU,{scope:e,forceMount:t,children:a.jsx(Ls,{present:t||i.open,children:a.jsx(ix,{asChild:!0,container:s,children:r})})})};yM.displayName=vw;var ld="PopoverContent",bM=S.forwardRef((n,e)=>{const t=AU(ld,n.__scopePopover),{forceMount:r=t.forceMount,...s}=n,i=Oo(ld,n.__scopePopover);return a.jsx(Ls,{present:r||i.open,children:i.modal?a.jsx(_U,{...s,ref:e}):a.jsx(DU,{...s,ref:e})})});bM.displayName=ld;var EU=wU("PopoverContent.RemoveScroll"),_U=S.forwardRef((n,e)=>{const t=Oo(ld,n.__scopePopover),r=S.useRef(null),s=Cn(e,r),i=S.useRef(!1);return S.useEffect(()=>{const l=r.current;if(l)return D9(l)},[]),a.jsx(R9,{as:EU,allowPinchZoom:!0,children:a.jsx(wM,{...n,ref:s,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$e(n.onCloseAutoFocus,l=>{l.preventDefault(),i.current||t.triggerRef.current?.focus()}),onPointerDownOutside:$e(n.onPointerDownOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,h=c.button===2||u;i.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:$e(n.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),DU=S.forwardRef((n,e)=>{const t=Oo(ld,n.__scopePopover),r=S.useRef(!1),s=S.useRef(!1);return a.jsx(wM,{...n,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{n.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||t.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{n.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=i.target;t.triggerRef.current?.contains(l)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),wM=S.forwardRef((n,e)=>{const{__scopePopover:t,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:h,onInteractOutside:m,...p}=n,x=Oo(ld,t),v=s0(t);return z9(),a.jsx(P9,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(Y4,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:m,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:h,onDismiss:()=>x.onOpenChange(!1),children:a.jsx(K4,{"data-state":OM(x.open),role:"dialog",id:x.contentId,...v,...p,ref:e,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),SM="PopoverClose",RU=S.forwardRef((n,e)=>{const{__scopePopover:t,...r}=n,s=Oo(SM,t);return a.jsx(Yt.button,{type:"button",...r,ref:e,onClick:$e(n.onClick,()=>s.onOpenChange(!1))})});RU.displayName=SM;var zU="PopoverArrow",PU=S.forwardRef((n,e)=>{const{__scopePopover:t,...r}=n,s=s0(t);return a.jsx(Z4,{...s,...r,ref:e})});PU.displayName=zU;function OM(n){return n?"open":"closed"}var LU=pM,BU=vM,IU=yM,kM=bM;const co=LU,uo=BU,hl=S.forwardRef(({className:n,align:e="center",sideOffset:t=4,...r},s)=>a.jsx(IU,{children:a.jsx(kM,{ref:s,align:e,sideOffset:t,className:ve("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",n),...r})}));hl.displayName=kM.displayName;const ko="/api/webui/config";async function FU(){const e=await(await ot(`${ko}/bot`)).json();if(!e.success)throw new Error("获取配置数据失败");return e.config}async function Wu(){const e=await(await ot(`${ko}/model`)).json();if(!e.success)throw new Error("获取模型配置数据失败");return e.config}async function Kk(n){const t=await(await ot(`${ko}/bot`,{method:"POST",headers:bt(),body:JSON.stringify(n)})).json();if(!t.success)throw new Error(t.message||"保存配置失败")}async function qU(){const e=await(await ot(`${ko}/bot/raw`)).json();if(!e.success)throw new Error("获取配置源代码失败");return e.content}async function QU(n){const t=await(await ot(`${ko}/bot/raw`,{method:"POST",headers:bt(),body:JSON.stringify({raw_content:n})})).json();if(!t.success)throw new Error(t.message||"保存配置失败")}async function Sg(n){const t=await(await ot(`${ko}/model`,{method:"POST",headers:bt(),body:JSON.stringify(n)})).json();if(!t.success)throw new Error(t.message||"保存配置失败")}async function $U(n,e){const r=await(await ot(`${ko}/bot/section/${n}`,{method:"POST",headers:bt(),body:JSON.stringify(e)})).json();if(!r.success)throw new Error(r.message||`保存配置节 ${n} 失败`)}async function m2(n,e){const r=await(await ot(`${ko}/model/section/${n}`,{method:"POST",headers:bt(),body:JSON.stringify(e)})).json();if(!r.success)throw new Error(r.message||`保存配置节 ${n} 失败`)}const HU=Zn.create({baseURL:"",timeout:1e4});async function yw(){try{return(await HU.post("/api/webui/system/restart")).data}catch(n){throw console.error("重启麦麦失败:",n),n}}const UU=Cd("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),od=S.forwardRef(({className:n,variant:e,...t},r)=>a.jsx("div",{ref:r,role:"alert",className:ve(UU({variant:e}),n),...t}));od.displayName="Alert";const VU=S.forwardRef(({className:n,...e},t)=>a.jsx("h5",{ref:t,className:ve("mb-1 font-medium leading-none tracking-tight",n),...e}));VU.displayName="AlertTitle";const cd=S.forwardRef(({className:n,...e},t)=>a.jsx("div",{ref:t,className:ve("text-sm [&_p]:leading-relaxed",n),...e}));cd.displayName="AlertDescription";function bw({onRestartComplete:n,onRestartFailed:e}){const[t,r]=S.useState(0),[s,i]=S.useState("restarting"),[l,c]=S.useState(0),[u,h]=S.useState(0);S.useEffect(()=>{const x=setInterval(()=>{r(O=>O>=90?O:O+1)},200),v=setInterval(()=>{c(O=>O+1)},1e3),b=setTimeout(()=>{i("checking"),m()},3e3);return()=>{clearInterval(x),clearInterval(v),clearTimeout(b)}},[]);const m=()=>{const v=async()=>{try{if(h(O=>O+1),(await fetch("/api/webui/system/status",{method:"GET",headers:{"Content-Type":"application/json"},signal:AbortSignal.timeout(3e3)})).ok)r(100),i("success"),setTimeout(()=>{n?.()},1500);else throw new Error("Status check failed")}catch{u<60?setTimeout(v,2e3):(i("failed"),e?.())}};v()},p=x=>{const v=Math.floor(x/60),b=x%60;return`${v}:${b.toString().padStart(2,"0")}`};return a.jsx("div",{className:"fixed inset-0 bg-background/95 backdrop-blur-sm z-50 flex items-center justify-center",children:a.jsxs("div",{className:"max-w-md w-full mx-4 space-y-8",children:[a.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[s==="restarting"&&a.jsxs(a.Fragment,{children:[a.jsx(ff,{className:"h-16 w-16 text-primary animate-spin"}),a.jsx("h2",{className:"text-2xl font-bold",children:"正在重启麦麦"}),a.jsx("p",{className:"text-muted-foreground text-center",children:"请稍候,麦麦正在重启中..."})]}),s==="checking"&&a.jsxs(a.Fragment,{children:[a.jsx(ff,{className:"h-16 w-16 text-primary animate-spin"}),a.jsx("h2",{className:"text-2xl font-bold",children:"检查服务状态"}),a.jsxs("p",{className:"text-muted-foreground text-center",children:["等待服务恢复... (尝试 ",u,"/60)"]})]}),s==="success"&&a.jsxs(a.Fragment,{children:[a.jsx(ua,{className:"h-16 w-16 text-green-500"}),a.jsx("h2",{className:"text-2xl font-bold",children:"重启成功"}),a.jsx("p",{className:"text-muted-foreground text-center",children:"正在跳转到登录页面..."})]}),s==="failed"&&a.jsxs(a.Fragment,{children:[a.jsx(xc,{className:"h-16 w-16 text-destructive"}),a.jsx("h2",{className:"text-2xl font-bold",children:"重启超时"}),a.jsx("p",{className:"text-muted-foreground text-center",children:"服务未能在预期时间内恢复,请手动检查或刷新页面"})]})]}),s!=="failed"&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(r0,{value:t,className:"h-2"}),a.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[a.jsxs("span",{children:[t,"%"]}),a.jsxs("span",{children:["已用时: ",p(l)]})]})]}),a.jsx("div",{className:"bg-muted/50 rounded-lg p-4 space-y-2",children:a.jsxs("p",{className:"text-sm text-muted-foreground",children:[s==="restarting"&&"🔄 配置已保存,正在重启主程序...",s==="checking"&&"⏳ 正在等待服务恢复,请勿关闭页面...",s==="success"&&"✅ 配置已生效,服务运行正常",s==="failed"&&"⚠️ 如果长时间无响应,请尝试手动重启"]})}),s==="failed"&&a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{onClick:()=>window.location.reload(),className:"flex-1 px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90",children:"刷新页面"}),a.jsx("button",{onClick:()=>{i("checking"),h(0),m()},className:"flex-1 px-4 py-2 bg-secondary text-secondary-foreground rounded-md hover:bg-secondary/90",children:"重试检测"})]})]})})}let p2=[],jM=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?jM:p2).push(t=t+n[e])})();function WU(n){if(n<768)return!1;for(let e=0,t=p2.length;;){let r=e+t>>1;if(n<p2[r])t=r;else if(n>=jM[r])e=r+1;else return!0;if(e==t)return!1}}function Zk(n){return n>=127462&&n<=127487}const Jk=8205;function GU(n,e,t=!0,r=!0){return(t?NM:XU)(n,e,r)}function NM(n,e,t){if(e==n.length)return e;e&&CM(n.charCodeAt(e))&&TM(n.charCodeAt(e-1))&&e--;let r=Ty(n,e);for(e+=ej(r);e<n.length;){let s=Ty(n,e);if(r==Jk||s==Jk||t&&WU(s))e+=ej(s),r=s;else if(Zk(s)){let i=0,l=e-2;for(;l>=0&&Zk(Ty(n,l));)i++,l-=2;if(i%2==0)break;e+=2}else break}return e}function XU(n,e,t){for(;e>0;){let r=NM(n,e-2,t);if(r<e)return r;e--}return 0}function Ty(n,e){let t=n.charCodeAt(e);if(!TM(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return CM(r)?(t-55296<<10)+(r-56320)+65536:t}function CM(n){return n>=56320&&n<57344}function TM(n){return n>=55296&&n<56320}function ej(n){return n<65536?1:2}class Wt{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,r){[e,t]=ud(this,e,t);let s=[];return this.decompose(0,e,s,2),r.length&&r.decompose(0,r.length,s,3),this.decompose(t,this.length,s,1),Xp.from(s,this.length-(t-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=ud(this,e,t);let r=[];return this.decompose(e,t,r,0),Xp.from(r,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),s=new Jh(this),i=new Jh(e);for(let l=t,c=t;;){if(s.next(l),i.next(l),l=0,s.lineBreak!=i.lineBreak||s.done!=i.done||s.value!=i.value)return!1;if(c+=s.value.length,s.done||c>=r)return!0}}iter(e=1){return new Jh(this,e)}iterRange(e,t=this.length){return new MM(this,e,t)}iterLines(e,t){let r;if(e==null)r=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;r=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new AM(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Wt.empty:e.length<=32?new ir(e):Xp.from(ir.split(e,[]))}}class ir extends Wt{constructor(e,t=YU(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,r,s){for(let i=0;;i++){let l=this.text[i],c=s+l.length;if((t?r:c)>=e)return new KU(s,c,r,l);s=c+1,r++}}decompose(e,t,r,s){let i=e<=0&&t>=this.length?this:new ir(tj(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let l=r.pop(),c=Yp(i.text,l.text.slice(),0,i.length);if(c.length<=32)r.push(new ir(c,l.length+i.length));else{let u=c.length>>1;r.push(new ir(c.slice(0,u)),new ir(c.slice(u)))}}else r.push(i)}replace(e,t,r){if(!(r instanceof ir))return super.replace(e,t,r);[e,t]=ud(this,e,t);let s=Yp(this.text,Yp(r.text,tj(this.text,0,e)),t),i=this.length+r.length-(t-e);return s.length<=32?new ir(s,i):Xp.from(ir.split(s,[]),i)}sliceString(e,t=this.length,r=`
|
||
`){[e,t]=ud(this,e,t);let s="";for(let i=0,l=0;i<=t&&l<this.text.length;l++){let c=this.text[l],u=i+c.length;i>e&&l&&(s+=r),e<u&&t>i&&(s+=c.slice(Math.max(0,e-i),t-i)),i=u+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let r=[],s=-1;for(let i of e)r.push(i),s+=i.length+1,r.length==32&&(t.push(new ir(r,s)),r=[],s=-1);return s>-1&&t.push(new ir(r,s)),t}}let Xp=class Ru extends Wt{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,t,r,s){for(let i=0;;i++){let l=this.children[i],c=s+l.length,u=r+l.lines-1;if((t?u:c)>=e)return l.lineInner(e,t,r,s);s=c+1,r=u+1}}decompose(e,t,r,s){for(let i=0,l=0;l<=t&&i<this.children.length;i++){let c=this.children[i],u=l+c.length;if(e<=u&&t>=l){let h=s&((l<=e?1:0)|(u>=t?2:0));l>=e&&u<=t&&!h?r.push(c):c.decompose(e-l,t-l,r,h)}l=u+1}}replace(e,t,r){if([e,t]=ud(this,e,t),r.lines<this.lines)for(let s=0,i=0;s<this.children.length;s++){let l=this.children[s],c=i+l.length;if(e>=i&&t<=c){let u=l.replace(e-i,t-i,r),h=this.lines-l.lines+u.lines;if(u.lines<h>>4&&u.lines>h>>6){let m=this.children.slice();return m[s]=u,new Ru(m,this.length-(t-e)+r.length)}return super.replace(i,c,u)}i=c+1}return super.replace(e,t,r)}sliceString(e,t=this.length,r=`
|
||
`){[e,t]=ud(this,e,t);let s="";for(let i=0,l=0;i<this.children.length&&l<=t;i++){let c=this.children[i],u=l+c.length;l>e&&i&&(s+=r),e<u&&t>l&&(s+=c.sliceString(e-l,t-l,r)),l=u+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Ru))return 0;let r=0,[s,i,l,c]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,i+=t){if(s==l||i==c)return r;let u=this.children[s],h=e.children[i];if(u!=h)return r+u.scanIdentical(h,t);r+=u.length+1}}static from(e,t=e.reduce((r,s)=>r+s.length+1,-1)){let r=0;for(let v of e)r+=v.lines;if(r<32){let v=[];for(let b of e)b.flatten(v);return new ir(v,t)}let s=Math.max(32,r>>5),i=s<<1,l=s>>1,c=[],u=0,h=-1,m=[];function p(v){let b;if(v.lines>i&&v instanceof Ru)for(let O of v.children)p(O);else v.lines>l&&(u>l||!u)?(x(),c.push(v)):v instanceof ir&&u&&(b=m[m.length-1])instanceof ir&&v.lines+b.lines<=32?(u+=v.lines,h+=v.length+1,m[m.length-1]=new ir(b.text.concat(v.text),b.length+1+v.length)):(u+v.lines>s&&x(),u+=v.lines,h+=v.length+1,m.push(v))}function x(){u!=0&&(c.push(m.length==1?m[0]:Ru.from(m,h)),h=-1,u=m.length=0)}for(let v of e)p(v);return x(),c.length==1?c[0]:new Ru(c,t)}};Wt.empty=new ir([""],0);function YU(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Yp(n,e,t=0,r=1e9){for(let s=0,i=0,l=!0;i<n.length&&s<=r;i++){let c=n[i],u=s+c.length;u>=t&&(u>r&&(c=c.slice(0,r-s)),s<t&&(c=c.slice(t-s)),l?(e[e.length-1]+=c,l=!1):e.push(c)),s=u+1}return e}function tj(n,e,t){return Yp(n,[""],e,t)}class Jh{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof ir?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,s=this.nodes[r],i=this.offsets[r],l=i>>1,c=s instanceof ir?s.text.length:s.children.length;if(l==(t>0?c:0)){if(r==0)return this.done=!0,this.value="",this;t>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[r]+=t,e==0)return this.lineBreak=!0,this.value=`
|
||
`,this;e--}else if(s instanceof ir){let u=s.text[l+(t<0?-1:0)];if(this.offsets[r]+=t,u.length>Math.max(0,e))return this.value=e==0?u:t>0?u.slice(e):u.slice(0,u.length-e),this;e-=u.length}else{let u=s.children[l+(t<0?-1:0)];e>u.length?(e-=u.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,this.nodes.push(u),this.offsets.push(t>0?1:(u instanceof ir?u.text.length:u.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class MM{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new Jh(e,t>r?-1:1),this.pos=t>r?e.length:0,this.from=Math.min(t,r),this.to=Math.max(t,r)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let r=t<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=r?s:t<0?s.slice(s.length-r):s.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class AM{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:r,value:s}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Wt.prototype[Symbol.iterator]=function(){return this.iter()},Jh.prototype[Symbol.iterator]=MM.prototype[Symbol.iterator]=AM.prototype[Symbol.iterator]=function(){return this});class KU{constructor(e,t,r,s){this.from=e,this.to=t,this.number=r,this.text=s}get length(){return this.to-this.from}}function ud(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function Vr(n,e,t=!0,r=!0){return GU(n,e,t,r)}function ZU(n){return n>=56320&&n<57344}function JU(n){return n>=55296&&n<56320}function Ms(n,e){let t=n.charCodeAt(e);if(!JU(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return ZU(r)?(t-55296<<10)+(r-56320)+65536:t}function ww(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function aa(n){return n<65536?1:2}const g2=/\r\n?|\n/;var Ur=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(Ur||(Ur={}));class xa{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let r=this.sections[t+1];e+=r<0?this.sections[t]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,r=0,s=0;t<this.sections.length;){let i=this.sections[t++],l=this.sections[t++];l<0?(e(r,s,i),s+=i):s+=l,r+=i}}iterChangedRanges(e,t=!1){x2(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let r=this.sections[t++],s=this.sections[t++];s<0?e.push(r,s):e.push(s,r)}return new xa(e)}composeDesc(e){return this.empty?e:e.empty?this:EM(this,e)}mapDesc(e,t=!1){return e.empty?this:v2(this,e,t)}mapPos(e,t=-1,r=Ur.Simple){let s=0,i=0;for(let l=0;l<this.sections.length;){let c=this.sections[l++],u=this.sections[l++],h=s+c;if(u<0){if(h>e)return i+(e-s);i+=c}else{if(r!=Ur.Simple&&h>=e&&(r==Ur.TrackDel&&s<e&&h>e||r==Ur.TrackBefore&&s<e||r==Ur.TrackAfter&&h>e))return null;if(h>e||h==e&&t<0&&!c)return e==s||t<0?i:i+u;i+=u}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return i}touchesRange(e,t=e){for(let r=0,s=0;r<this.sections.length&&s<=t;){let i=this.sections[r++],l=this.sections[r++],c=s+i;if(l>=0&&s<=t&&c>=e)return s<e&&c>t?"cover":!0;s=c}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let r=this.sections[t++],s=this.sections[t++];e+=(e?" ":"")+r+(s>=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new xa(e)}static create(e){return new xa(e)}}class Or extends xa{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return x2(this,(t,r,s,i,l)=>e=e.replace(s,s+(r-t),l),!1),e}mapDesc(e,t=!1){return v2(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let s=0,i=0;s<t.length;s+=2){let l=t[s],c=t[s+1];if(c>=0){t[s]=c,t[s+1]=l;let u=s>>1;for(;r.length<u;)r.push(Wt.empty);r.push(l?e.slice(i,i+l):Wt.empty)}i+=l}return new Or(t,r)}compose(e){return this.empty?e:e.empty?this:EM(this,e,!0)}map(e,t=!1){return e.empty?this:v2(this,e,t,!0)}iterChanges(e,t=!1){x2(this,e,t)}get desc(){return xa.create(this.sections)}filter(e){let t=[],r=[],s=[],i=new gf(this);e:for(let l=0,c=0;;){let u=l==e.length?1e9:e[l++];for(;c<u||c==u&&i.len==0;){if(i.done)break e;let m=Math.min(i.len,u-c);Jr(s,m,-1);let p=i.ins==-1?-1:i.off==0?i.ins:0;Jr(t,m,p),p>0&&no(r,t,i.text),i.forward(m),c+=m}let h=e[l++];for(;c<h;){if(i.done)break e;let m=Math.min(i.len,h-c);Jr(t,m,-1),Jr(s,m,i.ins==-1?-1:i.off==0?i.ins:0),i.forward(m),c+=m}}return{changes:new Or(t,r),filtered:xa.create(s)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let r=this.sections[t],s=this.sections[t+1];s<0?e.push(r):s==0?e.push([r]):e.push([r].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,r){let s=[],i=[],l=0,c=null;function u(m=!1){if(!m&&!s.length)return;l<t&&Jr(s,t-l,-1);let p=new Or(s,i);c=c?c.compose(p.map(c)):p,s=[],i=[],l=0}function h(m){if(Array.isArray(m))for(let p of m)h(p);else if(m instanceof Or){if(m.length!=t)throw new RangeError(`Mismatched change set length (got ${m.length}, expected ${t})`);u(),c=c?c.compose(m.map(c)):m}else{let{from:p,to:x=p,insert:v}=m;if(p>x||p<0||x>t)throw new RangeError(`Invalid change range ${p} to ${x} (in doc of length ${t})`);let b=v?typeof v=="string"?Wt.of(v.split(r||g2)):v:Wt.empty,O=b.length;if(p==x&&O==0)return;p<l&&u(),p>l&&Jr(s,p-l,-1),Jr(s,x-p,O),no(i,s,b),l=x}}return h(e),u(!c),c}static empty(e){return new Or(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],r=[];for(let s=0;s<e.length;s++){let i=e[s];if(typeof i=="number")t.push(i,-1);else{if(!Array.isArray(i)||typeof i[0]!="number"||i.some((l,c)=>c&&typeof l!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(i.length==1)t.push(i[0],0);else{for(;r.length<s;)r.push(Wt.empty);r[s]=Wt.of(i.slice(1)),t.push(i[0],r[s].length)}}}return new Or(t,r)}static createSet(e,t){return new Or(e,t)}}function Jr(n,e,t,r=!1){if(e==0&&t<=0)return;let s=n.length-2;s>=0&&t<=0&&t==n[s+1]?n[s]+=e:s>=0&&e==0&&n[s]==0?n[s+1]+=t:r?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function no(n,e,t){if(t.length==0)return;let r=e.length-2>>1;if(r<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<r;)n.push(Wt.empty);n.push(t)}}function x2(n,e,t){let r=n.inserted;for(let s=0,i=0,l=0;l<n.sections.length;){let c=n.sections[l++],u=n.sections[l++];if(u<0)s+=c,i+=c;else{let h=s,m=i,p=Wt.empty;for(;h+=c,m+=u,u&&r&&(p=p.append(r[l-2>>1])),!(t||l==n.sections.length||n.sections[l+1]<0);)c=n.sections[l++],u=n.sections[l++];e(s,h,i,m,p),s=h,i=m}}}function v2(n,e,t,r=!1){let s=[],i=r?[]:null,l=new gf(n),c=new gf(e);for(let u=-1;;){if(l.done&&c.len||c.done&&l.len)throw new Error("Mismatched change set lengths");if(l.ins==-1&&c.ins==-1){let h=Math.min(l.len,c.len);Jr(s,h,-1),l.forward(h),c.forward(h)}else if(c.ins>=0&&(l.ins<0||u==l.i||l.off==0&&(c.len<l.len||c.len==l.len&&!t))){let h=c.len;for(Jr(s,c.ins,-1);h;){let m=Math.min(l.len,h);l.ins>=0&&u<l.i&&l.len<=m&&(Jr(s,0,l.ins),i&&no(i,s,l.text),u=l.i),l.forward(m),h-=m}c.next()}else if(l.ins>=0){let h=0,m=l.len;for(;m;)if(c.ins==-1){let p=Math.min(m,c.len);h+=p,m-=p,c.forward(p)}else if(c.ins==0&&c.len<m)m-=c.len,c.next();else break;Jr(s,h,u<l.i?l.ins:0),i&&u<l.i&&no(i,s,l.text),u=l.i,l.forward(l.len-m)}else{if(l.done&&c.done)return i?Or.createSet(s,i):xa.create(s);throw new Error("Mismatched change set lengths")}}}function EM(n,e,t=!1){let r=[],s=t?[]:null,i=new gf(n),l=new gf(e);for(let c=!1;;){if(i.done&&l.done)return s?Or.createSet(r,s):xa.create(r);if(i.ins==0)Jr(r,i.len,0,c),i.next();else if(l.len==0&&!l.done)Jr(r,0,l.ins,c),s&&no(s,r,l.text),l.next();else{if(i.done||l.done)throw new Error("Mismatched change set lengths");{let u=Math.min(i.len2,l.len),h=r.length;if(i.ins==-1){let m=l.ins==-1?-1:l.off?0:l.ins;Jr(r,u,m,c),s&&m&&no(s,r,l.text)}else l.ins==-1?(Jr(r,i.off?0:i.len,u,c),s&&no(s,r,i.textBit(u))):(Jr(r,i.off?0:i.len,l.off?0:l.ins,c),s&&!l.off&&no(s,r,l.text));c=(i.ins>u||l.ins>=0&&l.len>u)&&(c||r.length>h),i.forward2(u),l.forward(u)}}}}class gf{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?Wt.empty:e[t]}textBit(e){let{inserted:t}=this.set,r=this.i-2>>1;return r>=t.length&&!e?Wt.empty:t[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class ac{constructor(e,t,r){this.from=e,this.to=t,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let r,s;return this.empty?r=s=e.mapPos(this.from,t):(r=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),r==this.from&&s==this.to?this:new ac(r,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return Ce.range(e,t);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Ce.range(this.anchor,r)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Ce.range(e.anchor,e.head)}static create(e,t,r){return new ac(e,t,r)}}class Ce{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:Ce.create(this.ranges.map(r=>r.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Ce([this.main],0)}addRange(e,t=!0){return Ce.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let r=this.ranges.slice();return r[t]=e,Ce.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Ce(e.ranges.map(t=>ac.fromJSON(t)),e.main)}static single(e,t=e){return new Ce([Ce.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,s=0;s<e.length;s++){let i=e[s];if(i.empty?i.from<=r:i.from<r)return Ce.normalized(e.slice(),t);r=i.to}return new Ce(e,t)}static cursor(e,t=0,r,s){return ac.create(e,e,(t==0?0:t<0?8:16)|(r==null?7:Math.min(6,r))|(s??16777215)<<6)}static range(e,t,r,s){let i=(r??16777215)<<6|(s==null?7:Math.min(6,s));return t<e?ac.create(t,e,48|i):ac.create(e,t,(t>e?8:0)|i)}static normalized(e,t=0){let r=e[t];e.sort((s,i)=>s.from-i.from),t=e.indexOf(r);for(let s=1;s<e.length;s++){let i=e[s],l=e[s-1];if(i.empty?i.from<=l.to:i.from<l.to){let c=l.from,u=Math.max(i.to,l.to);s<=t&&t--,e.splice(--s,2,i.anchor>i.head?Ce.range(u,c):Ce.range(c,u))}}return new Ce(e,t)}}function _M(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Sw=0;class He{constructor(e,t,r,s,i){this.combine=e,this.compareInput=t,this.compare=r,this.isStatic=s,this.id=Sw++,this.default=e([]),this.extensions=typeof i=="function"?i(this):i}get reader(){return this}static define(e={}){return new He(e.combine||(t=>t),e.compareInput||((t,r)=>t===r),e.compare||(e.combine?(t,r)=>t===r:Ow),!!e.static,e.enables)}of(e){return new Kp([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Kp(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Kp(e,this,2,t)}from(e,t){return t||(t=r=>r),this.compute([e],r=>t(r.field(e)))}}function Ow(n,e){return n==e||n.length==e.length&&n.every((t,r)=>t===e[r])}class Kp{constructor(e,t,r,s){this.dependencies=e,this.facet=t,this.type=r,this.value=s,this.id=Sw++}dynamicSlot(e){var t;let r=this.value,s=this.facet.compareInput,i=this.id,l=e[i]>>1,c=this.type==2,u=!1,h=!1,m=[];for(let p of this.dependencies)p=="doc"?u=!0:p=="selection"?h=!0:(((t=e[p.id])!==null&&t!==void 0?t:1)&1)==0&&m.push(e[p.id]);return{create(p){return p.values[l]=r(p),1},update(p,x){if(u&&x.docChanged||h&&(x.docChanged||x.selection)||y2(p,m)){let v=r(p);if(c?!nj(v,p.values[l],s):!s(v,p.values[l]))return p.values[l]=v,1}return 0},reconfigure:(p,x)=>{let v,b=x.config.address[i];if(b!=null){let O=kg(x,b);if(this.dependencies.every(k=>k instanceof He?x.facet(k)===p.facet(k):k instanceof Lr?x.field(k,!1)==p.field(k,!1):!0)||(c?nj(v=r(p),O,s):s(v=r(p),O)))return p.values[l]=O,0}else v=r(p);return p.values[l]=v,1}}}}function nj(n,e,t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!t(n[r],e[r]))return!1;return!0}function y2(n,e){let t=!1;for(let r of e)ef(n,r)&1&&(t=!0);return t}function eV(n,e,t){let r=t.map(u=>n[u.id]),s=t.map(u=>u.type),i=r.filter(u=>!(u&1)),l=n[e.id]>>1;function c(u){let h=[];for(let m=0;m<r.length;m++){let p=kg(u,r[m]);if(s[m]==2)for(let x of p)h.push(x);else h.push(p)}return e.combine(h)}return{create(u){for(let h of r)ef(u,h);return u.values[l]=c(u),1},update(u,h){if(!y2(u,i))return 0;let m=c(u);return e.compare(m,u.values[l])?0:(u.values[l]=m,1)},reconfigure(u,h){let m=y2(u,r),p=h.config.facets[e.id],x=h.facet(e);if(p&&!m&&Ow(t,p))return u.values[l]=x,0;let v=c(u);return e.compare(v,x)?(u.values[l]=x,0):(u.values[l]=v,1)}}}const Jm=He.define({static:!0});class Lr{constructor(e,t,r,s,i){this.id=e,this.createF=t,this.updateF=r,this.compareF=s,this.spec=i,this.provides=void 0}static define(e){let t=new Lr(Sw++,e.create,e.update,e.compare||((r,s)=>r===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Jm).find(r=>r.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:r=>(r.values[t]=this.create(r),1),update:(r,s)=>{let i=r.values[t],l=this.updateF(i,s);return this.compareF(i,l)?0:(r.values[t]=l,1)},reconfigure:(r,s)=>{let i=r.facet(Jm),l=s.facet(Jm),c;return(c=i.find(u=>u.field==this))&&c!=l.find(u=>u.field==this)?(r.values[t]=c.create(r),1):s.config.address[this.id]!=null?(r.values[t]=s.field(this),0):(r.values[t]=this.create(r),1)}}}init(e){return[this,Jm.of({field:this,create:e})]}get extension(){return this}}const rc={lowest:4,low:3,default:2,high:1,highest:0};function Dh(n){return e=>new DM(e,n)}const jo={highest:Dh(rc.highest),high:Dh(rc.high),default:Dh(rc.default),low:Dh(rc.low),lowest:Dh(rc.lowest)};class DM{constructor(e,t){this.inner=e,this.prec=t}}class Sx{of(e){return new b2(this,e)}reconfigure(e){return Sx.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class b2{constructor(e,t){this.compartment=e,this.inner=t}}class Og{constructor(e,t,r,s,i,l){for(this.base=e,this.compartments=t,this.dynamicSlots=r,this.address=s,this.staticValues=i,this.facets=l,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,r){let s=[],i=Object.create(null),l=new Map;for(let x of tV(e,t,l))x instanceof Lr?s.push(x):(i[x.facet.id]||(i[x.facet.id]=[])).push(x);let c=Object.create(null),u=[],h=[];for(let x of s)c[x.id]=h.length<<1,h.push(v=>x.slot(v));let m=r?.config.facets;for(let x in i){let v=i[x],b=v[0].facet,O=m&&m[x]||[];if(v.every(k=>k.type==0))if(c[b.id]=u.length<<1|1,Ow(O,v))u.push(r.facet(b));else{let k=b.combine(v.map(j=>j.value));u.push(r&&b.compare(k,r.facet(b))?r.facet(b):k)}else{for(let k of v)k.type==0?(c[k.id]=u.length<<1|1,u.push(k.value)):(c[k.id]=h.length<<1,h.push(j=>k.dynamicSlot(j)));c[b.id]=h.length<<1,h.push(k=>eV(k,b,v))}}let p=h.map(x=>x(c));return new Og(e,l,p,c,u,i)}}function tV(n,e,t){let r=[[],[],[],[],[]],s=new Map;function i(l,c){let u=s.get(l);if(u!=null){if(u<=c)return;let h=r[u].indexOf(l);h>-1&&r[u].splice(h,1),l instanceof b2&&t.delete(l.compartment)}if(s.set(l,c),Array.isArray(l))for(let h of l)i(h,c);else if(l instanceof b2){if(t.has(l.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(l.compartment)||l.inner;t.set(l.compartment,h),i(h,c)}else if(l instanceof DM)i(l.inner,l.prec);else if(l instanceof Lr)r[c].push(l),l.provides&&i(l.provides,c);else if(l instanceof Kp)r[c].push(l),l.facet.extensions&&i(l.facet.extensions,rc.default);else{let h=l.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${l}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);i(h,c)}}return i(n,rc.default),r.reduce((l,c)=>l.concat(c))}function ef(n,e){if(e&1)return 2;let t=e>>1,r=n.status[t];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function kg(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const RM=He.define(),w2=He.define({combine:n=>n.some(e=>e),static:!0}),zM=He.define({combine:n=>n.length?n[0]:void 0,static:!0}),PM=He.define(),LM=He.define(),BM=He.define(),IM=He.define({combine:n=>n.length?n[0]:!1});class Sa{constructor(e,t){this.type=e,this.value=t}static define(){return new nV}}class nV{of(e){return new Sa(this,e)}}class rV{constructor(e){this.map=e}of(e){return new xt(this,e)}}class xt{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new xt(this.type,t)}is(e){return this.type==e}static define(e={}){return new rV(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let r=[];for(let s of e){let i=s.map(t);i&&r.push(i)}return r}}xt.reconfigure=xt.define();xt.appendConfig=xt.define();class gr{constructor(e,t,r,s,i,l){this.startState=e,this.changes=t,this.selection=r,this.effects=s,this.annotations=i,this.scrollIntoView=l,this._doc=null,this._state=null,r&&_M(r,t.newLength),i.some(c=>c.type==gr.time)||(this.annotations=i.concat(gr.time.of(Date.now())))}static create(e,t,r,s,i,l){return new gr(e,t,r,s,i,l)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(gr.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}gr.time=Sa.define();gr.userEvent=Sa.define();gr.addToHistory=Sa.define();gr.remote=Sa.define();function sV(n,e){let t=[];for(let r=0,s=0;;){let i,l;if(r<n.length&&(s==e.length||e[s]>=n[r]))i=n[r++],l=n[r++];else if(s<e.length)i=e[s++],l=e[s++];else return t;!t.length||t[t.length-1]<i?t.push(i,l):t[t.length-1]<l&&(t[t.length-1]=l)}}function FM(n,e,t){var r;let s,i,l;return t?(s=e.changes,i=Or.empty(e.changes.length),l=n.changes.compose(e.changes)):(s=e.changes.map(n.changes),i=n.changes.mapDesc(e.changes,!0),l=n.changes.compose(s)),{changes:l,selection:e.selection?e.selection.map(i):(r=n.selection)===null||r===void 0?void 0:r.map(s),effects:xt.mapEffects(n.effects,s).concat(xt.mapEffects(e.effects,i)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function S2(n,e,t){let r=e.selection,s=Gu(e.annotations);return e.userEvent&&(s=s.concat(gr.userEvent.of(e.userEvent))),{changes:e.changes instanceof Or?e.changes:Or.of(e.changes||[],t,n.facet(zM)),selection:r&&(r instanceof Ce?r:Ce.single(r.anchor,r.head)),effects:Gu(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function qM(n,e,t){let r=S2(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let i=1;i<e.length;i++){e[i].filter===!1&&(t=!1);let l=!!e[i].sequential;r=FM(r,S2(n,e[i],l?r.changes.newLength:n.doc.length),l)}let s=gr.create(n,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return aV(t?iV(s):s)}function iV(n){let e=n.startState,t=!0;for(let s of e.facet(PM)){let i=s(n);if(i===!1){t=!1;break}Array.isArray(i)&&(t=t===!0?i:sV(t,i))}if(t!==!0){let s,i;if(t===!1)i=n.changes.invertedDesc,s=Or.empty(e.doc.length);else{let l=n.changes.filter(t);s=l.changes,i=l.filtered.mapDesc(l.changes).invertedDesc}n=gr.create(e,s,n.selection&&n.selection.map(i),xt.mapEffects(n.effects,i),n.annotations,n.scrollIntoView)}let r=e.facet(LM);for(let s=r.length-1;s>=0;s--){let i=r[s](n);i instanceof gr?n=i:Array.isArray(i)&&i.length==1&&i[0]instanceof gr?n=i[0]:n=qM(e,Gu(i),!1)}return n}function aV(n){let e=n.startState,t=e.facet(BM),r=n;for(let s=t.length-1;s>=0;s--){let i=t[s](n);i&&Object.keys(i).length&&(r=FM(r,S2(e,i,n.changes.newLength),!0))}return r==n?n:gr.create(e,n.changes,n.selection,r.effects,r.annotations,r.scrollIntoView)}const lV=[];function Gu(n){return n==null?lV:Array.isArray(n)?n:[n]}var Vn=(function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n})(Vn||(Vn={}));const oV=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let O2;try{O2=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function cV(n){if(O2)return O2.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||oV.test(t)))return!0}return!1}function uV(n){return e=>{if(!/\S/.test(e))return Vn.Space;if(cV(e))return Vn.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return Vn.Word;return Vn.Other}}class Vt{constructor(e,t,r,s,i,l){this.config=e,this.doc=t,this.selection=r,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=i,l&&(l._state=this);for(let c=0;c<this.config.dynamicSlots.length;c++)ef(this,c<<1);this.computeSlot=null}field(e,t=!0){let r=this.config.address[e.id];if(r==null){if(t)throw new RangeError("Field is not present in this state");return}return ef(this,r),kg(this,r)}update(...e){return qM(this,e,!0)}applyTransaction(e){let t=this.config,{base:r,compartments:s}=t;for(let c of e.effects)c.is(Sx.reconfigure)?(t&&(s=new Map,t.compartments.forEach((u,h)=>s.set(h,u)),t=null),s.set(c.value.compartment,c.value.extension)):c.is(xt.reconfigure)?(t=null,r=c.value):c.is(xt.appendConfig)&&(t=null,r=Gu(r).concat(c.value));let i;t?i=e.startState.values.slice():(t=Og.resolve(r,s,this),i=new Vt(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(u,h)=>h.reconfigure(u,this),null).values);let l=e.startState.facet(w2)?e.newSelection:e.newSelection.asSingle();new Vt(t,e.newDoc,l,i,(c,u)=>u.update(c,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:Ce.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,r=e(t.ranges[0]),s=this.changes(r.changes),i=[r.range],l=Gu(r.effects);for(let c=1;c<t.ranges.length;c++){let u=e(t.ranges[c]),h=this.changes(u.changes),m=h.map(s);for(let x=0;x<c;x++)i[x]=i[x].map(m);let p=s.mapDesc(h,!0);i.push(u.range.map(p)),s=s.compose(m),l=xt.mapEffects(l,m).concat(xt.mapEffects(Gu(u.effects),p))}return{changes:s,selection:Ce.create(i,t.mainIndex),effects:l}}changes(e=[]){return e instanceof Or?e:Or.of(e,this.doc.length,this.facet(Vt.lineSeparator))}toText(e){return Wt.of(e.split(this.facet(Vt.lineSeparator)||g2))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(ef(this,t),kg(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let s=e[r];s instanceof Lr&&this.config.address[s.id]!=null&&(t[r]=s.spec.toJSON(this.field(e[r]),this))}return t}static fromJSON(e,t={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let s=[];if(r){for(let i in r)if(Object.prototype.hasOwnProperty.call(e,i)){let l=r[i],c=e[i];s.push(l.init(u=>l.spec.fromJSON(c,u)))}}return Vt.create({doc:e.doc,selection:Ce.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=Og.resolve(e.extensions||[],new Map),r=e.doc instanceof Wt?e.doc:Wt.of((e.doc||"").split(t.staticFacet(Vt.lineSeparator)||g2)),s=e.selection?e.selection instanceof Ce?e.selection:Ce.single(e.selection.anchor,e.selection.head):Ce.single(0);return _M(s,r.length),t.staticFacet(w2)||(s=s.asSingle()),new Vt(t,r,s,t.dynamicSlots.map(()=>null),(i,l)=>l.create(i),null)}get tabSize(){return this.facet(Vt.tabSize)}get lineBreak(){return this.facet(Vt.lineSeparator)||`
|
||
`}get readOnly(){return this.facet(IM)}phrase(e,...t){for(let r of this.facet(Vt.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(r,s)=>{if(s=="$")return"$";let i=+(s||1);return!i||i>t.length?r:t[i-1]})),e}languageDataAt(e,t,r=-1){let s=[];for(let i of this.facet(RM))for(let l of i(this,t,r))Object.prototype.hasOwnProperty.call(l,e)&&s.push(l[e]);return s}charCategorizer(e){return uV(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:r,length:s}=this.doc.lineAt(e),i=this.charCategorizer(e),l=e-r,c=e-r;for(;l>0;){let u=Vr(t,l,!1);if(i(t.slice(u,l))!=Vn.Word)break;l=u}for(;c<s;){let u=Vr(t,c);if(i(t.slice(c,u))!=Vn.Word)break;c=u}return l==c?null:Ce.range(l+r,c+r)}}Vt.allowMultipleSelections=w2;Vt.tabSize=He.define({combine:n=>n.length?n[0]:4});Vt.lineSeparator=zM;Vt.readOnly=IM;Vt.phrases=He.define({compare(n,e){let t=Object.keys(n),r=Object.keys(e);return t.length==r.length&&t.every(s=>n[s]==e[s])}});Vt.languageData=RM;Vt.changeFilter=PM;Vt.transactionFilter=LM;Vt.transactionExtender=BM;Sx.reconfigure=xt.define();function Oa(n,e,t={}){let r={};for(let s of n)for(let i of Object.keys(s)){let l=s[i],c=r[i];if(c===void 0)r[i]=l;else if(!(c===l||l===void 0))if(Object.hasOwnProperty.call(t,i))r[i]=t[i](c,l);else throw new Error("Config merge conflict for field "+i)}for(let s in e)r[s]===void 0&&(r[s]=e[s]);return r}class yc{eq(e){return this==e}range(e,t=e){return k2.create(e,t,this)}}yc.prototype.startSide=yc.prototype.endSide=0;yc.prototype.point=!1;yc.prototype.mapMode=Ur.TrackDel;let k2=class QM{constructor(e,t,r){this.from=e,this.to=t,this.value=r}static create(e,t,r){return new QM(e,t,r)}};function j2(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class kw{constructor(e,t,r,s){this.from=e,this.to=t,this.value=r,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,r,s=0){let i=r?this.to:this.from;for(let l=s,c=i.length;;){if(l==c)return l;let u=l+c>>1,h=i[u]-e||(r?this.value[u].endSide:this.value[u].startSide)-t;if(u==l)return h>=0?l:c;h>=0?c=u:l=u+1}}between(e,t,r,s){for(let i=this.findIndex(t,-1e9,!0),l=this.findIndex(r,1e9,!1,i);i<l;i++)if(s(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(e,t){let r=[],s=[],i=[],l=-1,c=-1;for(let u=0;u<this.value.length;u++){let h=this.value[u],m=this.from[u]+e,p=this.to[u]+e,x,v;if(m==p){let b=t.mapPos(m,h.startSide,h.mapMode);if(b==null||(x=v=b,h.startSide!=h.endSide&&(v=t.mapPos(m,h.endSide),v<x)))continue}else if(x=t.mapPos(m,h.startSide),v=t.mapPos(p,h.endSide),x>v||x==v&&h.startSide>0&&h.endSide<=0)continue;(v-x||h.endSide-h.startSide)<0||(l<0&&(l=x),h.point&&(c=Math.max(c,v-x)),r.push(h),s.push(x-l),i.push(v-l))}return{mapped:r.length?new kw(s,i,r,c):null,pos:l}}}class Gt{constructor(e,t,r,s){this.chunkPos=e,this.chunk=t,this.nextLayer=r,this.maxPoint=s}static create(e,t,r,s){return new Gt(e,t,r,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:r=!1,filterFrom:s=0,filterTo:i=this.length}=e,l=e.filter;if(t.length==0&&!l)return this;if(r&&(t=t.slice().sort(j2)),this.isEmpty)return t.length?Gt.of(t):this;let c=new $M(this,null,-1).goto(0),u=0,h=[],m=new fl;for(;c.value||u<t.length;)if(u<t.length&&(c.from-t[u].from||c.startSide-t[u].value.startSide)>=0){let p=t[u++];m.addInner(p.from,p.to,p.value)||h.push(p)}else c.rangeIndex==1&&c.chunkIndex<this.chunk.length&&(u==t.length||this.chunkEnd(c.chunkIndex)<t[u].from)&&(!l||s>this.chunkEnd(c.chunkIndex)||i<this.chunkPos[c.chunkIndex])&&m.addChunk(this.chunkPos[c.chunkIndex],this.chunk[c.chunkIndex])?c.nextChunk():((!l||s>c.to||i<c.from||l(c.from,c.to,c.value))&&(m.addInner(c.from,c.to,c.value)||h.push(k2.create(c.from,c.to,c.value))),c.next());return m.finishInner(this.nextLayer.isEmpty&&!h.length?Gt.empty:this.nextLayer.update({add:h,filter:l,filterFrom:s,filterTo:i}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],r=[],s=-1;for(let l=0;l<this.chunk.length;l++){let c=this.chunkPos[l],u=this.chunk[l],h=e.touchesRange(c,c+u.length);if(h===!1)s=Math.max(s,u.maxPoint),t.push(u),r.push(e.mapPos(c));else if(h===!0){let{mapped:m,pos:p}=u.map(c,e);m&&(s=Math.max(s,m.maxPoint),t.push(m),r.push(p))}}let i=this.nextLayer.map(e);return t.length==0?i:new Gt(r,t,i||Gt.empty,s)}between(e,t,r){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let i=this.chunkPos[s],l=this.chunk[s];if(t>=i&&e<=i+l.length&&l.between(i,e-i,t-i,r)===!1)return}this.nextLayer.between(e,t,r)}}iter(e=0){return xf.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return xf.from(e).goto(t)}static compare(e,t,r,s,i=-1){let l=e.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=i),c=t.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=i),u=rj(l,c,r),h=new Rh(l,u,i),m=new Rh(c,u,i);r.iterGaps((p,x,v)=>sj(h,p,m,x,v,s)),r.empty&&r.length==0&&sj(h,0,m,0,0,s)}static eq(e,t,r=0,s){s==null&&(s=999999999);let i=e.filter(m=>!m.isEmpty&&t.indexOf(m)<0),l=t.filter(m=>!m.isEmpty&&e.indexOf(m)<0);if(i.length!=l.length)return!1;if(!i.length)return!0;let c=rj(i,l),u=new Rh(i,c,0).goto(r),h=new Rh(l,c,0).goto(r);for(;;){if(u.to!=h.to||!N2(u.active,h.active)||u.point&&(!h.point||!u.point.eq(h.point)))return!1;if(u.to>s)return!0;u.next(),h.next()}}static spans(e,t,r,s,i=-1){let l=new Rh(e,null,i).goto(t),c=t,u=l.openStart;for(;;){let h=Math.min(l.to,r);if(l.point){let m=l.activeForPoint(l.to),p=l.pointFrom<t?m.length+1:l.point.startSide<0?m.length:Math.min(m.length,u);s.point(c,h,l.point,m,p,l.pointRank),u=Math.min(l.openEnd(h),m.length)}else h>c&&(s.span(c,h,l.active,u),u=l.openEnd(h));if(l.to>r)return u+(l.point&&l.to>r?1:0);c=l.to,l.next()}}static of(e,t=!1){let r=new fl;for(let s of e instanceof k2?[e]:t?dV(e):e)r.add(s.from,s.to,s.value);return r.finish()}static join(e){if(!e.length)return Gt.empty;let t=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let s=e[r];s!=Gt.empty;s=s.nextLayer)t=new Gt(s.chunkPos,s.chunk,t,Math.max(s.maxPoint,t.maxPoint));return t}}Gt.empty=new Gt([],[],null,-1);function dV(n){if(n.length>1)for(let e=n[0],t=1;t<n.length;t++){let r=n[t];if(j2(e,r)>0)return n.slice().sort(j2);e=r}return n}Gt.empty.nextLayer=Gt.empty;class fl{finishChunk(e){this.chunks.push(new kw(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,r){this.addInner(e,t,r)||(this.nextLayer||(this.nextLayer=new fl)).add(e,t,r)}addInner(e,t,r){let s=e-this.lastTo||r.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=t,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let r=t.value.length-1;return this.last=t.value[r],this.lastFrom=t.from[r]+e,this.lastTo=t.to[r]+e,!0}finish(){return this.finishInner(Gt.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=Gt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function rj(n,e,t){let r=new Map;for(let i of n)for(let l=0;l<i.chunk.length;l++)i.chunk[l].maxPoint<=0&&r.set(i.chunk[l],i.chunkPos[l]);let s=new Set;for(let i of e)for(let l=0;l<i.chunk.length;l++){let c=r.get(i.chunk[l]);c!=null&&(t?t.mapPos(c):c)==i.chunkPos[l]&&!t?.touchesRange(c,c+i.chunk[l].length)&&s.add(i.chunk[l])}return s}class $M{constructor(e,t,r,s=0){this.layer=e,this.skip=t,this.minPoint=r,this.rank=s}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,r){for(;this.chunkIndex<this.layer.chunk.length;){let s=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(s)||this.layer.chunkEnd(this.chunkIndex)<e||s.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let s=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!r||this.rangeIndex<s)&&this.setRangeIndex(s)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],r=e+t.from[this.rangeIndex];if(this.from=r,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class xf{constructor(e){this.heap=e}static from(e,t=null,r=-1){let s=[];for(let i=0;i<e.length;i++)for(let l=e[i];!l.isEmpty;l=l.nextLayer)l.maxPoint>=r&&s.push(new $M(l,t,r,i));return s.length==1?s[0]:new xf(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let r of this.heap)r.goto(e,t);for(let r=this.heap.length>>1;r>=0;r--)My(this.heap,r);return this.next(),this}forward(e,t){for(let r of this.heap)r.forward(e,t);for(let r=this.heap.length>>1;r>=0;r--)My(this.heap,r);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),My(this.heap,0)}}}function My(n,e){for(let t=n[e];;){let r=(e<<1)+1;if(r>=n.length)break;let s=n[r];if(r+1<n.length&&s.compare(n[r+1])>=0&&(s=n[r+1],r++),t.compare(s)<0)break;n[r]=t,n[e]=s,e=r}}class Rh{constructor(e,t,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=xf.from(e,t,r)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){ep(this.active,e),ep(this.activeTo,e),ep(this.activeRank,e),this.minActive=ij(this.active,this.activeTo)}addActive(e){let t=0,{value:r,to:s,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||s-this.activeTo[t])>0;)t++;tp(this.active,t,r),tp(this.activeTo,t,s),tp(this.activeRank,t,i),e&&tp(e,t,this.cursor.from),this.minActive=ij(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),r&&ep(r,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let i=this.cursor.value;if(!i.point)this.addActive(r),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=i,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=i.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let s=r.length-1;s>=0&&r[s]<e;s--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&t.push(this.active[r]);return t.reverse()}openEnd(e){let t=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)t++;return t}}function sj(n,e,t,r,s,i){n.goto(e),t.goto(r);let l=r+s,c=r,u=r-e;for(;;){let h=n.to+u-t.to,m=h||n.endSide-t.endSide,p=m<0?n.to+u:t.to,x=Math.min(p,l);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&N2(n.activeForPoint(n.to),t.activeForPoint(t.to))||i.comparePoint(c,x,n.point,t.point):x>c&&!N2(n.active,t.active)&&i.compareRange(c,x,n.active,t.active),p>l)break;(h||n.openEnd!=t.openEnd)&&i.boundChange&&i.boundChange(p),c=p,m<=0&&n.next(),m>=0&&t.next()}}function N2(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t]&&!n[t].eq(e[t]))return!1;return!0}function ep(n,e){for(let t=e,r=n.length-1;t<r;t++)n[t]=n[t+1];n.pop()}function tp(n,e,t){for(let r=n.length-1;r>=e;r--)n[r+1]=n[r];n[e]=t}function ij(n,e){let t=-1,r=1e9;for(let s=0;s<e.length;s++)(e[s]-r||n[s].endSide-n[t].endSide)<0&&(t=s,r=e[s]);return t}function Md(n,e,t=n.length){let r=0;for(let s=0;s<t&&s<n.length;)n.charCodeAt(s)==9?(r+=e-r%e,s++):(r++,s=Vr(n,s));return r}function C2(n,e,t,r){for(let s=0,i=0;;){if(i>=e)return s;if(s==n.length)break;i+=n.charCodeAt(s)==9?t-i%t:1,s=Vr(n,s)}return r===!0?-1:n.length}const T2="ͼ",aj=typeof Symbol>"u"?"__"+T2:Symbol.for(T2),M2=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),lj=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ho{constructor(e,t){this.rules=[];let{finish:r}=t||{};function s(l){return/^@/.test(l)?[l]:l.split(/,\s*/)}function i(l,c,u,h){let m=[],p=/^@(\w+)\b/.exec(l[0]),x=p&&p[1]=="keyframes";if(p&&c==null)return u.push(l[0]+";");for(let v in c){let b=c[v];if(/&/.test(v))i(v.split(/,\s*/).map(O=>l.map(k=>O.replace(/&/,k))).reduce((O,k)=>O.concat(k)),b,u);else if(b&&typeof b=="object"){if(!p)throw new RangeError("The value of a property ("+v+") should be a primitive value.");i(s(v),b,m,x)}else b!=null&&m.push(v.replace(/_.*/,"").replace(/[A-Z]/g,O=>"-"+O.toLowerCase())+": "+b+";")}(m.length||x)&&u.push((r&&!p&&!h?l.map(r):l).join(", ")+" {"+m.join(" ")+"}")}for(let l in e)i(s(l),e[l],this.rules)}getRules(){return this.rules.join(`
|
||
`)}static newName(){let e=lj[aj]||1;return lj[aj]=e+1,T2+e.toString(36)}static mount(e,t,r){let s=e[M2],i=r&&r.nonce;s?i&&s.setNonce(i):s=new hV(e,i),s.mount(Array.isArray(t)?t:[t],e)}}let oj=new Map;class hV{constructor(e,t){let r=e.ownerDocument||e,s=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let i=oj.get(r);if(i)return e[M2]=i;this.sheet=new s.CSSStyleSheet,oj.set(r,this)}else this.styleTag=r.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[M2]=this}mount(e,t){let r=this.sheet,s=0,i=0;for(let l=0;l<e.length;l++){let c=e[l],u=this.modules.indexOf(c);if(u<i&&u>-1&&(this.modules.splice(u,1),i--,u=-1),u==-1){if(this.modules.splice(i++,0,c),r)for(let h=0;h<c.rules.length;h++)r.insertRule(c.rules[h],s++)}else{for(;i<u;)s+=this.modules[i++].rules.length;s+=c.rules.length,i++}}if(r)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let l="";for(let u=0;u<this.modules.length;u++)l+=this.modules[u].getRules()+`
|
||
`;this.styleTag.textContent=l;let c=t.head||t;this.styleTag.parentNode!=c&&c.insertBefore(this.styleTag,c.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var fo={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},vf={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},fV=typeof navigator<"u"&&/Mac/.test(navigator.platform),mV=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Hr=0;Hr<10;Hr++)fo[48+Hr]=fo[96+Hr]=String(Hr);for(var Hr=1;Hr<=24;Hr++)fo[Hr+111]="F"+Hr;for(var Hr=65;Hr<=90;Hr++)fo[Hr]=String.fromCharCode(Hr+32),vf[Hr]=String.fromCharCode(Hr);for(var Ay in fo)vf.hasOwnProperty(Ay)||(vf[Ay]=fo[Ay]);function pV(n){var e=fV&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||mV&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?vf:fo)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function An(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var s=t[r];typeof s=="string"?n.setAttribute(r,s):s!=null&&(n[r]=s)}e++}for(;e<arguments.length;e++)HM(n,arguments[e]);return n}function HM(n,e){if(typeof e=="string")n.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)n.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)HM(n,e[t]);else throw new RangeError("Unsupported child node: "+e)}let us=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},A2=typeof document<"u"?document:{documentElement:{style:{}}};const E2=/Edge\/(\d+)/.exec(us.userAgent),UM=/MSIE \d/.test(us.userAgent),_2=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(us.userAgent),Ox=!!(UM||_2||E2),cj=!Ox&&/gecko\/(\d+)/i.test(us.userAgent),Ey=!Ox&&/Chrome\/(\d+)/.exec(us.userAgent),gV="webkitFontSmoothing"in A2.documentElement.style,D2=!Ox&&/Apple Computer/.test(us.vendor),uj=D2&&(/Mobile\/\w+/.test(us.userAgent)||us.maxTouchPoints>2);var qe={mac:uj||/Mac/.test(us.platform),windows:/Win/.test(us.platform),linux:/Linux|X11/.test(us.platform),ie:Ox,ie_version:UM?A2.documentMode||6:_2?+_2[1]:E2?+E2[1]:0,gecko:cj,gecko_version:cj?+(/Firefox\/(\d+)/.exec(us.userAgent)||[0,0])[1]:0,chrome:!!Ey,chrome_version:Ey?+Ey[1]:0,ios:uj,android:/Android\b/.test(us.userAgent),webkit_version:gV?+(/\bAppleWebKit\/(\d+)/.exec(us.userAgent)||[0,0])[1]:0,safari:D2,safari_version:D2?+(/\bVersion\/(\d+(\.\d+)?)/.exec(us.userAgent)||[0,0])[1]:0,tabSize:A2.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function yf(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function R2(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function Zp(n,e){if(!e.anchorNode)return!1;try{return R2(n,e.anchorNode)}catch{return!1}}function dd(n){return n.nodeType==3?wc(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function tf(n,e,t,r){return t?dj(n,e,t,r,-1)||dj(n,e,t,r,1):!1}function bc(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function jg(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function dj(n,e,t,r,s){for(;;){if(n==t&&e==r)return!0;if(e==(s<0?0:ya(n))){if(n.nodeName=="DIV")return!1;let i=n.parentNode;if(!i||i.nodeType!=1)return!1;e=bc(n)+(s<0?0:1),n=i}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?ya(n):0}else return!1}}function ya(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function i0(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function xV(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function VM(n,e){let t=e.width/n.offsetWidth,r=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-n.offsetHeight)<1)&&(r=1),{scaleX:t,scaleY:r}}function vV(n,e,t,r,s,i,l,c){let u=n.ownerDocument,h=u.defaultView||window;for(let m=n,p=!1;m&&!p;)if(m.nodeType==1){let x,v=m==u.body,b=1,O=1;if(v)x=xV(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(m).position)&&(p=!0),m.scrollHeight<=m.clientHeight&&m.scrollWidth<=m.clientWidth){m=m.assignedSlot||m.parentNode;continue}let T=m.getBoundingClientRect();({scaleX:b,scaleY:O}=VM(m,T)),x={left:T.left,right:T.left+m.clientWidth*b,top:T.top,bottom:T.top+m.clientHeight*O}}let k=0,j=0;if(s=="nearest")e.top<x.top?(j=e.top-(x.top+l),t>0&&e.bottom>x.bottom+j&&(j=e.bottom-x.bottom+l)):e.bottom>x.bottom&&(j=e.bottom-x.bottom+l,t<0&&e.top-j<x.top&&(j=e.top-(x.top+l)));else{let T=e.bottom-e.top,M=x.bottom-x.top;j=(s=="center"&&T<=M?e.top+T/2-M/2:s=="start"||s=="center"&&t<0?e.top-l:e.bottom-M+l)-x.top}if(r=="nearest"?e.left<x.left?(k=e.left-(x.left+i),t>0&&e.right>x.right+k&&(k=e.right-x.right+i)):e.right>x.right&&(k=e.right-x.right+i,t<0&&e.left<x.left+k&&(k=e.left-(x.left+i))):k=(r=="center"?e.left+(e.right-e.left)/2-(x.right-x.left)/2:r=="start"==c?e.left-i:e.right-(x.right-x.left)+i)-x.left,k||j)if(v)h.scrollBy(k,j);else{let T=0,M=0;if(j){let _=m.scrollTop;m.scrollTop+=j/O,M=(m.scrollTop-_)*O}if(k){let _=m.scrollLeft;m.scrollLeft+=k/b,T=(m.scrollLeft-_)*b}e={left:e.left-T,top:e.top-M,right:e.right-T,bottom:e.bottom-M},T&&Math.abs(T-k)<1&&(r="nearest"),M&&Math.abs(M-j)<1&&(s="nearest")}if(v)break;(e.top<x.top||e.bottom>x.bottom||e.left<x.left||e.right>x.right)&&(e={left:Math.max(e.left,x.left),right:Math.min(e.right,x.right),top:Math.max(e.top,x.top),bottom:Math.min(e.bottom,x.bottom)}),m=m.assignedSlot||m.parentNode}else if(m.nodeType==11)m=m.host;else break}function yV(n){let e=n.ownerDocument,t,r;for(let s=n.parentNode;s&&!(s==e.body||t&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),!t&&s.scrollWidth>s.clientWidth&&(t=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:t,y:r}}class bV{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:r}=e;this.set(t,Math.min(e.anchorOffset,t?ya(t):0),r,Math.min(e.focusOffset,r?ya(r):0))}set(e,t,r,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=r,this.focusOffset=s}}let tc=null;qe.safari&&qe.safari_version>=26&&(tc=!1);function WM(n){if(n.setActive)return n.setActive();if(tc)return n.focus(tc);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(tc==null?{get preventScroll(){return tc={preventScroll:!0},!0}}:void 0),!tc){tc=!1;for(let t=0;t<e.length;){let r=e[t++],s=e[t++],i=e[t++];r.scrollTop!=s&&(r.scrollTop=s),r.scrollLeft!=i&&(r.scrollLeft=i)}}}let hj;function wc(n,e,t=e){let r=hj||(hj=document.createRange());return r.setEnd(n,t),r.setStart(n,e),r}function Xu(n,e,t,r){let s={key:e,code:e,keyCode:t,which:t,cancelable:!0};r&&({altKey:s.altKey,ctrlKey:s.ctrlKey,shiftKey:s.shiftKey,metaKey:s.metaKey}=r);let i=new KeyboardEvent("keydown",s);i.synthetic=!0,n.dispatchEvent(i);let l=new KeyboardEvent("keyup",s);return l.synthetic=!0,n.dispatchEvent(l),i.defaultPrevented||l.defaultPrevented}function wV(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function GM(n){for(;n.attributes.length;)n.removeAttributeNode(n.attributes[0])}function SV(n,e){let t=e.focusNode,r=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=r)return!1;for(r=Math.min(r,ya(t));;)if(r){if(t.nodeType!=1)return!1;let s=t.childNodes[r-1];s.contentEditable=="false"?r--:(t=s,r=ya(t))}else{if(t==n)return!0;r=bc(t),t=t.parentNode}}function XM(n){return n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function YM(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&r>0)return{node:t,offset:r};if(t.nodeType==1&&r>0){if(t.contentEditable=="false")return null;t=t.childNodes[r-1],r=ya(t)}else if(t.parentNode&&!jg(t))r=bc(t),t=t.parentNode;else return null}}function KM(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&r<t.nodeValue.length)return{node:t,offset:r};if(t.nodeType==1&&r<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[r],r=0}else if(t.parentNode&&!jg(t))r=bc(t)+1,t=t.parentNode;else return null}}class ns{constructor(e,t,r=!0){this.node=e,this.offset=t,this.precise=r}static before(e,t){return new ns(e.parentNode,bc(e),t)}static after(e,t){return new ns(e.parentNode,bc(e)+1,t)}}const jw=[];class jn{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let r of this.children){if(r==e)return t;t+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let r=this.dom,s=null,i;for(let l of this.children){if(l.flags&7){if(!l.dom&&(i=s?s.nextSibling:r.firstChild)){let c=jn.get(i);(!c||!c.parent&&c.canReuseDOM(l))&&l.reuseDOM(i)}l.sync(e,t),l.flags&=-8}if(i=s?s.nextSibling:r.firstChild,t&&!t.written&&t.node==r&&i!=l.dom&&(t.written=!0),l.dom.parentNode==r)for(;i&&i!=l.dom;)i=fj(i);else r.insertBefore(l.dom,i);s=l.dom}for(i=s?s.nextSibling:r.firstChild,i&&t&&t.node==r&&(t.written=!0);i;)i=fj(i)}else if(this.flags&1)for(let r of this.children)r.flags&7&&(r.sync(e,t),r.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let r;if(e==this.dom)r=this.dom.childNodes[t];else{let s=ya(e)==0?0:t==0?-1:1;for(;;){let i=e.parentNode;if(i==this.dom)break;s==0&&i.firstChild!=i.lastChild&&(e==i.firstChild?s=-1:s=1),e=i}s<0?r=e:r=e.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!jn.get(r);)r=r.nextSibling;if(!r)return this.length;for(let s=0,i=0;;s++){let l=this.children[s];if(l.dom==r)return i;i+=l.length+l.breakAfter}}domBoundsAround(e,t,r=0){let s=-1,i=-1,l=-1,c=-1;for(let u=0,h=r,m=r;u<this.children.length;u++){let p=this.children[u],x=h+p.length;if(h<e&&x>t)return p.domBoundsAround(e,t,h);if(x>=e&&s==-1&&(s=u,i=h),h>t&&p.dom.parentNode==this.dom){l=u,c=m;break}m=x,h=x+p.breakAfter}return{from:i,to:c<0?r+this.length:c,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:l<this.children.length&&l>=0?this.children[l].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,r=jw){this.markDirty();for(let s=e;s<t;s++){let i=this.children[s];i.parent==this&&r.indexOf(i)<0&&i.destroy()}r.length<250?this.children.splice(e,t-e,...r):this.children=[].concat(this.children.slice(0,e),r,this.children.slice(t));for(let s=0;s<r.length;s++)r[s].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new ZM(this.children,e,this.children.length)}childPos(e,t=1){return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,t,r,s,i,l){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}jn.prototype.breakAfter=0;function fj(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class ZM{constructor(e,t,r){this.children=e,this.pos=t,this.i=r,this.off=0}findPos(e,t=1){for(;;){if(e>this.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function JM(n,e,t,r,s,i,l,c,u){let{children:h}=n,m=h.length?h[e]:null,p=i.length?i[i.length-1]:null,x=p?p.breakAfter:l;if(!(e==r&&m&&!l&&!x&&i.length<2&&m.merge(t,s,i.length?p:null,t==0,c,u))){if(r<h.length){let v=h[r];v&&(s<v.length||v.breakAfter&&p?.breakAfter)?(e==r&&(v=v.split(s),s=0),!x&&p&&v.merge(0,s,p,!0,0,u)?i[i.length-1]=v:((s||v.children.length&&!v.children[0].length)&&v.merge(0,s,null,!1,0,u),i.push(v))):v?.breakAfter&&(p?p.breakAfter=1:l=1),r++}for(m&&(m.breakAfter=l,t>0&&(!l&&i.length&&m.merge(t,m.length,i[0],!1,c,0)?m.breakAfter=i.shift().breakAfter:(t<m.length||m.children.length&&m.children[m.children.length-1].length==0)&&m.merge(t,m.length,null,!1,c,0),e++));e<r&&i.length;)if(h[r-1].become(i[i.length-1]))r--,i.pop(),u=i.length?0:c;else if(h[e].become(i[0]))e++,i.shift(),c=i.length?0:u;else break;!i.length&&e&&r<h.length&&!h[e-1].breakAfter&&h[r].merge(0,0,h[e-1],!1,c,u)&&e--,(e<r||i.length)&&n.replaceChildren(e,r,i)}}function eA(n,e,t,r,s,i){let l=n.childCursor(),{i:c,off:u}=l.findPos(t,1),{i:h,off:m}=l.findPos(e,-1),p=e-t;for(let x of r)p+=x.length;n.length+=p,JM(n,h,m,c,u,r,0,s,i)}const OV=256;class Qi extends jn{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,r){return this.flags&8||r&&(!(r instanceof Qi)||this.length-(t-e)+r.length>OV||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new Qi(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new ns(this.dom,e)}domBoundsAround(e,t,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return kV(this.dom,e,t)}}class ml extends jn{constructor(e,t=[],r=0){super(),this.mark=e,this.children=t,this.length=r;for(let s of t)s.setParent(this)}setAttrs(e){if(GM(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,r,s,i,l){return r&&(!(r instanceof ml&&r.mark.eq(this.mark))||e&&i<=0||t<this.length&&l<=0)?!1:(eA(this,e,t,r?r.children.slice():[],i-1,l-1),this.markDirty(),!0)}split(e){let t=[],r=0,s=-1,i=0;for(let c of this.children){let u=r+c.length;u>e&&t.push(r<e?c.split(e-r):c),s<0&&r>=e&&(s=i),r=u,i++}let l=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new ml(this.mark,t,l)}domAtPos(e){return tA(this,e)}coordsAt(e,t){return rA(this,e,t)}}function kV(n,e,t){let r=n.nodeValue.length;e>r&&(e=r);let s=e,i=e,l=0;e==0&&t<0||e==r&&t>=0?qe.chrome||qe.gecko||(e?(s--,l=1):i<r&&(i++,l=-1)):t<0?s--:i<r&&i++;let c=wc(n,s,i).getClientRects();if(!c.length)return null;let u=c[(l?l<0:t>=0)?0:c.length-1];return qe.safari&&!l&&u.width==0&&(u=Array.prototype.find.call(c,h=>h.width)||u),l?i0(u,l<0):u||null}class il extends jn{static create(e,t,r){return new il(e,t,r)}constructor(e,t,r){super(),this.widget=e,this.length=t,this.side=r,this.prevWidget=null}split(e){let t=il.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,r,s,i,l){return r&&(!(r instanceof il)||!this.widget.compare(r.widget)||e>0&&i<=0||t<this.length&&l<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-t),!0)}become(e){return e instanceof il&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return Wt.empty;let e=this;for(;e.parent;)e=e.parent;let{view:t}=e,r=t&&t.state.doc,s=this.posAtStart;return r?r.slice(s,s+this.length):Wt.empty}domAtPos(e){return(this.length?e==0:this.side>0)?ns.before(this.dom):ns.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;let s=this.dom.getClientRects(),i=null;if(!s.length)return null;let l=this.side?this.side<0:e>0;for(let c=l?s.length-1:0;i=s[c],!(e>0?c==0:c==s.length-1||i.top<i.bottom);c+=l?-1:1);return i0(i,!l)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class hd extends jn{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof hd&&e.side==this.side}split(){return new hd(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?ns.before(this.dom):ns.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Wt.empty}get isHidden(){return!0}}Qi.prototype.children=il.prototype.children=hd.prototype.children=jw;function tA(n,e){let t=n.dom,{children:r}=n,s=0;for(let i=0;s<r.length;s++){let l=r[s],c=i+l.length;if(!(c==i&&l.getSide()<=0)){if(e>i&&e<c&&l.dom.parentNode==t)return l.domAtPos(e-i);if(e<=i)break;i=c}}for(let i=s;i>0;i--){let l=r[i-1];if(l.dom.parentNode==t)return l.domAtPos(l.length)}for(let i=s;i<r.length;i++){let l=r[i];if(l.dom.parentNode==t)return l.domAtPos(0)}return new ns(t,0)}function nA(n,e,t){let r,{children:s}=n;t>0&&e instanceof ml&&s.length&&(r=s[s.length-1])instanceof ml&&r.mark.eq(e.mark)?nA(r,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function rA(n,e,t){let r=null,s=-1,i=null,l=-1;function c(h,m){for(let p=0,x=0;p<h.children.length&&x<=m;p++){let v=h.children[p],b=x+v.length;b>=m&&(v.children.length?c(v,m-x):(!i||i.isHidden&&(t>0||NV(i,v)))&&(b>m||x==b&&v.getSide()>0)?(i=v,l=m-x):(x<m||x==b&&v.getSide()<0&&!v.isHidden)&&(r=v,s=m-x)),x=b}}c(n,e);let u=(t<0?r:i)||r||i;return u?u.coordsAt(Math.max(0,u==r?s:l),t):jV(n)}function jV(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=dd(e);return t[t.length-1]||null}function NV(n,e){let t=n.coordsAt(0,1),r=e.coordsAt(0,1);return t&&r&&r.top<t.bottom}function z2(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}const mj=Object.create(null);function Ng(n,e,t){if(n==e)return!0;n||(n=mj),e||(e=mj);let r=Object.keys(n),s=Object.keys(e);if(r.length-(t&&r.indexOf(t)>-1?1:0)!=s.length-(t&&s.indexOf(t)>-1?1:0))return!1;for(let i of r)if(i!=t&&(s.indexOf(i)==-1||n[i]!==e[i]))return!1;return!0}function P2(n,e,t){let r=!1;if(e)for(let s in e)t&&s in t||(r=!0,s=="style"?n.style.cssText="":n.removeAttribute(s));if(t)for(let s in t)e&&e[s]==t[s]||(r=!0,s=="style"?n.style.cssText=t[s]:n.setAttribute(s,t[s]));return r}function CV(n){let e=Object.create(null);for(let t=0;t<n.attributes.length;t++){let r=n.attributes[t];e[r.name]=r.value}return e}class ka{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var fs=(function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n})(fs||(fs={}));class Je extends yc{constructor(e,t,r,s){super(),this.startSide=e,this.endSide=t,this.widget=r,this.spec=s}get heightRelevant(){return!1}static mark(e){return new a0(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return t+=r&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new mo(e,t,t,r,e.widget||null,!1)}static replace(e){let t=!!e.block,r,s;if(e.isBlockGap)r=-5e8,s=4e8;else{let{start:i,end:l}=sA(e,t);r=(i?t?-3e8:-1:5e8)-1,s=(l?t?2e8:1:-6e8)+1}return new mo(e,r,s,t,e.widget||null,!0)}static line(e){return new l0(e)}static set(e,t=!1){return Gt.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Je.none=Gt.empty;class a0 extends Je{constructor(e){let{start:t,end:r}=sA(e);super(t?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,r;return this==e||e instanceof a0&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&Ng(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}a0.prototype.point=!1;class l0 extends Je{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof l0&&this.spec.class==e.spec.class&&Ng(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}l0.prototype.mapMode=Ur.TrackBefore;l0.prototype.point=!0;class mo extends Je{constructor(e,t,r,s,i,l){super(t,r,i,e),this.block=s,this.isReplace=l,this.mapMode=s?t<=0?Ur.TrackBefore:Ur.TrackAfter:Ur.TrackDel}get type(){return this.startSide!=this.endSide?fs.WidgetRange:this.startSide<=0?fs.WidgetBefore:fs.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof mo&&TV(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}mo.prototype.point=!0;function sA(n,e=!1){let{inclusiveStart:t,inclusiveEnd:r}=n;return t==null&&(t=n.inclusive),r==null&&(r=n.inclusive),{start:t??e,end:r??e}}function TV(n,e){return n==e||!!(n&&e&&n.compare(e))}function Jp(n,e,t,r=0){let s=t.length-1;s>=0&&t[s]+r>=n?t[s]=Math.max(t[s],e):t.push(n,e)}class pr extends jn{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,r,s,i,l){if(r){if(!(r instanceof pr))return!1;this.dom||r.transferDOM(this)}return s&&this.setDeco(r?r.attrs:null),eA(this,e,t,r?r.children.slice():[],i,l),!0}split(e){let t=new pr;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i:r,off:s}=this.childPos(e);s&&(t.append(this.children[r].split(s),0),this.children[r].merge(s,this.children[r].length,null,!1,0,0),r++);for(let i=r;i<this.children.length;i++)t.append(this.children[i],0);for(;r>0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Ng(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){nA(this,e,t)}addLineDeco(e){let t=e.spec.attributes,r=e.spec.class;t&&(this.attrs=z2(t,this.attrs||{})),r&&(this.attrs=z2({class:r},this.attrs||{}))}domAtPos(e){return tA(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var r;this.dom?this.flags&4&&(GM(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(P2(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let s=this.dom.lastChild;for(;s&&jn.get(s)instanceof ml;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((r=jn.get(s))===null||r===void 0?void 0:r.isEditable)==!1&&(!qe.ios||!this.children.some(i=>i instanceof Qi))){let i=document.createElement("BR");i.cmIgnore=!0,this.dom.appendChild(i)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let r of this.children){if(!(r instanceof Qi)||/[^ -~]/.test(r.text))return null;let s=dd(r.dom);if(s.length!=1)return null;e+=s[0].width,t=s[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let r=rA(this,e,t);if(!this.children.length&&r&&this.parent){let{heightOracle:s}=this.parent.view.viewState,i=r.bottom-r.top;if(Math.abs(i-s.lineHeight)<2&&s.textHeight<i){let l=(i-s.textHeight)/2;return{top:r.top+l,bottom:r.bottom-l,left:r.left,right:r.left}}}return r}become(e){return e instanceof pr&&this.children.length==0&&e.children.length==0&&Ng(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,t){for(let r=0,s=0;r<e.children.length;r++){let i=e.children[r],l=s+i.length;if(l>=t){if(i instanceof pr)return i;if(l>t)break}s=l+i.breakAfter}return null}}class ol extends jn{constructor(e,t,r){super(),this.widget=e,this.length=t,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,t,r,s,i,l){return r&&(!(r instanceof ol)||!this.widget.compare(r.widget)||e>0&&i<=0||t<this.length&&l<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-t),!0)}domAtPos(e){return e==0?ns.before(this.dom):ns.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let r=new ol(this.widget,t,this.deco);return r.breakAfter=this.breakAfter,r}get children(){return jw}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):Wt.empty}domBoundsAround(){return null}become(e){return e instanceof ol&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,t){let r=this.widget.coordsAt(this.dom,e,t);return r||(this.widget instanceof L2?null:i0(this.dom.getBoundingClientRect(),this.length?e==0:t<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:t,endSide:r}=this.deco;return t==r?!1:e<0?t<0:r>0}}class L2 extends ka{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class nf{constructor(e,t,r,s){this.doc=e,this.pos=t,this.end=r,this.disallowBlockEffectsFor=s,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof ol&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new pr),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(np(new hd(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof ol)&&this.getLine()}buildText(e,t,r){for(;e>0;){if(this.textOff==this.text.length){let{value:l,lineBreak:c,done:u}=this.cursor.next(this.skip);if(this.skip=0,u)throw new Error("Ran out of text content when drawing inline views");if(c){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=l,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e),i=Math.min(s,512);this.flushBuffer(t.slice(t.length-r)),this.getLine().append(np(new Qi(this.text.slice(this.textOff,this.textOff+i)),t),r),this.atCursorPos=!0,this.textOff+=i,e-=i,r=s<=i?0:t.length}}span(e,t,r,s){this.buildText(t-e,r,s),this.pos=t,this.openStart<0&&(this.openStart=s)}point(e,t,r,s,i,l){if(this.disallowBlockEffectsFor[l]&&r instanceof mo){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let c=t-e;if(r instanceof mo)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new ol(r.widget||fd.block,c,r));else{let u=il.create(r.widget||fd.inline,c,c?0:r.startSide),h=this.atCursorPos&&!u.isEditable&&i<=s.length&&(e<t||r.startSide>0),m=!u.isEditable&&(e<t||i>s.length||r.startSide<=0),p=this.getLine();this.pendingBuffer==2&&!h&&!u.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),h&&(p.append(np(new hd(1),s),i),i=s.length+Math.max(0,i-s.length)),p.append(np(u,s),i),this.atCursorPos=m,this.pendingBuffer=m?e<t||i>s.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);c&&(this.textOff+c<=this.text.length?this.textOff+=c:(this.skip+=c-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=i)}static build(e,t,r,s,i){let l=new nf(e,t,r,i);return l.openEnd=Gt.spans(s,t,r,l),l.openStart<0&&(l.openStart=l.openEnd),l.finish(l.openEnd),l}}function np(n,e){for(let t of e)n=new ml(t,[n],n.length);return n}class fd extends ka{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}fd.inline=new fd("span");fd.block=new fd("div");var Hn=(function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n})(Hn||(Hn={}));const Sc=Hn.LTR,Nw=Hn.RTL;function iA(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const MV=iA("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),AV=iA("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),B2=Object.create(null),Ji=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);B2[e]=t,B2[t]=-e}function aA(n){return n<=247?MV[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?AV[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const EV=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class ro{get dir(){return this.level%2?Nw:Sc}constructor(e,t,r){this.from=e,this.to=t,this.level=r}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,r,s){let i=-1;for(let l=0;l<e.length;l++){let c=e[l];if(c.from<=t&&c.to>=t){if(c.level==r)return l;(i<0||(s!=0?s<0?c.from<t:c.to>t:e[i].level>c.level))&&(i=l)}}if(i<0)throw new RangeError("Index out of range");return i}}function lA(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++){let r=n[t],s=e[t];if(r.from!=s.from||r.to!=s.to||r.direction!=s.direction||!lA(r.inner,s.inner))return!1}return!0}const En=[];function _V(n,e,t,r,s){for(let i=0;i<=r.length;i++){let l=i?r[i-1].to:e,c=i<r.length?r[i].from:t,u=i?256:s;for(let h=l,m=u,p=u;h<c;h++){let x=aA(n.charCodeAt(h));x==512?x=m:x==8&&p==4&&(x=16),En[h]=x==4?2:x,x&7&&(p=x),m=x}for(let h=l,m=u,p=u;h<c;h++){let x=En[h];if(x==128)h<c-1&&m==En[h+1]&&m&24?x=En[h]=m:En[h]=256;else if(x==64){let v=h+1;for(;v<c&&En[v]==64;)v++;let b=h&&m==8||v<t&&En[v]==8?p==1?1:8:256;for(let O=h;O<v;O++)En[O]=b;h=v-1}else x==8&&p==1&&(En[h]=1);m=x,x&7&&(p=x)}}}function DV(n,e,t,r,s){let i=s==1?2:1;for(let l=0,c=0,u=0;l<=r.length;l++){let h=l?r[l-1].to:e,m=l<r.length?r[l].from:t;for(let p=h,x,v,b;p<m;p++)if(v=B2[x=n.charCodeAt(p)])if(v<0){for(let O=c-3;O>=0;O-=3)if(Ji[O+1]==-v){let k=Ji[O+2],j=k&2?s:k&4?k&1?i:s:0;j&&(En[p]=En[Ji[O]]=j),c=O;break}}else{if(Ji.length==189)break;Ji[c++]=p,Ji[c++]=x,Ji[c++]=u}else if((b=En[p])==2||b==1){let O=b==s;u=O?0:1;for(let k=c-3;k>=0;k-=3){let j=Ji[k+2];if(j&2)break;if(O)Ji[k+2]|=2;else{if(j&4)break;Ji[k+2]|=4}}}}}function RV(n,e,t,r){for(let s=0,i=r;s<=t.length;s++){let l=s?t[s-1].to:n,c=s<t.length?t[s].from:e;for(let u=l;u<c;){let h=En[u];if(h==256){let m=u+1;for(;;)if(m==c){if(s==t.length)break;m=t[s++].to,c=s<t.length?t[s].from:e}else if(En[m]==256)m++;else break;let p=i==1,x=(m<e?En[m]:r)==1,v=p==x?p?1:2:r;for(let b=m,O=s,k=O?t[O-1].to:n;b>u;)b==k&&(b=t[--O].from,k=O?t[O-1].to:n),En[--b]=v;u=m}else i=h,u++}}}function I2(n,e,t,r,s,i,l){let c=r%2?2:1;if(r%2==s%2)for(let u=e,h=0;u<t;){let m=!0,p=!1;if(h==i.length||u<i[h].from){let O=En[u];O!=c&&(m=!1,p=O==16)}let x=!m&&c==1?[]:null,v=m?r:r+1,b=u;e:for(;;)if(h<i.length&&b==i[h].from){if(p)break e;let O=i[h];if(!m)for(let k=O.to,j=h+1;;){if(k==t)break e;if(j<i.length&&i[j].from==k)k=i[j++].to;else{if(En[k]==c)break e;break}}if(h++,x)x.push(O);else{O.from>u&&l.push(new ro(u,O.from,v));let k=O.direction==Sc!=!(v%2);F2(n,k?r+1:r,s,O.inner,O.from,O.to,l),u=O.to}b=O.to}else{if(b==t||(m?En[b]!=c:En[b]==c))break;b++}x?I2(n,u,b,r+1,s,x,l):u<b&&l.push(new ro(u,b,v)),u=b}else for(let u=t,h=i.length;u>e;){let m=!0,p=!1;if(!h||u>i[h-1].to){let O=En[u-1];O!=c&&(m=!1,p=O==16)}let x=!m&&c==1?[]:null,v=m?r:r+1,b=u;e:for(;;)if(h&&b==i[h-1].to){if(p)break e;let O=i[--h];if(!m)for(let k=O.from,j=h;;){if(k==e)break e;if(j&&i[j-1].to==k)k=i[--j].from;else{if(En[k-1]==c)break e;break}}if(x)x.push(O);else{O.to<u&&l.push(new ro(O.to,u,v));let k=O.direction==Sc!=!(v%2);F2(n,k?r+1:r,s,O.inner,O.from,O.to,l),u=O.from}b=O.from}else{if(b==e||(m?En[b-1]!=c:En[b-1]==c))break;b--}x?I2(n,b,u,r+1,s,x,l):b<u&&l.push(new ro(b,u,v)),u=b}}function F2(n,e,t,r,s,i,l){let c=e%2?2:1;_V(n,s,i,r,c),DV(n,s,i,r,c),RV(s,i,r,c),I2(n,s,i,e,t,r,l)}function zV(n,e,t){if(!n)return[new ro(0,0,e==Nw?1:0)];if(e==Sc&&!t.length&&!EV.test(n))return oA(n.length);if(t.length)for(;n.length>En.length;)En[En.length]=256;let r=[],s=e==Sc?0:1;return F2(n,s,s,t,0,n.length,r),r}function oA(n){return[new ro(0,n,0)]}let cA="";function PV(n,e,t,r,s){var i;let l=r.head-n.from,c=ro.find(e,l,(i=r.bidiLevel)!==null&&i!==void 0?i:-1,r.assoc),u=e[c],h=u.side(s,t);if(l==h){let x=c+=s?1:-1;if(x<0||x>=e.length)return null;u=e[c=x],l=u.side(!s,t),h=u.side(s,t)}let m=Vr(n.text,l,u.forward(s,t));(m<u.from||m>u.to)&&(m=h),cA=n.text.slice(Math.min(l,m),Math.max(l,m));let p=c==(s?e.length-1:0)?null:e[c+(s?1:-1)];return p&&m==h&&p.level+(s?0:1)<u.level?Ce.cursor(p.side(!s,t)+n.from,p.forward(s,t)?1:-1,p.level):Ce.cursor(m+n.from,u.forward(s,t)?-1:1,u.level)}function LV(n,e,t){for(let r=e;r<t;r++){let s=aA(n.charCodeAt(r));if(s==1)return Sc;if(s==2||s==4)return Nw}return Sc}const uA=He.define(),dA=He.define(),hA=He.define(),fA=He.define(),q2=He.define(),mA=He.define(),pA=He.define(),Cw=He.define(),Tw=He.define(),gA=He.define({combine:n=>n.some(e=>e)}),xA=He.define({combine:n=>n.some(e=>e)}),vA=He.define();class Yu{constructor(e,t="nearest",r="nearest",s=5,i=5,l=!1){this.range=e,this.y=t,this.x=r,this.yMargin=s,this.xMargin=i,this.isSnapshot=l}map(e){return e.empty?this:new Yu(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Yu(Ce.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const rp=xt.define({map:(n,e)=>n.map(e)}),yA=xt.define();function Es(n,e,t){let r=n.facet(fA);r.length?r[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}const sl=He.define({combine:n=>n.length?n[0]:!0});let BV=0;const Qu=He.define({combine(n){return n.filter((e,t)=>{for(let r=0;r<t;r++)if(n[r].plugin==e.plugin)return!1;return!0})}});class lr{constructor(e,t,r,s,i){this.id=e,this.create=t,this.domEventHandlers=r,this.domEventObservers=s,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(Qu.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Qu.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:r,eventObservers:s,provide:i,decorations:l}=t||{};return new lr(BV++,e,r,s,c=>{let u=[];return l&&u.push(bf.of(h=>{let m=h.plugin(c);return m?l(m):Je.none})),i&&u.push(i(c)),u})}static fromClass(e,t){return lr.define((r,s)=>new e(r,s),t)}}class _y{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(r){if(Es(t.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){Es(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(r){Es(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const bA=He.define(),Mw=He.define(),bf=He.define(),wA=He.define(),o0=He.define(),SA=He.define();function pj(n,e){let t=n.state.facet(SA);if(!t.length)return t;let r=t.map(i=>i instanceof Function?i(n):i),s=[];return Gt.spans(r,e.from,e.to,{point(){},span(i,l,c,u){let h=i-e.from,m=l-e.from,p=s;for(let x=c.length-1;x>=0;x--,u--){let v=c[x].spec.bidiIsolate,b;if(v==null&&(v=LV(e.text,h,m)),u>0&&p.length&&(b=p[p.length-1]).to==h&&b.direction==v)b.to=m,p=b.inner;else{let O={from:h,to:m,direction:v,inner:[]};p.push(O),p=O.inner}}}}),s}const OA=He.define();function Aw(n){let e=0,t=0,r=0,s=0;for(let i of n.state.facet(OA)){let l=i(n);l&&(l.left!=null&&(e=Math.max(e,l.left)),l.right!=null&&(t=Math.max(t,l.right)),l.top!=null&&(r=Math.max(r,l.top)),l.bottom!=null&&(s=Math.max(s,l.bottom)))}return{left:e,right:t,top:r,bottom:s}}const $h=He.define();class ji{constructor(e,t,r,s){this.fromA=e,this.toA=t,this.fromB=r,this.toB=s}join(e){return new ji(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,r=this;for(;t>0;t--){let s=e[t-1];if(!(s.fromA>r.toA)){if(s.toA<r.fromA)break;r=r.join(s),e.splice(t-1,1)}}return e.splice(t,0,r),e}static extendWithRanges(e,t){if(t.length==0)return e;let r=[];for(let s=0,i=0,l=0,c=0;;s++){let u=s==e.length?null:e[s],h=l-c,m=u?u.fromB:1e9;for(;i<t.length&&t[i]<m;){let p=t[i],x=t[i+1],v=Math.max(c,p),b=Math.min(m,x);if(v<=b&&new ji(v+h,b+h,v,b).addToSet(r),x>m)break;i+=2}if(!u)return r;new ji(u.fromA,u.toA,u.fromB,u.toB).addToSet(r),l=u.toA,c=u.toB}}}class Cg{constructor(e,t,r){this.view=e,this.state=t,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=Or.empty(this.startState.doc.length);for(let i of r)this.changes=this.changes.compose(i.changes);let s=[];this.changes.iterChangedRanges((i,l,c,u)=>s.push(new ji(i,l,c,u))),this.changedRanges=s}static create(e,t,r){return new Cg(e,t,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class gj extends jn{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=Je.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new pr],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new ji(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:h,toA:m})=>m<this.minWidthFrom||h>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?s=this.domChanged.newSel.head:!UV(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let i=s>-1?FV(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:h,to:m}=this.hasComposition;r=new ji(h,m,e.changes.mapPos(h,-1),e.changes.mapPos(m,1)).addToSet(r.slice())}this.hasComposition=i?{from:i.range.fromB,to:i.range.toB}:null,(qe.ie||qe.chrome)&&!i&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let l=this.decorations,c=this.updateDeco(),u=$V(l,c,e.changes);return r=ji.extendWithRanges(r,u),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,i),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,r);let{observer:s}=this.view;s.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let l=qe.chrome||qe.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,l),this.flags&=-8,l&&(l.written||s.selectionRange.focusNode!=l.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(l=>l.flags&=-9);let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let l of this.children)l instanceof ol&&l.widget instanceof L2&&i.push(l.dom);s.updateGaps(i)}updateChildren(e,t,r){let s=r?r.range.addToSet(e.slice()):e,i=this.childCursor(t);for(let l=s.length-1;;l--){let c=l>=0?s[l]:null;if(!c)break;let{fromA:u,toA:h,fromB:m,toB:p}=c,x,v,b,O;if(r&&r.range.fromB<p&&r.range.toB>m){let _=nf.build(this.view.state.doc,m,r.range.fromB,this.decorations,this.dynamicDecorationMap),D=nf.build(this.view.state.doc,r.range.toB,p,this.decorations,this.dynamicDecorationMap);v=_.breakAtStart,b=_.openStart,O=D.openEnd;let E=this.compositionView(r);D.breakAtStart?E.breakAfter=1:D.content.length&&E.merge(E.length,E.length,D.content[0],!1,D.openStart,0)&&(E.breakAfter=D.content[0].breakAfter,D.content.shift()),_.content.length&&E.merge(0,0,_.content[_.content.length-1],!0,0,_.openEnd)&&_.content.pop(),x=_.content.concat(E).concat(D.content)}else({content:x,breakAtStart:v,openStart:b,openEnd:O}=nf.build(this.view.state.doc,m,p,this.decorations,this.dynamicDecorationMap));let{i:k,off:j}=i.findPos(h,1),{i:T,off:M}=i.findPos(u,-1);JM(this,T,M,k,j,x,v,b,O)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let r of t.effects)r.is(yA)&&(this.editContextFormatting=r.value)}compositionView(e){let t=new Qi(e.text.nodeValue);t.flags|=8;for(let{deco:s}of e.marks)t=new ml(s,[t],t.length);let r=new pr;return r.append(t,0),r}fixCompositionDOM(e){let t=(i,l)=>{l.flags|=8|(l.children.some(u=>u.flags&7)?1:0),this.markedForComposition.add(l);let c=jn.get(i);c&&c!=l&&(c.dom=null),l.setDOM(i)},r=this.childPos(e.range.fromB,1),s=this.children[r.i];t(e.line,s);for(let i=e.marks.length-1;i>=-1;i--)r=s.childPos(r.off,1),s=s.children[r.i],t(i>=0?e.marks[i].node:e.text,s)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,s=r==this.dom,i=!s&&!(this.view.state.facet(sl)||this.dom.tabIndex>-1)&&Zp(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(s||t||i))return;let l=this.forceSelection;this.forceSelection=!1;let c=this.view.state.selection.main,u=this.moveToLine(this.domAtPos(c.anchor)),h=c.empty?u:this.moveToLine(this.domAtPos(c.head));if(qe.gecko&&c.empty&&!this.hasComposition&&IV(u)){let p=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(p,u.node.childNodes[u.offset]||null)),u=h=new ns(p,0),l=!0}let m=this.view.observer.selectionRange;(l||!m.focusNode||(!tf(u.node,u.offset,m.anchorNode,m.anchorOffset)||!tf(h.node,h.offset,m.focusNode,m.focusOffset))&&!this.suppressWidgetCursorChange(m,c))&&(this.view.observer.ignore(()=>{qe.android&&qe.chrome&&this.dom.contains(m.focusNode)&&HV(m.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let p=yf(this.view.root);if(p)if(c.empty){if(qe.gecko){let x=qV(u.node,u.offset);if(x&&x!=3){let v=(x==1?YM:KM)(u.node,u.offset);v&&(u=new ns(v.node,v.offset))}}p.collapse(u.node,u.offset),c.bidiLevel!=null&&p.caretBidiLevel!==void 0&&(p.caretBidiLevel=c.bidiLevel)}else if(p.extend){p.collapse(u.node,u.offset);try{p.extend(h.node,h.offset)}catch{}}else{let x=document.createRange();c.anchor>c.head&&([u,h]=[h,u]),x.setEnd(h.node,h.offset),x.setStart(u.node,u.offset),p.removeAllRanges(),p.addRange(x)}i&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,h)),this.impreciseAnchor=u.precise?null:new ns(m.anchorNode,m.anchorOffset),this.impreciseHead=h.precise?null:new ns(m.focusNode,m.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&tf(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,r=yf(e.root),{anchorNode:s,anchorOffset:i}=e.observer.selectionRange;if(!r||!t.empty||!t.assoc||!r.modify)return;let l=pr.find(this,t.head);if(!l)return;let c=l.posAtStart;if(t.head==c||t.head==c+l.length)return;let u=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!u||!h||u.bottom>h.top)return;let m=this.domAtPos(t.head+t.assoc);r.collapse(m.node,m.offset),r.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let p=e.observer.selectionRange;e.docView.posFromDOM(p.anchorNode,p.anchorOffset)!=t.from&&r.collapse(s,i)}moveToLine(e){let t=this.dom,r;if(e.node!=t)return e;for(let s=e.offset;!r&&s<t.childNodes.length;s++){let i=jn.get(t.childNodes[s]);i instanceof pr&&(r=i.domAtPos(0))}for(let s=e.offset-1;!r&&s>=0;s--){let i=jn.get(t.childNodes[s]);i instanceof pr&&(r=i.domAtPos(i.length))}return r?new ns(r.node,r.offset,!0):e}nearest(e){for(let t=e;t;){let r=jn.get(t);if(r&&r.rootView==this)return r;t=t.parentNode}return null}posFromDOM(e,t){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,t)+r.posAtStart}domAtPos(e){let{i:t,off:r}=this.childCursor().findPos(e,-1);for(;t<this.children.length-1;){let s=this.children[t];if(r<s.length||s instanceof pr)break;t++,r=0}return this.children[t].domAtPos(r)}coordsAt(e,t){let r=null,s=0;for(let i=this.length,l=this.children.length-1;l>=0;l--){let c=this.children[l],u=i-c.breakAfter,h=u-c.length;if(u<e)break;if(h<=e&&(h<e||c.covers(-1))&&(u>e||c.covers(1))&&(!r||c instanceof pr&&!(r instanceof pr&&t>=0)))r=c,s=h;else if(r&&h==e&&u==e&&c instanceof ol&&Math.abs(t)<2){if(c.deco.startSide<0)break;l&&(r=null)}i=h}return r?r.coordsAt(e-s,t):null}coordsForChar(e){let{i:t,off:r}=this.childPos(e,1),s=this.children[t];if(!(s instanceof pr))return null;for(;s.children.length;){let{i:c,off:u}=s.childPos(r,1);for(;;c++){if(c==s.children.length)return null;if((s=s.children[c]).length)break}r=u}if(!(s instanceof Qi))return null;let i=Vr(s.text,r);if(i==r)return null;let l=wc(s.dom,r,i).getClientRects();for(let c=0;c<l.length;c++){let u=l[c];if(c==l.length-1||u.top<u.bottom&&u.left<u.right)return u}return null}measureVisibleLineHeights(e){let t=[],{from:r,to:s}=e,i=this.view.contentDOM.clientWidth,l=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,c=-1,u=this.view.textDirection==Hn.LTR;for(let h=0,m=0;m<this.children.length;m++){let p=this.children[m],x=h+p.length;if(x>s)break;if(h>=r){let v=p.dom.getBoundingClientRect();if(t.push(v.height),l){let b=p.dom.lastChild,O=b?dd(b):[];if(O.length){let k=O[O.length-1],j=u?k.right-v.left:v.right-k.left;j>c&&(c=j,this.minWidth=i,this.minWidthFrom=h,this.minWidthTo=x)}}}h=x+p.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?Hn.RTL:Hn.LTR}measureTextSize(){for(let i of this.children)if(i instanceof pr){let l=i.measureTextSize();if(l)return l}let e=document.createElement("div"),t,r,s;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let i=dd(e.firstChild)[0];t=e.getBoundingClientRect().height,r=i?i.width/27:7,s=i?i.height:t,e.remove()}),{lineHeight:t,charWidth:r,textHeight:s}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new ZM(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let r=0,s=0;;s++){let i=s==t.viewports.length?null:t.viewports[s],l=i?i.from-1:this.length;if(l>r){let c=(t.lineBlockAt(l).bottom-t.lineBlockAt(r).top)/this.view.scaleY;e.push(Je.replace({widget:new L2(c),block:!0,inclusive:!0,isBlockGap:!0}).range(r,l))}if(!i)break;r=i.to+1}return Je.set(e)}updateDeco(){let e=1,t=this.view.state.facet(bf).map(i=>(this.dynamicDecorationMap[e++]=typeof i=="function")?i(this.view):i),r=!1,s=this.view.state.facet(wA).map((i,l)=>{let c=typeof i=="function";return c&&(r=!0),c?i(this.view):i});for(s.length&&(this.dynamicDecorationMap[e++]=r,t.push(Gt.join(s))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let h=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=h.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let h of this.view.state.facet(vA))try{if(h(this.view,e.range,e))return!0}catch(m){Es(this.view.state,m,"scroll handler")}let{range:t}=e,r=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),s;if(!r)return;!t.empty&&(s=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(r={left:Math.min(r.left,s.left),top:Math.min(r.top,s.top),right:Math.max(r.right,s.right),bottom:Math.max(r.bottom,s.bottom)});let i=Aw(this.view),l={left:r.left-i.left,top:r.top-i.top,right:r.right+i.right,bottom:r.bottom+i.bottom},{offsetWidth:c,offsetHeight:u}=this.view.scrollDOM;vV(this.view.scrollDOM,l,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,c),-c),Math.max(Math.min(e.yMargin,u),-u),this.view.textDirection==Hn.LTR)}lineHasWidget(e){let{i:t}=this.childCursor().findPos(e);if(t==this.children.length)return!1;let r=s=>s instanceof il||s.children.some(r);return r(this.children[t])}}function IV(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable=="false")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable=="false")}function kA(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let r=YM(t.focusNode,t.focusOffset),s=KM(t.focusNode,t.focusOffset),i=r||s;if(s&&r&&s.node!=r.node){let c=jn.get(s.node);if(!c||c instanceof Qi&&c.text!=s.node.nodeValue)i=s;else if(n.docView.lastCompositionAfterCursor){let u=jn.get(r.node);!u||u instanceof Qi&&u.text!=r.node.nodeValue||(i=s)}}if(n.docView.lastCompositionAfterCursor=i!=r,!i)return null;let l=e-i.offset;return{from:l,to:l+i.node.nodeValue.length,node:i.node}}function FV(n,e,t){let r=kA(n,t);if(!r)return null;let{node:s,from:i,to:l}=r,c=s.nodeValue;if(/[\n\r]/.test(c)||n.state.doc.sliceString(r.from,r.to)!=c)return null;let u=e.invertedDesc,h=new ji(u.mapPos(i),u.mapPos(l),i,l),m=[];for(let p=s.parentNode;;p=p.parentNode){let x=jn.get(p);if(x instanceof ml)m.push({node:p,deco:x.mark});else{if(x instanceof pr||p.nodeName=="DIV"&&p.parentNode==n.contentDOM)return{range:h,text:s,marks:m,line:p};if(p!=n.contentDOM)m.push({node:p,deco:new a0({inclusive:!0,attributes:CV(p),tagName:p.tagName.toLowerCase()})});else return null}}}function qV(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e<n.childNodes.length&&n.childNodes[e].contentEditable=="false"?2:0)}let QV=class{constructor(){this.changes=[]}compareRange(e,t){Jp(e,t,this.changes)}comparePoint(e,t){Jp(e,t,this.changes)}boundChange(e){Jp(e,e,this.changes)}};function $V(n,e,t){let r=new QV;return Gt.compare(n,e,t,r),r.changes}function HV(n,e){for(let t=n;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function UV(n,e){let t=!1;return e&&n.iterChangedRanges((r,s)=>{r<e.to&&s>e.from&&(t=!0)}),t}function VV(n,e,t=1){let r=n.charCategorizer(e),s=n.doc.lineAt(e),i=e-s.from;if(s.length==0)return Ce.cursor(e);i==0?t=1:i==s.length&&(t=-1);let l=i,c=i;t<0?l=Vr(s.text,i,!1):c=Vr(s.text,i);let u=r(s.text.slice(l,c));for(;l>0;){let h=Vr(s.text,l,!1);if(r(s.text.slice(h,l))!=u)break;l=h}for(;c<s.length;){let h=Vr(s.text,c);if(r(s.text.slice(c,h))!=u)break;c=h}return Ce.range(l+s.from,c+s.from)}function WV(n,e){return e.left>n?e.left-n:Math.max(0,n-e.right)}function GV(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function Dy(n,e){return n.top<e.bottom-1&&n.bottom>e.top+1}function xj(n,e){return e<n.top?{top:e,left:n.left,right:n.right,bottom:n.bottom}:n}function vj(n,e){return e>n.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function Q2(n,e,t){let r,s,i,l,c=!1,u,h,m,p;for(let b=n.firstChild;b;b=b.nextSibling){let O=dd(b);for(let k=0;k<O.length;k++){let j=O[k];s&&Dy(s,j)&&(j=xj(vj(j,s.bottom),s.top));let T=WV(e,j),M=GV(t,j);if(T==0&&M==0)return b.nodeType==3?yj(b,e,t):Q2(b,e,t);(!r||l>M||l==M&&i>T)&&(r=b,s=j,i=T,l=M,c=T?e<j.left?k>0:k<O.length-1:!0),T==0?t>j.bottom&&(!m||m.bottom<j.bottom)?(u=b,m=j):t<j.top&&(!p||p.top>j.top)&&(h=b,p=j):m&&Dy(m,j)?m=vj(m,j.bottom):p&&Dy(p,j)&&(p=xj(p,j.top))}}if(m&&m.bottom>=t?(r=u,s=m):p&&p.top<=t&&(r=h,s=p),!r)return{node:n,offset:0};let x=Math.max(s.left,Math.min(s.right,e));if(r.nodeType==3)return yj(r,x,t);if(c&&r.contentEditable!="false")return Q2(r,x,t);let v=Array.prototype.indexOf.call(n.childNodes,r)+(e>=(s.left+s.right)/2?1:0);return{node:n,offset:v}}function yj(n,e,t){let r=n.nodeValue.length,s=-1,i=1e9,l=0;for(let c=0;c<r;c++){let u=wc(n,c,c+1).getClientRects();for(let h=0;h<u.length;h++){let m=u[h];if(m.top==m.bottom)continue;l||(l=e-m.left);let p=(m.top>t?m.top-t:t-m.bottom)-1;if(m.left-1<=e&&m.right+1>=e&&p<i){let x=e>=(m.left+m.right)/2,v=x;if(qe.chrome||qe.gecko){let b=wc(n,c).getBoundingClientRect();Math.abs(b.left-m.right)<.1&&(v=!x)}if(p<=0)return{node:n,offset:c+(v?1:0)};s=c+(v?1:0),i=p}}}return{node:n,offset:s>-1?s:l>0?n.nodeValue.length:0}}function jA(n,e,t,r=-1){var s,i;let l=n.contentDOM.getBoundingClientRect(),c=l.top+n.viewState.paddingTop,u,{docHeight:h}=n.viewState,{x:m,y:p}=e,x=p-c;if(x<0)return 0;if(x>h)return n.state.doc.length;for(let _=n.viewState.heightOracle.textHeight/2,D=!1;u=n.elementAtHeight(x),u.type!=fs.Text;)for(;x=r>0?u.bottom+_:u.top-_,!(x>=0&&x<=h);){if(D)return t?null:0;D=!0,r=-r}p=c+x;let v=u.from;if(v<n.viewport.from)return n.viewport.from==0?0:t?null:bj(n,l,u,m,p);if(v>n.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:bj(n,l,u,m,p);let b=n.dom.ownerDocument,O=n.root.elementFromPoint?n.root:b,k=O.elementFromPoint(m,p);k&&!n.contentDOM.contains(k)&&(k=null),k||(m=Math.max(l.left+1,Math.min(l.right-1,m)),k=O.elementFromPoint(m,p),k&&!n.contentDOM.contains(k)&&(k=null));let j,T=-1;if(k&&((s=n.docView.nearest(k))===null||s===void 0?void 0:s.isEditable)!=!1){if(b.caretPositionFromPoint){let _=b.caretPositionFromPoint(m,p);_&&({offsetNode:j,offset:T}=_)}else if(b.caretRangeFromPoint){let _=b.caretRangeFromPoint(m,p);_&&({startContainer:j,startOffset:T}=_)}j&&(!n.contentDOM.contains(j)||qe.safari&&XV(j,T,m)||qe.chrome&&YV(j,T,m))&&(j=void 0),j&&(T=Math.min(ya(j),T))}if(!j||!n.docView.dom.contains(j)){let _=pr.find(n.docView,v);if(!_)return x>u.top+u.height/2?u.to:u.from;({node:j,offset:T}=Q2(_.dom,m,p))}let M=n.docView.nearest(j);if(!M)return null;if(M.isWidget&&((i=M.dom)===null||i===void 0?void 0:i.nodeType)==1){let _=M.dom.getBoundingClientRect();return e.y<_.top||e.y<=_.bottom&&e.x<=(_.left+_.right)/2?M.posAtStart:M.posAtEnd}else return M.localPosFromDOM(j,T)+M.posAtStart}function bj(n,e,t,r,s){let i=Math.round((r-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let c=n.viewState.heightOracle.textHeight,u=Math.floor((s-t.top-(n.defaultLineHeight-c)*.5)/c);i+=u*n.viewState.heightOracle.lineLength}let l=n.state.sliceDoc(t.from,t.to);return t.from+C2(l,i,n.state.tabSize)}function NA(n,e,t){let r,s=n;if(n.nodeType!=3||e!=(r=n.nodeValue.length))return!1;for(;;){let i=s.nextSibling;if(i){if(i.nodeName=="BR")break;return!1}else{let l=s.parentNode;if(!l||l.nodeName=="DIV")break;s=l}}return wc(n,r-1,r).getBoundingClientRect().right>t}function XV(n,e,t){return NA(n,e,t)}function YV(n,e,t){if(e!=0)return NA(n,e,t);for(let s=n;;){let i=s.parentNode;if(!i||i.nodeType!=1||i.firstChild!=s)return!1;if(i.classList.contains("cm-line"))break;s=i}let r=n.nodeType==1?n.getBoundingClientRect():wc(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-r.left>5}function $2(n,e,t){let r=n.lineBlockAt(e);if(Array.isArray(r.type)){let s;for(let i of r.type){if(i.from>e)break;if(!(i.to<e)){if(i.from<e&&i.to>e)return i;(!s||i.type==fs.Text&&(s.type!=i.type||(t<0?i.from<e:i.to>e)))&&(s=i)}}return s||r}return r}function KV(n,e,t,r){let s=$2(n,e.head,e.assoc||-1),i=!r||s.type!=fs.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(i){let l=n.dom.getBoundingClientRect(),c=n.textDirectionAt(s.from),u=n.posAtCoords({x:t==(c==Hn.LTR)?l.right-1:l.left+1,y:(i.top+i.bottom)/2});if(u!=null)return Ce.cursor(u,t?-1:1)}return Ce.cursor(t?s.to:s.from,t?-1:1)}function wj(n,e,t,r){let s=n.state.doc.lineAt(e.head),i=n.bidiSpans(s),l=n.textDirectionAt(s.from);for(let c=e,u=null;;){let h=PV(s,i,l,c,t),m=cA;if(!h){if(s.number==(t?n.state.doc.lines:1))return c;m=`
|
||
`,s=n.state.doc.line(s.number+(t?1:-1)),i=n.bidiSpans(s),h=n.visualLineSide(s,!t)}if(u){if(!u(m))return c}else{if(!r)return h;u=r(m)}c=h}}function ZV(n,e,t){let r=n.state.charCategorizer(e),s=r(t);return i=>{let l=r(i);return s==Vn.Space&&(s=l),s==l}}function JV(n,e,t,r){let s=e.head,i=t?1:-1;if(s==(t?n.state.doc.length:0))return Ce.cursor(s,e.assoc);let l=e.goalColumn,c,u=n.contentDOM.getBoundingClientRect(),h=n.coordsAtPos(s,e.assoc||-1),m=n.documentTop;if(h)l==null&&(l=h.left-u.left),c=i<0?h.top:h.bottom;else{let v=n.viewState.lineBlockAt(s);l==null&&(l=Math.min(u.right-u.left,n.defaultCharacterWidth*(s-v.from))),c=(i<0?v.top:v.bottom)+m}let p=u.left+l,x=r??n.viewState.heightOracle.textHeight>>1;for(let v=0;;v+=10){let b=c+(x+v)*i,O=jA(n,{x:p,y:b},!1,i);if(b<u.top||b>u.bottom||(i<0?O<s:O>s)){let k=n.docView.coordsForChar(O),j=!k||b<k.top?-1:1;return Ce.cursor(O,j,void 0,l)}}}function rf(n,e,t){for(;;){let r=0;for(let s of n)s.between(e-1,e+1,(i,l,c)=>{if(e>i&&e<l){let u=r||t||(e-i<l-e?-1:1);e=u<0?i:l,r=u}});if(!r)return e}}function CA(n,e){let t=null;for(let r=0;r<e.ranges.length;r++){let s=e.ranges[r],i=null;if(s.empty){let l=rf(n,s.from,0);l!=s.from&&(i=Ce.cursor(l,-1))}else{let l=rf(n,s.from,-1),c=rf(n,s.to,1);(l!=s.from||c!=s.to)&&(i=Ce.range(s.from==s.anchor?l:c,s.from==s.head?l:c))}i&&(t||(t=e.ranges.slice()),t[r]=i)}return t?Ce.create(t,e.mainIndex):e}function Ry(n,e,t){let r=rf(n.state.facet(o0).map(s=>s(n)),t.from,e.head>t.from?-1:1);return r==t.from?t:Ce.cursor(r,r<t.from?1:-1)}const Hh="";class eW{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(Vt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Hh}readRange(e,t){if(!e)return this;let r=e.parentNode;for(let s=e;;){this.findPointBefore(r,s);let i=this.text.length;this.readNode(s);let l=s.nextSibling;if(l==t)break;let c=jn.get(s),u=jn.get(l);(c&&u?c.breakAfter:(c?c.breakAfter:jg(s))||jg(l)&&(s.nodeName!="BR"||s.cmIgnore)&&this.text.length>i)&&!nW(l,t)&&this.lineBreak(),s=l}return this.findPointBefore(r,t),this}readTextNode(e){let t=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,t.length));for(let r=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,l=1,c;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,r),l=this.lineSeparator.length):(c=s.exec(t))&&(i=c.index,l=c[0].length),this.append(t.slice(r,i<0?t.length:i)),i<0)break;if(this.lineBreak(),l>1)for(let u of this.points)u.node==e&&u.pos>this.text.length&&(u.pos-=l-1);r=i+l}}readNode(e){if(e.cmIgnore)return;let t=jn.get(e),r=t&&t.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let s=r.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==t&&(r.pos=this.text.length)}findPointInside(e,t){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(tW(e,r.node,r.offset)?t:0))}}function tW(n,e,t){for(;;){if(!e||t<ya(e))return!1;if(e==n)return!0;t=bc(e)+1,e=e.parentNode}}function nW(n,e){let t;for(;!(n==e||!n);n=n.nextSibling){let r=jn.get(n);if(!(r?.isWidget||n.cmIgnore))return!1;r&&(t||(t=[])).push(r)}if(t)for(let r of t){let s=r.overrideDOMText;if(s?.length)return!1}return!0}class Sj{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class rW{constructor(e,t,r,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:i,impreciseAnchor:l}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,r,0))){let c=i||l?[]:iW(e),u=new eW(c,e.state);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=aW(c,this.bounds.from)}else{let c=e.observer.selectionRange,u=i&&i.node==c.focusNode&&i.offset==c.focusOffset||!R2(e.contentDOM,c.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(c.focusNode,c.focusOffset),h=l&&l.node==c.anchorNode&&l.offset==c.anchorOffset||!R2(e.contentDOM,c.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(c.anchorNode,c.anchorOffset),m=e.viewport;if((qe.ios||qe.chrome)&&e.state.selection.main.empty&&u!=h&&(m.from>0||m.to<e.state.doc.length)){let p=Math.min(u,h),x=Math.max(u,h),v=m.from-p,b=m.to-x;(v==0||v==1||p==0)&&(b==0||b==-1||x==e.state.doc.length)&&(u=0,h=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(Ce.range(h,u)):this.newSel=Ce.single(h,u)}}}function TA(n,e){let t,{newSel:r}=e,s=n.state.selection.main,i=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:c}=e.bounds,u=s.from,h=null;(i===8||qe.android&&e.text.length<c-l)&&(u=s.to,h="end");let m=MA(n.state.doc.sliceString(l,c,Hh),e.text,u-l,h);m&&(qe.chrome&&i==13&&m.toB==m.from+2&&e.text.slice(m.from,m.toB)==Hh+Hh&&m.toB--,t={from:l+m.from,to:l+m.toA,insert:Wt.of(e.text.slice(m.from,m.toB).split(Hh))})}else r&&(!n.hasFocus&&n.state.facet(sl)||r.main.eq(s))&&(r=null);if(!t&&!r)return!1;if(!t&&e.typeOver&&!s.empty&&r&&r.main.empty?t={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,s.to)}:(qe.mac||qe.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(r&&t.insert.length==2&&(r=Ce.single(r.main.anchor-1,r.main.head-1)),t={from:t.from,to:t.to,insert:Wt.of([t.insert.toString().replace("."," ")])}):t&&t.from>=s.from&&t.to<=s.to&&(t.from!=s.from||t.to!=s.to)&&s.to-s.from-(t.to-t.from)<=4?t={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,s.to))}:n.state.doc.lineAt(s.from).to<s.to&&n.docView.lineHasWidget(s.to)&&n.inputState.insertingTextAt>Date.now()-50?t={from:s.from,to:s.to,insert:n.state.toText(n.inputState.insertingText)}:qe.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==`
|
||
`&&n.lineWrapping&&(r&&(r=Ce.single(r.main.anchor-1,r.main.head-1)),t={from:s.from,to:s.to,insert:Wt.of([" "])}),t)return Ew(n,t,r,i);if(r&&!r.main.eq(s)){let l=!1,c="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(l=!0),c=n.inputState.lastSelectionOrigin,c=="select.pointer"&&(r=CA(n.state.facet(o0).map(u=>u(n)),r))),n.dispatch({selection:r,scrollIntoView:l,userEvent:c}),!0}else return!1}function Ew(n,e,t,r=-1){if(qe.ios&&n.inputState.flushIOSKey(e))return!0;let s=n.state.selection.main;if(qe.android&&(e.to==s.to&&(e.from==s.from||e.from==s.from-1&&n.state.sliceDoc(e.from,s.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Xu(n.contentDOM,"Enter",13)||(e.from==s.from-1&&e.to==s.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>s.head)&&Xu(n.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&Xu(n.contentDOM,"Delete",46)))return!0;let i=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let l,c=()=>l||(l=sW(n,e,t));return n.state.facet(mA).some(u=>u(n,e.from,e.to,i,c))||n.dispatch(c()),!0}function sW(n,e,t){let r,s=n.state,i=s.selection.main,l=-1;if(e.from==e.to&&e.from<i.from||e.from>i.to){let u=e.from<i.from?-1:1,h=u<0?i.from:i.to,m=rf(s.facet(o0).map(p=>p(n)),h,u);e.from==m&&(l=m)}if(l>-1)r={changes:e,selection:Ce.cursor(e.from+e.insert.length,-1)};else if(e.from>=i.from&&e.to<=i.to&&e.to-e.from>=(i.to-i.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let u=i.from<e.from?s.sliceDoc(i.from,e.from):"",h=i.to>e.to?s.sliceDoc(e.to,i.to):"";r=s.replaceSelection(n.state.toText(u+e.insert.sliceString(0,void 0,n.state.lineBreak)+h))}else{let u=s.changes(e),h=t&&t.main.to<=u.newLength?t.main:void 0;if(s.selection.ranges.length>1&&(n.inputState.composing>=0||n.inputState.compositionPendingChange)&&e.to<=i.to+10&&e.to>=i.to-10){let m=n.state.sliceDoc(e.from,e.to),p,x=t&&kA(n,t.main.head);if(x){let b=e.insert.length-(e.to-e.from);p={from:x.from,to:x.to-b}}else p=n.state.doc.lineAt(i.head);let v=i.to-e.to;r=s.changeByRange(b=>{if(b.from==i.from&&b.to==i.to)return{changes:u,range:h||b.map(u)};let O=b.to-v,k=O-m.length;if(n.state.sliceDoc(k,O)!=m||O>=p.from&&k<=p.to)return{range:b};let j=s.changes({from:k,to:O,insert:e.insert}),T=b.to-i.to;return{changes:j,range:h?Ce.range(Math.max(0,h.anchor+T),Math.max(0,h.head+T)):b.map(j)}})}else r={changes:u,selection:h&&s.selection.replaceRange(h)}}let c="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,c+=".compose",n.inputState.compositionFirstChange&&(c+=".start",n.inputState.compositionFirstChange=!1)),s.update(r,{userEvent:c,scrollIntoView:!0})}function MA(n,e,t,r){let s=Math.min(n.length,e.length),i=0;for(;i<s&&n.charCodeAt(i)==e.charCodeAt(i);)i++;if(i==s&&n.length==e.length)return null;let l=n.length,c=e.length;for(;l>0&&c>0&&n.charCodeAt(l-1)==e.charCodeAt(c-1);)l--,c--;if(r=="end"){let u=Math.max(0,i-Math.min(l,c));t-=l+u-i}if(l<i&&n.length<e.length){let u=t<=i&&t>=l?i-t:0;i-=u,c=i+(c-l),l=i}else if(c<i){let u=t<=i&&t>=c?i-t:0;i-=u,l=i+(l-c),c=i}return{from:i,toA:l,toB:c}}function iW(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:r,focusNode:s,focusOffset:i}=n.observer.selectionRange;return t&&(e.push(new Sj(t,r)),(s!=t||i!=r)&&e.push(new Sj(s,i))),e}function aW(n,e){if(n.length==0)return null;let t=n[0].pos,r=n.length==2?n[1].pos:t;return t>-1&&r>-1?Ce.single(t+e,r+e):null}class lW{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,qe.safari&&e.contentDOM.addEventListener("input",()=>null),qe.gecko&&OW(e.contentDOM.ownerDocument)}handleEvent(e){!pW(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let r=this.handlers[e];if(r){for(let s of r.observers)s(this.view,t);for(let s of r.handlers){if(t.defaultPrevented)break;if(s(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=oW(e),r=this.handlers,s=this.view.contentDOM;for(let i in t)if(i!="scroll"){let l=!t[i].handlers.length,c=r[i];c&&l!=!c.handlers.length&&(s.removeEventListener(i,this.handleEvent),c=null),c||s.addEventListener(i,this.handleEvent,{passive:l})}for(let i in r)i!="scroll"&&!t[i]&&s.removeEventListener(i,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&EA.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),qe.android&&qe.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return qe.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=AA.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||cW.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Xu(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:qe.safari&&!qe.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function Oj(n,e){return(t,r)=>{try{return e.call(n,r,t)}catch(s){Es(t.state,s)}}}function oW(n){let e=Object.create(null);function t(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of n){let s=r.spec,i=s&&s.plugin.domEventHandlers,l=s&&s.plugin.domEventObservers;if(i)for(let c in i){let u=i[c];u&&t(c).handlers.push(Oj(r.value,u))}if(l)for(let c in l){let u=l[c];u&&t(c).observers.push(Oj(r.value,u))}}for(let r in $i)t(r).handlers.push($i[r]);for(let r in Ci)t(r).observers.push(Ci[r]);return e}const AA=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],cW="dthko",EA=[16,17,18,20,91,92,224,225],sp=6;function ip(n){return Math.max(0,n)*.7+8}function uW(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class dW{constructor(e,t,r,s){this.view=e,this.startEvent=t,this.style=r,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=yV(e.contentDOM),this.atoms=e.state.facet(o0).map(l=>l(e));let i=e.contentDOM.ownerDocument;i.addEventListener("mousemove",this.move=this.move.bind(this)),i.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Vt.allowMultipleSelections)&&hW(e,t),this.dragging=mW(e,t)&&RA(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&uW(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,r=0,s=0,i=0,l=this.view.win.innerWidth,c=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:l}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:c}=this.scrollParents.y.getBoundingClientRect());let u=Aw(this.view);e.clientX-u.left<=s+sp?t=-ip(s-e.clientX):e.clientX+u.right>=l-sp&&(t=ip(e.clientX-l)),e.clientY-u.top<=i+sp?r=-ip(i-e.clientY):e.clientY+u.bottom>=c-sp&&(r=ip(e.clientY-c)),this.setScrollSpeed(t,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,r=CA(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function hW(n,e){let t=n.state.facet(uA);return t.length?t[0](e):qe.mac?e.metaKey:e.ctrlKey}function fW(n,e){let t=n.state.facet(dA);return t.length?t[0](e):qe.mac?!e.altKey:!e.ctrlKey}function mW(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let r=yf(n.root);if(!r||r.rangeCount==0)return!0;let s=r.getRangeAt(0).getClientRects();for(let i=0;i<s.length;i++){let l=s[i];if(l.left<=e.clientX&&l.right>=e.clientX&&l.top<=e.clientY&&l.bottom>=e.clientY)return!0}return!1}function pW(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,r;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(r=jn.get(t))&&r.ignoreEvent(e))return!1;return!0}const $i=Object.create(null),Ci=Object.create(null),_A=qe.ie&&qe.ie_version<15||qe.ios&&qe.webkit_version<604;function gW(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),DA(n,t.value)},50)}function kx(n,e,t){for(let r of n.facet(e))t=r(t,n);return t}function DA(n,e){e=kx(n.state,Cw,e);let{state:t}=n,r,s=1,i=t.toText(e),l=i.lines==t.selection.ranges.length;if(H2!=null&&t.selection.ranges.every(u=>u.empty)&&H2==i.toString()){let u=-1;r=t.changeByRange(h=>{let m=t.doc.lineAt(h.from);if(m.from==u)return{range:h};u=m.from;let p=t.toText((l?i.line(s++).text:e)+t.lineBreak);return{changes:{from:m.from,insert:p},range:Ce.cursor(h.from+p.length)}})}else l?r=t.changeByRange(u=>{let h=i.line(s++);return{changes:{from:u.from,to:u.to,insert:h.text},range:Ce.cursor(u.from+h.length)}}):r=t.replaceSelection(i);n.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Ci.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};$i.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);Ci.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};Ci.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};$i.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let r of n.state.facet(hA))if(t=r(n,e),t)break;if(!t&&e.button==0&&(t=yW(n,e)),t){let r=!n.hasFocus;n.inputState.startMouseSelection(new dW(n,e,t,r)),r&&n.observer.ignore(()=>{WM(n.contentDOM);let i=n.root.activeElement;i&&!i.contains(n.contentDOM)&&i.blur()});let s=n.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}else n.inputState.setSelectionOrigin("select.pointer");return!1};function kj(n,e,t,r){if(r==1)return Ce.cursor(e,t);if(r==2)return VV(n.state,e,t);{let s=pr.find(n.docView,e),i=n.state.doc.lineAt(s?s.posAtEnd:e),l=s?s.posAtStart:i.from,c=s?s.posAtEnd:i.to;return c<n.state.doc.length&&c==i.to&&c++,Ce.range(l,c)}}let jj=(n,e,t)=>e>=t.top&&e<=t.bottom&&n>=t.left&&n<=t.right;function xW(n,e,t,r){let s=pr.find(n.docView,e);if(!s)return 1;let i=e-s.posAtStart;if(i==0)return 1;if(i==s.length)return-1;let l=s.coordsAt(i,-1);if(l&&jj(t,r,l))return-1;let c=s.coordsAt(i,1);return c&&jj(t,r,c)?1:l&&l.bottom>=r?-1:1}function Nj(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:xW(n,t,e.clientX,e.clientY)}}const vW=qe.ie&&qe.ie_version<=11;let Cj=null,Tj=0,Mj=0;function RA(n){if(!vW)return n.detail;let e=Cj,t=Mj;return Cj=n,Mj=Date.now(),Tj=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(Tj+1)%3:1}function yW(n,e){let t=Nj(n,e),r=RA(e),s=n.state.selection;return{update(i){i.docChanged&&(t.pos=i.changes.mapPos(t.pos),s=s.map(i.changes))},get(i,l,c){let u=Nj(n,i),h,m=kj(n,u.pos,u.bias,r);if(t.pos!=u.pos&&!l){let p=kj(n,t.pos,t.bias,r),x=Math.min(p.from,m.from),v=Math.max(p.to,m.to);m=x<m.from?Ce.range(x,v):Ce.range(v,x)}return l?s.replaceRange(s.main.extend(m.from,m.to)):c&&r==1&&s.ranges.length>1&&(h=bW(s,u.pos))?h:c?s.addRange(m):Ce.create([m])}}}function bW(n,e){for(let t=0;t<n.ranges.length;t++){let{from:r,to:s}=n.ranges[t];if(r<=e&&s>=e)return Ce.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}$i.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let s=n.docView.nearest(e.target);if(s&&s.isWidget){let i=s.posAtStart,l=i+s.length;(i>=t.to||l<=t.from)&&(t=Ce.range(i,l))}}let{inputState:r}=n;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",kx(n.state,Tw,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};$i.dragend=n=>(n.inputState.draggedContent=null,!1);function Aj(n,e,t,r){if(t=kx(n.state,Cw,t),!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:i}=n.inputState,l=r&&i&&fW(n,e)?{from:i.from,to:i.to}:null,c={from:s,insert:t},u=n.state.changes(l?[l,c]:c);n.focus(),n.dispatch({changes:u,selection:{anchor:u.mapPos(s,-1),head:u.mapPos(s,1)},userEvent:l?"move.drop":"input.drop"}),n.inputState.draggedContent=null}$i.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let r=Array(t.length),s=0,i=()=>{++s==t.length&&Aj(n,e,r.filter(l=>l!=null).join(n.state.lineBreak),!1)};for(let l=0;l<t.length;l++){let c=new FileReader;c.onerror=i,c.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(c.result)||(r[l]=c.result),i()},c.readAsText(t[l])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return Aj(n,e,r,!0),!0}return!1};$i.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=_A?null:e.clipboardData;return t?(DA(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(gW(n),!1)};function wW(n,e){let t=n.dom.parentNode;if(!t)return;let r=t.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),n.focus()},50)}function SW(n){let e=[],t=[],r=!1;for(let s of n.selection.ranges)s.empty||(e.push(n.sliceDoc(s.from,s.to)),t.push(s));if(!e.length){let s=-1;for(let{from:i}of n.selection.ranges){let l=n.doc.lineAt(i);l.number>s&&(e.push(l.text),t.push({from:l.from,to:Math.min(n.doc.length,l.to+1)})),s=l.number}r=!0}return{text:kx(n,Tw,e.join(n.lineBreak)),ranges:t,linewise:r}}let H2=null;$i.copy=$i.cut=(n,e)=>{let{text:t,ranges:r,linewise:s}=SW(n.state);if(!t&&!s)return!1;H2=s?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let i=_A?null:e.clipboardData;return i?(i.clearData(),i.setData("text/plain",t),!0):(wW(n,t),!1)};const zA=Sa.define();function PA(n,e){let t=[];for(let r of n.facet(pA)){let s=r(n,e);s&&t.push(s)}return t.length?n.update({effects:t,annotations:zA.of(!0)}):null}function LA(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=PA(n.state,e);t?n.dispatch(t):n.update([])}},10)}Ci.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),LA(n)};Ci.blur=n=>{n.observer.clearSelectionRange(),LA(n)};Ci.compositionstart=Ci.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};Ci.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,qe.chrome&&qe.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};Ci.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};$i.beforeinput=(n,e)=>{var t,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(n.inputState.insertingText=e.data,n.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&n.observer.editContext){let i=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),l=e.getTargetRanges();if(i&&l.length){let c=l[0],u=n.posAtDOM(c.startContainer,c.startOffset),h=n.posAtDOM(c.endContainer,c.endOffset);return Ew(n,{from:u,to:h,insert:n.state.toText(i)},null),!0}}let s;if(qe.chrome&&qe.android&&(s=AA.find(i=>i.inputType==e.inputType))&&(n.observer.delayAndroidKey(s.key,s.keyCode),s.key=="Backspace"||s.key=="Delete")){let i=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var l;(((l=window.visualViewport)===null||l===void 0?void 0:l.height)||0)>i+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return qe.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),qe.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>Ci.compositionend(n,e),20),!1};const Ej=new Set;function OW(n){Ej.has(n)||(Ej.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const _j=["pre-wrap","normal","pre-line","break-spaces"];let md=!1;function Dj(){md=!1}class kW{constructor(e){this.lineWrapping=e,this.doc=Wt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let r=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((t-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return _j.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let r=0;r<e.length;r++){let s=e[r];s<0?r++:this.heightSamples[Math.floor(s*10)]||(t=!0,this.heightSamples[Math.floor(s*10)]=!0)}return t}refresh(e,t,r,s,i,l){let c=_j.indexOf(e)>-1,u=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=c;if(this.lineWrapping=c,this.lineHeight=t,this.charWidth=r,this.textHeight=s,this.lineLength=i,u){this.heightSamples={};for(let h=0;h<l.length;h++){let m=l[h];m<0?h++:this.heightSamples[Math.floor(m*10)]=!0}}return u}}class jW{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class la{constructor(e,t,r,s,i){this.from=e,this.length=t,this.top=r,this.height=s,this._content=i}get type(){return typeof this._content=="number"?fs.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof mo?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new la(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var Qn=(function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n})(Qn||(Qn={}));const eg=.001;class ms{constructor(e,t,r=2){this.length=e,this.height=t,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>eg&&(md=!0),this.height=e)}replace(e,t,r){return ms.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,r,s){let i=this,l=r.doc;for(let c=s.length-1;c>=0;c--){let{fromA:u,toA:h,fromB:m,toB:p}=s[c],x=i.lineAt(u,Qn.ByPosNoHeight,r.setDoc(t),0,0),v=x.to>=h?x:i.lineAt(h,Qn.ByPosNoHeight,r,0,0);for(p+=v.to-h,h=v.to;c>0&&x.from<=s[c-1].toA;)u=s[c-1].fromA,m=s[c-1].fromB,c--,u<x.from&&(x=i.lineAt(u,Qn.ByPosNoHeight,r,0,0));m+=x.from-u,u=x.from;let b=_w.build(r.setDoc(l),e,m,p);i=Tg(i,i.replace(u,h,b))}return i.updateHeight(r,0)}static empty(){return new Js(0,0)}static of(e){if(e.length==1)return e[0];let t=0,r=e.length,s=0,i=0;for(;;)if(t==r)if(s>i*2){let c=e[t-1];c.break?e.splice(--t,1,c.left,null,c.right):e.splice(--t,1,c.left,c.right),r+=1+c.break,s-=c.size}else if(i>s*2){let c=e[r];c.break?e.splice(r,1,c.left,null,c.right):e.splice(r,1,c.left,c.right),r+=2+c.break,i-=c.size}else break;else if(s<i){let c=e[t++];c&&(s+=c.size)}else{let c=e[--r];c&&(i+=c.size)}let l=0;return e[t-1]==null?(l=1,t--):e[t]==null&&(l=1,r++),new NW(ms.of(e.slice(0,t)),l,ms.of(e.slice(r)))}}function Tg(n,e){return n==e?n:(n.constructor!=e.constructor&&(md=!0),e)}ms.prototype.size=1;class BA extends ms{constructor(e,t,r){super(e,t),this.deco=r}blockAt(e,t,r,s){return new la(s,this.length,r,this.height,this.deco||0)}lineAt(e,t,r,s,i){return this.blockAt(0,r,s,i)}forEachLine(e,t,r,s,i,l){e<=i+this.length&&t>=i&&l(this.blockAt(0,r,s,i))}updateHeight(e,t=0,r=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Js extends BA{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,r,s){return new la(s,this.length,r,this.height,this.breaks)}replace(e,t,r){let s=r[0];return r.length==1&&(s instanceof Js||s instanceof $r&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof $r?s=new Js(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):ms.of(r)}updateHeight(e,t=0,r=!1,s){return s&&s.from<=t&&s.more?this.setHeight(s.heights[s.index++]):(r||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class $r extends ms{constructor(e){super(e,0)}heightMetrics(e,t){let r=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,i=s-r+1,l,c=0;if(e.lineWrapping){let u=Math.min(this.height,e.lineHeight*i);l=u/i,this.length>i+1&&(c=(this.height-u)/(this.length-i-1))}else l=this.height/i;return{firstLine:r,lastLine:s,perLine:l,perChar:c}}blockAt(e,t,r,s){let{firstLine:i,lastLine:l,perLine:c,perChar:u}=this.heightMetrics(t,s);if(t.lineWrapping){let h=s+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),m=t.doc.lineAt(h),p=c+m.length*u,x=Math.max(r,e-p/2);return new la(m.from,m.length,x,p,0)}else{let h=Math.max(0,Math.min(l-i,Math.floor((e-r)/c))),{from:m,length:p}=t.doc.line(i+h);return new la(m,p,r+c*h,c,0)}}lineAt(e,t,r,s,i){if(t==Qn.ByHeight)return this.blockAt(e,r,s,i);if(t==Qn.ByPosNoHeight){let{from:v,to:b}=r.doc.lineAt(e);return new la(v,b-v,0,0,0)}let{firstLine:l,perLine:c,perChar:u}=this.heightMetrics(r,i),h=r.doc.lineAt(e),m=c+h.length*u,p=h.number-l,x=s+c*p+u*(h.from-i-p);return new la(h.from,h.length,Math.max(s,Math.min(x,s+this.height-m)),m,0)}forEachLine(e,t,r,s,i,l){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:c,perLine:u,perChar:h}=this.heightMetrics(r,i);for(let m=e,p=s;m<=t;){let x=r.doc.lineAt(m);if(m==e){let b=x.number-c;p+=u*b+h*(e-i-b)}let v=u+h*x.length;l(new la(x.from,x.length,p,v,0)),p+=v,m=x.to+1}}replace(e,t,r){let s=this.length-t;if(s>0){let i=r[r.length-1];i instanceof $r?r[r.length-1]=new $r(i.length+s):r.push(null,new $r(s-1))}if(e>0){let i=r[0];i instanceof $r?r[0]=new $r(e+i.length):r.unshift(new $r(e-1),null)}return ms.of(r)}decomposeLeft(e,t){t.push(new $r(e-1),null)}decomposeRight(e,t){t.push(null,new $r(this.length-e-1))}updateHeight(e,t=0,r=!1,s){let i=t+this.length;if(s&&s.from<=t+this.length&&s.more){let l=[],c=Math.max(t,s.from),u=-1;for(s.from>t&&l.push(new $r(s.from-t-1).updateHeight(e,t));c<=i&&s.more;){let m=e.doc.lineAt(c).length;l.length&&l.push(null);let p=s.heights[s.index++];u==-1?u=p:Math.abs(p-u)>=eg&&(u=-2);let x=new Js(m,p);x.outdated=!1,l.push(x),c+=m+1}c<=i&&l.push(null,new $r(i-c).updateHeight(e,c));let h=ms.of(l);return(u<0||Math.abs(h.height-this.height)>=eg||Math.abs(u-this.heightMetrics(e,t).perLine)>=eg)&&(md=!0),Tg(this,h)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class NW extends ms{constructor(e,t,r){super(e.length+t+r.length,e.height+r.height,t|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,t,r,s){let i=r+this.left.height;return e<i?this.left.blockAt(e,t,r,s):this.right.blockAt(e,t,i,s+this.left.length+this.break)}lineAt(e,t,r,s,i){let l=s+this.left.height,c=i+this.left.length+this.break,u=t==Qn.ByHeight?e<l:e<c,h=u?this.left.lineAt(e,t,r,s,i):this.right.lineAt(e,t,r,l,c);if(this.break||(u?h.to<c:h.from>c))return h;let m=t==Qn.ByPosNoHeight?Qn.ByPosNoHeight:Qn.ByPos;return u?h.join(this.right.lineAt(c,m,r,l,c)):this.left.lineAt(c,m,r,s,i).join(h)}forEachLine(e,t,r,s,i,l){let c=s+this.left.height,u=i+this.left.length+this.break;if(this.break)e<u&&this.left.forEachLine(e,t,r,s,i,l),t>=u&&this.right.forEachLine(e,t,r,c,u,l);else{let h=this.lineAt(u,Qn.ByPos,r,s,i);e<h.from&&this.left.forEachLine(e,h.from-1,r,s,i,l),h.to>=e&&h.from<=t&&l(h),t>h.to&&this.right.forEachLine(h.to+1,t,r,c,u,l)}}replace(e,t,r){let s=this.left.length+this.break;if(t<s)return this.balanced(this.left.replace(e,t,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-s,t-s,r));let i=[];e>0&&this.decomposeLeft(e,i);let l=i.length;for(let c of r)i.push(c);if(e>0&&Rj(i,l-1),t<this.length){let c=i.length;this.decomposeRight(t,i),Rj(i,c)}return ms.of(i)}decomposeLeft(e,t){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(r++,e>=r&&t.push(null)),e>r&&this.right.decomposeLeft(e-r,t)}decomposeRight(e,t){let r=this.left.length,s=r+this.break;if(e>=s)return this.right.decomposeRight(e-s,t);e<r&&this.left.decomposeRight(e,t),this.break&&e<s&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?ms.of(this.break?[e,null,t]:[e,t]):(this.left=Tg(this.left,e),this.right=Tg(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,r=!1,s){let{left:i,right:l}=this,c=t+i.length+this.break,u=null;return s&&s.from<=t+i.length&&s.more?u=i=i.updateHeight(e,t,r,s):i.updateHeight(e,t,r),s&&s.from<=c+l.length&&s.more?u=l=l.updateHeight(e,c,r,s):l.updateHeight(e,c,r),u?this.balanced(i,l):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Rj(n,e){let t,r;n[e]==null&&(t=n[e-1])instanceof $r&&(r=n[e+1])instanceof $r&&n.splice(e-1,3,new $r(t.length+1+r.length))}const CW=5;class _w{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let r=Math.min(t,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Js?s.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Js(r-this.pos,-1)),this.writtenTo=r,t>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,r){if(e<t||r.heightRelevant){let s=r.widget?r.widget.estimatedHeight:0,i=r.widget?r.widget.lineBreaks:0;s<0&&(s=this.oracle.lineHeight);let l=t-e;r.block?this.addBlock(new BA(l,s,r)):(l||i||s>=CW)&&this.addLineDeco(s,i,l)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Js(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let r=new $r(t-e);return this.oracle.doc.lineAt(e).to==t&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Js)return e;let t=new Js(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,r){let s=this.ensureLine();s.length+=r,s.collapsed+=r,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=t,this.writtenTo=this.pos=this.pos+r}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Js)&&!this.isCovered?this.nodes.push(new Js(0,-1)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let s of this.nodes)s instanceof Js&&s.updateHeight(this.oracle,r),r+=s?s.length:1;return this.nodes}static build(e,t,r,s){let i=new _w(r,e);return Gt.spans(t,r,s,i,0),i.finish(r)}}function TW(n,e,t){let r=new MW;return Gt.compare(n,e,t,r,0),r.changes}class MW{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,r,s){(e<t||r&&r.heightRelevant||s&&s.heightRelevant)&&Jp(e,t,this.changes,5)}}function AW(n,e){let t=n.getBoundingClientRect(),r=n.ownerDocument,s=r.defaultView||window,i=Math.max(0,t.left),l=Math.min(s.innerWidth,t.right),c=Math.max(0,t.top),u=Math.min(s.innerHeight,t.bottom);for(let h=n.parentNode;h&&h!=r.body;)if(h.nodeType==1){let m=h,p=window.getComputedStyle(m);if((m.scrollHeight>m.clientHeight||m.scrollWidth>m.clientWidth)&&p.overflow!="visible"){let x=m.getBoundingClientRect();i=Math.max(i,x.left),l=Math.min(l,x.right),c=Math.max(c,x.top),u=Math.min(h==n.parentNode?s.innerHeight:u,x.bottom)}h=p.position=="absolute"||p.position=="fixed"?m.offsetParent:m.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:i-t.left,right:Math.max(i,l)-t.left,top:c-(t.top+e),bottom:Math.max(c,u)-(t.top+e)}}function EW(n){let e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}function _W(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class zy{constructor(e,t,r,s){this.from=e,this.to=t,this.size=r,this.displaySize=s}static same(e,t){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++){let s=e[r],i=t[r];if(s.from!=i.from||s.to!=i.to||s.size!=i.size)return!1}return!0}draw(e,t){return Je.replace({widget:new DW(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class DW extends ka{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class zj{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Pj,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Hn.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(Mw).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new kW(t),this.stateDeco=e.facet(bf).filter(r=>typeof r!="function"),this.heightMap=ms.empty().applyChanges(this.stateDeco,Wt.empty,this.heightOracle.setDoc(e.doc),[new ji(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Je.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let r=0;r<=1;r++){let s=r?t.head:t.anchor;if(!e.some(({from:i,to:l})=>s>=i&&s<=l)){let{from:i,to:l}=this.lineBlockAt(s);e.push(new ap(i,l))}}return this.viewports=e.sort((r,s)=>r.from-s.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Pj:new Dw(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Uh(e,this.scaler))})}update(e,t=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(bf).filter(m=>typeof m!="function");let s=e.changedRanges,i=ji.extendWithRanges(s,TW(r,this.stateDeco,e?e.changes:Or.empty(this.state.doc.length))),l=this.heightMap.height,c=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);Dj(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=l||md)&&(e.flags|=2),c?(this.scrollAnchorPos=e.changes.mapPos(c.from,-1),this.scrollAnchorHeight=c.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=l);let u=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<u.from||t.range.head>u.to)||!this.viewportIsAppropriate(u))&&(u=this.getViewport(0,t));let h=u.from!=this.viewport.from||u.to!=this.viewport.to;this.viewport=u,e.flags|=this.updateForViewport(),(h||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(xA)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,r=window.getComputedStyle(t),s=this.heightOracle,i=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?Hn.RTL:Hn.LTR;let l=this.heightOracle.mustRefreshForWrapping(i),c=t.getBoundingClientRect(),u=l||this.mustMeasureContent||this.contentDOMHeight!=c.height;this.contentDOMHeight=c.height,this.mustMeasureContent=!1;let h=0,m=0;if(c.width&&c.height){let{scaleX:_,scaleY:D}=VM(t,c);(_>.005&&Math.abs(this.scaleX-_)>.005||D>.005&&Math.abs(this.scaleY-D)>.005)&&(this.scaleX=_,this.scaleY=D,h|=16,l=u=!0)}let p=(parseInt(r.paddingTop)||0)*this.scaleY,x=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=p||this.paddingBottom!=x)&&(this.paddingTop=p,this.paddingBottom=x,h|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(u=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let v=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=v&&(this.scrollAnchorHeight=-1,this.scrollTop=v),this.scrolledToBottom=XM(e.scrollDOM);let b=(this.printing?_W:AW)(t,this.paddingTop),O=b.top-this.pixelViewport.top,k=b.bottom-this.pixelViewport.bottom;this.pixelViewport=b;let j=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(j!=this.inView&&(this.inView=j,j&&(u=!0)),!this.inView&&!this.scrollTarget&&!EW(e.dom))return 0;let T=c.width;if((this.contentDOMWidth!=T||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=c.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),u){let _=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(_)&&(l=!0),l||s.lineWrapping&&Math.abs(T-this.contentDOMWidth)>s.charWidth){let{lineHeight:D,charWidth:E,textHeight:z}=e.docView.measureTextSize();l=D>0&&s.refresh(i,D,E,z,Math.max(5,T/E),_),l&&(e.docView.minWidth=0,h|=16)}O>0&&k>0?m=Math.max(O,k):O<0&&k<0&&(m=Math.min(O,k)),Dj();for(let D of this.viewports){let E=D.from==this.viewport.from?_:e.docView.measureVisibleLineHeights(D);this.heightMap=(l?ms.empty().applyChanges(this.stateDeco,Wt.empty,this.heightOracle,[new ji(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,l,new jW(D.from,E))}md&&(h|=2)}let M=!this.viewportIsAppropriate(this.viewport,m)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return M&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(m,this.scrollTarget),h|=this.updateForViewport()),(h&2||M)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,i=this.heightOracle,{visibleTop:l,visibleBottom:c}=this,u=new ap(s.lineAt(l-r*1e3,Qn.ByHeight,i,0,0).from,s.lineAt(c+(1-r)*1e3,Qn.ByHeight,i,0,0).to);if(t){let{head:h}=t.range;if(h<u.from||h>u.to){let m=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),p=s.lineAt(h,Qn.ByPos,i,0,0),x;t.y=="center"?x=(p.top+p.bottom)/2-m/2:t.y=="start"||t.y=="nearest"&&h<u.from?x=p.top:x=p.bottom-m,u=new ap(s.lineAt(x-1e3/2,Qn.ByHeight,i,0,0).from,s.lineAt(x+m+1e3/2,Qn.ByHeight,i,0,0).to)}}return u}mapViewport(e,t){let r=t.mapPos(e.from,-1),s=t.mapPos(e.to,1);return new ap(this.heightMap.lineAt(r,Qn.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,Qn.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},r=0){if(!this.inView)return!0;let{top:s}=this.heightMap.lineAt(e,Qn.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,Qn.ByPos,this.heightOracle,0,0),{visibleTop:l,visibleBottom:c}=this;return(e==0||s<=l-Math.max(10,Math.min(-r,250)))&&(t==this.state.doc.length||i>=c+Math.max(10,Math.min(r,250)))&&s>l-2*1e3&&i<c+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let r=[];for(let s of e)t.touchesRange(s.from,s.to)||r.push(new zy(t.mapPos(s.from),t.mapPos(s.to),s.size,s.displaySize));return r}ensureLineGaps(e,t){let r=this.heightOracle.lineWrapping,s=r?1e4:2e3,i=s>>1,l=s<<1;if(this.defaultTextDirection!=Hn.LTR&&!r)return[];let c=[],u=(m,p,x,v)=>{if(p-m<i)return;let b=this.state.selection.main,O=[b.from];b.empty||O.push(b.to);for(let j of O)if(j>m&&j<p){u(m,j-10,x,v),u(j+10,p,x,v);return}let k=zW(e,j=>j.from>=x.from&&j.to<=x.to&&Math.abs(j.from-m)<i&&Math.abs(j.to-p)<i&&!O.some(T=>j.from<T&&j.to>T));if(!k){if(p<x.to&&t&&r&&t.visibleRanges.some(M=>M.from<=p&&M.to>=p)){let M=t.moveToLineBoundary(Ce.cursor(p),!1,!0).head;M>m&&(p=M)}let j=this.gapSize(x,m,p,v),T=r||j<2e6?j:2e6;k=new zy(m,p,j,T)}c.push(k)},h=m=>{if(m.length<l||m.type!=fs.Text)return;let p=RW(m.from,m.to,this.stateDeco);if(p.total<l)return;let x=this.scrollTarget?this.scrollTarget.range.head:null,v,b;if(r){let O=s/this.heightOracle.lineLength*this.heightOracle.lineHeight,k,j;if(x!=null){let T=op(p,x),M=((this.visibleBottom-this.visibleTop)/2+O)/m.height;k=T-M,j=T+M}else k=(this.visibleTop-m.top-O)/m.height,j=(this.visibleBottom-m.top+O)/m.height;v=lp(p,k),b=lp(p,j)}else{let O=p.total*this.heightOracle.charWidth,k=s*this.heightOracle.charWidth,j=0;if(O>2e6)for(let E of e)E.from>=m.from&&E.from<m.to&&E.size!=E.displaySize&&E.from*this.heightOracle.charWidth+j<this.pixelViewport.left&&(j=E.size-E.displaySize);let T=this.pixelViewport.left+j,M=this.pixelViewport.right+j,_,D;if(x!=null){let E=op(p,x),z=((M-T)/2+k)/O;_=E-z,D=E+z}else _=(T-k)/O,D=(M+k)/O;v=lp(p,_),b=lp(p,D)}v>m.from&&u(m.from,v,m,p),b<m.to&&u(b,m.to,m,p)};for(let m of this.viewportLines)Array.isArray(m.type)?m.type.forEach(h):h(m);return c}gapSize(e,t,r,s){let i=op(s,r)-op(s,t);return this.heightOracle.lineWrapping?e.height*i:s.total*this.heightOracle.charWidth*i}updateLineGaps(e){zy.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Je.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let r=[];Gt.spans(t,this.viewport.from,this.viewport.to,{span(i,l){r.push({from:i,to:l})},point(){}},20);let s=0;if(r.length!=this.visibleRanges.length)s=12;else for(let i=0;i<r.length&&!(s&8);i++){let l=this.visibleRanges[i],c=r[i];(l.from!=c.from||l.to!=c.to)&&(s|=4,e&&e.mapPos(l.from,-1)==c.from&&e.mapPos(l.to,1)==c.to||(s|=8))}return this.visibleRanges=r,s}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Uh(this.heightMap.lineAt(e,Qn.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Uh(this.heightMap.lineAt(this.scaler.fromDOM(e),Qn.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Uh(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}let ap=class{constructor(e,t){this.from=e,this.to=t}};function RW(n,e,t){let r=[],s=n,i=0;return Gt.spans(t,n,e,{span(){},point(l,c){l>s&&(r.push({from:s,to:l}),i+=l-s),s=c}},20),s<e&&(r.push({from:s,to:e}),i+=e-s),{total:i,ranges:r}}function lp({total:n,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let r=Math.floor(n*t);for(let s=0;;s++){let{from:i,to:l}=e[s],c=l-i;if(r<=c)return i+r;r-=c}}function op(n,e){let t=0;for(let{from:r,to:s}of n.ranges){if(e<=s){t+=e-r;break}t+=s-r}return t/n.total}function zW(n,e){for(let t of n)if(e(t))return t}const Pj={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};class Dw{constructor(e,t,r){let s=0,i=0,l=0;this.viewports=r.map(({from:c,to:u})=>{let h=t.lineAt(c,Qn.ByPos,e,0,0).top,m=t.lineAt(u,Qn.ByPos,e,0,0).bottom;return s+=m-h,{from:c,to:u,top:h,bottom:m,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let c of this.viewports)c.domTop=l+(c.top-i)*this.scale,l=c.domBottom=c.domTop+(c.bottom-c.top),i=c.bottom}toDOM(e){for(let t=0,r=0,s=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return s+(e-r)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);r=i.bottom,s=i.domBottom}}fromDOM(e){for(let t=0,r=0,s=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return r+(e-s)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);r=i.bottom,s=i.domBottom}}eq(e){return e instanceof Dw?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,r)=>t.from==e.viewports[r].from&&t.to==e.viewports[r].to):!1}}function Uh(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),r=e.toDOM(n.bottom);return new la(n.from,n.length,t,r-t,Array.isArray(n._content)?n._content.map(s=>Uh(s,e)):n._content)}const cp=He.define({combine:n=>n.join(" ")}),U2=He.define({combine:n=>n.indexOf(!0)>-1}),V2=ho.newName(),IA=ho.newName(),FA=ho.newName(),qA={"&light":"."+IA,"&dark":"."+FA};function W2(n,e,t){return new ho(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,s=>{if(s=="&")return n;if(!t||!t[s])throw new RangeError(`Unsupported selector: ${s}`);return t[s]}):n+" "+r}})}const PW=W2("."+V2,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},qA),LW={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Py=qe.ie&&qe.ie_version<=11;class BW{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new bV,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let r of t)this.queue.push(r);(qe.ie&&qe.ie_version<=11||qe.ios&&e.composing)&&t.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&qe.android&&e.constructor.EDIT_CONTEXT!==!1&&!(qe.chrome&&qe.chrome_version<126)&&(this.editContext=new FW(e),e.state.facet(sl)&&(e.contentDOM.editContext=this.editContext.editContext)),Py&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,r)=>t!=e[r]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,s=this.selectionRange;if(r.state.facet(sl)?r.root.activeElement!=this.dom:!Zp(this.dom,s))return;let i=s.anchorNode&&r.docView.nearest(s.anchorNode);if(i&&i.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(qe.ie&&qe.ie_version<=11||qe.android&&qe.chrome)&&!r.state.selection.main.empty&&s.focusNode&&tf(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=yf(e.root);if(!t)return!1;let r=qe.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&IW(this.view,t)||t;if(!r||this.selectionRange.eq(r))return!1;let s=Zp(this.dom,r);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&SV(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),s&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let r=this.dom;r;)if(r.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=t)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,LW),Py&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Py&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var r;if(!this.delayedAndroidKey){let s=()=>{let i=this.delayedAndroidKey;i&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=i.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&i.force&&Xu(this.dom,i.key,i.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,r=-1,s=!1;for(let i of e){let l=this.readMutation(i);l&&(l.typeOver&&(s=!0),t==-1?{from:t,to:r}=l:(t=Math.min(l.from,t),r=Math.max(l.to,r)))}return{from:t,to:r,typeOver:s}}readChange(){let{from:e,to:t,typeOver:r}=this.processRecords(),s=this.selectionChanged&&Zp(this.dom,this.selectionRange);if(e<0&&!s)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new rW(this.view,e,t,r);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let r=this.view.state,s=TA(this.view,t);return this.view.state==r&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),s}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let r=Lj(t,e.previousSibling||e.target.previousSibling,-1),s=Lj(t,e.nextSibling||e.target.nextSibling,1);return{from:r?t.posAfter(r):t.posAtStart,to:s?t.posBefore(s):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(sl)!=e.state.facet(sl)&&(e.view.contentDOM.editContext=e.state.facet(sl)?this.editContext.editContext:null))}destroy(){var e,t,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Lj(n,e,t){for(;e;){let r=jn.get(e);if(r&&r.parent==n)return r;let s=e.parentNode;e=s!=n.dom?s:t>0?e.nextSibling:e.previousSibling}return null}function Bj(n,e){let t=e.startContainer,r=e.startOffset,s=e.endContainer,i=e.endOffset,l=n.docView.domAtPos(n.state.selection.main.anchor);return tf(l.node,l.offset,s,i)&&([t,r,s,i]=[s,i,t,r]),{anchorNode:t,anchorOffset:r,focusNode:s,focusOffset:i}}function IW(n,e){if(e.getComposedRanges){let s=e.getComposedRanges(n.root)[0];if(s)return Bj(n,s)}let t=null;function r(s){s.preventDefault(),s.stopImmediatePropagation(),t=s.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",r,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",r,!0),t?Bj(n,t):null}class FW{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let s=e.state.selection.main,{anchor:i,head:l}=s,c=this.toEditorPos(r.updateRangeStart),u=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:c,drifted:!1});let h=u-c>r.text.length;c==this.from&&i<this.from?c=i:u==this.to&&i>this.to&&(u=i);let m=MA(e.state.sliceDoc(c,u),r.text,(h?s.from:s.to)-c,h?"end":null);if(!m){let x=Ce.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));x.main.eq(s)||e.dispatch({selection:x,userEvent:"select"});return}let p={from:m.from+c,to:m.toA+c,insert:Wt.of(r.text.slice(m.from,m.toB).split(`
|
||
`))};if((qe.mac||qe.android)&&p.from==l-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(p={from:c,to:u,insert:Wt.of([r.text.replace("."," ")])}),this.pendingContextChange=p,!e.state.readOnly){let x=this.to-this.from+(p.to-p.from+p.insert.length);Ew(e,p,Ce.single(this.toEditorPos(r.selectionStart,x),this.toEditorPos(r.selectionEnd,x)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),p.from<p.to&&!p.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(t.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let s=[],i=null;for(let l=this.toEditorPos(r.rangeStart),c=this.toEditorPos(r.rangeEnd);l<c;l++){let u=e.coordsForChar(l);i=u&&new DOMRect(u.left,u.top,u.right-u.left,u.bottom-u.top)||i||new DOMRect,s.push(i)}t.updateCharacterBounds(r.rangeStart,s)},this.handlers.textformatupdate=r=>{let s=[];for(let i of r.getTextFormats()){let l=i.underlineStyle,c=i.underlineThickness;if(!/none/i.test(l)&&!/none/i.test(c)){let u=this.toEditorPos(i.rangeStart),h=this.toEditorPos(i.rangeEnd);if(u<h){let m=`text-decoration: underline ${/^[a-z]/.test(l)?l+" ":l=="Dashed"?"dashed ":l=="Squiggle"?"wavy ":""}${/thin/i.test(c)?1:2}px`;s.push(Je.mark({attributes:{style:m}}).range(u,h))}}}e.dispatch({effects:yA.of(Je.set(s))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)t.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let s=yf(r.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,r=!1,s=this.pendingContextChange;return e.changes.iterChanges((i,l,c,u,h)=>{if(r)return;let m=h.length-(l-i);if(s&&l>=s.to)if(s.from==i&&s.to==l&&s.insert.eq(h)){s=this.pendingContextChange=null,t+=m,this.to+=m;return}else s=null,this.revertPending(e.state);if(i+=t,l+=t,l<=this.from)this.from+=m,this.to+=m;else if(i<this.to){if(i<this.from||l>this.to||this.to-this.from+h.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(l),h.toString()),this.to+=m}t+=m}),s&&!r&&this.revertPending(e.state),!r}update(e){let t=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(s=>!s.isUserEvent("input.type")&&s.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),s=this.toContextPos(t.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(r,s)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Fe{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(s=>s.forEach(i=>r(i,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=e.root||wV(e.parent)||document,this.viewState=new zj(e.state||Vt.create(e)),e.scrollTo&&e.scrollTo.is(rp)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Qu).map(s=>new _y(s));for(let s of this.plugins)s.update(this);this.observer=new BW(this),this.inputState=new lW(this),this.inputState.ensureHandlers(this.plugins),this.docView=new gj(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof gr?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,r=!1,s,i=this.state;for(let x of e){if(x.startState!=i)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");i=x.state}if(this.destroyed){this.viewState.state=i;return}let l=this.hasFocus,c=0,u=null;e.some(x=>x.annotation(zA))?(this.inputState.notifiedFocused=l,c=1):l!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=l,u=PA(i,l),u||(c=1));let h=this.observer.delayedAndroidKey,m=null;if(h?(this.observer.clearDelayedAndroidKey(),m=this.observer.readChange(),(m&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(m=null)):this.observer.clear(),i.facet(Vt.phrases)!=this.state.facet(Vt.phrases))return this.setState(i);s=Cg.create(this,i,e),s.flags|=c;let p=this.viewState.scrollTarget;try{this.updateState=2;for(let x of e){if(p&&(p=p.map(x.changes)),x.scrollIntoView){let{main:v}=x.state.selection;p=new Yu(v.empty?v:Ce.cursor(v.head,v.head>v.anchor?-1:1))}for(let v of x.effects)v.is(rp)&&(p=v.value.clip(this.state))}this.viewState.update(s,p),this.bidiCache=Mg.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet($h)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(x=>x.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(cp)!=s.state.facet(cp)&&(this.viewState.mustMeasureContent=!0),(t||r||p||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!s.empty)for(let x of this.state.facet(q2))try{x(s)}catch(v){Es(this.state,v,"update listener")}(u||m)&&Promise.resolve().then(()=>{u&&this.state==u.startState&&this.dispatch(u),m&&!TA(this,m)&&h.force&&Xu(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new zj(e),this.plugins=e.facet(Qu).map(r=>new _y(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new gj(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Qu),r=e.state.facet(Qu);if(t!=r){let s=[];for(let i of r){let l=t.indexOf(i);if(l<0)s.push(new _y(i));else{let c=this.plugins[l];c.mustUpdate=e,s.push(c)}}for(let i of this.plugins)i.mustUpdate!=e&&i.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s<this.plugins.length;s++)this.plugins[s].update(this);t!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(r){Es(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,r=this.scrollDOM,s=r.scrollTop*this.scaleY,{scrollAnchorPos:i,scrollAnchorHeight:l}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(l=-1),this.viewState.scrollAnchorHeight=-1;try{for(let c=0;;c++){if(l<0)if(XM(r))i=-1,l=this.viewState.heightMap.height;else{let v=this.viewState.scrollAnchorAt(s);i=v.from,l=v.top}this.updateState=1;let u=this.viewState.measure(this);if(!u&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(c>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];u&4||([this.measureRequests,h]=[h,this.measureRequests]);let m=h.map(v=>{try{return v.read(this)}catch(b){return Es(this.state,b),Ij}}),p=Cg.create(this,this.state,[]),x=!1;p.flags|=u,t?t.flags|=u:t=p,this.updateState=2,p.empty||(this.updatePlugins(p),this.inputState.update(p),this.updateAttrs(),x=this.docView.update(p),x&&this.docViewUpdate());for(let v=0;v<h.length;v++)if(m[v]!=Ij)try{let b=h[v];b.write&&b.write(m[v],this)}catch(b){Es(this.state,b)}if(x&&this.docView.updateSelection(!0),!p.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,l=-1;continue}else{let b=(i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-l;if(b>1||b<-1){s=s+b,r.scrollTop=s/this.scaleY,l=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let c of this.state.facet(q2))c(t)}get themeClasses(){return V2+" "+(this.state.facet(U2)?FA:IA)+" "+this.state.facet(cp)}updateAttrs(){let e=Fj(this,bA,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(sl)?"true":"false",class:"cm-content",style:`${qe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Fj(this,Mw,t);let r=this.observer.ignore(()=>{let s=P2(this.contentDOM,this.contentAttrs,t),i=P2(this.dom,this.editorAttrs,e);return s||i});return this.editorAttrs=e,this.contentAttrs=t,r}showAnnouncements(e){let t=!0;for(let r of e)for(let s of r.effects)if(s.is(Fe.announce)){t&&(this.announceDOM.textContent=""),t=!1;let i=this.announceDOM.appendChild(document.createElement("div"));i.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet($h);let e=this.state.facet(Fe.cspNonce);ho.mount(this.root,this.styleModules.concat(PW).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(r=>r.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,r){return Ry(this,e,wj(this,e,t,r))}moveByGroup(e,t){return Ry(this,e,wj(this,e,t,r=>ZV(this,e.head,r)))}visualLineSide(e,t){let r=this.bidiSpans(e),s=this.textDirectionAt(e.from),i=r[t?r.length-1:0];return Ce.cursor(i.side(t,s)+e.from,i.forward(!t,s)?1:-1)}moveToLineBoundary(e,t,r=!0){return KV(this,e,t,r)}moveVertically(e,t,r){return Ry(this,e,JV(this,e,t,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),jA(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let r=this.docView.coordsAt(e,t);if(!r||r.left==r.right)return r;let s=this.state.doc.lineAt(e),i=this.bidiSpans(s),l=i[ro.find(i,e-s.from,-1,t)];return i0(r,l.dir==Hn.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(gA)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>qW)return oA(e.length);let t=this.textDirectionAt(e.from),r;for(let i of this.bidiCache)if(i.from==e.from&&i.dir==t&&(i.fresh||lA(i.isolates,r=pj(this,e))))return i.order;r||(r=pj(this,e));let s=zV(e.text,t,r);return this.bidiCache.push(new Mg(e.from,e.to,t,r,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||qe.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{WM(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return rp.of(new Yu(typeof e=="number"?Ce.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return rp.of(new Yu(Ce.cursor(r.from),"start","start",r.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return lr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return lr.define(()=>({}),{eventObservers:e})}static theme(e,t){let r=ho.newName(),s=[cp.of(r),$h.of(W2(`.${r}`,e))];return t&&t.dark&&s.push(U2.of(!0)),s}static baseTheme(e){return jo.lowest($h.of(W2("."+V2,e,qA)))}static findFromDOM(e){var t;let r=e.querySelector(".cm-content"),s=r&&jn.get(r)||jn.get(e);return((t=s?.rootView)===null||t===void 0?void 0:t.view)||null}}Fe.styleModule=$h;Fe.inputHandler=mA;Fe.clipboardInputFilter=Cw;Fe.clipboardOutputFilter=Tw;Fe.scrollHandler=vA;Fe.focusChangeEffect=pA;Fe.perLineTextDirection=gA;Fe.exceptionSink=fA;Fe.updateListener=q2;Fe.editable=sl;Fe.mouseSelectionStyle=hA;Fe.dragMovesSelection=dA;Fe.clickAddsSelectionRange=uA;Fe.decorations=bf;Fe.outerDecorations=wA;Fe.atomicRanges=o0;Fe.bidiIsolatedRanges=SA;Fe.scrollMargins=OA;Fe.darkTheme=U2;Fe.cspNonce=He.define({combine:n=>n.length?n[0]:""});Fe.contentAttributes=Mw;Fe.editorAttributes=bA;Fe.lineWrapping=Fe.contentAttributes.of({class:"cm-lineWrapping"});Fe.announce=xt.define();const qW=4096,Ij={};class Mg{constructor(e,t,r,s,i,l){this.from=e,this.to=t,this.dir=r,this.isolates=s,this.fresh=i,this.order=l}static update(e,t){if(t.empty&&!e.some(i=>i.fresh))return e;let r=[],s=e.length?e[e.length-1].dir:Hn.LTR;for(let i=Math.max(0,e.length-10);i<e.length;i++){let l=e[i];l.dir==s&&!t.touchesRange(l.from,l.to)&&r.push(new Mg(t.mapPos(l.from,1),t.mapPos(l.to,-1),l.dir,l.isolates,!1,l.order))}return r}}function Fj(n,e,t){for(let r=n.state.facet(e),s=r.length-1;s>=0;s--){let i=r[s],l=typeof i=="function"?i(n):i;l&&z2(l,t)}return t}const QW=qe.mac?"mac":qe.windows?"win":qe.linux?"linux":"key";function $W(n,e){const t=n.split(/-(?!$)/);let r=t[t.length-1];r=="Space"&&(r=" ");let s,i,l,c;for(let u=0;u<t.length-1;++u){const h=t[u];if(/^(cmd|meta|m)$/i.test(h))c=!0;else if(/^a(lt)?$/i.test(h))s=!0;else if(/^(c|ctrl|control)$/i.test(h))i=!0;else if(/^s(hift)?$/i.test(h))l=!0;else if(/^mod$/i.test(h))e=="mac"?c=!0:i=!0;else throw new Error("Unrecognized modifier name: "+h)}return s&&(r="Alt-"+r),i&&(r="Ctrl-"+r),c&&(r="Meta-"+r),l&&(r="Shift-"+r),r}function up(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}const HW=jo.default(Fe.domEventHandlers({keydown(n,e){return $A(QA(e.state),n,e,"editor")}})),c0=He.define({enables:HW}),qj=new WeakMap;function QA(n){let e=n.facet(c0),t=qj.get(e);return t||qj.set(e,t=WW(e.reduce((r,s)=>r.concat(s),[]))),t}function UW(n,e,t){return $A(QA(n.state),e,n,t)}let to=null;const VW=4e3;function WW(n,e=QW){let t=Object.create(null),r=Object.create(null),s=(l,c)=>{let u=r[l];if(u==null)r[l]=c;else if(u!=c)throw new Error("Key binding "+l+" is used both as a regular binding and as a multi-stroke prefix")},i=(l,c,u,h,m)=>{var p,x;let v=t[l]||(t[l]=Object.create(null)),b=c.split(/ (?!$)/).map(j=>$W(j,e));for(let j=1;j<b.length;j++){let T=b.slice(0,j).join(" ");s(T,!0),v[T]||(v[T]={preventDefault:!0,stopPropagation:!1,run:[M=>{let _=to={view:M,prefix:T,scope:l};return setTimeout(()=>{to==_&&(to=null)},VW),!0}]})}let O=b.join(" ");s(O,!1);let k=v[O]||(v[O]={preventDefault:!1,stopPropagation:!1,run:((x=(p=v._any)===null||p===void 0?void 0:p.run)===null||x===void 0?void 0:x.slice())||[]});u&&k.run.push(u),h&&(k.preventDefault=!0),m&&(k.stopPropagation=!0)};for(let l of n){let c=l.scope?l.scope.split(" "):["editor"];if(l.any)for(let h of c){let m=t[h]||(t[h]=Object.create(null));m._any||(m._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:p}=l;for(let x in m)m[x].run.push(v=>p(v,G2))}let u=l[e]||l.key;if(u)for(let h of c)i(h,u,l.run,l.preventDefault,l.stopPropagation),l.shift&&i(h,"Shift-"+u,l.shift,l.preventDefault,l.stopPropagation)}return t}let G2=null;function $A(n,e,t,r){G2=e;let s=pV(e),i=Ms(s,0),l=aa(i)==s.length&&s!=" ",c="",u=!1,h=!1,m=!1;to&&to.view==t&&to.scope==r&&(c=to.prefix+" ",EA.indexOf(e.keyCode)<0&&(h=!0,to=null));let p=new Set,x=k=>{if(k){for(let j of k.run)if(!p.has(j)&&(p.add(j),j(t)))return k.stopPropagation&&(m=!0),!0;k.preventDefault&&(k.stopPropagation&&(m=!0),h=!0)}return!1},v=n[r],b,O;return v&&(x(v[c+up(s,e,!l)])?u=!0:l&&(e.altKey||e.metaKey||e.ctrlKey)&&!(qe.windows&&e.ctrlKey&&e.altKey)&&!(qe.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(b=fo[e.keyCode])&&b!=s?(x(v[c+up(b,e,!0)])||e.shiftKey&&(O=vf[e.keyCode])!=s&&O!=b&&x(v[c+up(O,e,!1)]))&&(u=!0):l&&e.shiftKey&&x(v[c+up(s,e,!0)])&&(u=!0),!u&&x(v._any)&&(u=!0)),h&&(u=!0),u&&m&&e.stopPropagation(),G2=null,u}class u0{constructor(e,t,r,s,i){this.className=e,this.left=t,this.top=r,this.width=s,this.height=i}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,r){if(r.empty){let s=e.coordsAtPos(r.head,r.assoc||1);if(!s)return[];let i=HA(e);return[new u0(t,s.left-i.left,s.top-i.top,null,s.bottom-s.top)]}else return GW(e,t,r)}}function HA(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==Hn.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function Qj(n,e,t,r){let s=n.coordsAtPos(e,t*2);if(!s)return r;let i=n.dom.getBoundingClientRect(),l=(s.top+s.bottom)/2,c=n.posAtCoords({x:i.left+1,y:l}),u=n.posAtCoords({x:i.right-1,y:l});return c==null||u==null?r:{from:Math.max(r.from,Math.min(c,u)),to:Math.min(r.to,Math.max(c,u))}}function GW(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let r=Math.max(t.from,n.viewport.from),s=Math.min(t.to,n.viewport.to),i=n.textDirection==Hn.LTR,l=n.contentDOM,c=l.getBoundingClientRect(),u=HA(n),h=l.querySelector(".cm-line"),m=h&&window.getComputedStyle(h),p=c.left+(m?parseInt(m.paddingLeft)+Math.min(0,parseInt(m.textIndent)):0),x=c.right-(m?parseInt(m.paddingRight):0),v=$2(n,r,1),b=$2(n,s,-1),O=v.type==fs.Text?v:null,k=b.type==fs.Text?b:null;if(O&&(n.lineWrapping||v.widgetLineBreaks)&&(O=Qj(n,r,1,O)),k&&(n.lineWrapping||b.widgetLineBreaks)&&(k=Qj(n,s,-1,k)),O&&k&&O.from==k.from&&O.to==k.to)return T(M(t.from,t.to,O));{let D=O?M(t.from,null,O):_(v,!1),E=k?M(null,t.to,k):_(b,!0),z=[];return(O||v).to<(k||b).from-(O&&k?1:0)||v.widgetLineBreaks>1&&D.bottom+n.defaultLineHeight/2<E.top?z.push(j(p,D.bottom,x,E.top)):D.bottom<E.top&&n.elementAtHeight((D.bottom+E.top)/2).type==fs.Text&&(D.bottom=E.top=(D.bottom+E.top)/2),T(D).concat(z).concat(T(E))}function j(D,E,z,Q){return new u0(e,D-u.left,E-u.top,z-D,Q-E)}function T({top:D,bottom:E,horizontal:z}){let Q=[];for(let q=0;q<z.length;q+=2)Q.push(j(z[q],D,z[q+1],E));return Q}function M(D,E,z){let Q=1e9,q=-1e9,B=[];function U(W,J,H,ae,ne){let ue=n.coordsAtPos(W,W==z.to?-2:2),R=n.coordsAtPos(H,H==z.from?2:-2);!ue||!R||(Q=Math.min(ue.top,R.top,Q),q=Math.max(ue.bottom,R.bottom,q),ne==Hn.LTR?B.push(i&&J?p:ue.left,i&&ae?x:R.right):B.push(!i&&ae?p:R.left,!i&&J?x:ue.right))}let V=D??z.from,ce=E??z.to;for(let W of n.visibleRanges)if(W.to>V&&W.from<ce)for(let J=Math.max(W.from,V),H=Math.min(W.to,ce);;){let ae=n.state.doc.lineAt(J);for(let ne of n.bidiSpans(ae)){let ue=ne.from+ae.from,R=ne.to+ae.from;if(ue>=H)break;R>J&&U(Math.max(ue,J),D==null&&ue<=V,Math.min(R,H),E==null&&R>=ce,ne.dir)}if(J=ae.to+1,J>=H)break}return B.length==0&&U(V,D==null,ce,E==null,n.textDirection),{top:Q,bottom:q,horizontal:B}}function _(D,E){let z=c.top+(E?D.top:D.bottom);return{top:z,bottom:z,horizontal:[]}}}function XW(n,e){return n.constructor==e.constructor&&n.eq(e)}class YW{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(tg)!=e.state.facet(tg)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,r=e.facet(tg);for(;t<r.length&&r[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((t,r)=>!XW(t,this.drawn[r]))){let t=this.dom.firstChild,r=0;for(let s of e)s.update&&t&&s.constructor&&this.drawn[r].constructor&&s.update(t,this.drawn[r])?(t=t.nextSibling,r++):this.dom.insertBefore(s.draw(),t);for(;t;){let s=t.nextSibling;t.remove(),t=s}this.drawn=e,qe.safari&&qe.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const tg=He.define();function UA(n){return[lr.define(e=>new YW(e,n)),tg.of(n)]}const wf=He.define({combine(n){return Oa(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function KW(n={}){return[wf.of(n),ZW,JW,eG,xA.of(!0)]}function VA(n){return n.startState.facet(wf)!=n.state.facet(wf)}const ZW=UA({above:!0,markers(n){let{state:e}=n,t=e.facet(wf),r=[];for(let s of e.selection.ranges){let i=s==e.selection.main;if(s.empty||t.drawRangeCursor){let l=i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",c=s.empty?s:Ce.cursor(s.head,s.head>s.anchor?-1:1);for(let u of u0.forRange(n,l,c))r.push(u)}}return r},update(n,e){n.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=VA(n);return t&&$j(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){$j(e.state,n)},class:"cm-cursorLayer"});function $j(n,e){e.style.animationDuration=n.facet(wf).cursorBlinkRate+"ms"}const JW=UA({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:u0.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||VA(n)},class:"cm-selectionLayer"}),eG=jo.highest(Fe.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),WA=xt.define({map(n,e){return n==null?null:e.mapPos(n)}}),Vh=Lr.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,r)=>r.is(WA)?r.value:t,n)}}),tG=lr.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(Vh);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(Vh)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(Vh),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let r=n.scrollDOM.getBoundingClientRect();return{left:t.left-r.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-r.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(Vh)!=n&&this.view.dispatch({effects:WA.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function nG(){return[Vh,tG]}function Hj(n,e,t,r,s){e.lastIndex=0;for(let i=n.iterRange(t,r),l=t,c;!i.next().done;l+=i.value.length)if(!i.lineBreak)for(;c=e.exec(i.value);)s(l+c.index,c)}function rG(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let r=[];for(let{from:s,to:i}of t)s=Math.max(n.state.doc.lineAt(s).from,s-e),i=Math.min(n.state.doc.lineAt(i).to,i+e),r.length&&r[r.length-1].to>=s?r[r.length-1].to=i:r.push({from:s,to:i});return r}class sG{constructor(e){const{regexp:t,decoration:r,decorate:s,boundary:i,maxLength:l=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,s)this.addMatch=(c,u,h,m)=>s(m,h,h+c[0].length,c,u);else if(typeof r=="function")this.addMatch=(c,u,h,m)=>{let p=r(c,u,h);p&&m(h,h+c[0].length,p)};else if(r)this.addMatch=(c,u,h,m)=>m(h,h+c[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=i,this.maxLength=l}createDeco(e){let t=new fl,r=t.add.bind(t);for(let{from:s,to:i}of rG(e,this.maxLength))Hj(e.state.doc,this.regexp,s,i,(l,c)=>this.addMatch(c,e,l,r));return t.finish()}updateDeco(e,t){let r=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((i,l,c,u)=>{u>=e.view.viewport.from&&c<=e.view.viewport.to&&(r=Math.min(c,r),s=Math.max(u,s))}),e.viewportMoved||s-r>1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,t.map(e.changes),r,s):t}updateRange(e,t,r,s){for(let i of e.visibleRanges){let l=Math.max(i.from,r),c=Math.min(i.to,s);if(c>=l){let u=e.state.doc.lineAt(l),h=u.to<c?e.state.doc.lineAt(c):u,m=Math.max(i.from,u.from),p=Math.min(i.to,h.to);if(this.boundary){for(;l>u.from;l--)if(this.boundary.test(u.text[l-1-u.from])){m=l;break}for(;c<h.to;c++)if(this.boundary.test(h.text[c-h.from])){p=c;break}}let x=[],v,b=(O,k,j)=>x.push(j.range(O,k));if(u==h)for(this.regexp.lastIndex=m-u.from;(v=this.regexp.exec(u.text))&&v.index<p-u.from;)this.addMatch(v,e,v.index+u.from,b);else Hj(e.state.doc,this.regexp,m,p,(O,k)=>this.addMatch(k,e,O,b));t=t.update({filterFrom:m,filterTo:p,filter:(O,k)=>O<m||k>p,add:x})}}return t}}const X2=/x/.unicode!=null?"gu":"g",iG=new RegExp(`[\0-\b
|
||
--\u2028\u2029\uFEFF-]`,X2),aG={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Ly=null;function lG(){var n;if(Ly==null&&typeof document<"u"&&document.body){let e=document.body.style;Ly=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Ly||!1}const ng=He.define({combine(n){let e=Oa(n,{render:null,specialChars:iG,addSpecialChars:null});return(e.replaceTabs=!lG())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,X2)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,X2)),e}});function oG(n={}){return[ng.of(n),cG()]}let Uj=null;function cG(){return Uj||(Uj=lr.fromClass(class{constructor(n){this.view=n,this.decorations=Je.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(ng)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new sG({regexp:n.specialChars,decoration:(e,t,r)=>{let{doc:s}=t.state,i=Ms(e[0],0);if(i==9){let l=s.lineAt(r),c=t.state.tabSize,u=Md(l.text,c,r-l.from);return Je.replace({widget:new fG((c-u%c)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[i]||(this.decorationCache[i]=Je.replace({widget:new hG(n,i)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(ng);n.startState.facet(ng)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const uG="•";function dG(n){return n>=32?uG:n==10?"":String.fromCharCode(9216+n)}class hG extends ka{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=dG(this.code),r=e.state.phrase("Control character")+" "+(aG[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,r,t);if(s)return s;let i=document.createElement("span");return i.textContent=t,i.title=r,i.setAttribute("aria-label",r),i.className="cm-specialChar",i}ignoreEvent(){return!1}}class fG extends ka{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function mG(){return gG}const pG=Je.line({class:"cm-activeLine"}),gG=lr.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let r of n.state.selection.ranges){let s=n.lineBlockAt(r.head);s.from>e&&(t.push(pG.range(s.from)),e=s.from)}return Je.set(t)}},{decorations:n=>n.decorations});class xG extends ka{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?dd(e.firstChild):[];if(!t.length)return null;let r=window.getComputedStyle(e.parentNode),s=i0(t[0],r.direction!="rtl"),i=parseInt(r.lineHeight);return s.bottom-s.top>i*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+i}:s}ignoreEvent(){return!1}}function vG(n){let e=lr.fromClass(class{constructor(t){this.view=t,this.placeholder=n?Je.set([Je.widget({widget:new xG(n),side:1}).range(0)]):Je.none}get decorations(){return this.view.state.doc.length?Je.none:this.placeholder}},{decorations:t=>t.decorations});return typeof n=="string"?[e,Fe.contentAttributes.of({"aria-placeholder":n})]:e}const Y2=2e3;function yG(n,e,t){let r=Math.min(e.line,t.line),s=Math.max(e.line,t.line),i=[];if(e.off>Y2||t.off>Y2||e.col<0||t.col<0){let l=Math.min(e.off,t.off),c=Math.max(e.off,t.off);for(let u=r;u<=s;u++){let h=n.doc.line(u);h.length<=c&&i.push(Ce.range(h.from+l,h.to+c))}}else{let l=Math.min(e.col,t.col),c=Math.max(e.col,t.col);for(let u=r;u<=s;u++){let h=n.doc.line(u),m=C2(h.text,l,n.tabSize,!0);if(m<0)i.push(Ce.cursor(h.to));else{let p=C2(h.text,c,n.tabSize);i.push(Ce.range(h.from+m,h.from+p))}}}return i}function bG(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function Vj(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),r=n.state.doc.lineAt(t),s=t-r.from,i=s>Y2?-1:s==r.length?bG(n,e.clientX):Md(r.text,n.state.tabSize,t-r.from);return{line:r.number,col:i,off:s}}function wG(n,e){let t=Vj(n,e),r=n.state.selection;return t?{update(s){if(s.docChanged){let i=s.changes.mapPos(s.startState.doc.line(t.line).from),l=s.state.doc.lineAt(i);t={line:l.number,col:t.col,off:Math.min(t.off,l.length)},r=r.map(s.changes)}},get(s,i,l){let c=Vj(n,s);if(!c)return r;let u=yG(n.state,t,c);return u.length?l?Ce.create(u.concat(r.ranges)):Ce.create(u):r}}:null}function SG(n){let e=(t=>t.altKey&&t.button==0);return Fe.mouseSelectionStyle.of((t,r)=>e(r)?wG(t,r):null)}const OG={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},kG={style:"cursor: crosshair"};function jG(n={}){let[e,t]=OG[n.key||"Alt"],r=lr.fromClass(class{constructor(s){this.view=s,this.isDown=!1}set(s){this.isDown!=s&&(this.isDown=s,this.view.update([]))}},{eventObservers:{keydown(s){this.set(s.keyCode==e||t(s))},keyup(s){(s.keyCode==e||!t(s))&&this.set(!1)},mousemove(s){this.set(t(s))}}});return[r,Fe.contentAttributes.of(s=>{var i;return!((i=s.plugin(r))===null||i===void 0)&&i.isDown?kG:null})]}const dp="-10000px";class GA{constructor(e,t,r,s){this.facet=t,this.createTooltipView=r,this.removeTooltipView=s,this.input=e.state.facet(t),this.tooltips=this.input.filter(l=>l);let i=null;this.tooltipViews=this.tooltips.map(l=>i=r(l,i))}update(e,t){var r;let s=e.state.facet(this.facet),i=s.filter(u=>u);if(s===this.input){for(let u of this.tooltipViews)u.update&&u.update(e);return!1}let l=[],c=t?[]:null;for(let u=0;u<i.length;u++){let h=i[u],m=-1;if(h){for(let p=0;p<this.tooltips.length;p++){let x=this.tooltips[p];x&&x.create==h.create&&(m=p)}if(m<0)l[u]=this.createTooltipView(h,u?l[u-1]:null),c&&(c[u]=!!h.above);else{let p=l[u]=this.tooltipViews[m];c&&(c[u]=t[m]),p.update&&p.update(e)}}}for(let u of this.tooltipViews)l.indexOf(u)<0&&(this.removeTooltipView(u),(r=u.destroy)===null||r===void 0||r.call(u));return t&&(c.forEach((u,h)=>t[h]=u),t.length=c.length),this.input=s,this.tooltips=i,this.tooltipViews=l,!0}}function NG(n){let e=n.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const By=He.define({combine:n=>{var e,t,r;return{position:qe.ios?"absolute":((e=n.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((r=n.find(s=>s.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||NG}}}),Wj=new WeakMap,Rw=lr.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(By);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new GA(n,zw,(t,r)=>this.createTooltip(t,r),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,r=n.state.facet(By);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),r=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let s=document.createElement("div");s.className="cm-tooltip-arrow",t.dom.appendChild(s)}return t.dom.style.position=this.position,t.dom.style.top=dp,t.dom.style.left="0px",this.container.insertBefore(t.dom,r),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(n=r.destroy)===null||n===void 0||n.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(qe.safari){let l=i.getBoundingClientRect();t=Math.abs(l.top+1e4)>1||Math.abs(l.left)>1}else t=!!i.offsetParent&&i.offsetParent!=this.container.ownerDocument.body}if(t||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(n=i.width/this.parent.offsetWidth,e=i.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),s=Aw(this.view);return{visible:{left:r.left+s.left,top:r.top+s.top,right:r.right-s.right,bottom:r.bottom-s.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((i,l)=>{let c=this.manager.tooltipViews[l];return c.getCoords?c.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(By).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let c of this.manager.tooltipViews)c.dom.style.position="absolute"}let{visible:t,space:r,scaleX:s,scaleY:i}=n,l=[];for(let c=0;c<this.manager.tooltips.length;c++){let u=this.manager.tooltips[c],h=this.manager.tooltipViews[c],{dom:m}=h,p=n.pos[c],x=n.size[c];if(!p||u.clip!==!1&&(p.bottom<=Math.max(t.top,r.top)||p.top>=Math.min(t.bottom,r.bottom)||p.right<Math.max(t.left,r.left)-.1||p.left>Math.min(t.right,r.right)+.1)){m.style.top=dp;continue}let v=u.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,b=v?7:0,O=x.right-x.left,k=(e=Wj.get(h))!==null&&e!==void 0?e:x.bottom-x.top,j=h.offset||TG,T=this.view.textDirection==Hn.LTR,M=x.width>r.right-r.left?T?r.left:r.right-x.width:T?Math.max(r.left,Math.min(p.left-(v?14:0)+j.x,r.right-O)):Math.min(Math.max(r.left,p.left-O+(v?14:0)-j.x),r.right-O),_=this.above[c];!u.strictSide&&(_?p.top-k-b-j.y<r.top:p.bottom+k+b+j.y>r.bottom)&&_==r.bottom-p.bottom>p.top-r.top&&(_=this.above[c]=!_);let D=(_?p.top-r.top:r.bottom-p.bottom)-b;if(D<k&&h.resize!==!1){if(D<this.view.defaultLineHeight){m.style.top=dp;continue}Wj.set(h,k),m.style.height=(k=D)/i+"px"}else m.style.height&&(m.style.height="");let E=_?p.top-k-b-j.y:p.bottom+b+j.y,z=M+O;if(h.overlap!==!0)for(let Q of l)Q.left<z&&Q.right>M&&Q.top<E+k&&Q.bottom>E&&(E=_?Q.top-k-2-b:Q.bottom+b+2);if(this.position=="absolute"?(m.style.top=(E-n.parent.top)/i+"px",Gj(m,(M-n.parent.left)/s)):(m.style.top=E/i+"px",Gj(m,M/s)),v){let Q=p.left+(T?j.x:-j.x)-(M+14-7);v.style.left=Q/s+"px"}h.overlap!==!0&&l.push({left:M,top:E,right:z,bottom:E+k}),m.classList.toggle("cm-tooltip-above",_),m.classList.toggle("cm-tooltip-below",!_),h.positioned&&h.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=dp}},{eventObservers:{scroll(){this.maybeMeasure()}}});function Gj(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+"px")}const CG=Fe.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),TG={x:0,y:0},zw=He.define({enables:[Rw,CG]}),Ag=He.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class jx{static create(e){return new jx(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new GA(e,Ag,(t,r)=>this.createHostedView(t,r),t=>t.dom.remove())}createHostedView(e,t){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let r of this.manager.tooltipViews){let s=r[e];if(s!==void 0){if(t===void 0)t=s;else if(t!==s)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const MG=zw.compute([Ag],n=>{let e=n.facet(Ag);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var r;return(r=t.end)!==null&&r!==void 0?r:t.pos})),create:jx.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class AG{constructor(e,t,r,s,i){this.view=e,this.source=t,this.field=r,this.setHover=s,this.hoverTime=i,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,r=e.docView.nearest(t.target);if(!r)return;let s,i=1;if(r instanceof il)s=r.posAtStart;else{if(s=e.posAtCoords(t),s==null)return;let c=e.coordsAtPos(s);if(!c||t.y<c.top||t.y>c.bottom||t.x<c.left-e.defaultCharacterWidth||t.x>c.right+e.defaultCharacterWidth)return;let u=e.bidiSpans(e.state.doc.lineAt(s)).find(m=>m.from<=s&&m.to>=s),h=u&&u.dir==Hn.RTL?-1:1;i=t.x<c.left?-h:h}let l=this.source(e,s,i);if(l?.then){let c=this.pending={pos:s};l.then(u=>{this.pending==c&&(this.pending=null,u&&!(Array.isArray(u)&&!u.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(u)?u:[u])}))},u=>Es(e.state,u,"hover tooltip"))}else l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])})}get tooltip(){let e=this.view.plugin(Rw),t=e?e.manager.tooltips.findIndex(r=>r.create==jx.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:s,tooltip:i}=this;if(s.length&&i&&!EG(i.dom,e)||this.pending){let{pos:l}=s[0]||this.pending,c=(r=(t=s[0])===null||t===void 0?void 0:t.end)!==null&&r!==void 0?r:l;(l==c?this.view.posAtCoords(this.lastMove)!=l:!_G(this.view,l,c,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=r=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const hp=4;function EG(n,e){let{left:t,right:r,top:s,bottom:i}=n.getBoundingClientRect(),l;if(l=n.querySelector(".cm-tooltip-arrow")){let c=l.getBoundingClientRect();s=Math.min(c.top,s),i=Math.max(c.bottom,i)}return e.clientX>=t-hp&&e.clientX<=r+hp&&e.clientY>=s-hp&&e.clientY<=i+hp}function _G(n,e,t,r,s,i){let l=n.scrollDOM.getBoundingClientRect(),c=n.documentTop+n.documentPadding.top+n.contentHeight;if(l.left>r||l.right<r||l.top>s||Math.min(l.bottom,c)<s)return!1;let u=n.posAtCoords({x:r,y:s},!1);return u>=e&&u<=t}function DG(n,e={}){let t=xt.define(),r=Lr.define({create(){return[]},update(s,i){if(s.length&&(e.hideOnChange&&(i.docChanged||i.selection)?s=[]:e.hideOn&&(s=s.filter(l=>!e.hideOn(i,l))),i.docChanged)){let l=[];for(let c of s){let u=i.changes.mapPos(c.pos,-1,Ur.TrackDel);if(u!=null){let h=Object.assign(Object.create(null),c);h.pos=u,h.end!=null&&(h.end=i.changes.mapPos(h.end)),l.push(h)}}s=l}for(let l of i.effects)l.is(t)&&(s=l.value),l.is(RG)&&(s=[]);return s},provide:s=>Ag.from(s)});return{active:r,extension:[r,lr.define(s=>new AG(s,n,r,t,e.hoverTime||300)),MG]}}function XA(n,e){let t=n.plugin(Rw);if(!t)return null;let r=t.manager.tooltips.indexOf(e);return r<0?null:t.manager.tooltipViews[r]}const RG=xt.define(),Xj=He.define({combine(n){let e,t;for(let r of n)e=e||r.topContainer,t=t||r.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Sf(n,e){let t=n.plugin(YA),r=t?t.specs.indexOf(e):-1;return r>-1?t.panels[r]:null}const YA=lr.fromClass(class{constructor(n){this.input=n.state.facet(Of),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(Xj);this.top=new fp(n,!0,e.topContainer),this.bottom=new fp(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(Xj);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new fp(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new fp(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(Of);if(t!=this.input){let r=t.filter(u=>u),s=[],i=[],l=[],c=[];for(let u of r){let h=this.specs.indexOf(u),m;h<0?(m=u(n.view),c.push(m)):(m=this.panels[h],m.update&&m.update(n)),s.push(m),(m.top?i:l).push(m)}this.specs=r,this.panels=s,this.top.sync(i),this.bottom.sync(l);for(let u of c)u.dom.classList.add("cm-panel"),u.mount&&u.mount()}else for(let r of this.panels)r.update&&r.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>Fe.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class fp{constructor(e,t,r){this.view=e,this.top=t,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Yj(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Yj(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Yj(n){let e=n.nextSibling;return n.remove(),e}const Of=He.define({enables:YA});class pl extends yc{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}pl.prototype.elementClass="";pl.prototype.toDOM=void 0;pl.prototype.mapMode=Ur.TrackBefore;pl.prototype.startSide=pl.prototype.endSide=-1;pl.prototype.point=!0;const rg=He.define(),zG=He.define(),PG={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Gt.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},sf=He.define();function LG(n){return[KA(),sf.of({...PG,...n})]}const Kj=He.define({combine:n=>n.some(e=>e)});function KA(n){return[BG]}const BG=lr.fromClass(class{constructor(n){this.view=n,this.domAfter=null,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(sf).map(e=>new Jj(n,e)),this.fixed=!n.state.facet(Kj);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,r=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(r<(t.to-t.from)*.8)}if(n.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(Kj)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=Gt.iter(this.view.state.facet(rg),this.view.viewport.from),r=[],s=this.gutters.map(i=>new IG(i,this.view.viewport,-this.view.documentPadding.top));for(let i of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(i.type)){let l=!0;for(let c of i.type)if(c.type==fs.Text&&l){K2(t,r,c.from);for(let u of s)u.line(this.view,c,r);l=!1}else if(c.widget)for(let u of s)u.widget(this.view,c)}else if(i.type==fs.Text){K2(t,r,i.from);for(let l of s)l.line(this.view,i,r)}else if(i.widget)for(let l of s)l.widget(this.view,i);for(let i of s)i.finish();n&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(n){let e=n.startState.facet(sf),t=n.state.facet(sf),r=n.docChanged||n.heightChanged||n.viewportChanged||!Gt.eq(n.startState.facet(rg),n.state.facet(rg),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let s of this.gutters)s.update(n)&&(r=!0);else{r=!0;let s=[];for(let i of t){let l=e.indexOf(i);l<0?s.push(new Jj(this.view,i)):(this.gutters[l].update(n),s.push(this.gutters[l]))}for(let i of this.gutters)i.dom.remove(),s.indexOf(i)<0&&i.destroy();for(let i of s)i.config.side=="after"?this.getDOMAfter().appendChild(i.dom):this.dom.appendChild(i.dom);this.gutters=s}return r}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:n=>Fe.scrollMargins.of(e=>{let t=e.plugin(n);if(!t||t.gutters.length==0||!t.fixed)return null;let r=t.dom.offsetWidth*e.scaleX,s=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Hn.LTR?{left:r,right:s}:{right:r,left:s}})});function Zj(n){return Array.isArray(n)?n:[n]}function K2(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class IG{constructor(e,t,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Gt.iter(e.markers,t.from)}addElement(e,t,r){let{gutter:s}=this,i=(t.top-this.height)/e.scaleY,l=t.height/e.scaleY;if(this.i==s.elements.length){let c=new ZA(e,l,i,r);s.elements.push(c),s.dom.appendChild(c.dom)}else s.elements[this.i].update(e,l,i,r);this.height=t.bottom,this.i++}line(e,t,r){let s=[];K2(this.cursor,s,t.from),r.length&&(s=s.concat(r));let i=this.gutter.config.lineMarker(e,t,s);i&&s.unshift(i);let l=this.gutter;s.length==0&&!l.config.renderEmptyElements||this.addElement(e,t,s)}widget(e,t){let r=this.gutter.config.widgetMarker(e,t.widget,t),s=r?[r]:null;for(let i of e.state.facet(zG)){let l=i(e,t.widget,t);l&&(s||(s=[])).push(l)}s&&this.addElement(e,t,s)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Jj{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in t.domEventHandlers)this.dom.addEventListener(r,s=>{let i=s.target,l;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let u=i.getBoundingClientRect();l=(u.top+u.bottom)/2}else l=s.clientY;let c=e.lineBlockAtHeight(l-e.documentTop);t.domEventHandlers[r](e,c,s)&&s.preventDefault()});this.markers=Zj(t.markers(e)),t.initialSpacer&&(this.spacer=new ZA(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=Zj(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let r=e.view.viewport;return!Gt.eq(this.markers,t,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class ZA{constructor(e,t,r,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,r,s)}update(e,t,r,s){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),FG(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,t){let r="cm-gutterElement",s=this.dom.firstChild;for(let i=0,l=0;;){let c=l,u=i<t.length?t[i++]:null,h=!1;if(u){let m=u.elementClass;m&&(r+=" "+m);for(let p=l;p<this.markers.length;p++)if(this.markers[p].compare(u)){c=p,h=!0;break}}else c=this.markers.length;for(;l<c;){let m=this.markers[l++];if(m.toDOM){m.destroy(s);let p=s.nextSibling;s.remove(),s=p}}if(!u)break;u.toDOM&&(h?s=s.nextSibling:this.dom.insertBefore(u.toDOM(e),s)),h&&l++}this.dom.className=r,this.markers=t}destroy(){this.setMarkers(null,[])}}function FG(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].compare(e[t]))return!1;return!0}const qG=He.define(),QG=He.define(),$u=He.define({combine(n){return Oa(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let r=Object.assign({},e);for(let s in t){let i=r[s],l=t[s];r[s]=i?(c,u,h)=>i(c,u,h)||l(c,u,h):l}return r}})}});class Iy extends pl{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Fy(n,e){return n.state.facet($u).formatNumber(e,n.state)}const $G=sf.compute([$u],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(qG)},lineMarker(e,t,r){return r.some(s=>s.toDOM)?null:new Iy(Fy(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,r)=>{for(let s of e.state.facet(QG)){let i=s(e,t,r);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet($u)!=e.state.facet($u),initialSpacer(e){return new Iy(Fy(e,e7(e.state.doc.lines)))},updateSpacer(e,t){let r=Fy(t.view,e7(t.view.state.doc.lines));return r==e.number?e:new Iy(r)},domEventHandlers:n.facet($u).domEventHandlers,side:"before"}));function HG(n={}){return[$u.of(n),KA(),$G]}function e7(n){let e=9;for(;e<n;)e=e*10+9;return e}const UG=new class extends pl{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},VG=rg.compute(["selection"],n=>{let e=[],t=-1;for(let r of n.selection.ranges){let s=n.doc.lineAt(r.head).from;s>t&&(t=s,e.push(UG.range(s)))}return Gt.of(e)});function WG(){return VG}const JA=1024;let GG=0;class qy{constructor(e,t){this.from=e,this.to=t}}class Et{constructor(e={}){this.id=GG++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=gs.match(e)),t=>{let r=e(t);return r===void 0?null:[this,r]}}}Et.closedBy=new Et({deserialize:n=>n.split(" ")});Et.openedBy=new Et({deserialize:n=>n.split(" ")});Et.group=new Et({deserialize:n=>n.split(" ")});Et.isolate=new Et({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});Et.contextHash=new Et({perNode:!0});Et.lookAhead=new Et({perNode:!0});Et.mounted=new Et({perNode:!0});class Eg{constructor(e,t,r){this.tree=e,this.overlay=t,this.parser=r}static get(e){return e&&e.props&&e.props[Et.mounted.id]}}const XG=Object.create(null);class gs{constructor(e,t,r,s=0){this.name=e,this.props=t,this.id=r,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):XG,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new gs(e.name||"",t,e.id,r);if(e.props){for(let i of e.props)if(Array.isArray(i)||(i=i(s)),i){if(i[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[i[0].id]=i[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(Et.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let r in e)for(let s of r.split(" "))t[s]=e[r];return r=>{for(let s=r.prop(Et.group),i=-1;i<(s?s.length:0);i++){let l=t[i<0?r.name:s[i]];if(l)return l}}}}gs.none=new gs("",Object.create(null),0,8);class Nx{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let r of this.types){let s=null;for(let i of e){let l=i(r);if(l){s||(s=Object.assign({},r.props));let c=l[1],u=l[0];u.combine&&u.id in s&&(c=u.combine(s[u.id],c)),s[u.id]=c}}t.push(s?new gs(r.name,s,r.id,r.flags):r)}return new Nx(t)}}const mp=new WeakMap,t7=new WeakMap;var kr;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays"})(kr||(kr={}));class _n{constructor(e,t,r,s,i){if(this.type=e,this.children=t,this.positions=r,this.length=s,this.props=null,i&&i.length){this.props=Object.create(null);for(let[l,c]of i)this.props[typeof l=="number"?l:l.id]=c}}toString(){let e=Eg.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let r of this.children){let s=r.toString();s&&(t&&(t+=","),t+=s)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new J2(this.topNode,e)}cursorAt(e,t=0,r=0){let s=mp.get(this)||this.topNode,i=new J2(s);return i.moveTo(e,t),mp.set(this,i._tree),i}get topNode(){return new zs(this,0,0,null)}resolve(e,t=0){let r=kf(mp.get(this)||this.topNode,e,t,!1);return mp.set(this,r),r}resolveInner(e,t=0){let r=kf(t7.get(this)||this.topNode,e,t,!0);return t7.set(this,r),r}resolveStack(e,t=0){return ZG(this,e,t)}iterate(e){let{enter:t,leave:r,from:s=0,to:i=this.length}=e,l=e.mode||0,c=(l&kr.IncludeAnonymous)>0;for(let u=this.cursor(l|kr.IncludeAnonymous);;){let h=!1;if(u.from<=i&&u.to>=s&&(!c&&u.type.isAnonymous||t(u)!==!1)){if(u.firstChild())continue;h=!0}for(;h&&r&&(c||!u.type.isAnonymous)&&r(u),!u.nextSibling();){if(!u.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Bw(gs.none,this.children,this.positions,0,this.children.length,0,this.length,(t,r,s)=>new _n(this.type,t,r,s,this.propValues),e.makeTree||((t,r,s)=>new _n(gs.none,t,r,s)))}static build(e){return JG(e)}}_n.empty=new _n(gs.none,[],[],0);class Pw{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Pw(this.buffer,this.index)}}class po{constructor(e,t,r){this.buffer=e,this.length=t,this.set=r}get type(){return gs.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],r=this.buffer[e+3],s=this.set.types[t],i=s.name;if(/\W/.test(i)&&!s.isError&&(i=JSON.stringify(i)),e+=4,r==e)return i;let l=[];for(;e<r;)l.push(this.childString(e)),e=this.buffer[e+3];return i+"("+l.join(",")+")"}findChild(e,t,r,s,i){let{buffer:l}=this,c=-1;for(let u=e;u!=t&&!(eE(i,s,l[u+1],l[u+2])&&(c=u,r>0));u=l[u+3]);return c}slice(e,t,r){let s=this.buffer,i=new Uint16Array(t-e),l=0;for(let c=e,u=0;c<t;){i[u++]=s[c++],i[u++]=s[c++]-r;let h=i[u++]=s[c++]-r;i[u++]=s[c++]-e,l=Math.max(l,h)}return new po(i,l,this.set)}}function eE(n,e,t,r){switch(n){case-2:return t<e;case-1:return r>=e&&t<e;case 0:return t<e&&r>e;case 1:return t<=e&&r>e;case 2:return r>e;case 4:return!0}}function kf(n,e,t,r){for(var s;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let l=!r&&n instanceof zs&&n.index<0?null:n.parent;if(!l)return n;n=l}let i=r?0:kr.IgnoreOverlays;if(r)for(let l=n,c=l.parent;c;l=c,c=l.parent)l instanceof zs&&l.index<0&&((s=c.enter(e,t,i))===null||s===void 0?void 0:s.from)!=l.from&&(n=c);for(;;){let l=n.enter(e,t,i);if(!l)return n;n=l}}class tE{cursor(e=0){return new J2(this,e)}getChild(e,t=null,r=null){let s=n7(this,e,t,r);return s.length?s[0]:null}getChildren(e,t=null,r=null){return n7(this,e,t,r)}resolve(e,t=0){return kf(this,e,t,!1)}resolveInner(e,t=0){return kf(this,e,t,!0)}matchContext(e){return Z2(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),r=this;for(;t;){let s=t.lastChild;if(!s||s.to!=t.to)break;s.type.isError&&s.from==s.to?(r=t,t=s.prevSibling):t=s}return r}get node(){return this}get next(){return this.parent}}class zs extends tE{constructor(e,t,r,s){super(),this._tree=e,this.from=t,this.index=r,this._parent=s}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,r,s,i=0){for(let l=this;;){for(let{children:c,positions:u}=l._tree,h=t>0?c.length:-1;e!=h;e+=t){let m=c[e],p=u[e]+l.from;if(eE(s,r,p,p+m.length)){if(m instanceof po){if(i&kr.ExcludeBuffers)continue;let x=m.findChild(0,m.buffer.length,t,r-p,s);if(x>-1)return new da(new YG(l,m,e,p),null,x)}else if(i&kr.IncludeAnonymous||!m.type.isAnonymous||Lw(m)){let x;if(!(i&kr.IgnoreMounts)&&(x=Eg.get(m))&&!x.overlay)return new zs(x.tree,p,e,l);let v=new zs(m,p,e,l);return i&kr.IncludeAnonymous||!v.type.isAnonymous?v:v.nextChild(t<0?m.children.length-1:0,t,r,s)}}}if(i&kr.IncludeAnonymous||!l.type.isAnonymous||(l.index>=0?e=l.index+t:e=t<0?-1:l._parent._tree.children.length,l=l._parent,!l))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,r=0){let s;if(!(r&kr.IgnoreOverlays)&&(s=Eg.get(this._tree))&&s.overlay){let i=e-this.from;for(let{from:l,to:c}of s.overlay)if((t>0?l<=i:l<i)&&(t<0?c>=i:c>i))return new zs(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function n7(n,e,t,r){let s=n.cursor(),i=[];if(!s.firstChild())return i;if(t!=null){for(let l=!1;!l;)if(l=s.type.is(t),!s.nextSibling())return i}for(;;){if(r!=null&&s.type.is(r))return i;if(s.type.is(e)&&i.push(s.node),!s.nextSibling())return r==null?i:[]}}function Z2(n,e,t=e.length-1){for(let r=n;t>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[t]&&e[t]!=r.name)return!1;t--}}return!0}class YG{constructor(e,t,r,s){this.parent=e,this.buffer=t,this.index=r,this.start=s}}class da extends tE{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,r){super(),this.context=e,this._parent=t,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,t,r){let{buffer:s}=this.context,i=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,r);return i<0?null:new da(this.context,this,i)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,r=0){if(r&kr.ExcludeBuffers)return null;let{buffer:s}=this.context,i=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return i<0?null:new da(this.context,this,i)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new da(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new da(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:r}=this.context,s=this.index+4,i=r.buffer[this.index+3];if(i>s){let l=r.buffer[this.index+1];e.push(r.slice(s,i,l)),t.push(0)}return new _n(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function nE(n){if(!n.length)return null;let e=0,t=n[0];for(let i=1;i<n.length;i++){let l=n[i];(l.from>t.from||l.to<t.to)&&(t=l,e=i)}let r=t instanceof zs&&t.index<0?null:t.parent,s=n.slice();return r?s[e]=r:s.splice(e,1),new KG(s,t)}class KG{constructor(e,t){this.heads=e,this.node=t}get next(){return nE(this.heads)}}function ZG(n,e,t){let r=n.resolveInner(e,t),s=null;for(let i=r instanceof zs?r:r.context.parent;i;i=i.parent)if(i.index<0){let l=i.parent;(s||(s=[r])).push(l.resolve(e,t)),i=l}else{let l=Eg.get(i.tree);if(l&&l.overlay&&l.overlay[0].from<=e&&l.overlay[l.overlay.length-1].to>=e){let c=new zs(l.tree,l.overlay[0].from+i.from,-1,i);(s||(s=[r])).push(kf(c,e,t,!1))}}return s?nE(s):r}class J2{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof zs)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:r,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=r+s.buffer[e+1],this.to=r+s.buffer[e+2],!0}yield(e){return e?e instanceof zs?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,r,this.mode));let{buffer:s}=this.buffer,i=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,r);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,r=this.mode){return this.buffer?r&kr.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&kr.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&kr.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,r=this.stack.length-1;if(e<0){let s=r<0?0:this.stack[r]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(r<0?t.buffer.length:t.buffer[this.stack[r]+3]))return this.yieldBuf(s)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,r,{buffer:s}=this;if(s){if(e>0){if(this.index<s.buffer.buffer.length)return!1}else for(let i=0;i<this.index;i++)if(s.buffer.buffer[i+3]<this.index)return!1;({index:t,parent:r}=s)}else({index:t,_parent:r}=this._tree);for(;r;{index:t,_parent:r}=r)if(t>-1)for(let i=t+e,l=e<0?-1:r._tree.children.length;i!=l;i+=e){let c=r._tree.children[i];if(this.mode&kr.IncludeAnonymous||c instanceof po||!c.type.isAnonymous||Lw(c))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,r=0;if(e&&e.context==this.buffer)e:for(let s=this.index,i=this.stack.length;i>=0;){for(let l=e;l;l=l._parent)if(l.index==s){if(s==this.index)return l;t=l,r=i+1;break e}s=this.stack[--i]}for(let s=r;s<this.stack.length;s++)t=new da(this.buffer,t,this.stack[s]);return this.bufferNode=new da(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let r=0;;){let s=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(s=!0)}for(;;){if(s&&t&&t(this),s=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,s=!0}}}matchContext(e){if(!this.buffer)return Z2(this.node.parent,e);let{buffer:t}=this.buffer,{types:r}=t.set;for(let s=e.length-1,i=this.stack.length-1;s>=0;i--){if(i<0)return Z2(this._tree,e,s);let l=r[t.buffer[this.stack[i]]];if(!l.isAnonymous){if(e[s]&&e[s]!=l.name)return!1;s--}}return!0}}function Lw(n){return n.children.some(e=>e instanceof po||!e.type.isAnonymous||Lw(e))}function JG(n){var e;let{buffer:t,nodeSet:r,maxBufferLength:s=JA,reused:i=[],minRepeatType:l=r.types.length}=n,c=Array.isArray(t)?new Pw(t,t.length):t,u=r.types,h=0,m=0;function p(D,E,z,Q,q,B){let{id:U,start:V,end:ce,size:W}=c,J=m,H=h;if(W<0)if(c.next(),W==-1){let me=i[U];z.push(me),Q.push(V-D);return}else if(W==-3){h=U;return}else if(W==-4){m=U;return}else throw new RangeError(`Unrecognized record size: ${W}`);let ae=u[U],ne,ue,R=V-D;if(ce-V<=s&&(ue=k(c.pos-E,q))){let me=new Uint16Array(ue.size-ue.skip),Y=c.pos-ue.size,P=me.length;for(;c.pos>Y;)P=j(ue.start,me,P);ne=new po(me,ce-ue.start,r),R=ue.start-D}else{let me=c.pos-W;c.next();let Y=[],P=[],K=U>=l?U:-1,$=0,fe=ce;for(;c.pos>me;)K>=0&&c.id==K&&c.size>=0?(c.end<=fe-s&&(b(Y,P,V,$,c.end,fe,K,J,H),$=Y.length,fe=c.end),c.next()):B>2500?x(V,me,Y,P):p(V,me,Y,P,K,B+1);if(K>=0&&$>0&&$<Y.length&&b(Y,P,V,$,V,fe,K,J,H),Y.reverse(),P.reverse(),K>-1&&$>0){let ye=v(ae,H);ne=Bw(ae,Y,P,0,Y.length,0,ce-V,ye,ye)}else ne=O(ae,Y,P,ce-V,J-ce,H)}z.push(ne),Q.push(R)}function x(D,E,z,Q){let q=[],B=0,U=-1;for(;c.pos>E;){let{id:V,start:ce,end:W,size:J}=c;if(J>4)c.next();else{if(U>-1&&ce<U)break;U<0&&(U=W-s),q.push(V,ce,W),B++,c.next()}}if(B){let V=new Uint16Array(B*4),ce=q[q.length-2];for(let W=q.length-3,J=0;W>=0;W-=3)V[J++]=q[W],V[J++]=q[W+1]-ce,V[J++]=q[W+2]-ce,V[J++]=J;z.push(new po(V,q[2]-ce,r)),Q.push(ce-D)}}function v(D,E){return(z,Q,q)=>{let B=0,U=z.length-1,V,ce;if(U>=0&&(V=z[U])instanceof _n){if(!U&&V.type==D&&V.length==q)return V;(ce=V.prop(Et.lookAhead))&&(B=Q[U]+V.length+ce)}return O(D,z,Q,q,B,E)}}function b(D,E,z,Q,q,B,U,V,ce){let W=[],J=[];for(;D.length>Q;)W.push(D.pop()),J.push(E.pop()+z-q);D.push(O(r.types[U],W,J,B-q,V-B,ce)),E.push(q-z)}function O(D,E,z,Q,q,B,U){if(B){let V=[Et.contextHash,B];U=U?[V].concat(U):[V]}if(q>25){let V=[Et.lookAhead,q];U=U?[V].concat(U):[V]}return new _n(D,E,z,Q,U)}function k(D,E){let z=c.fork(),Q=0,q=0,B=0,U=z.end-s,V={size:0,start:0,skip:0};e:for(let ce=z.pos-D;z.pos>ce;){let W=z.size;if(z.id==E&&W>=0){V.size=Q,V.start=q,V.skip=B,B+=4,Q+=4,z.next();continue}let J=z.pos-W;if(W<0||J<ce||z.start<U)break;let H=z.id>=l?4:0,ae=z.start;for(z.next();z.pos>J;){if(z.size<0)if(z.size==-3)H+=4;else break e;else z.id>=l&&(H+=4);z.next()}q=ae,Q+=W,B+=H}return(E<0||Q==D)&&(V.size=Q,V.start=q,V.skip=B),V.size>4?V:void 0}function j(D,E,z){let{id:Q,start:q,end:B,size:U}=c;if(c.next(),U>=0&&Q<l){let V=z;if(U>4){let ce=c.pos-(U-4);for(;c.pos>ce;)z=j(D,E,z)}E[--z]=V,E[--z]=B-D,E[--z]=q-D,E[--z]=Q}else U==-3?h=Q:U==-4&&(m=Q);return z}let T=[],M=[];for(;c.pos>0;)p(n.start||0,n.bufferStart||0,T,M,-1,0);let _=(e=n.length)!==null&&e!==void 0?e:T.length?M[0]+T[0].length:0;return new _n(u[n.topID],T.reverse(),M.reverse(),_)}const r7=new WeakMap;function sg(n,e){if(!n.isAnonymous||e instanceof po||e.type!=n)return 1;let t=r7.get(e);if(t==null){t=1;for(let r of e.children){if(r.type!=n||!(r instanceof _n)){t=1;break}t+=sg(n,r)}r7.set(e,t)}return t}function Bw(n,e,t,r,s,i,l,c,u){let h=0;for(let b=r;b<s;b++)h+=sg(n,e[b]);let m=Math.ceil(h*1.5/8),p=[],x=[];function v(b,O,k,j,T){for(let M=k;M<j;){let _=M,D=O[M],E=sg(n,b[M]);for(M++;M<j;M++){let z=sg(n,b[M]);if(E+z>=m)break;E+=z}if(M==_+1){if(E>m){let z=b[_];v(z.children,z.positions,0,z.children.length,O[_]+T);continue}p.push(b[_])}else{let z=O[M-1]+b[M-1].length-D;p.push(Bw(n,b,O,_,M,D,z,null,u))}x.push(D+T-i)}}return v(e,t,r,s,0),(c||u)(p,x,l)}class eX{constructor(){this.map=new WeakMap}setBuffer(e,t,r){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(t,r)}getBuffer(e,t){let r=this.map.get(e);return r&&r.get(t)}set(e,t){e instanceof da?this.setBuffer(e.context.buffer,e.index,t):e instanceof zs&&this.map.set(e.tree,t)}get(e){return e instanceof da?this.getBuffer(e.context.buffer,e.index):e instanceof zs?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class pc{constructor(e,t,r,s,i=!1,l=!1){this.from=e,this.to=t,this.tree=r,this.offset=s,this.open=(i?1:0)|(l?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],r=!1){let s=[new pc(0,e.length,e,0,!1,r)];for(let i of t)i.to>e.length&&s.push(i);return s}static applyChanges(e,t,r=128){if(!t.length)return e;let s=[],i=1,l=e.length?e[0]:null;for(let c=0,u=0,h=0;;c++){let m=c<t.length?t[c]:null,p=m?m.fromA:1e9;if(p-u>=r)for(;l&&l.from<p;){let x=l;if(u>=x.from||p<=x.to||h){let v=Math.max(x.from,u)-h,b=Math.min(x.to,p)-h;x=v>=b?null:new pc(v,b,x.tree,x.offset+h,c>0,!!m)}if(x&&s.push(x),l.to>p)break;l=i<e.length?e[i++]:null}if(!m)break;u=m.toA,h=m.toA-m.toB}return s}}let Iw=class{startParse(e,t,r){return typeof e=="string"&&(e=new tX(e)),r=r?r.length?r.map(s=>new qy(s.from,s.to)):[new qy(0,0)]:[new qy(0,e.length)],this.createParse(e,t||[],r)}parse(e,t,r){let s=this.startParse(e,t,r);for(;;){let i=s.advance();if(i)return i}}};class tX{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new Et({perNode:!0});let nX=0;class vi{constructor(e,t,r,s){this.name=e,this.set=t,this.base=r,this.modified=s,this.id=nX++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let r=typeof e=="string"?e:"?";if(e instanceof vi&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let s=new vi(r,[],null,[]);if(s.set.push(s),t)for(let i of t.set)s.set.push(i);return s}static defineModifier(e){let t=new _g(e);return r=>r.modified.indexOf(t)>-1?r:_g.get(r.base||r,r.modified.concat(t).sort((s,i)=>s.id-i.id))}}let rX=0;class _g{constructor(e){this.name=e,this.instances=[],this.id=rX++}static get(e,t){if(!t.length)return e;let r=t[0].instances.find(c=>c.base==e&&sX(t,c.modified));if(r)return r;let s=[],i=new vi(e.name,s,e,t);for(let c of t)c.instances.push(i);let l=iX(t);for(let c of e.set)if(!c.modified.length)for(let u of l)s.push(_g.get(c,u));return i}}function sX(n,e){return n.length==e.length&&n.every((t,r)=>t==e[r])}function iX(n){let e=[[]];for(let t=0;t<n.length;t++)for(let r=0,s=e.length;r<s;r++)e.push(e[r].concat(n[t]));return e.sort((t,r)=>r.length-t.length)}function Fw(n){let e=Object.create(null);for(let t in n){let r=n[t];Array.isArray(r)||(r=[r]);for(let s of t.split(" "))if(s){let i=[],l=2,c=s;for(let p=0;;){if(c=="..."&&p>0&&p+3==s.length){l=1;break}let x=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(c);if(!x)throw new RangeError("Invalid path: "+s);if(i.push(x[0]=="*"?"":x[0][0]=='"'?JSON.parse(x[0]):x[0]),p+=x[0].length,p==s.length)break;let v=s[p++];if(p==s.length&&v=="!"){l=0;break}if(v!="/")throw new RangeError("Invalid path: "+s);c=s.slice(p)}let u=i.length-1,h=i[u];if(!h)throw new RangeError("Invalid path: "+s);let m=new jf(r,l,u>0?i.slice(0,u):null);e[h]=m.sort(e[h])}}return rE.add(e)}const rE=new Et({combine(n,e){let t,r,s;for(;n||e;){if(!n||e&&n.depth>=e.depth?(s=e,e=e.next):(s=n,n=n.next),t&&t.mode==s.mode&&!s.context&&!t.context)continue;let i=new jf(s.tags,s.mode,s.context);t?t.next=i:r=i,t=i}return r}});class jf{constructor(e,t,r,s){this.tags=e,this.mode=t,this.context=r,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}jf.empty=new jf([],2,null);function sE(n,e){let t=Object.create(null);for(let i of n)if(!Array.isArray(i.tag))t[i.tag.id]=i.class;else for(let l of i.tag)t[l.id]=i.class;let{scope:r,all:s=null}=e||{};return{style:i=>{let l=s;for(let c of i)for(let u of c.set){let h=t[u.id];if(h){l=l?l+" "+h:h;break}}return l},scope:r}}function aX(n,e){let t=null;for(let r of n){let s=r.style(e);s&&(t=t?t+" "+s:s)}return t}function lX(n,e,t,r=0,s=n.length){let i=new oX(r,Array.isArray(e)?e:[e],t);i.highlightRange(n.cursor(),r,s,"",i.highlighters),i.flush(s)}class oX{constructor(e,t,r){this.at=e,this.highlighters=t,this.span=r,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,r,s,i){let{type:l,from:c,to:u}=e;if(c>=r||u<=t)return;l.isTop&&(i=this.highlighters.filter(v=>!v.scope||v.scope(l)));let h=s,m=cX(e)||jf.empty,p=aX(i,m.tags);if(p&&(h&&(h+=" "),h+=p,m.mode==1&&(s+=(s?" ":"")+p)),this.startSpan(Math.max(t,c),h),m.opaque)return;let x=e.tree&&e.tree.prop(Et.mounted);if(x&&x.overlay){let v=e.node.enter(x.overlay[0].from+c,1),b=this.highlighters.filter(k=>!k.scope||k.scope(x.tree.type)),O=e.firstChild();for(let k=0,j=c;;k++){let T=k<x.overlay.length?x.overlay[k]:null,M=T?T.from+c:u,_=Math.max(t,j),D=Math.min(r,M);if(_<D&&O)for(;e.from<D&&(this.highlightRange(e,_,D,s,i),this.startSpan(Math.min(D,e.to),h),!(e.to>=M||!e.nextSibling())););if(!T||M>r)break;j=T.to+c,j>t&&(this.highlightRange(v.cursor(),Math.max(t,T.from+c),Math.min(r,j),"",b),this.startSpan(Math.min(r,j),h))}O&&e.parent()}else if(e.firstChild()){x&&(s="");do if(!(e.to<=t)){if(e.from>=r)break;this.highlightRange(e,t,r,s,i),this.startSpan(Math.min(r,e.to),h)}while(e.nextSibling());e.parent()}}}function cX(n){let e=n.type.prop(rE);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const Ie=vi.define,pp=Ie(),Jl=Ie(),s7=Ie(Jl),i7=Ie(Jl),eo=Ie(),gp=Ie(eo),Qy=Ie(eo),na=Ie(),Ko=Ie(na),ea=Ie(),ta=Ie(),e4=Ie(),zh=Ie(e4),xp=Ie(),he={comment:pp,lineComment:Ie(pp),blockComment:Ie(pp),docComment:Ie(pp),name:Jl,variableName:Ie(Jl),typeName:s7,tagName:Ie(s7),propertyName:i7,attributeName:Ie(i7),className:Ie(Jl),labelName:Ie(Jl),namespace:Ie(Jl),macroName:Ie(Jl),literal:eo,string:gp,docString:Ie(gp),character:Ie(gp),attributeValue:Ie(gp),number:Qy,integer:Ie(Qy),float:Ie(Qy),bool:Ie(eo),regexp:Ie(eo),escape:Ie(eo),color:Ie(eo),url:Ie(eo),keyword:ea,self:Ie(ea),null:Ie(ea),atom:Ie(ea),unit:Ie(ea),modifier:Ie(ea),operatorKeyword:Ie(ea),controlKeyword:Ie(ea),definitionKeyword:Ie(ea),moduleKeyword:Ie(ea),operator:ta,derefOperator:Ie(ta),arithmeticOperator:Ie(ta),logicOperator:Ie(ta),bitwiseOperator:Ie(ta),compareOperator:Ie(ta),updateOperator:Ie(ta),definitionOperator:Ie(ta),typeOperator:Ie(ta),controlOperator:Ie(ta),punctuation:e4,separator:Ie(e4),bracket:zh,angleBracket:Ie(zh),squareBracket:Ie(zh),paren:Ie(zh),brace:Ie(zh),content:na,heading:Ko,heading1:Ie(Ko),heading2:Ie(Ko),heading3:Ie(Ko),heading4:Ie(Ko),heading5:Ie(Ko),heading6:Ie(Ko),contentSeparator:Ie(na),list:Ie(na),quote:Ie(na),emphasis:Ie(na),strong:Ie(na),link:Ie(na),monospace:Ie(na),strikethrough:Ie(na),inserted:Ie(),deleted:Ie(),changed:Ie(),invalid:Ie(),meta:xp,documentMeta:Ie(xp),annotation:Ie(xp),processingInstruction:Ie(xp),definition:vi.defineModifier("definition"),constant:vi.defineModifier("constant"),function:vi.defineModifier("function"),standard:vi.defineModifier("standard"),local:vi.defineModifier("local"),special:vi.defineModifier("special")};for(let n in he){let e=he[n];e instanceof vi&&(e.name=n)}sE([{tag:he.link,class:"tok-link"},{tag:he.heading,class:"tok-heading"},{tag:he.emphasis,class:"tok-emphasis"},{tag:he.strong,class:"tok-strong"},{tag:he.keyword,class:"tok-keyword"},{tag:he.atom,class:"tok-atom"},{tag:he.bool,class:"tok-bool"},{tag:he.url,class:"tok-url"},{tag:he.labelName,class:"tok-labelName"},{tag:he.inserted,class:"tok-inserted"},{tag:he.deleted,class:"tok-deleted"},{tag:he.literal,class:"tok-literal"},{tag:he.string,class:"tok-string"},{tag:he.number,class:"tok-number"},{tag:[he.regexp,he.escape,he.special(he.string)],class:"tok-string2"},{tag:he.variableName,class:"tok-variableName"},{tag:he.local(he.variableName),class:"tok-variableName tok-local"},{tag:he.definition(he.variableName),class:"tok-variableName tok-definition"},{tag:he.special(he.variableName),class:"tok-variableName2"},{tag:he.definition(he.propertyName),class:"tok-propertyName tok-definition"},{tag:he.typeName,class:"tok-typeName"},{tag:he.namespace,class:"tok-namespace"},{tag:he.className,class:"tok-className"},{tag:he.macroName,class:"tok-macroName"},{tag:he.propertyName,class:"tok-propertyName"},{tag:he.operator,class:"tok-operator"},{tag:he.comment,class:"tok-comment"},{tag:he.meta,class:"tok-meta"},{tag:he.invalid,class:"tok-invalid"},{tag:he.punctuation,class:"tok-punctuation"}]);var $y;const lc=new Et;function iE(n){return He.define({combine:n?e=>e.concat(n):void 0})}const uX=new Et;class bi{constructor(e,t,r=[],s=""){this.data=e,this.name=s,Vt.prototype.hasOwnProperty("tree")||Object.defineProperty(Vt.prototype,"tree",{get(){return zr(this)}}),this.parser=t,this.extension=[go.of(this),Vt.languageData.of((i,l,c)=>{let u=a7(i,l,c),h=u.type.prop(lc);if(!h)return[];let m=i.facet(h),p=u.type.prop(uX);if(p){let x=u.resolve(l-u.from,c);for(let v of p)if(v.test(x,i)){let b=i.facet(v.facet);return v.type=="replace"?b:b.concat(m)}}return m})].concat(r)}isActiveAt(e,t,r=-1){return a7(e,t,r).type.prop(lc)==this.data}findRegions(e){let t=e.facet(go);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let r=[],s=(i,l)=>{if(i.prop(lc)==this.data){r.push({from:l,to:l+i.length});return}let c=i.prop(Et.mounted);if(c){if(c.tree.prop(lc)==this.data){if(c.overlay)for(let u of c.overlay)r.push({from:u.from+l,to:u.to+l});else r.push({from:l,to:l+i.length});return}else if(c.overlay){let u=r.length;if(s(c.tree,c.overlay[0].from+l),r.length>u)return}}for(let u=0;u<i.children.length;u++){let h=i.children[u];h instanceof _n&&s(h,i.positions[u]+l)}};return s(zr(e),0),r}get allowsNesting(){return!0}}bi.setState=xt.define();function a7(n,e,t){let r=n.facet(go),s=zr(n).topNode;if(!r||r.allowsNesting)for(let i=s;i;i=i.enter(e,t,kr.ExcludeBuffers))i.type.isTop&&(s=i);return s}class Nf extends bi{constructor(e,t,r){super(e,t,[],r),this.parser=t}static define(e){let t=iE(e.languageData);return new Nf(t,e.parser.configure({props:[lc.add(r=>r.isTop?t:void 0)]}),e.name)}configure(e,t){return new Nf(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function zr(n){let e=n.field(bi.state,!1);return e?e.tree:_n.empty}class dX{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let r=this.cursorPos-this.string.length;return e<r||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-r,t-r)}}let Ph=null;class pd{constructor(e,t,r=[],s,i,l,c,u){this.parser=e,this.state=t,this.fragments=r,this.tree=s,this.treeLen=i,this.viewport=l,this.skipped=c,this.scheduleOn=u,this.parse=null,this.tempSkipped=[]}static create(e,t,r){return new pd(e,t,[],_n.empty,0,r,[],null)}startParse(){return this.parser.startParse(new dX(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=_n.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let s=this.parse.advance();if(s)if(this.fragments=this.withoutTempSkipped(pc.addTree(s,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=s,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(pc.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Ph;Ph=this;try{return e()}finally{Ph=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=l7(e,t.from,t.to);return e}changes(e,t){let{fragments:r,tree:s,treeLen:i,viewport:l,skipped:c}=this;if(this.takeTree(),!e.empty){let u=[];if(e.iterChangedRanges((h,m,p,x)=>u.push({fromA:h,toA:m,fromB:p,toB:x})),r=pc.applyChanges(r,u),s=_n.empty,i=0,l={from:e.mapPos(l.from,-1),to:e.mapPos(l.to,1)},this.skipped.length){c=[];for(let h of this.skipped){let m=e.mapPos(h.from,1),p=e.mapPos(h.to,-1);m<p&&c.push({from:m,to:p})}}}return new pd(this.parser,t,r,s,i,l,c,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:s,to:i}=this.skipped[r];s<e.to&&i>e.from&&(this.fragments=l7(this.fragments,s,i),this.skipped.splice(r--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Iw{createParse(t,r,s){let i=s[0].from,l=s[s.length-1].to;return{parsedPos:i,advance(){let u=Ph;if(u){for(let h of s)u.tempSkipped.push(h);e&&(u.scheduleOn=u.scheduleOn?Promise.all([u.scheduleOn,e]):e)}return this.parsedPos=l,new _n(gs.none,[],[],l-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Ph}}function l7(n,e,t){return pc.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class gd{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,r)||t.takeTree(),new gd(t)}static init(e){let t=Math.min(3e3,e.doc.length),r=pd.create(e.facet(go).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new gd(r)}}bi.state=Lr.define({create:gd.init,update(n,e){for(let t of e.effects)if(t.is(bi.setState))return t.value;return e.startState.facet(go)!=e.state.facet(go)?gd.init(e.state):n.apply(e)}});let aE=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(aE=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Hy=typeof navigator<"u"&&(!(($y=navigator.scheduling)===null||$y===void 0)&&$y.isInputPending)?()=>navigator.scheduling.isInputPending():null,hX=lr.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(bi.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(bi.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=aE(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:s}}=this.view,i=r.field(bi.state);if(i.tree==i.context.tree&&i.context.isDone(s+1e5))return;let l=Date.now()+Math.min(this.chunkBudget,100,e&&!Hy?Math.max(25,e.timeRemaining()-5):1e9),c=i.context.treeLen<s&&r.doc.length>s+1e3,u=i.context.work(()=>Hy&&Hy()||Date.now()>l,s+(c?0:1e5));this.chunkBudget-=Date.now()-t,(u||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:bi.setState.of(new gd(i.context))})),this.chunkBudget>0&&!(u&&!c)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Es(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),go=He.define({combine(n){return n.length?n[0]:null},enables:n=>[bi.state,hX,Fe.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class lE{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const fX=He.define(),d0=He.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Oc(n){let e=n.facet(d0);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function Cf(n,e){let t="",r=n.tabSize,s=n.facet(d0)[0];if(s==" "){for(;e>=r;)t+=" ",e-=r;s=" "}for(let i=0;i<e;i++)t+=s;return t}function qw(n,e){n instanceof Vt&&(n=new Cx(n));for(let r of n.state.facet(fX)){let s=r(n,e);if(s!==void 0)return s}let t=zr(n.state);return t.length>=e?mX(n,t,e):null}class Cx{constructor(e,t={}){this.state=e,this.options=t,this.unit=Oc(e)}lineAt(e,t=1){let r=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:i}=this.options;return s!=null&&s>=r.from&&s<=r.to?i&&s==e?{text:"",from:e}:(t<0?s<e:s<=e)?{text:r.text.slice(s-r.from),from:s}:{text:r.text.slice(0,s-r.from),from:r.from}:r}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:s}=this.lineAt(e,t);return r.slice(e-s,Math.min(r.length,e+100-s))}column(e,t=1){let{text:r,from:s}=this.lineAt(e,t),i=this.countColumn(r,e-s),l=this.options.overrideIndentation?this.options.overrideIndentation(s):-1;return l>-1&&(i+=l-this.countColumn(r,r.search(/\S|$/))),i}countColumn(e,t=e.length){return Md(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:r,from:s}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let l=i(s);if(l>-1)return l}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Tx=new Et;function mX(n,e,t){let r=e.resolveStack(t),s=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(s!=r.node){let i=[];for(let l=s;l&&!(l.from<r.node.from||l.to>r.node.to||l.from==r.node.from&&l.type==r.node.type);l=l.parent)i.push(l);for(let l=i.length-1;l>=0;l--)r={node:i[l],next:r}}return oE(r,n,t)}function oE(n,e,t){for(let r=n;r;r=r.next){let s=gX(r.node);if(s)return s(Qw.create(e,t,r))}return 0}function pX(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function gX(n){let e=n.type.prop(Tx);if(e)return e;let t=n.firstChild,r;if(t&&(r=t.type.prop(Et.closedBy))){let s=n.lastChild,i=s&&r.indexOf(s.name)>-1;return l=>cE(l,!0,1,void 0,i&&!pX(l)?s.from:void 0)}return n.parent==null?xX:null}function xX(){return 0}class Qw extends Cx{constructor(e,t,r){super(e.state,e.options),this.base=e,this.pos=t,this.context=r}get node(){return this.context.node}static create(e,t,r){return new Qw(e,t,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(t.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(vX(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return oE(this.context.next,this.base,this.pos)}}function vX(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function yX(n){let e=n.node,t=e.childAfter(e.from),r=e.lastChild;if(!t)return null;let s=n.options.simulateBreak,i=n.state.doc.lineAt(t.from),l=s==null||s<=i.from?i.to:Math.min(i.to,s);for(let c=t.to;;){let u=e.childAfter(c);if(!u||u==r)return null;if(!u.type.isSkipped){if(u.from>=l)return null;let h=/^ */.exec(i.text.slice(t.to-i.from))[0].length;return{from:t.from,to:t.to+h}}c=u.to}}function Uy({closing:n,align:e=!0,units:t=1}){return r=>cE(r,e,t,n)}function cE(n,e,t,r,s){let i=n.textAfter,l=i.match(/^\s*/)[0].length,c=r&&i.slice(l,l+r.length)==r||s==n.pos+l,u=e?yX(n):null;return u?c?n.column(u.from):n.column(u.to):n.baseIndent+(c?0:n.unit*t)}function o7({except:n,units:e=1}={}){return t=>{let r=n&&n.test(t.textAfter);return t.baseIndent+(r?0:e*t.unit)}}const bX=200;function wX(){return Vt.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:r}=n.newSelection.main,s=t.lineAt(r);if(r>s.from+bX)return n;let i=t.sliceString(s.from,r);if(!e.some(h=>h.test(i)))return n;let{state:l}=n,c=-1,u=[];for(let{head:h}of l.selection.ranges){let m=l.doc.lineAt(h);if(m.from==c)continue;c=m.from;let p=qw(l,m.from);if(p==null)continue;let x=/^\s*/.exec(m.text)[0],v=Cf(l,p);x!=v&&u.push({from:m.from,to:m.from+x.length,insert:v})}return u.length?[n,{changes:u,sequential:!0}]:n})}const SX=He.define(),$w=new Et;function uE(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}function OX(n,e,t){let r=zr(n);if(r.length<t)return null;let s=r.resolveStack(t,1),i=null;for(let l=s;l;l=l.next){let c=l.node;if(c.to<=t||c.from>t)continue;if(i&&c.from<e)break;let u=c.type.prop($w);if(u&&(c.to<r.length-50||r.length==n.doc.length||!kX(c))){let h=u(c,n);h&&h.from<=t&&h.from>=e&&h.to>t&&(i=h)}}return i}function kX(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function Dg(n,e,t){for(let r of n.facet(SX)){let s=r(n,e,t);if(s)return s}return OX(n,e,t)}function dE(n,e){let t=e.mapPos(n.from,1),r=e.mapPos(n.to,-1);return t>=r?void 0:{from:t,to:r}}const Mx=xt.define({map:dE}),h0=xt.define({map:dE});function hE(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(r=>r.from<=t&&r.to>=t)||e.push(n.lineBlockAt(t));return e}const kc=Lr.define({create(){return Je.none},update(n,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((t,r)=>n=c7(n,t,r)),n=n.map(e.changes);for(let t of e.effects)if(t.is(Mx)&&!jX(n,t.value.from,t.value.to)){let{preparePlaceholder:r}=e.state.facet(pE),s=r?Je.replace({widget:new _X(r(e.state,t.value))}):u7;n=n.update({add:[s.range(t.value.from,t.value.to)]})}else t.is(h0)&&(n=n.update({filter:(r,s)=>t.value.from!=r||t.value.to!=s,filterFrom:t.value.from,filterTo:t.value.to}));return e.selection&&(n=c7(n,e.selection.main.head)),n},provide:n=>Fe.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(r,s)=>{t.push(r,s)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<n.length;){let r=n[t++],s=n[t++];if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid JSON for fold state");e.push(u7.range(r,s))}return Je.set(e,!0)}});function c7(n,e,t=e){let r=!1;return n.between(e,t,(s,i)=>{s<t&&i>e&&(r=!0)}),r?n.update({filterFrom:e,filterTo:t,filter:(s,i)=>s>=t||i<=e}):n}function Rg(n,e,t){var r;let s=null;return(r=n.field(kc,!1))===null||r===void 0||r.between(e,t,(i,l)=>{(!s||s.from>i)&&(s={from:i,to:l})}),s}function jX(n,e,t){let r=!1;return n.between(e,e,(s,i)=>{s==e&&i==t&&(r=!0)}),r}function fE(n,e){return n.field(kc,!1)?e:e.concat(xt.appendConfig.of(gE()))}const NX=n=>{for(let e of hE(n)){let t=Dg(n.state,e.from,e.to);if(t)return n.dispatch({effects:fE(n.state,[Mx.of(t),mE(n,t)])}),!0}return!1},CX=n=>{if(!n.state.field(kc,!1))return!1;let e=[];for(let t of hE(n)){let r=Rg(n.state,t.from,t.to);r&&e.push(h0.of(r),mE(n,r,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function mE(n,e,t=!0){let r=n.state.doc.lineAt(e.from).number,s=n.state.doc.lineAt(e.to).number;return Fe.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${r} ${n.state.phrase("to")} ${s}.`)}const TX=n=>{let{state:e}=n,t=[];for(let r=0;r<e.doc.length;){let s=n.lineBlockAt(r),i=Dg(e,s.from,s.to);i&&t.push(Mx.of(i)),r=(i?n.lineBlockAt(i.to):s).to+1}return t.length&&n.dispatch({effects:fE(n.state,t)}),!!t.length},MX=n=>{let e=n.state.field(kc,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(r,s)=>{t.push(h0.of({from:r,to:s}))}),n.dispatch({effects:t}),!0},AX=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:NX},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:CX},{key:"Ctrl-Alt-[",run:TX},{key:"Ctrl-Alt-]",run:MX}],EX={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},pE=He.define({combine(n){return Oa(n,EX)}});function gE(n){return[kc,zX]}function xE(n,e){let{state:t}=n,r=t.facet(pE),s=l=>{let c=n.lineBlockAt(n.posAtDOM(l.target)),u=Rg(n.state,c.from,c.to);u&&n.dispatch({effects:h0.of(u)}),l.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(n,s,e);let i=document.createElement("span");return i.textContent=r.placeholderText,i.setAttribute("aria-label",t.phrase("folded code")),i.title=t.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=s,i}const u7=Je.replace({widget:new class extends ka{toDOM(n){return xE(n,null)}}});class _X extends ka{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return xE(e,this.value)}}const DX={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Vy extends pl{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function RX(n={}){let e={...DX,...n},t=new Vy(e,!0),r=new Vy(e,!1),s=lr.fromClass(class{constructor(l){this.from=l.viewport.from,this.markers=this.buildMarkers(l)}update(l){(l.docChanged||l.viewportChanged||l.startState.facet(go)!=l.state.facet(go)||l.startState.field(kc,!1)!=l.state.field(kc,!1)||zr(l.startState)!=zr(l.state)||e.foldingChanged(l))&&(this.markers=this.buildMarkers(l.view))}buildMarkers(l){let c=new fl;for(let u of l.viewportLineBlocks){let h=Rg(l.state,u.from,u.to)?r:Dg(l.state,u.from,u.to)?t:null;h&&c.add(u.from,u.from,h)}return c.finish()}}),{domEventHandlers:i}=e;return[s,LG({class:"cm-foldGutter",markers(l){var c;return((c=l.plugin(s))===null||c===void 0?void 0:c.markers)||Gt.empty},initialSpacer(){return new Vy(e,!1)},domEventHandlers:{...i,click:(l,c,u)=>{if(i.click&&i.click(l,c,u))return!0;let h=Rg(l.state,c.from,c.to);if(h)return l.dispatch({effects:h0.of(h)}),!0;let m=Dg(l.state,c.from,c.to);return m?(l.dispatch({effects:Mx.of(m)}),!0):!1}}}),gE()]}const zX=Fe.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class f0{constructor(e,t){this.specs=e;let r;function s(c){let u=ho.newName();return(r||(r=Object.create(null)))["."+u]=c,u}const i=typeof t.all=="string"?t.all:t.all?s(t.all):void 0,l=t.scope;this.scope=l instanceof bi?c=>c.prop(lc)==l.data:l?c=>c==l:void 0,this.style=sE(e.map(c=>({tag:c.tag,class:c.class||s(Object.assign({},c,{tag:null}))})),{all:i}).style,this.module=r?new ho(r):null,this.themeType=t.themeType}static define(e,t){return new f0(e,t||{})}}const t4=He.define(),vE=He.define({combine(n){return n.length?[n[0]]:null}});function Wy(n){let e=n.facet(t4);return e.length?e:n.facet(vE)}function yE(n,e){let t=[LX],r;return n instanceof f0&&(n.module&&t.push(Fe.styleModule.of(n.module)),r=n.themeType),e?.fallback?t.push(vE.of(n)):r?t.push(t4.computeN([Fe.darkTheme],s=>s.facet(Fe.darkTheme)==(r=="dark")?[n]:[])):t.push(t4.of(n)),t}class PX{constructor(e){this.markCache=Object.create(null),this.tree=zr(e.state),this.decorations=this.buildDeco(e,Wy(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=zr(e.state),r=Wy(e.state),s=r!=Wy(e.startState),{viewport:i}=e.view,l=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!s&&t.type==this.tree.type&&l>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=l):(t!=this.tree||e.viewportChanged||s)&&(this.tree=t,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return Je.none;let r=new fl;for(let{from:s,to:i}of e.visibleRanges)lX(this.tree,t,(l,c,u)=>{r.add(l,c,this.markCache[u]||(this.markCache[u]=Je.mark({class:u})))},s,i);return r.finish()}}const LX=jo.high(lr.fromClass(PX,{decorations:n=>n.decorations})),BX=f0.define([{tag:he.meta,color:"#404740"},{tag:he.link,textDecoration:"underline"},{tag:he.heading,textDecoration:"underline",fontWeight:"bold"},{tag:he.emphasis,fontStyle:"italic"},{tag:he.strong,fontWeight:"bold"},{tag:he.strikethrough,textDecoration:"line-through"},{tag:he.keyword,color:"#708"},{tag:[he.atom,he.bool,he.url,he.contentSeparator,he.labelName],color:"#219"},{tag:[he.literal,he.inserted],color:"#164"},{tag:[he.string,he.deleted],color:"#a11"},{tag:[he.regexp,he.escape,he.special(he.string)],color:"#e40"},{tag:he.definition(he.variableName),color:"#00f"},{tag:he.local(he.variableName),color:"#30a"},{tag:[he.typeName,he.namespace],color:"#085"},{tag:he.className,color:"#167"},{tag:[he.special(he.variableName),he.macroName],color:"#256"},{tag:he.definition(he.propertyName),color:"#00c"},{tag:he.comment,color:"#940"},{tag:he.invalid,color:"#f00"}]),IX=Fe.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),bE=1e4,wE="()[]{}",SE=He.define({combine(n){return Oa(n,{afterCursor:!0,brackets:wE,maxScanDistance:bE,renderMatch:QX})}}),FX=Je.mark({class:"cm-matchingBracket"}),qX=Je.mark({class:"cm-nonmatchingBracket"});function QX(n){let e=[],t=n.matched?FX:qX;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const $X=Lr.define({create(){return Je.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],r=e.state.facet(SE);for(let s of e.state.selection.ranges){if(!s.empty)continue;let i=ha(e.state,s.head,-1,r)||s.head>0&&ha(e.state,s.head-1,1,r)||r.afterCursor&&(ha(e.state,s.head,1,r)||s.head<e.state.doc.length&&ha(e.state,s.head+1,-1,r));i&&(t=t.concat(r.renderMatch(i,e.state)))}return Je.set(t,!0)},provide:n=>Fe.decorations.from(n)}),HX=[$X,IX];function UX(n={}){return[SE.of(n),HX]}const VX=new Et;function n4(n,e,t){let r=n.prop(e<0?Et.openedBy:Et.closedBy);if(r)return r;if(n.name.length==1){let s=t.indexOf(n.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function r4(n){let e=n.type.prop(VX);return e?e(n.node):n}function ha(n,e,t,r={}){let s=r.maxScanDistance||bE,i=r.brackets||wE,l=zr(n),c=l.resolveInner(e,t);for(let u=c;u;u=u.parent){let h=n4(u.type,t,i);if(h&&u.from<u.to){let m=r4(u);if(m&&(t>0?e>=m.from&&e<m.to:e>m.from&&e<=m.to))return WX(n,e,t,u,m,h,i)}}return GX(n,e,t,l,c.type,s,i)}function WX(n,e,t,r,s,i,l){let c=r.parent,u={from:s.from,to:s.to},h=0,m=c?.cursor();if(m&&(t<0?m.childBefore(r.from):m.childAfter(r.to)))do if(t<0?m.to<=r.from:m.from>=r.to){if(h==0&&i.indexOf(m.type.name)>-1&&m.from<m.to){let p=r4(m);return{start:u,end:p?{from:p.from,to:p.to}:void 0,matched:!0}}else if(n4(m.type,t,l))h++;else if(n4(m.type,-t,l)){if(h==0){let p=r4(m);return{start:u,end:p&&p.from<p.to?{from:p.from,to:p.to}:void 0,matched:!1}}h--}}while(t<0?m.prevSibling():m.nextSibling());return{start:u,matched:!1}}function GX(n,e,t,r,s,i,l){let c=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),u=l.indexOf(c);if(u<0||u%2==0!=t>0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},m=n.doc.iterRange(e,t>0?n.doc.length:0),p=0;for(let x=0;!m.next().done&&x<=i;){let v=m.value;t<0&&(x+=v.length);let b=e+x*t;for(let O=t>0?0:v.length-1,k=t>0?v.length:-1;O!=k;O+=t){let j=l.indexOf(v[O]);if(!(j<0||r.resolveInner(b+O,1).type!=s))if(j%2==0==t>0)p++;else{if(p==1)return{start:h,end:{from:b+O,to:b+O+1},matched:j>>1==u>>1};p--}}t>0&&(x+=v.length)}return m.done?{start:h,matched:!1}:null}function d7(n,e,t,r=0,s=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let i=s;for(let l=r;l<e;l++)n.charCodeAt(l)==9?i+=t-i%t:i++;return i}class OE{constructor(e,t,r,s){this.string=e,this.tabSize=t,this.indentUnit=r,this.overrideIndent=s,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let t=this.string.charAt(this.pos),r;if(typeof e=="string"?r=t==e:r=t&&(e instanceof RegExp?e.test(t):e(t)),r)return++this.pos,t}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=d7(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:d7(this.string,null,this.tabSize)}match(e,t,r){if(typeof e=="string"){let s=l=>r?l.toLowerCase():l,i=this.string.substr(this.pos,e.length);return s(i)==s(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function XX(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||YX,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||Vw,mergeTokens:n.mergeTokens!==!1}}function YX(n){if(typeof n!="object")return n;let e={};for(let t in n){let r=n[t];e[t]=r instanceof Array?r.slice():r}return e}const h7=new WeakMap;class Hw extends bi{constructor(e){let t=iE(e.languageData),r=XX(e),s,i=new class extends Iw{createParse(l,c,u){return new ZX(s,l,c,u)}};super(t,i,[],e.name),this.topNode=tY(t,this),s=this,this.streamParser=r,this.stateAfter=new Et({perNode:!0}),this.tokenTable=e.tokenTable?new CE(r.tokenTable):eY}static define(e){return new Hw(e)}getIndent(e){let t,{overrideIndentation:r}=e.options;r&&(t=h7.get(e.state),t!=null&&t<e.pos-1e4&&(t=void 0));let s=Uw(this,e.node.tree,e.node.from,e.node.from,t??e.pos),i,l;if(s?(l=s.state,i=s.pos+1):(l=this.streamParser.startState(e.unit),i=e.node.from),e.pos-i>1e4)return null;for(;i<e.pos;){let u=e.state.doc.lineAt(i),h=Math.min(e.pos,u.to);if(u.length){let m=r?r(u.from):-1,p=new OE(u.text,e.state.tabSize,e.unit,m<0?void 0:m);for(;p.pos<h-u.from;)jE(this.streamParser.token,p,l)}else this.streamParser.blankLine(l,e.unit);if(h==e.pos)break;i=u.to+1}let c=e.lineAt(e.pos);return r&&t==null&&h7.set(e.state,c.from),this.streamParser.indent(l,/^\s*(.*)/.exec(c.text)[1],e)}get allowsNesting(){return!1}}function Uw(n,e,t,r,s){let i=t>=r&&t+e.length<=s&&e.prop(n.stateAfter);if(i)return{state:n.streamParser.copyState(i),pos:t+e.length};for(let l=e.children.length-1;l>=0;l--){let c=e.children[l],u=t+e.positions[l],h=c instanceof _n&&u<s&&Uw(n,c,u,r,s);if(h)return h}return null}function kE(n,e,t,r,s){if(s&&t<=0&&r>=e.length)return e;!s&&t==0&&e.type==n.topNode&&(s=!0);for(let i=e.children.length-1;i>=0;i--){let l=e.positions[i],c=e.children[i],u;if(l<r&&c instanceof _n){if(!(u=kE(n,c,t-l,r-l,s)))break;return s?new _n(e.type,e.children.slice(0,i).concat(u),e.positions.slice(0,i+1),l+u.length):u}}return null}function KX(n,e,t,r,s){for(let i of e){let l=i.from+(i.openStart?25:0),c=i.to-(i.openEnd?25:0),u=l<=t&&c>t&&Uw(n,i.tree,0-i.offset,t,c),h;if(u&&u.pos<=r&&(h=kE(n,i.tree,t+i.offset,u.pos+i.offset,!1)))return{state:u.state,tree:h}}return{state:n.streamParser.startState(s?Oc(s):4),tree:_n.empty}}let ZX=class{constructor(e,t,r,s){this.lang=e,this.input=t,this.fragments=r,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let i=pd.get(),l=s[0].from,{state:c,tree:u}=KX(e,r,l,this.to,i?.state);this.state=c,this.parsedPos=this.chunkStart=l+u.length;for(let h=0;h<u.children.length;h++)this.chunks.push(u.children[h]),this.chunkPos.push(u.positions[h]);i&&this.parsedPos<i.viewport.from-1e5&&s.some(h=>h.from<=i.viewport.from&&h.to>=i.viewport.from)&&(this.state=this.lang.streamParser.startState(Oc(i.state)),i.skipUntilInView(this.parsedPos,i.viewport.from),this.parsedPos=i.viewport.from),this.moveRangeIndex()}advance(){let e=pd.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),r=Math.min(t,this.chunkStart+512);for(e&&(r=Math.min(r,e.viewport.to));this.parsedPos<r;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==`
|
||
`&&(t="");else{let r=t.indexOf(`
|
||
`);r>-1&&(t=t.slice(0,r))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),r=e+t.length;for(let s=this.rangeIndex;;){let i=this.ranges[s].to;if(i>=r||(t=t.slice(0,i-(r-t.length)),s++,s==this.ranges.length))break;let l=this.ranges[s].from,c=this.lineAfter(l);t+=c,r=l+c.length}return{line:t,end:r}}skipGapsTo(e,t,r){for(;;){let s=this.ranges[this.rangeIndex].to,i=e+t;if(r>0?s>i:s>=i)break;let l=this.ranges[++this.rangeIndex].from;t+=l-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,r,s){let i=4;if(this.ranges.length>1){s=this.skipGapsTo(t,s,1),t+=s;let c=this.chunk.length;s=this.skipGapsTo(r,s,-1),r+=s,i+=this.chunk.length-c}let l=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&i==4&&l>=0&&this.chunk[l]==e&&this.chunk[l+2]==t?this.chunk[l+2]=r:this.chunk.push(e,t,r,i),s}parseLine(e){let{line:t,end:r}=this.nextLine(),s=0,{streamParser:i}=this.lang,l=new OE(t,e?e.state.tabSize:4,e?Oc(e.state):2);if(l.eol())i.blankLine(this.state,l.indentUnit);else for(;!l.eol();){let c=jE(i.token,l,this.state);if(c&&(s=this.emitToken(this.lang.tokenTable.resolve(c),this.parsedPos+l.start,this.parsedPos+l.pos,s)),l.start>1e4)break}this.parsedPos=r,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=_n.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:JX,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new _n(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new _n(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}};function jE(n,e,t){e.start=e.pos;for(let r=0;r<10;r++){let s=n(e,t);if(e.pos>e.start)return s}throw new Error("Stream parser failed to advance stream.")}const Vw=Object.create(null),Tf=[gs.none],JX=new Nx(Tf),f7=[],m7=Object.create(null),NE=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])NE[n]=TE(Vw,e);class CE{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),NE)}resolve(e){return e?this.table[e]||(this.table[e]=TE(this.extra,e)):0}}const eY=new CE(Vw);function Gy(n,e){f7.indexOf(n)>-1||(f7.push(n),console.warn(e))}function TE(n,e){let t=[];for(let c of e.split(" ")){let u=[];for(let h of c.split(".")){let m=n[h]||he[h];m?typeof m=="function"?u.length?u=u.map(m):Gy(h,`Modifier ${h} used at start of tag`):u.length?Gy(h,`Tag ${h} used as modifier`):u=Array.isArray(m)?m:[m]:Gy(h,`Unknown highlighting tag ${h}`)}for(let h of u)t.push(h)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),s=r+" "+t.map(c=>c.id),i=m7[s];if(i)return i.id;let l=m7[s]=gs.define({id:Tf.length,name:r,props:[Fw({[r]:t})]});return Tf.push(l),l.id}function tY(n,e){let t=gs.define({id:Tf.length,name:"Document",props:[lc.add(()=>n),Tx.add(()=>r=>e.getIndent(r))],top:!0});return Tf.push(t),t}Hn.RTL,Hn.LTR;const nY=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),r=Gw(n.state,t.from);return r.line?rY(n):r.block?iY(n):!1};function Ww(n,e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(r(t.update(s)),!0):!1}}const rY=Ww(oY,0),sY=Ww(ME,0),iY=Ww((n,e)=>ME(n,e,lY(e)),0);function Gw(n,e){let t=n.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const Lh=50;function aY(n,{open:e,close:t},r,s){let i=n.sliceDoc(r-Lh,r),l=n.sliceDoc(s,s+Lh),c=/\s*$/.exec(i)[0].length,u=/^\s*/.exec(l)[0].length,h=i.length-c;if(i.slice(h-e.length,h)==e&&l.slice(u,u+t.length)==t)return{open:{pos:r-c,margin:c&&1},close:{pos:s+u,margin:u&&1}};let m,p;s-r<=2*Lh?m=p=n.sliceDoc(r,s):(m=n.sliceDoc(r,r+Lh),p=n.sliceDoc(s-Lh,s));let x=/^\s*/.exec(m)[0].length,v=/\s*$/.exec(p)[0].length,b=p.length-v-t.length;return m.slice(x,x+e.length)==e&&p.slice(b,b+t.length)==t?{open:{pos:r+x+e.length,margin:/\s/.test(m.charAt(x+e.length))?1:0},close:{pos:s-v-t.length,margin:/\s/.test(p.charAt(b-1))?1:0}}:null}function lY(n){let e=[];for(let t of n.selection.ranges){let r=n.doc.lineAt(t.from),s=t.to<=r.to?r:n.doc.lineAt(t.to);s.from>r.from&&s.from==t.to&&(s=t.to==r.to+1?r:n.doc.lineAt(t.to-1));let i=e.length-1;i>=0&&e[i].to>r.from?e[i].to=s.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:s.to})}return e}function ME(n,e,t=e.selection.ranges){let r=t.map(i=>Gw(e,i.from).block);if(!r.every(i=>i))return null;let s=t.map((i,l)=>aY(e,r[l],i.from,i.to));if(n!=2&&!s.every(i=>i))return{changes:e.changes(t.map((i,l)=>s[l]?[]:[{from:i.from,insert:r[l].open+" "},{from:i.to,insert:" "+r[l].close}]))};if(n!=1&&s.some(i=>i)){let i=[];for(let l=0,c;l<s.length;l++)if(c=s[l]){let u=r[l],{open:h,close:m}=c;i.push({from:h.pos-u.open.length,to:h.pos+h.margin},{from:m.pos-m.margin,to:m.pos+u.close.length})}return{changes:i}}return null}function oY(n,e,t=e.selection.ranges){let r=[],s=-1;for(let{from:i,to:l}of t){let c=r.length,u=1e9,h=Gw(e,i).line;if(h){for(let m=i;m<=l;){let p=e.doc.lineAt(m);if(p.from>s&&(i==l||l>p.from)){s=p.from;let x=/^\s*/.exec(p.text)[0].length,v=x==p.length,b=p.text.slice(x,x+h.length)==h?x:-1;x<p.text.length&&x<u&&(u=x),r.push({line:p,comment:b,token:h,indent:x,empty:v,single:!1})}m=p.to+1}if(u<1e9)for(let m=c;m<r.length;m++)r[m].indent<r[m].line.text.length&&(r[m].indent=u);r.length==c+1&&(r[c].single=!0)}}if(n!=2&&r.some(i=>i.comment<0&&(!i.empty||i.single))){let i=[];for(let{line:c,token:u,indent:h,empty:m,single:p}of r)(p||!m)&&i.push({from:c.from+h,insert:u+" "});let l=e.changes(i);return{changes:l,selection:e.selection.map(l,1)}}else if(n!=1&&r.some(i=>i.comment>=0)){let i=[];for(let{line:l,comment:c,token:u}of r)if(c>=0){let h=l.from+c,m=h+u.length;l.text[m-l.from]==" "&&m++,i.push({from:h,to:m})}return{changes:i}}return null}const s4=Sa.define(),cY=Sa.define(),uY=He.define(),AE=He.define({combine(n){return Oa(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(r,s)=>e(r,s)||t(r,s)})}}),EE=Lr.define({create(){return fa.empty},update(n,e){let t=e.state.facet(AE),r=e.annotation(s4);if(r){let u=_s.fromTransaction(e,r.selection),h=r.side,m=h==0?n.undone:n.done;return u?m=zg(m,m.length,t.minDepth,u):m=RE(m,e.startState.selection),new fa(h==0?r.rest:m,h==0?m:r.rest)}let s=e.annotation(cY);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation(gr.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let i=_s.fromTransaction(e),l=e.annotation(gr.time),c=e.annotation(gr.userEvent);return i?n=n.addChanges(i,l,c,t,e):e.selection&&(n=n.addSelection(e.startState.selection,l,c,t.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new fa(n.done.map(_s.fromJSON),n.undone.map(_s.fromJSON))}});function dY(n={}){return[EE,AE.of(n),Fe.domEventHandlers({beforeinput(e,t){let r=e.inputType=="historyUndo"?_E:e.inputType=="historyRedo"?i4:null;return r?(e.preventDefault(),r(t)):!1}})]}function Ax(n,e){return function({state:t,dispatch:r}){if(!e&&t.readOnly)return!1;let s=t.field(EE,!1);if(!s)return!1;let i=s.pop(n,t,e);return i?(r(i),!0):!1}}const _E=Ax(0,!1),i4=Ax(1,!1),hY=Ax(0,!0),fY=Ax(1,!0);class _s{constructor(e,t,r,s,i){this.changes=e,this.effects=t,this.mapped=r,this.startSelection=s,this.selectionsAfter=i}setSelAfter(e){return new _s(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new _s(e.changes&&Or.fromJSON(e.changes),[],e.mapped&&xa.fromJSON(e.mapped),e.startSelection&&Ce.fromJSON(e.startSelection),e.selectionsAfter.map(Ce.fromJSON))}static fromTransaction(e,t){let r=wi;for(let s of e.startState.facet(uY)){let i=s(e);i.length&&(r=r.concat(i))}return!r.length&&e.changes.empty?null:new _s(e.changes.invert(e.startState.doc),r,void 0,t||e.startState.selection,wi)}static selection(e){return new _s(void 0,wi,void 0,void 0,e)}}function zg(n,e,t,r){let s=e+1>t+20?e-t-1:0,i=n.slice(s,e);return i.push(r),i}function mY(n,e){let t=[],r=!1;return n.iterChangedRanges((s,i)=>t.push(s,i)),e.iterChangedRanges((s,i,l,c)=>{for(let u=0;u<t.length;){let h=t[u++],m=t[u++];c>=h&&l<=m&&(r=!0)}}),r}function pY(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,r)=>t.empty!=e.ranges[r].empty).length===0}function DE(n,e){return n.length?e.length?n.concat(e):n:e}const wi=[],gY=200;function RE(n,e){if(n.length){let t=n[n.length-1],r=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-gY));return r.length&&r[r.length-1].eq(e)?n:(r.push(e),zg(n,n.length-1,1e9,t.setSelAfter(r)))}else return[_s.selection([e])]}function xY(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Xy(n,e){if(!n.length)return n;let t=n.length,r=wi;for(;t;){let s=vY(n[t-1],e,r);if(s.changes&&!s.changes.empty||s.effects.length){let i=n.slice(0,t);return i[t-1]=s,i}else e=s.mapped,t--,r=s.selectionsAfter}return r.length?[_s.selection(r)]:wi}function vY(n,e,t){let r=DE(n.selectionsAfter.length?n.selectionsAfter.map(c=>c.map(e)):wi,t);if(!n.changes)return _s.selection(r);let s=n.changes.map(e),i=e.mapDesc(n.changes,!0),l=n.mapped?n.mapped.composeDesc(i):i;return new _s(s,xt.mapEffects(n.effects,e),l,n.startSelection.map(i),r)}const yY=/^(input\.type|delete)($|\.)/;class fa{constructor(e,t,r=0,s=void 0){this.done=e,this.undone=t,this.prevTime=r,this.prevUserEvent=s}isolate(){return this.prevTime?new fa(this.done,this.undone):this}addChanges(e,t,r,s,i){let l=this.done,c=l[l.length-1];return c&&c.changes&&!c.changes.empty&&e.changes&&(!r||yY.test(r))&&(!c.selectionsAfter.length&&t-this.prevTime<s.newGroupDelay&&s.joinToEvent(i,mY(c.changes,e.changes))||r=="input.type.compose")?l=zg(l,l.length-1,s.minDepth,new _s(e.changes.compose(c.changes),DE(xt.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,wi)):l=zg(l,l.length,s.minDepth,e),new fa(l,wi,t,r)}addSelection(e,t,r,s){let i=this.done.length?this.done[this.done.length-1].selectionsAfter:wi;return i.length>0&&t-this.prevTime<s&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&pY(i[i.length-1],e)?this:new fa(RE(this.done,e),this.undone,t,r)}addMapping(e){return new fa(Xy(this.done,e),Xy(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,r){let s=e==0?this.done:this.undone;if(s.length==0)return null;let i=s[s.length-1],l=i.selectionsAfter[0]||t.selection;if(r&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:s4.of({side:e,rest:xY(s),selection:l}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(i.changes){let c=s.length==1?wi:s.slice(0,s.length-1);return i.mapped&&(c=Xy(c,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:s4.of({side:e,rest:c,selection:l}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}fa.empty=new fa(wi,wi);const bY=[{key:"Mod-z",run:_E,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:i4,preventDefault:!0},{linux:"Ctrl-Shift-z",run:i4,preventDefault:!0},{key:"Mod-u",run:hY,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:fY,preventDefault:!0}];function Ad(n,e){return Ce.create(n.ranges.map(e),n.mainIndex)}function Vi(n,e){return n.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Wi({state:n,dispatch:e},t){let r=Ad(n.selection,t);return r.eq(n.selection,!0)?!1:(e(Vi(n,r)),!0)}function Ex(n,e){return Ce.cursor(e?n.to:n.from)}function zE(n,e){return Wi(n,t=>t.empty?n.moveByChar(t,e):Ex(t,e))}function is(n){return n.textDirectionAt(n.state.selection.main.head)==Hn.LTR}const PE=n=>zE(n,!is(n)),LE=n=>zE(n,is(n));function BE(n,e){return Wi(n,t=>t.empty?n.moveByGroup(t,e):Ex(t,e))}const wY=n=>BE(n,!is(n)),SY=n=>BE(n,is(n));function OY(n,e,t){if(e.type.prop(t))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function _x(n,e,t){let r=zr(n).resolveInner(e.head),s=t?Et.closedBy:Et.openedBy;for(let u=e.head;;){let h=t?r.childAfter(u):r.childBefore(u);if(!h)break;OY(n,h,s)?r=h:u=t?h.to:h.from}let i=r.type.prop(s),l,c;return i&&(l=t?ha(n,r.from,1):ha(n,r.to,-1))&&l.matched?c=t?l.end.to:l.end.from:c=t?r.to:r.from,Ce.cursor(c,t?-1:1)}const kY=n=>Wi(n,e=>_x(n.state,e,!is(n))),jY=n=>Wi(n,e=>_x(n.state,e,is(n)));function IE(n,e){return Wi(n,t=>{if(!t.empty)return Ex(t,e);let r=n.moveVertically(t,e);return r.head!=t.head?r:n.moveToLineBoundary(t,e)})}const FE=n=>IE(n,!1),qE=n=>IE(n,!0);function QE(n){let e=n.scrollDOM.clientHeight<n.scrollDOM.scrollHeight-2,t=0,r=0,s;if(e){for(let i of n.state.facet(Fe.scrollMargins)){let l=i(n);l?.top&&(t=Math.max(l?.top,t)),l?.bottom&&(r=Math.max(l?.bottom,r))}s=n.scrollDOM.clientHeight-t-r}else s=(n.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:r,selfScroll:e,height:Math.max(n.defaultLineHeight,s-5)}}function $E(n,e){let t=QE(n),{state:r}=n,s=Ad(r.selection,l=>l.empty?n.moveVertically(l,e,t.height):Ex(l,e));if(s.eq(r.selection))return!1;let i;if(t.selfScroll){let l=n.coordsAtPos(r.selection.main.head),c=n.scrollDOM.getBoundingClientRect(),u=c.top+t.marginTop,h=c.bottom-t.marginBottom;l&&l.top>u&&l.bottom<h&&(i=Fe.scrollIntoView(s.main.head,{y:"start",yMargin:l.top-u}))}return n.dispatch(Vi(r,s),{effects:i}),!0}const p7=n=>$E(n,!1),a4=n=>$E(n,!0);function No(n,e,t){let r=n.lineBlockAt(e.head),s=n.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?r.to:r.from)&&(s=n.moveToLineBoundary(e,t,!1)),!t&&s.head==r.from&&r.length){let i=/^\s*/.exec(n.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;i&&e.head!=r.from+i&&(s=Ce.cursor(r.from+i))}return s}const NY=n=>Wi(n,e=>No(n,e,!0)),CY=n=>Wi(n,e=>No(n,e,!1)),TY=n=>Wi(n,e=>No(n,e,!is(n))),MY=n=>Wi(n,e=>No(n,e,is(n))),AY=n=>Wi(n,e=>Ce.cursor(n.lineBlockAt(e.head).from,1)),EY=n=>Wi(n,e=>Ce.cursor(n.lineBlockAt(e.head).to,-1));function _Y(n,e,t){let r=!1,s=Ad(n.selection,i=>{let l=ha(n,i.head,-1)||ha(n,i.head,1)||i.head>0&&ha(n,i.head-1,1)||i.head<n.doc.length&&ha(n,i.head+1,-1);if(!l||!l.end)return i;r=!0;let c=l.start.from==i.head?l.end.to:l.end.from;return Ce.cursor(c)});return r?(e(Vi(n,s)),!0):!1}const DY=({state:n,dispatch:e})=>_Y(n,e);function Ei(n,e){let t=Ad(n.state.selection,r=>{let s=e(r);return Ce.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(Vi(n.state,t)),!0)}function HE(n,e){return Ei(n,t=>n.moveByChar(t,e))}const UE=n=>HE(n,!is(n)),VE=n=>HE(n,is(n));function WE(n,e){return Ei(n,t=>n.moveByGroup(t,e))}const RY=n=>WE(n,!is(n)),zY=n=>WE(n,is(n)),PY=n=>Ei(n,e=>_x(n.state,e,!is(n))),LY=n=>Ei(n,e=>_x(n.state,e,is(n)));function GE(n,e){return Ei(n,t=>n.moveVertically(t,e))}const XE=n=>GE(n,!1),YE=n=>GE(n,!0);function KE(n,e){return Ei(n,t=>n.moveVertically(t,e,QE(n).height))}const g7=n=>KE(n,!1),x7=n=>KE(n,!0),BY=n=>Ei(n,e=>No(n,e,!0)),IY=n=>Ei(n,e=>No(n,e,!1)),FY=n=>Ei(n,e=>No(n,e,!is(n))),qY=n=>Ei(n,e=>No(n,e,is(n))),QY=n=>Ei(n,e=>Ce.cursor(n.lineBlockAt(e.head).from)),$Y=n=>Ei(n,e=>Ce.cursor(n.lineBlockAt(e.head).to)),v7=({state:n,dispatch:e})=>(e(Vi(n,{anchor:0})),!0),y7=({state:n,dispatch:e})=>(e(Vi(n,{anchor:n.doc.length})),!0),b7=({state:n,dispatch:e})=>(e(Vi(n,{anchor:n.selection.main.anchor,head:0})),!0),w7=({state:n,dispatch:e})=>(e(Vi(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),HY=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),UY=({state:n,dispatch:e})=>{let t=Dx(n).map(({from:r,to:s})=>Ce.range(r,Math.min(s+1,n.doc.length)));return e(n.update({selection:Ce.create(t),userEvent:"select"})),!0},VY=({state:n,dispatch:e})=>{let t=Ad(n.selection,r=>{let s=zr(n),i=s.resolveStack(r.from,1);if(r.empty){let l=s.resolveStack(r.from,-1);l.node.from>=i.node.from&&l.node.to<=i.node.to&&(i=l)}for(let l=i;l;l=l.next){let{node:c}=l;if((c.from<r.from&&c.to>=r.to||c.to>r.to&&c.from<=r.from)&&l.next)return Ce.range(c.to,c.from)}return r});return t.eq(n.selection)?!1:(e(Vi(n,t)),!0)};function ZE(n,e){let{state:t}=n,r=t.selection,s=t.selection.ranges.slice();for(let i of t.selection.ranges){let l=t.doc.lineAt(i.head);if(e?l.to<n.state.doc.length:l.from>0)for(let c=i;;){let u=n.moveVertically(c,e);if(u.head<l.from||u.head>l.to){s.some(h=>h.head==u.head)||s.push(u);break}else{if(u.head==c.head)break;c=u}}}return s.length==r.ranges.length?!1:(n.dispatch(Vi(t,Ce.create(s,s.length-1))),!0)}const WY=n=>ZE(n,!1),GY=n=>ZE(n,!0),XY=({state:n,dispatch:e})=>{let t=n.selection,r=null;return t.ranges.length>1?r=Ce.create([t.main]):t.main.empty||(r=Ce.create([Ce.cursor(t.main.head)])),r?(e(Vi(n,r)),!0):!1};function m0(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:r}=n,s=r.changeByRange(i=>{let{from:l,to:c}=i;if(l==c){let u=e(i);u<l?(t="delete.backward",u=vp(n,u,!1)):u>l&&(t="delete.forward",u=vp(n,u,!0)),l=Math.min(l,u),c=Math.max(c,u)}else l=vp(n,l,!1),c=vp(n,c,!0);return l==c?{range:i}:{changes:{from:l,to:c},range:Ce.cursor(l,l<i.head?-1:1)}});return s.changes.empty?!1:(n.dispatch(r.update(s,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?Fe.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function vp(n,e,t){if(n instanceof Fe)for(let r of n.state.facet(Fe.atomicRanges).map(s=>s(n)))r.between(e,e,(s,i)=>{s<e&&i>e&&(e=t?i:s)});return e}const JE=(n,e,t)=>m0(n,r=>{let s=r.from,{state:i}=n,l=i.doc.lineAt(s),c,u;if(t&&!e&&s>l.from&&s<l.from+200&&!/[^ \t]/.test(c=l.text.slice(0,s-l.from))){if(c[c.length-1]==" ")return s-1;let h=Md(c,i.tabSize),m=h%Oc(i)||Oc(i);for(let p=0;p<m&&c[c.length-1-p]==" ";p++)s--;u=s}else u=Vr(l.text,s-l.from,e,e)+l.from,u==s&&l.number!=(e?i.doc.lines:1)?u+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(l.text.slice(u-l.from,s-l.from))&&(u=Vr(l.text,u-l.from,!1,!1)+l.from);return u}),l4=n=>JE(n,!1,!0),e_=n=>JE(n,!0,!1),t_=(n,e)=>m0(n,t=>{let r=t.head,{state:s}=n,i=s.doc.lineAt(r),l=s.charCategorizer(r);for(let c=null;;){if(r==(e?i.to:i.from)){r==t.head&&i.number!=(e?s.doc.lines:1)&&(r+=e?1:-1);break}let u=Vr(i.text,r-i.from,e)+i.from,h=i.text.slice(Math.min(r,u)-i.from,Math.max(r,u)-i.from),m=l(h);if(c!=null&&m!=c)break;(h!=" "||r!=t.head)&&(c=m),r=u}return r}),n_=n=>t_(n,!1),YY=n=>t_(n,!0),KY=n=>m0(n,e=>{let t=n.lineBlockAt(e.head).to;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),ZY=n=>m0(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),JY=n=>m0(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),eK=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Wt.of(["",""])},range:Ce.cursor(r.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},tK=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(r=>{if(!r.empty||r.from==0||r.from==n.doc.length)return{range:r};let s=r.from,i=n.doc.lineAt(s),l=s==i.from?s-1:Vr(i.text,s-i.from,!1)+i.from,c=s==i.to?s+1:Vr(i.text,s-i.from,!0)+i.from;return{changes:{from:l,to:c,insert:n.doc.slice(s,c).append(n.doc.slice(l,s))},range:Ce.cursor(c)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Dx(n){let e=[],t=-1;for(let r of n.selection.ranges){let s=n.doc.lineAt(r.from),i=n.doc.lineAt(r.to);if(!r.empty&&r.to==i.from&&(i=n.doc.lineAt(r.to-1)),t>=s.number){let l=e[e.length-1];l.to=i.to,l.ranges.push(r)}else e.push({from:s.from,to:i.to,ranges:[r]});t=i.number+1}return e}function r_(n,e,t){if(n.readOnly)return!1;let r=[],s=[];for(let i of Dx(n)){if(t?i.to==n.doc.length:i.from==0)continue;let l=n.doc.lineAt(t?i.to+1:i.from-1),c=l.length+1;if(t){r.push({from:i.to,to:l.to},{from:i.from,insert:l.text+n.lineBreak});for(let u of i.ranges)s.push(Ce.range(Math.min(n.doc.length,u.anchor+c),Math.min(n.doc.length,u.head+c)))}else{r.push({from:l.from,to:i.from},{from:i.to,insert:n.lineBreak+l.text});for(let u of i.ranges)s.push(Ce.range(u.anchor-c,u.head-c))}}return r.length?(e(n.update({changes:r,scrollIntoView:!0,selection:Ce.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const nK=({state:n,dispatch:e})=>r_(n,e,!1),rK=({state:n,dispatch:e})=>r_(n,e,!0);function s_(n,e,t){if(n.readOnly)return!1;let r=[];for(let s of Dx(n))t?r.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):r.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});return e(n.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const sK=({state:n,dispatch:e})=>s_(n,e,!1),iK=({state:n,dispatch:e})=>s_(n,e,!0),aK=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(Dx(e).map(({from:s,to:i})=>(s>0?s--:i<e.doc.length&&i++,{from:s,to:i}))),r=Ad(e.selection,s=>{let i;if(n.lineWrapping){let l=n.lineBlockAt(s.head),c=n.coordsAtPos(s.head,s.assoc||1);c&&(i=l.bottom+n.documentTop-c.bottom+n.defaultLineHeight/2)}return n.moveVertically(s,!0,i)}).map(t);return n.dispatch({changes:t,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function lK(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=zr(n).resolveInner(e),r=t.childBefore(e),s=t.childAfter(e),i;return r&&s&&r.to<=e&&s.from>=e&&(i=r.type.prop(Et.closedBy))&&i.indexOf(s.name)>-1&&n.doc.lineAt(r.to).from==n.doc.lineAt(s.from).from&&!/\S/.test(n.sliceDoc(r.to,s.from))?{from:r.to,to:s.from}:null}const S7=i_(!1),oK=i_(!0);function i_(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(s=>{let{from:i,to:l}=s,c=e.doc.lineAt(i),u=!n&&i==l&&lK(e,i);n&&(i=l=(l<=c.to?c:e.doc.lineAt(l)).to);let h=new Cx(e,{simulateBreak:i,simulateDoubleBreak:!!u}),m=qw(h,i);for(m==null&&(m=Md(/^\s*/.exec(e.doc.lineAt(i).text)[0],e.tabSize));l<c.to&&/\s/.test(c.text[l-c.from]);)l++;u?{from:i,to:l}=u:i>c.from&&i<c.from+100&&!/\S/.test(c.text.slice(0,i))&&(i=c.from);let p=["",Cf(e,m)];return u&&p.push(Cf(e,h.lineIndent(c.from,-1))),{changes:{from:i,to:l,insert:Wt.of(p)},range:Ce.cursor(i+1+p[1].length)}});return t(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Xw(n,e){let t=-1;return n.changeByRange(r=>{let s=[];for(let l=r.from;l<=r.to;){let c=n.doc.lineAt(l);c.number>t&&(r.empty||r.to>c.from)&&(e(c,s,r),t=c.number),l=c.to+1}let i=n.changes(s);return{changes:s,range:Ce.range(i.mapPos(r.anchor,1),i.mapPos(r.head,1))}})}const cK=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),r=new Cx(n,{overrideIndentation:i=>{let l=t[i];return l??-1}}),s=Xw(n,(i,l,c)=>{let u=qw(r,i.from);if(u==null)return;/\S/.test(i.text)||(u=0);let h=/^\s*/.exec(i.text)[0],m=Cf(n,u);(h!=m||c.from<i.from+h.length)&&(t[i.from]=u,l.push({from:i.from,to:i.from+h.length,insert:m}))});return s.changes.empty||e(n.update(s,{userEvent:"indent"})),!0},a_=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Xw(n,(t,r)=>{r.push({from:t.from,insert:n.facet(d0)})}),{userEvent:"input.indent"})),!0),l_=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Xw(n,(t,r)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let i=Md(s,n.tabSize),l=0,c=Cf(n,Math.max(0,i-Oc(n)));for(;l<s.length&&l<c.length&&s.charCodeAt(l)==c.charCodeAt(l);)l++;r.push({from:t.from+l,to:t.from+s.length,insert:c.slice(l)})}),{userEvent:"delete.dedent"})),!0),uK=n=>(n.setTabFocusMode(),!0),dK=[{key:"Ctrl-b",run:PE,shift:UE,preventDefault:!0},{key:"Ctrl-f",run:LE,shift:VE},{key:"Ctrl-p",run:FE,shift:XE},{key:"Ctrl-n",run:qE,shift:YE},{key:"Ctrl-a",run:AY,shift:QY},{key:"Ctrl-e",run:EY,shift:$Y},{key:"Ctrl-d",run:e_},{key:"Ctrl-h",run:l4},{key:"Ctrl-k",run:KY},{key:"Ctrl-Alt-h",run:n_},{key:"Ctrl-o",run:eK},{key:"Ctrl-t",run:tK},{key:"Ctrl-v",run:a4}],hK=[{key:"ArrowLeft",run:PE,shift:UE,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:wY,shift:RY,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:TY,shift:FY,preventDefault:!0},{key:"ArrowRight",run:LE,shift:VE,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:SY,shift:zY,preventDefault:!0},{mac:"Cmd-ArrowRight",run:MY,shift:qY,preventDefault:!0},{key:"ArrowUp",run:FE,shift:XE,preventDefault:!0},{mac:"Cmd-ArrowUp",run:v7,shift:b7},{mac:"Ctrl-ArrowUp",run:p7,shift:g7},{key:"ArrowDown",run:qE,shift:YE,preventDefault:!0},{mac:"Cmd-ArrowDown",run:y7,shift:w7},{mac:"Ctrl-ArrowDown",run:a4,shift:x7},{key:"PageUp",run:p7,shift:g7},{key:"PageDown",run:a4,shift:x7},{key:"Home",run:CY,shift:IY,preventDefault:!0},{key:"Mod-Home",run:v7,shift:b7},{key:"End",run:NY,shift:BY,preventDefault:!0},{key:"Mod-End",run:y7,shift:w7},{key:"Enter",run:S7,shift:S7},{key:"Mod-a",run:HY},{key:"Backspace",run:l4,shift:l4,preventDefault:!0},{key:"Delete",run:e_,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:n_,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:YY,preventDefault:!0},{mac:"Mod-Backspace",run:ZY,preventDefault:!0},{mac:"Mod-Delete",run:JY,preventDefault:!0}].concat(dK.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),fK=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:kY,shift:PY},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:jY,shift:LY},{key:"Alt-ArrowUp",run:nK},{key:"Shift-Alt-ArrowUp",run:sK},{key:"Alt-ArrowDown",run:rK},{key:"Shift-Alt-ArrowDown",run:iK},{key:"Mod-Alt-ArrowUp",run:WY},{key:"Mod-Alt-ArrowDown",run:GY},{key:"Escape",run:XY},{key:"Mod-Enter",run:oK},{key:"Alt-l",mac:"Ctrl-l",run:UY},{key:"Mod-i",run:VY,preventDefault:!0},{key:"Mod-[",run:l_},{key:"Mod-]",run:a_},{key:"Mod-Alt-\\",run:cK},{key:"Shift-Mod-k",run:aK},{key:"Shift-Mod-\\",run:DY},{key:"Mod-/",run:nY},{key:"Alt-A",run:sY},{key:"Ctrl-m",mac:"Shift-Alt-m",run:uK}].concat(hK),mK={key:"Tab",run:a_,shift:l_},O7=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class xd{constructor(e,t,r=0,s=e.length,i,l){this.test=l,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,s),this.bufferStart=r,this.normalize=i?c=>i(O7(c)):O7,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ms(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=ww(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=aa(e);let s=this.normalize(t);if(s.length)for(let i=0,l=r;;i++){let c=s.charCodeAt(i),u=this.match(c,l,this.bufferPos+this.bufferStart);if(i==s.length-1){if(u)return this.value=u,this;break}l==r&&i<t.length&&t.charCodeAt(i)==c&&l++}}}match(e,t,r){let s=null;for(let i=0;i<this.matches.length;i+=2){let l=this.matches[i],c=!1;this.query.charCodeAt(l)==e&&(l==this.query.length-1?s={from:this.matches[i+1],to:r}:(this.matches[i]++,c=!0)),c||(this.matches.splice(i,2),i-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?s={from:t,to:r}:this.matches.push(1,t)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(xd.prototype[Symbol.iterator]=function(){return this});const o_={from:-1,to:-1,match:/.*/.exec("")},Yw="gm"+(/x/.unicode==null?"":"u");class c_{constructor(e,t,r,s=0,i=e.length){if(this.text=e,this.to=i,this.curLine="",this.done=!1,this.value=o_,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new u_(e,t,r,s,i);this.re=new RegExp(t,Yw+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=e.iter();let l=e.lineAt(s);this.curLineStart=l.from,this.matchPos=Pg(e,s),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let r=this.curLineStart+t.index,s=r+t[0].length;if(this.matchPos=Pg(this.text,s+(r==s?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<s||r>this.value.to)&&(!this.test||this.test(r,s,t)))return this.value={from:r,to:s,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const Yy=new WeakMap;class Ku{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,r){let s=Yy.get(e);if(!s||s.from>=r||s.to<=t){let c=new Ku(t,e.sliceString(t,r));return Yy.set(e,c),c}if(s.from==t&&s.to==r)return s;let{text:i,from:l}=s;return l>t&&(i=e.sliceString(t,l)+i,l=t),s.to<r&&(i+=e.sliceString(s.to,r)),Yy.set(e,new Ku(l,i)),new Ku(t,i.slice(t-l,r-l))}}class u_{constructor(e,t,r,s,i){this.text=e,this.to=i,this.done=!1,this.value=o_,this.matchPos=Pg(e,s),this.re=new RegExp(t,Yw+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=Ku.get(e,s,this.chunkEnd(s+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let r=this.flat.from+t.index,s=r+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,s,t)))return this.value={from:r,to:s,match:t},this.matchPos=Pg(this.text,s+(r==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ku.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(c_.prototype[Symbol.iterator]=u_.prototype[Symbol.iterator]=function(){return this});function pK(n){try{return new RegExp(n,Yw),!0}catch{return!1}}function Pg(n,e){if(e>=n.length)return e;let t=n.lineAt(e),r;for(;e<t.to&&(r=t.text.charCodeAt(e-t.from))>=56320&&r<57344;)e++;return e}function o4(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=An("input",{class:"cm-textfield",name:"line",value:e}),r=An("form",{class:"cm-gotoLine",onkeydown:i=>{i.keyCode==27?(i.preventDefault(),n.dispatch({effects:af.of(!1)}),n.focus()):i.keyCode==13&&(i.preventDefault(),s())},onsubmit:i=>{i.preventDefault(),s()}},An("label",n.state.phrase("Go to line"),": ",t)," ",An("button",{class:"cm-button",type:"submit"},n.state.phrase("go")),An("button",{name:"close",onclick:()=>{n.dispatch({effects:af.of(!1)}),n.focus()},"aria-label":n.state.phrase("close"),type:"button"},["×"]));function s(){let i=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!i)return;let{state:l}=n,c=l.doc.lineAt(l.selection.main.head),[,u,h,m,p]=i,x=m?+m.slice(1):0,v=h?+h:c.number;if(h&&p){let k=v/100;u&&(k=k*(u=="-"?-1:1)+c.number/l.doc.lines),v=Math.round(l.doc.lines*k)}else h&&u&&(v=v*(u=="-"?-1:1)+c.number);let b=l.doc.line(Math.max(1,Math.min(l.doc.lines,v))),O=Ce.cursor(b.from+Math.max(0,Math.min(x,b.length)));n.dispatch({effects:[af.of(!1),Fe.scrollIntoView(O.from,{y:"center"})],selection:O}),n.focus()}return{dom:r}}const af=xt.define(),k7=Lr.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(af)&&(n=t.value);return n},provide:n=>Of.from(n,e=>e?o4:null)}),gK=n=>{let e=Sf(n,o4);if(!e){let t=[af.of(!0)];n.state.field(k7,!1)==null&&t.push(xt.appendConfig.of([k7,xK])),n.dispatch({effects:t}),e=Sf(n,o4)}return e&&e.dom.querySelector("input").select(),!0},xK=Fe.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),vK={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},yK=He.define({combine(n){return Oa(n,vK,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function bK(n){return[jK,kK]}const wK=Je.mark({class:"cm-selectionMatch"}),SK=Je.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function j7(n,e,t,r){return(t==0||n(e.sliceDoc(t-1,t))!=Vn.Word)&&(r==e.doc.length||n(e.sliceDoc(r,r+1))!=Vn.Word)}function OK(n,e,t,r){return n(e.sliceDoc(t,t+1))==Vn.Word&&n(e.sliceDoc(r-1,r))==Vn.Word}const kK=lr.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(yK),{state:t}=n,r=t.selection;if(r.ranges.length>1)return Je.none;let s=r.main,i,l=null;if(s.empty){if(!e.highlightWordAroundCursor)return Je.none;let u=t.wordAt(s.head);if(!u)return Je.none;l=t.charCategorizer(s.head),i=t.sliceDoc(u.from,u.to)}else{let u=s.to-s.from;if(u<e.minSelectionLength||u>200)return Je.none;if(e.wholeWords){if(i=t.sliceDoc(s.from,s.to),l=t.charCategorizer(s.head),!(j7(l,t,s.from,s.to)&&OK(l,t,s.from,s.to)))return Je.none}else if(i=t.sliceDoc(s.from,s.to),!i)return Je.none}let c=[];for(let u of n.visibleRanges){let h=new xd(t.doc,i,u.from,u.to);for(;!h.next().done;){let{from:m,to:p}=h.value;if((!l||j7(l,t,m,p))&&(s.empty&&m<=s.from&&p>=s.to?c.push(SK.range(m,p)):(m>=s.to||p<=s.from)&&c.push(wK.range(m,p)),c.length>e.maxMatches))return Je.none}}return Je.set(c)}},{decorations:n=>n.decorations}),jK=Fe.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),NK=({state:n,dispatch:e})=>{let{selection:t}=n,r=Ce.create(t.ranges.map(s=>n.wordAt(s.head)||Ce.cursor(s.head)),t.mainIndex);return r.eq(t)?!1:(e(n.update({selection:r})),!0)};function CK(n,e){let{main:t,ranges:r}=n.selection,s=n.wordAt(t.head),i=s&&s.from==t.from&&s.to==t.to;for(let l=!1,c=new xd(n.doc,e,r[r.length-1].to);;)if(c.next(),c.done){if(l)return null;c=new xd(n.doc,e,0,Math.max(0,r[r.length-1].from-1)),l=!0}else{if(l&&r.some(u=>u.from==c.value.from))continue;if(i){let u=n.wordAt(c.value.from);if(!u||u.from!=c.value.from||u.to!=c.value.to)continue}return c.value}}const TK=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(i=>i.from===i.to))return NK({state:n,dispatch:e});let r=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(i=>n.sliceDoc(i.from,i.to)!=r))return!1;let s=CK(n,r);return s?(e(n.update({selection:n.selection.addRange(Ce.range(s.from,s.to),!1),effects:Fe.scrollIntoView(s.to)})),!0):!1},Ed=He.define({combine(n){return Oa(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new FK(e),scrollToMatch:e=>Fe.scrollIntoView(e)})}});class d_{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||pK(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,r)=>r=="n"?`
|
||
`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new _K(this):new AK(this)}getCursor(e,t=0,r){let s=e.doc?e:Vt.create({doc:e});return r==null&&(r=s.doc.length),this.regexp?Pu(this,s,t,r):zu(this,s,t,r)}}class h_{constructor(e){this.spec=e}}function zu(n,e,t,r){return new xd(e.doc,n.unquoted,t,r,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?MK(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function MK(n,e){return(t,r,s,i)=>((i>t||i+s.length<r)&&(i=Math.max(0,t-2),s=n.sliceString(i,Math.min(n.length,r+2))),(e(Lg(s,t-i))!=Vn.Word||e(Bg(s,t-i))!=Vn.Word)&&(e(Bg(s,r-i))!=Vn.Word||e(Lg(s,r-i))!=Vn.Word))}class AK extends h_{constructor(e){super(e)}nextMatch(e,t,r){let s=zu(this.spec,e,r,e.doc.length).nextOverlapping();if(s.done){let i=Math.min(e.doc.length,t+this.spec.unquoted.length);s=zu(this.spec,e,0,i).nextOverlapping()}return s.done||s.value.from==t&&s.value.to==r?null:s.value}prevMatchInRange(e,t,r){for(let s=r;;){let i=Math.max(t,s-1e4-this.spec.unquoted.length),l=zu(this.spec,e,i,s),c=null;for(;!l.nextOverlapping().done;)c=l.value;if(c)return c;if(i==t)return null;s-=1e4}}prevMatch(e,t,r){let s=this.prevMatchInRange(e,0,t);return s||(s=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),s&&(s.from!=t||s.to!=r)?s:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let r=zu(this.spec,e,0,e.doc.length),s=[];for(;!r.next().done;){if(s.length>=t)return null;s.push(r.value)}return s}highlight(e,t,r,s){let i=zu(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)s(i.value.from,i.value.to)}}function Pu(n,e,t,r){return new c_(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?EK(e.charCategorizer(e.selection.main.head)):void 0},t,r)}function Lg(n,e){return n.slice(Vr(n,e,!1),e)}function Bg(n,e){return n.slice(e,Vr(n,e))}function EK(n){return(e,t,r)=>!r[0].length||(n(Lg(r.input,r.index))!=Vn.Word||n(Bg(r.input,r.index))!=Vn.Word)&&(n(Bg(r.input,r.index+r[0].length))!=Vn.Word||n(Lg(r.input,r.index+r[0].length))!=Vn.Word)}class _K extends h_{nextMatch(e,t,r){let s=Pu(this.spec,e,r,e.doc.length).next();return s.done&&(s=Pu(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,r){for(let s=1;;s++){let i=Math.max(t,r-s*1e4),l=Pu(this.spec,e,i,r),c=null;for(;!l.next().done;)c=l.value;if(c&&(i==t||c.from>i+10))return c;if(i==t)return null}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let s=r.length;s>0;s--){let i=+r.slice(0,s);if(i>0&&i<e.match.length)return e.match[i]+r.slice(s)}return t})}matchAll(e,t){let r=Pu(this.spec,e,0,e.doc.length),s=[];for(;!r.next().done;){if(s.length>=t)return null;s.push(r.value)}return s}highlight(e,t,r,s){let i=Pu(this.spec,e,Math.max(0,t-250),Math.min(r+250,e.doc.length));for(;!i.next().done;)s(i.value.from,i.value.to)}}const Mf=xt.define(),Kw=xt.define(),ao=Lr.define({create(n){return new Ky(c4(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Mf)?n=new Ky(t.value.create(),n.panel):t.is(Kw)&&(n=new Ky(n.query,t.value?Zw:null));return n},provide:n=>Of.from(n,e=>e.panel)});class Ky{constructor(e,t){this.query=e,this.panel=t}}const DK=Je.mark({class:"cm-searchMatch"}),RK=Je.mark({class:"cm-searchMatch cm-searchMatch-selected"}),zK=lr.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(ao))}update(n){let e=n.state.field(ao);(e!=n.startState.field(ao)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return Je.none;let{view:t}=this,r=new fl;for(let s=0,i=t.visibleRanges,l=i.length;s<l;s++){let{from:c,to:u}=i[s];for(;s<l-1&&u>i[s+1].from-500;)u=i[++s].to;n.highlight(t.state,c,u,(h,m)=>{let p=t.state.selection.ranges.some(x=>x.from==h&&x.to==m);r.add(h,m,p?RK:DK)})}return r.finish()}},{decorations:n=>n.decorations});function p0(n){return e=>{let t=e.state.field(ao,!1);return t&&t.query.spec.valid?n(e,t):p_(e)}}const Ig=p0((n,{query:e})=>{let{to:t}=n.state.selection.main,r=e.nextMatch(n.state,t,t);if(!r)return!1;let s=Ce.single(r.from,r.to),i=n.state.facet(Ed);return n.dispatch({selection:s,effects:[Jw(n,r),i.scrollToMatch(s.main,n)],userEvent:"select.search"}),m_(n),!0}),Fg=p0((n,{query:e})=>{let{state:t}=n,{from:r}=t.selection.main,s=e.prevMatch(t,r,r);if(!s)return!1;let i=Ce.single(s.from,s.to),l=n.state.facet(Ed);return n.dispatch({selection:i,effects:[Jw(n,s),l.scrollToMatch(i.main,n)],userEvent:"select.search"}),m_(n),!0}),PK=p0((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:Ce.create(t.map(r=>Ce.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),LK=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:r,to:s}=t.main,i=[],l=0;for(let c=new xd(n.doc,n.sliceDoc(r,s));!c.next().done;){if(i.length>1e3)return!1;c.value.from==r&&(l=i.length),i.push(Ce.range(c.value.from,c.value.to))}return e(n.update({selection:Ce.create(i,l),userEvent:"select.search.matches"})),!0},N7=p0((n,{query:e})=>{let{state:t}=n,{from:r,to:s}=t.selection.main;if(t.readOnly)return!1;let i=e.nextMatch(t,r,r);if(!i)return!1;let l=i,c=[],u,h,m=[];l.from==r&&l.to==s&&(h=t.toText(e.getReplacement(l)),c.push({from:l.from,to:l.to,insert:h}),l=e.nextMatch(t,l.from,l.to),m.push(Fe.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(r).number)+".")));let p=n.state.changes(c);return l&&(u=Ce.single(l.from,l.to).map(p),m.push(Jw(n,l)),m.push(t.facet(Ed).scrollToMatch(u.main,n))),n.dispatch({changes:p,selection:u,effects:m,userEvent:"input.replace"}),!0}),BK=p0((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(s=>{let{from:i,to:l}=s;return{from:i,to:l,insert:e.getReplacement(s)}});if(!t.length)return!1;let r=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:Fe.announce.of(r),userEvent:"input.replace.all"}),!0});function Zw(n){return n.state.facet(Ed).createPanel(n)}function c4(n,e){var t,r,s,i,l;let c=n.selection.main,u=c.empty||c.to>c.from+100?"":n.sliceDoc(c.from,c.to);if(e&&!u)return e;let h=n.facet(Ed);return new d_({search:((t=e?.literal)!==null&&t!==void 0?t:h.literal)?u:u.replace(/\n/g,"\\n"),caseSensitive:(r=e?.caseSensitive)!==null&&r!==void 0?r:h.caseSensitive,literal:(s=e?.literal)!==null&&s!==void 0?s:h.literal,regexp:(i=e?.regexp)!==null&&i!==void 0?i:h.regexp,wholeWord:(l=e?.wholeWord)!==null&&l!==void 0?l:h.wholeWord})}function f_(n){let e=Sf(n,Zw);return e&&e.dom.querySelector("[main-field]")}function m_(n){let e=f_(n);e&&e==n.root.activeElement&&e.select()}const p_=n=>{let e=n.state.field(ao,!1);if(e&&e.panel){let t=f_(n);if(t&&t!=n.root.activeElement){let r=c4(n.state,e.query.spec);r.valid&&n.dispatch({effects:Mf.of(r)}),t.focus(),t.select()}}else n.dispatch({effects:[Kw.of(!0),e?Mf.of(c4(n.state,e.query.spec)):xt.appendConfig.of(QK)]});return!0},g_=n=>{let e=n.state.field(ao,!1);if(!e||!e.panel)return!1;let t=Sf(n,Zw);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:Kw.of(!1)}),!0},IK=[{key:"Mod-f",run:p_,scope:"editor search-panel"},{key:"F3",run:Ig,shift:Fg,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Ig,shift:Fg,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:g_,scope:"editor search-panel"},{key:"Mod-Shift-l",run:LK},{key:"Mod-Alt-g",run:gK},{key:"Mod-d",run:TK,preventDefault:!0}];class FK{constructor(e){this.view=e;let t=this.query=e.state.field(ao).query.spec;this.commit=this.commit.bind(this),this.searchField=An("input",{value:t.search,placeholder:Xs(e,"Find"),"aria-label":Xs(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=An("input",{value:t.replace,placeholder:Xs(e,"Replace"),"aria-label":Xs(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=An("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=An("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=An("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function r(s,i,l){return An("button",{class:"cm-button",name:s,onclick:i,type:"button"},l)}this.dom=An("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,r("next",()=>Ig(e),[Xs(e,"next")]),r("prev",()=>Fg(e),[Xs(e,"previous")]),r("select",()=>PK(e),[Xs(e,"all")]),An("label",null,[this.caseField,Xs(e,"match case")]),An("label",null,[this.reField,Xs(e,"regexp")]),An("label",null,[this.wordField,Xs(e,"by word")]),...e.state.readOnly?[]:[An("br"),this.replaceField,r("replace",()=>N7(e),[Xs(e,"replace")]),r("replaceAll",()=>BK(e),[Xs(e,"replace all")])],An("button",{name:"close",onclick:()=>g_(e),"aria-label":Xs(e,"close"),type:"button"},["×"])])}commit(){let e=new d_({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Mf.of(e)}))}keydown(e){UW(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Fg:Ig)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),N7(this.view))}update(e){for(let t of e.transactions)for(let r of t.effects)r.is(Mf)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Ed).top}}function Xs(n,e){return n.state.phrase(e)}const yp=30,bp=/[\s\.,:;?!]/;function Jw(n,{from:e,to:t}){let r=n.state.doc.lineAt(e),s=n.state.doc.lineAt(t).to,i=Math.max(r.from,e-yp),l=Math.min(s,t+yp),c=n.state.sliceDoc(i,l);if(i!=r.from){for(let u=0;u<yp;u++)if(!bp.test(c[u+1])&&bp.test(c[u])){c=c.slice(u);break}}if(l!=s){for(let u=c.length-1;u>c.length-yp;u--)if(!bp.test(c[u-1])&&bp.test(c[u])){c=c.slice(0,u);break}}return Fe.announce.of(`${n.state.phrase("current match")}. ${c} ${n.state.phrase("on line")} ${r.number}.`)}const qK=Fe.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),QK=[ao,jo.low(zK),qK];class x_{constructor(e,t,r,s){this.state=e,this.pos=t,this.explicit=r,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=zr(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),r=Math.max(t.from,this.pos-250),s=t.text.slice(r-t.from,this.pos-t.from),i=s.search(y_(e,!1));return i<0?null:{from:r+i,to:this.pos,text:s.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function C7(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function $K(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let i=1;i<s.length;i++)t[s[i]]=!0}let r=C7(e)+C7(t)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function v_(n){let e=n.map(s=>typeof s=="string"?{label:s}:s),[t,r]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:$K(e);return s=>{let i=s.matchBefore(r);return i||s.explicit?{from:i?i.from:s.pos,options:e,validFor:t}:null}}function HK(n,e){return t=>{for(let r=zr(t.state).resolveInner(t.pos,-1);r;r=r.parent){if(n.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(t)}}let T7=class{constructor(e,t,r,s){this.completion=e,this.source=t,this.match=r,this.score=s}};function gc(n){return n.selection.main.from}function y_(n,e){var t;let{source:r}=n,s=e&&r[0]!="^",i=r[r.length-1]!="$";return!s&&!i?n:new RegExp(`${s?"^":""}(?:${r})${i?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const e5=Sa.define();function UK(n,e,t,r){let{main:s}=n.selection,i=t-s.from,l=r-s.from;return{...n.changeByRange(c=>{if(c!=s&&t!=r&&n.sliceDoc(c.from+i,c.from+l)!=n.sliceDoc(t,r))return{range:c};let u=n.toText(e);return{changes:{from:c.from+i,to:r==s.from?c.to:c.from+l,insert:u},range:Ce.cursor(c.from+i+u.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const M7=new WeakMap;function VK(n){if(!Array.isArray(n))return n;let e=M7.get(n);return e||M7.set(n,e=v_(n)),e}const qg=xt.define(),Af=xt.define();class WK{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let r=Ms(e,t),s=aa(r);this.chars.push(r);let i=e.slice(t,t+s),l=i.toUpperCase();this.folded.push(Ms(l==i?i.toLowerCase():l,0)),t+=s}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:r,any:s,precise:i,byWord:l}=this;if(t.length==1){let T=Ms(e,0),M=aa(T),_=M==e.length?0:-100;if(T!=t[0])if(T==r[0])_+=-200;else return null;return this.ret(_,[0,M])}let c=e.indexOf(this.pattern);if(c==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let u=t.length,h=0;if(c<0){for(let T=0,M=Math.min(e.length,200);T<M&&h<u;){let _=Ms(e,T);(_==t[h]||_==r[h])&&(s[h++]=T),T+=aa(_)}if(h<u)return null}let m=0,p=0,x=!1,v=0,b=-1,O=-1,k=/[a-z]/.test(e),j=!0;for(let T=0,M=Math.min(e.length,200),_=0;T<M&&p<u;){let D=Ms(e,T);c<0&&(m<u&&D==t[m]&&(i[m++]=T),v<u&&(D==t[v]||D==r[v]?(v==0&&(b=T),O=T+1,v++):v=0));let E,z=D<255?D>=48&&D<=57||D>=97&&D<=122?2:D>=65&&D<=90?1:0:(E=ww(D))!=E.toLowerCase()?1:E!=E.toUpperCase()?2:0;(!T||z==1&&k||_==0&&z!=0)&&(t[p]==D||r[p]==D&&(x=!0)?l[p++]=T:l.length&&(j=!1)),_=z,T+=aa(D)}return p==u&&l[0]==0&&j?this.result(-100+(x?-200:0),l,e):v==u&&b==0?this.ret(-200-e.length+(O==e.length?0:-100),[0,O]):c>-1?this.ret(-700-e.length,[c,c+this.pattern.length]):v==u?this.ret(-900-e.length,[b,O]):p==u?this.result(-100+(x?-200:0)+-700+(j?0:-1100),l,e):t.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,r){let s=[],i=0;for(let l of t){let c=l+(this.astral?aa(Ms(r,l)):1);i&&s[i-1]==l?s[i-1]=c:(s[i++]=l,s[i++]=c)}return this.ret(e-r.length,s)}}class GK{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),r=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return r==null?null:(this.matched=[0,t.length],this.score=r+(e.length==this.pattern.length?0:-100),this)}}const Dr=He.define({combine(n){return Oa(n,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:XK,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>r=>A7(e(r),t(r)),optionClass:(e,t)=>r=>A7(e(r),t(r)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function A7(n,e){return n?e?n+" "+e:n:e}function XK(n,e,t,r,s,i){let l=n.textDirection==Hn.RTL,c=l,u=!1,h="top",m,p,x=e.left-s.left,v=s.right-e.right,b=r.right-r.left,O=r.bottom-r.top;if(c&&x<Math.min(b,v)?c=!1:!c&&v<Math.min(b,x)&&(c=!0),b<=(c?x:v))m=Math.max(s.top,Math.min(t.top,s.bottom-O))-e.top,p=Math.min(400,c?x:v);else{u=!0,p=Math.min(400,(l?e.right:s.right-e.left)-30);let T=s.bottom-e.bottom;T>=O||T>e.top?m=t.bottom-e.top:(h="bottom",m=e.bottom-t.top)}let k=(e.bottom-e.top)/i.offsetHeight,j=(e.right-e.left)/i.offsetWidth;return{style:`${h}: ${m/k}px; max-width: ${p/j}px`,class:"cm-completionInfo-"+(u?l?"left-narrow":"right-narrow":c?"left":"right")}}function YK(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),t.type&&r.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(t,r,s,i){let l=document.createElement("span");l.className="cm-completionLabel";let c=t.displayLabel||t.label,u=0;for(let h=0;h<i.length;){let m=i[h++],p=i[h++];m>u&&l.appendChild(document.createTextNode(c.slice(u,m)));let x=l.appendChild(document.createElement("span"));x.appendChild(document.createTextNode(c.slice(m,p))),x.className="cm-completionMatchedText",u=p}return u<c.length&&l.appendChild(document.createTextNode(c.slice(u))),l},position:50},{render(t){if(!t.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=t.detail,r},position:80}),e.sort((t,r)=>t.position-r.position).map(t=>t.render)}function Zy(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let r=Math.floor((n-e)/t);return{from:n-(r+1)*t,to:n-r*t}}class KK{constructor(e,t,r){this.view=e,this.stateField=t,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:u=>this.placeInfo(u),key:this},this.space=null,this.currentClass="";let s=e.state.field(t),{options:i,selected:l}=s.open,c=e.state.facet(Dr);this.optionContent=YK(c),this.optionClass=c.optionClass,this.tooltipClass=c.tooltipClass,this.range=Zy(i.length,l,c.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",u=>{let{options:h}=e.state.field(t).open;for(let m=u.target,p;m&&m!=this.dom;m=m.parentNode)if(m.nodeName=="LI"&&(p=/-(\d+)$/.exec(m.id))&&+p[1]<h.length){this.applyCompletion(e,h[+p[1]]),u.preventDefault();return}}),this.dom.addEventListener("focusout",u=>{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(Dr).closeOnBlur&&u.relatedTarget!=e.contentDOM&&e.dispatch({effects:Af.of(null)})}),this.showOptions(i,s.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let r=e.state.field(this.stateField),s=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=s){let{options:i,selected:l,disabled:c}=r.open;(!s.open||s.open.options!=i)&&(this.range=Zy(i.length,l,e.state.facet(Dr).maxRenderedOptions),this.showOptions(i,r.id)),this.updateSel(),c!=((t=s.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!c)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of t.split(" "))r&&this.dom.classList.add(r);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=Zy(t.options.length,t.selected,this.view.state.facet(Dr).maxRenderedOptions),this.showOptions(t.options,e.id));let r=this.updateSelectedOption(t.selected);if(r){this.destroyInfo();let{completion:s}=t.options[t.selected],{info:i}=s;if(!i)return;let l=typeof i=="string"?document.createTextNode(i):i(s);if(!l)return;"then"in l?l.then(c=>{c&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(c,s)}).catch(c=>Es(this.view.state,c,"completion info")):(this.addInfoPane(l,s),r.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",r.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:i}=e;r.appendChild(s),this.infoDestroy=i||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let r=this.list.firstChild,s=this.range.from;r;r=r.nextSibling,s++)r.nodeName!="LI"||!r.id?s--:s==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),t=r):r.hasAttribute("aria-selected")&&(r.removeAttribute("aria-selected"),r.removeAttribute("aria-describedby"));return t&&JK(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),i=this.space;if(!i){let l=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:l.clientWidth,bottom:l.clientHeight}}return s.top>Math.min(i.bottom,t.bottom)-10||s.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(Dr).positionInfo(this.view,t,s,r,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,r){const s=document.createElement("ul");s.id=t,s.setAttribute("role","listbox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-label",this.view.state.phrase("Completions")),s.addEventListener("mousedown",l=>{l.target==s&&l.preventDefault()});let i=null;for(let l=r.from;l<r.to;l++){let{completion:c,match:u}=e[l],{section:h}=c;if(h){let x=typeof h=="string"?h:h.name;if(x!=i&&(l>r.from||r.from==0))if(i=x,typeof h!="string"&&h.header)s.appendChild(h.header(h));else{let v=s.appendChild(document.createElement("completion-section"));v.textContent=x}}const m=s.appendChild(document.createElement("li"));m.id=t+"-"+l,m.setAttribute("role","option");let p=this.optionClass(c);p&&(m.className=p);for(let x of this.optionContent){let v=x(c,this.view.state,this.view,u);v&&m.appendChild(v)}}return r.from&&s.classList.add("cm-completionListIncompleteTop"),r.to<e.length&&s.classList.add("cm-completionListIncompleteBottom"),s}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function ZK(n,e){return t=>new KK(t,n,e)}function JK(n,e){let t=n.getBoundingClientRect(),r=e.getBoundingClientRect(),s=t.height/n.offsetHeight;r.top<t.top?n.scrollTop-=(t.top-r.top)/s:r.bottom>t.bottom&&(n.scrollTop+=(r.bottom-t.bottom)/s)}function E7(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function eZ(n,e){let t=[],r=null,s=null,i=m=>{t.push(m);let{section:p}=m.completion;if(p){r||(r=[]);let x=typeof p=="string"?p:p.name;r.some(v=>v.name==x)||r.push(typeof p=="string"?{name:x}:p)}},l=e.facet(Dr);for(let m of n)if(m.hasResult()){let p=m.result.getMatch;if(m.result.filter===!1)for(let x of m.result.options)i(new T7(x,m.source,p?p(x):[],1e9-t.length));else{let x=e.sliceDoc(m.from,m.to),v,b=l.filterStrict?new GK(x):new WK(x);for(let O of m.result.options)if(v=b.match(O.label)){let k=O.displayLabel?p?p(O,v.matched):[]:v.matched,j=v.score+(O.boost||0);if(i(new T7(O,m.source,k,j)),typeof O.section=="object"&&O.section.rank==="dynamic"){let{name:T}=O.section;s||(s=Object.create(null)),s[T]=Math.max(j,s[T]||-1e9)}}}}if(r){let m=Object.create(null),p=0,x=(v,b)=>(v.rank==="dynamic"&&b.rank==="dynamic"?s[b.name]-s[v.name]:0)||(typeof v.rank=="number"?v.rank:1e9)-(typeof b.rank=="number"?b.rank:1e9)||(v.name<b.name?-1:1);for(let v of r.sort(x))p-=1e5,m[v.name]=p;for(let v of t){let{section:b}=v.completion;b&&(v.score+=m[typeof b=="string"?b:b.name])}}let c=[],u=null,h=l.compareCompletions;for(let m of t.sort((p,x)=>x.score-p.score||h(p.completion,x.completion))){let p=m.completion;!u||u.label!=p.label||u.detail!=p.detail||u.type!=null&&p.type!=null&&u.type!=p.type||u.apply!=p.apply||u.boost!=p.boost?c.push(m):E7(m.completion)>E7(u)&&(c[c.length-1]=m),u=m.completion}return c}class Hu{constructor(e,t,r,s,i,l){this.options=e,this.attrs=t,this.tooltip=r,this.timestamp=s,this.selected=i,this.disabled=l}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Hu(this.options,_7(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,r,s,i,l){if(s&&!l&&e.some(h=>h.isPending))return s.setDisabled();let c=eZ(e,t);if(!c.length)return s&&e.some(h=>h.isPending)?s.setDisabled():null;let u=t.facet(Dr).selectOnOpen?0:-1;if(s&&s.selected!=u&&s.selected!=-1){let h=s.options[s.selected].completion;for(let m=0;m<c.length;m++)if(c[m].completion==h){u=m;break}}return new Hu(c,_7(r,u),{pos:e.reduce((h,m)=>m.hasResult()?Math.min(h,m.from):h,1e8),create:aZ,above:i.aboveCursor},s?s.timestamp:Date.now(),u,!1)}map(e){return new Hu(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Hu(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Qg{constructor(e,t,r){this.active=e,this.id=t,this.open=r}static start(){return new Qg(sZ,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,r=t.facet(Dr),i=(r.override||t.languageDataAt("autocomplete",gc(t)).map(VK)).map(u=>(this.active.find(m=>m.source==u)||new Si(u,this.active.some(m=>m.state!=0)?1:0)).update(e,r));i.length==this.active.length&&i.every((u,h)=>u==this.active[h])&&(i=this.active);let l=this.open,c=e.effects.some(u=>u.is(t5));l&&e.docChanged&&(l=l.map(e.changes)),e.selection||i.some(u=>u.hasResult()&&e.changes.touchesRange(u.from,u.to))||!tZ(i,this.active)||c?l=Hu.build(i,t,this.id,l,r,c):l&&l.disabled&&!i.some(u=>u.isPending)&&(l=null),!l&&i.every(u=>!u.isPending)&&i.some(u=>u.hasResult())&&(i=i.map(u=>u.hasResult()?new Si(u.source,0):u));for(let u of e.effects)u.is(w_)&&(l=l&&l.setSelected(u.value,this.id));return i==this.active&&l==this.open?this:new Qg(i,this.id,l)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?nZ:rZ}}function tZ(n,e){if(n==e)return!0;for(let t=0,r=0;;){for(;t<n.length&&!n[t].hasResult();)t++;for(;r<e.length&&!e[r].hasResult();)r++;let s=t==n.length,i=r==e.length;if(s||i)return s==i;if(n[t++].result!=e[r++].result)return!1}}const nZ={"aria-autocomplete":"list"},rZ={};function _7(n,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":n};return e>-1&&(t["aria-activedescendant"]=n+"-"+e),t}const sZ=[];function b_(n,e){if(n.isUserEvent("input.complete")){let r=n.annotation(e5);if(r&&e.activateOnCompletion(r))return 12}let t=n.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class Si{constructor(e,t,r=!1){this.source=e,this.state=t,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let r=b_(e,t),s=this;(r&8||r&16&&this.touches(e))&&(s=new Si(s.source,0)),r&4&&s.state==0&&(s=new Si(this.source,1)),s=s.updateFor(e,r);for(let i of e.effects)if(i.is(qg))s=new Si(s.source,1,i.value);else if(i.is(Af))s=new Si(s.source,0);else if(i.is(t5))for(let l of i.value)l.source==s.source&&(s=l);return s}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(gc(e.state))}}class Zu extends Si{constructor(e,t,r,s,i,l){super(e,3,t),this.limit=r,this.result=s,this.from=i,this.to=l}hasResult(){return!0}updateFor(e,t){var r;if(!(t&3))return this.map(e.changes);let s=this.result;s.map&&!e.changes.empty&&(s=s.map(s,e.changes));let i=e.changes.mapPos(this.from),l=e.changes.mapPos(this.to,1),c=gc(e.state);if(c>l||!s||t&2&&(gc(e.startState)==this.from||c<this.limit))return new Si(this.source,t&4?1:0);let u=e.changes.mapPos(this.limit);return iZ(s.validFor,e.state,i,l)?new Zu(this.source,this.explicit,u,s,i,l):s.update&&(s=s.update(s,i,l,new x_(e.state,c,!1)))?new Zu(this.source,this.explicit,u,s,s.from,(r=s.to)!==null&&r!==void 0?r:gc(e.state)):new Si(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new Zu(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Si(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function iZ(n,e,t,r){if(!n)return!1;let s=e.sliceDoc(t,r);return typeof n=="function"?n(s,t,r,e):y_(n,!0).test(s)}const t5=xt.define({map(n,e){return n.map(t=>t.map(e))}}),w_=xt.define(),As=Lr.define({create(){return Qg.start()},update(n,e){return n.update(e)},provide:n=>[zw.from(n,e=>e.tooltip),Fe.contentAttributes.from(n,e=>e.attrs)]});function n5(n,e){const t=e.completion.apply||e.completion.label;let r=n.state.field(As).active.find(s=>s.source==e.source);return r instanceof Zu?(typeof t=="string"?n.dispatch({...UK(n.state,t,r.from,r.to),annotations:e5.of(e.completion)}):t(n,e.completion,r.from,r.to),!0):!1}const aZ=ZK(As,n5);function wp(n,e="option"){return t=>{let r=t.state.field(As,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<t.state.facet(Dr).interactionDelay)return!1;let s=1,i;e=="page"&&(i=XA(t,r.open.tooltip))&&(s=Math.max(2,Math.floor(i.dom.offsetHeight/i.dom.querySelector("li").offsetHeight)-1));let{length:l}=r.open.options,c=r.open.selected>-1?r.open.selected+s*(n?1:-1):n?0:l-1;return c<0?c=e=="page"?0:l-1:c>=l&&(c=e=="page"?l-1:0),t.dispatch({effects:w_.of(c)}),!0}}const lZ=n=>{let e=n.state.field(As,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<n.state.facet(Dr).interactionDelay?!1:n5(n,e.open.options[e.open.selected])},Jy=n=>n.state.field(As,!1)?(n.dispatch({effects:qg.of(!0)}),!0):!1,oZ=n=>{let e=n.state.field(As,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:Af.of(null)}),!0)};class cZ{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const uZ=50,dZ=1e3,hZ=lr.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(As).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(As),t=n.state.facet(Dr);if(!n.selectionSet&&!n.docChanged&&n.startState.field(As)==e)return;let r=n.transactions.some(i=>{let l=b_(i,t);return l&8||(i.selection||i.docChanged)&&!(l&3)});for(let i=0;i<this.running.length;i++){let l=this.running[i];if(r||l.context.abortOnDocChange&&n.docChanged||l.updates.length+n.transactions.length>uZ&&Date.now()-l.time>dZ){for(let c of l.context.abortListeners)try{c()}catch(u){Es(this.view.state,u)}l.context.abortListeners=null,this.running.splice(i--,1)}else l.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(i=>i.effects.some(l=>l.is(qg)))&&(this.pendingStart=!0);let s=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(i=>i.isPending&&!this.running.some(l=>l.active.source==i.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let i of n.transactions)i.isUserEvent("input.type")?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(As);for(let t of e.active)t.isPending&&!this.running.some(r=>r.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Dr).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=gc(e),r=new x_(e,t,n.explicit,this.view),s=new cZ(n,r);this.running.push(s),Promise.resolve(n.source(r)).then(i=>{s.context.aborted||(s.done=i||null,this.scheduleAccept())},i=>{this.view.dispatch({effects:Af.of(null)}),Es(this.view.state,i)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Dr).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Dr),r=this.view.state.field(As);for(let s=0;s<this.running.length;s++){let i=this.running[s];if(i.done===void 0)continue;if(this.running.splice(s--,1),i.done){let c=gc(i.updates.length?i.updates[0].startState:this.view.state),u=Math.min(c,i.done.from+(i.active.explicit?0:1)),h=new Zu(i.active.source,i.active.explicit,u,i.done,i.done.from,(n=i.done.to)!==null&&n!==void 0?n:c);for(let m of i.updates)h=h.update(m,t);if(h.hasResult()){e.push(h);continue}}let l=r.active.find(c=>c.source==i.active.source);if(l&&l.isPending)if(i.done==null){let c=new Si(i.active.source,0);for(let u of i.updates)c=c.update(u,t);c.isPending||e.push(c)}else this.startQuery(l)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:t5.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(As,!1);if(e&&e.tooltip&&this.view.state.facet(Dr).closeOnBlur){let t=e.open&&XA(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Af.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:qg.of(!1)}),20),this.composing=0}}}),fZ=typeof navigator=="object"&&/Win/.test(navigator.platform),mZ=jo.highest(Fe.domEventHandlers({keydown(n,e){let t=e.state.field(As,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(fZ&&n.altKey)||n.metaKey)return!1;let r=t.open.options[t.open.selected],s=t.active.find(l=>l.source==r.source),i=r.completion.commitCharacters||s.result.commitCharacters;return i&&i.indexOf(n.key)>-1&&n5(e,r),!1}})),S_=Fe.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class pZ{constructor(e,t,r,s){this.field=e,this.line=t,this.from=r,this.to=s}}class r5{constructor(e,t,r){this.field=e,this.from=t,this.to=r}map(e){let t=e.mapPos(this.from,-1,Ur.TrackDel),r=e.mapPos(this.to,1,Ur.TrackDel);return t==null||r==null?null:new r5(this.field,t,r)}}class s5{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let r=[],s=[t],i=e.doc.lineAt(t),l=/^\s*/.exec(i.text)[0];for(let u of this.lines){if(r.length){let h=l,m=/^\t*/.exec(u)[0].length;for(let p=0;p<m;p++)h+=e.facet(d0);s.push(t+h.length-m),u=h+u.slice(m)}r.push(u),t+=u.length+1}let c=this.fieldPositions.map(u=>new r5(u.field,s[u.line]+u.from,s[u.line]+u.to));return{text:r,ranges:c}}static parse(e){let t=[],r=[],s=[],i;for(let l of e.split(/\r\n?|\n/)){for(;i=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(l);){let c=i[1]?+i[1]:null,u=i[2]||i[3]||"",h=-1,m=u.replace(/\\[{}]/g,p=>p[1]);for(let p=0;p<t.length;p++)(c!=null?t[p].seq==c:m&&t[p].name==m)&&(h=p);if(h<0){let p=0;for(;p<t.length&&(c==null||t[p].seq!=null&&t[p].seq<c);)p++;t.splice(p,0,{seq:c,name:m}),h=p;for(let x of s)x.field>=h&&x.field++}for(let p of s)if(p.line==r.length&&p.from>i.index){let x=i[2]?3+(i[1]||"").length:2;p.from-=x,p.to-=x}s.push(new pZ(h,r.length,i.index,i.index+m.length)),l=l.slice(0,i.index)+u+l.slice(i.index+i[0].length)}l=l.replace(/\\([{}])/g,(c,u,h)=>{for(let m of s)m.line==r.length&&m.from>h&&(m.from--,m.to--);return u}),r.push(l)}return new s5(r,s)}}let gZ=Je.widget({widget:new class extends ka{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),xZ=Je.mark({class:"cm-snippetField"});class _d{constructor(e,t){this.ranges=e,this.active=t,this.deco=Je.set(e.map(r=>(r.from==r.to?gZ:xZ).range(r.from,r.to)),!0)}map(e){let t=[];for(let r of this.ranges){let s=r.map(e);if(!s)return null;t.push(s)}return new _d(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(r=>r.field==this.active&&r.from<=t.from&&r.to>=t.to))}}const g0=xt.define({map(n,e){return n&&n.map(e)}}),vZ=xt.define(),Ef=Lr.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(g0))return t.value;if(t.is(vZ)&&n)return new _d(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>Fe.decorations.from(n,e=>e?e.deco:Je.none)});function i5(n,e){return Ce.create(n.filter(t=>t.field==e).map(t=>Ce.range(t.from,t.to)))}function yZ(n){let e=s5.parse(n);return(t,r,s,i)=>{let{text:l,ranges:c}=e.instantiate(t.state,s),{main:u}=t.state.selection,h={changes:{from:s,to:i==u.from?u.to:i,insert:Wt.of(l)},scrollIntoView:!0,annotations:r?[e5.of(r),gr.userEvent.of("input.complete")]:void 0};if(c.length&&(h.selection=i5(c,0)),c.some(m=>m.field>0)){let m=new _d(c,0),p=h.effects=[g0.of(m)];t.state.field(Ef,!1)===void 0&&p.push(xt.appendConfig.of([Ef,kZ,jZ,S_]))}t.dispatch(t.state.update(h))}}function O_(n){return({state:e,dispatch:t})=>{let r=e.field(Ef,!1);if(!r||n<0&&r.active==0)return!1;let s=r.active+n,i=n>0&&!r.ranges.some(l=>l.field==s+n);return t(e.update({selection:i5(r.ranges,s),effects:g0.of(i?null:new _d(r.ranges,s)),scrollIntoView:!0})),!0}}const bZ=({state:n,dispatch:e})=>n.field(Ef,!1)?(e(n.update({effects:g0.of(null)})),!0):!1,wZ=O_(1),SZ=O_(-1),OZ=[{key:"Tab",run:wZ,shift:SZ},{key:"Escape",run:bZ}],D7=He.define({combine(n){return n.length?n[0]:OZ}}),kZ=jo.highest(c0.compute([D7],n=>n.facet(D7)));function Xa(n,e){return{...e,apply:yZ(n)}}const jZ=Fe.domEventHandlers({mousedown(n,e){let t=e.state.field(Ef,!1),r;if(!t||(r=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let s=t.ranges.find(i=>i.from<=r&&i.to>=r);return!s||s.field==t.active?!1:(e.dispatch({selection:i5(t.ranges,s.field),effects:g0.of(t.ranges.some(i=>i.field>s.field)?new _d(t.ranges,s.field):null),scrollIntoView:!0}),!0)}}),_f={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},oc=xt.define({map(n,e){let t=e.mapPos(n,-1,Ur.TrackAfter);return t??void 0}}),a5=new class extends yc{};a5.startSide=1;a5.endSide=-1;const k_=Lr.define({create(){return Gt.empty},update(n,e){if(n=n.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:r=>r>=t.from&&r<=t.to})}for(let t of e.effects)t.is(oc)&&(n=n.update({add:[a5.range(t.value,t.value+1)]}));return n}});function NZ(){return[TZ,k_]}const eb="()[]{}<>«»»«[]{}";function j_(n){for(let e=0;e<eb.length;e+=2)if(eb.charCodeAt(e)==n)return eb.charAt(e+1);return ww(n<128?n:n+1)}function N_(n,e){return n.languageDataAt("closeBrackets",e)[0]||_f}const CZ=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),TZ=Fe.inputHandler.of((n,e,t,r)=>{if((CZ?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(r.length>2||r.length==2&&aa(Ms(r,0))==1||e!=s.from||t!=s.to)return!1;let i=EZ(n.state,r);return i?(n.dispatch(i),!0):!1}),MZ=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let r=N_(n,n.selection.main.head).brackets||_f.brackets,s=null,i=n.changeByRange(l=>{if(l.empty){let c=_Z(n.doc,l.head);for(let u of r)if(u==c&&Rx(n.doc,l.head)==j_(Ms(u,0)))return{changes:{from:l.head-u.length,to:l.head+u.length},range:Ce.cursor(l.head-u.length)}}return{range:s=l}});return s||e(n.update(i,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},AZ=[{key:"Backspace",run:MZ}];function EZ(n,e){let t=N_(n,n.selection.main.head),r=t.brackets||_f.brackets;for(let s of r){let i=j_(Ms(s,0));if(e==s)return i==s?zZ(n,s,r.indexOf(s+s+s)>-1,t):DZ(n,s,i,t.before||_f.before);if(e==i&&C_(n,n.selection.main.from))return RZ(n,s,i)}return null}function C_(n,e){let t=!1;return n.field(k_).between(0,n.doc.length,r=>{r==e&&(t=!0)}),t}function Rx(n,e){let t=n.sliceString(e,e+2);return t.slice(0,aa(Ms(t,0)))}function _Z(n,e){let t=n.sliceString(e-2,e);return aa(Ms(t,0))==t.length?t:t.slice(1)}function DZ(n,e,t,r){let s=null,i=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:t,from:l.to}],effects:oc.of(l.to+e.length),range:Ce.range(l.anchor+e.length,l.head+e.length)};let c=Rx(n.doc,l.head);return!c||/\s/.test(c)||r.indexOf(c)>-1?{changes:{insert:e+t,from:l.head},effects:oc.of(l.head+e.length),range:Ce.cursor(l.head+e.length)}:{range:s=l}});return s?null:n.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function RZ(n,e,t){let r=null,s=n.changeByRange(i=>i.empty&&Rx(n.doc,i.head)==t?{changes:{from:i.head,to:i.head+t.length,insert:t},range:Ce.cursor(i.head+t.length)}:r={range:i});return r?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function zZ(n,e,t,r){let s=r.stringPrefixes||_f.stringPrefixes,i=null,l=n.changeByRange(c=>{if(!c.empty)return{changes:[{insert:e,from:c.from},{insert:e,from:c.to}],effects:oc.of(c.to+e.length),range:Ce.range(c.anchor+e.length,c.head+e.length)};let u=c.head,h=Rx(n.doc,u),m;if(h==e){if(R7(n,u))return{changes:{insert:e+e,from:u},effects:oc.of(u+e.length),range:Ce.cursor(u+e.length)};if(C_(n,u)){let x=t&&n.sliceDoc(u,u+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:u,to:u+x.length,insert:x},range:Ce.cursor(u+x.length)}}}else{if(t&&n.sliceDoc(u-2*e.length,u)==e+e&&(m=z7(n,u-2*e.length,s))>-1&&R7(n,m))return{changes:{insert:e+e+e+e,from:u},effects:oc.of(u+e.length),range:Ce.cursor(u+e.length)};if(n.charCategorizer(u)(h)!=Vn.Word&&z7(n,u,s)>-1&&!PZ(n,u,e,s))return{changes:{insert:e+e,from:u},effects:oc.of(u+e.length),range:Ce.cursor(u+e.length)}}return{range:i=c}});return i?null:n.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function R7(n,e){let t=zr(n).resolveInner(e+1);return t.parent&&t.from==e}function PZ(n,e,t,r){let s=zr(n).resolveInner(e,-1),i=r.reduce((l,c)=>Math.max(l,c.length),0);for(let l=0;l<5;l++){let c=n.sliceDoc(s.from,Math.min(s.to,s.from+t.length+i)),u=c.indexOf(t);if(!u||u>-1&&r.indexOf(c.slice(0,u))>-1){let m=s.firstChild;for(;m&&m.from==s.from&&m.to-m.from>t.length+u;){if(n.sliceDoc(m.to-t.length,m.to)==t)return!1;m=m.firstChild}return!0}let h=s.to==e&&s.parent;if(!h)break;s=h}return!1}function z7(n,e,t){let r=n.charCategorizer(e);if(r(n.sliceDoc(e-1,e))!=Vn.Word)return e;for(let s of t){let i=e-s.length;if(n.sliceDoc(i,e)==s&&r(n.sliceDoc(i-1,i))!=Vn.Word)return i}return-1}function LZ(n={}){return[mZ,As,Dr.of(n),hZ,BZ,S_]}const T_=[{key:"Ctrl-Space",run:Jy},{mac:"Alt-`",run:Jy},{mac:"Alt-i",run:Jy},{key:"Escape",run:oZ},{key:"ArrowDown",run:wp(!0)},{key:"ArrowUp",run:wp(!1)},{key:"PageDown",run:wp(!0,"page")},{key:"PageUp",run:wp(!1,"page")},{key:"Enter",run:lZ}],BZ=jo.highest(c0.computeN([Dr],n=>n.facet(Dr).defaultKeymap?[T_]:[]));class P7{constructor(e,t,r){this.from=e,this.to=t,this.diagnostic=r}}class sc{constructor(e,t,r){this.diagnostics=e,this.panel=t,this.selected=r}static init(e,t,r){let s=r.facet(Df).markerFilter;s&&(e=s(e,r));let i=e.slice().sort((v,b)=>v.from-b.from||v.to-b.to),l=new fl,c=[],u=0,h=r.doc.iter(),m=0,p=r.doc.length;for(let v=0;;){let b=v==i.length?null:i[v];if(!b&&!c.length)break;let O,k;if(c.length)O=u,k=c.reduce((M,_)=>Math.min(M,_.to),b&&b.from>O?b.from:1e8);else{if(O=b.from,O>p)break;k=b.to,c.push(b),v++}for(;v<i.length;){let M=i[v];if(M.from==O&&(M.to>M.from||M.to==O))c.push(M),v++,k=Math.min(M.to,k);else{k=Math.min(M.from,k);break}}k=Math.min(k,p);let j=!1;if(c.some(M=>M.from==O&&(M.to==k||k==p))&&(j=O==k,!j&&k-O<10)){let M=O-(m+h.value.length);M>0&&(h.next(M),m=O);for(let _=O;;){if(_>=k){j=!0;break}if(!h.lineBreak&&m+h.value.length>_)break;_=m+h.value.length,m+=h.value.length,h.next()}}let T=KZ(c);if(j)l.add(O,O,Je.widget({widget:new WZ(T),diagnostics:c.slice()}));else{let M=c.reduce((_,D)=>D.markClass?_+" "+D.markClass:_,"");l.add(O,k,Je.mark({class:"cm-lintRange cm-lintRange-"+T+M,diagnostics:c.slice(),inclusiveEnd:c.some(_=>_.to>k)}))}if(u=k,u==p)break;for(let M=0;M<c.length;M++)c[M].to<=u&&c.splice(M--,1)}let x=l.finish();return new sc(x,t,vd(x))}}function vd(n,e=null,t=0){let r=null;return n.between(t,1e9,(s,i,{spec:l})=>{if(!(e&&l.diagnostics.indexOf(e)<0))if(!r)r=new P7(s,i,e||l.diagnostics[0]);else{if(l.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new P7(r.from,i,r.diagnostic)}}),r}function IZ(n,e){let t=e.pos,r=e.end||t,s=n.state.facet(Df).hideOn(n,t,r);if(s!=null)return s;let i=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(l=>l.is(M_))||n.changes.touchesRange(i.from,Math.max(i.to,r)))}function FZ(n,e){return n.field(ni,!1)?e:e.concat(xt.appendConfig.of(ZZ))}const M_=xt.define(),l5=xt.define(),A_=xt.define(),ni=Lr.define({create(){return new sc(Je.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),r=null,s=n.panel;if(n.selected){let i=e.changes.mapPos(n.selected.from,1);r=vd(t,n.selected.diagnostic,i)||vd(t,null,i)}!t.size&&s&&e.state.facet(Df).autoPanel&&(s=null),n=new sc(t,s,r)}for(let t of e.effects)if(t.is(M_)){let r=e.state.facet(Df).autoPanel?t.value.length?Rf.open:null:n.panel;n=sc.init(t.value,r,e.state)}else t.is(l5)?n=new sc(n.diagnostics,t.value?Rf.open:null,n.selected):t.is(A_)&&(n=new sc(n.diagnostics,n.panel,t.value));return n},provide:n=>[Of.from(n,e=>e.panel),Fe.decorations.from(n,e=>e.diagnostics)]}),qZ=Je.mark({class:"cm-lintRange cm-lintRange-active"});function QZ(n,e,t){let{diagnostics:r}=n.state.field(ni),s,i=-1,l=-1;r.between(e-(t<0?1:0),e+(t>0?1:0),(u,h,{spec:m})=>{if(e>=u&&e<=h&&(u==h||(e>u||t>0)&&(e<h||t<0)))return s=m.diagnostics,i=u,l=h,!1});let c=n.state.facet(Df).tooltipFilter;return s&&c&&(s=c(s,n.state)),s?{pos:i,end:l,above:n.state.doc.lineAt(i).to<l,create(){return{dom:$Z(n,s)}}}:null}function $Z(n,e){return An("ul",{class:"cm-tooltip-lint"},e.map(t=>__(n,t,!1)))}const HZ=n=>{let e=n.state.field(ni,!1);(!e||!e.panel)&&n.dispatch({effects:FZ(n.state,[l5.of(!0)])});let t=Sf(n,Rf.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},L7=n=>{let e=n.state.field(ni,!1);return!e||!e.panel?!1:(n.dispatch({effects:l5.of(!1)}),!0)},UZ=n=>{let e=n.state.field(ni,!1);if(!e)return!1;let t=n.state.selection.main,r=e.diagnostics.iter(t.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==t.from&&r.to==t.to)?!1:(n.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},VZ=[{key:"Mod-Shift-m",run:HZ,preventDefault:!0},{key:"F8",run:UZ}],Df=He.define({combine(n){return{sources:n.map(e=>e.source).filter(e=>e!=null),...Oa(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:B7,tooltipFilter:B7,needsRefresh:(e,t)=>e?t?r=>e(r)||t(r):e:t,hideOn:(e,t)=>e?t?(r,s,i)=>e(r,s,i)||t(r,s,i):e:t,autoPanel:(e,t)=>e||t})}}});function B7(n,e){return n?e?(t,r)=>e(n(t,r),r):n:e}function E_(n){let e=[];if(n)e:for(let{name:t}of n){for(let r=0;r<t.length;r++){let s=t[r];if(/[a-zA-Z]/.test(s)&&!e.some(i=>i.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function __(n,e,t){var r;let s=t?E_(e.actions):[];return An("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},An("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((i,l)=>{let c=!1,u=v=>{if(v.preventDefault(),c)return;c=!0;let b=vd(n.state.field(ni).diagnostics,e);b&&i.apply(n,b.from,b.to)},{name:h}=i,m=s[l]?h.indexOf(s[l]):-1,p=m<0?h:[h.slice(0,m),An("u",h.slice(m,m+1)),h.slice(m+1)],x=i.markClass?" "+i.markClass:"";return An("button",{type:"button",class:"cm-diagnosticAction"+x,onclick:u,onmousedown:u,"aria-label":` Action: ${h}${m<0?"":` (access key "${s[l]})"`}.`},p)}),e.source&&An("div",{class:"cm-diagnosticSource"},e.source))}class WZ extends ka{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return An("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class I7{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=__(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Rf{constructor(e){this.view=e,this.items=[];let t=s=>{if(s.keyCode==27)L7(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:i}=this.items[this.selectedIndex],l=E_(i.actions);for(let c=0;c<l.length;c++)if(l[c].toUpperCase().charCodeAt(0)==s.keyCode){let u=vd(this.view.state.field(ni).diagnostics,i);u&&i.actions[c].apply(e,u.from,u.to)}}else return;s.preventDefault()},r=s=>{for(let i=0;i<this.items.length;i++)this.items[i].dom.contains(s.target)&&this.moveSelection(i)};this.list=An("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:r}),this.dom=An("div",{class:"cm-panel-lint"},this.list,An("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>L7(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(ni).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(ni),r=0,s=!1,i=null,l=new Set;for(e.between(0,this.view.state.doc.length,(c,u,{spec:h})=>{for(let m of h.diagnostics){if(l.has(m))continue;l.add(m);let p=-1,x;for(let v=r;v<this.items.length;v++)if(this.items[v].diagnostic==m){p=v;break}p<0?(x=new I7(this.view,m),this.items.splice(r,0,x),s=!0):(x=this.items[p],p>r&&(this.items.splice(r,p-r),s=!0)),t&&x.diagnostic==t.diagnostic?x.dom.hasAttribute("aria-selected")||(x.dom.setAttribute("aria-selected","true"),i=x):x.dom.hasAttribute("aria-selected")&&x.dom.removeAttribute("aria-selected"),r++}});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)s=!0,this.items.pop();this.items.length==0&&(this.items.push(new I7(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),s=!0),i?(this.list.setAttribute("aria-activedescendant",i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:c,panel:u})=>{let h=u.height/this.list.offsetHeight;c.top<u.top?this.list.scrollTop-=(u.top-c.top)/h:c.bottom>u.bottom&&(this.list.scrollTop+=(c.bottom-u.bottom)/h)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function t(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)t();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(ni),r=vd(t.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:A_.of(r)})}static open(e){return new Rf(e)}}function GZ(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(n)}</svg>')`}function Sp(n){return GZ(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${n}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const XZ=Fe.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Sp("#d11")},".cm-lintRange-warning":{backgroundImage:Sp("orange")},".cm-lintRange-info":{backgroundImage:Sp("#999")},".cm-lintRange-hint":{backgroundImage:Sp("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function YZ(n){return n=="error"?4:n=="warning"?3:n=="info"?2:1}function KZ(n){let e="hint",t=1;for(let r of n){let s=YZ(r.severity);s>t&&(t=s,e=r.severity)}return e}const ZZ=[ni,Fe.decorations.compute([ni],n=>{let{selected:e,panel:t}=n.field(ni);return!e||!t||e.from==e.to?Je.none:Je.set([qZ.range(e.from,e.to)])}),DG(QZ,{hideOn:IZ}),XZ];var F7=function(e){e===void 0&&(e={});var{crosshairCursor:t=!1}=e,r=[];e.closeBracketsKeymap!==!1&&(r=r.concat(AZ)),e.defaultKeymap!==!1&&(r=r.concat(fK)),e.searchKeymap!==!1&&(r=r.concat(IK)),e.historyKeymap!==!1&&(r=r.concat(bY)),e.foldKeymap!==!1&&(r=r.concat(AX)),e.completionKeymap!==!1&&(r=r.concat(T_)),e.lintKeymap!==!1&&(r=r.concat(VZ));var s=[];return e.lineNumbers!==!1&&s.push(HG()),e.highlightActiveLineGutter!==!1&&s.push(WG()),e.highlightSpecialChars!==!1&&s.push(oG()),e.history!==!1&&s.push(dY()),e.foldGutter!==!1&&s.push(RX()),e.drawSelection!==!1&&s.push(KW()),e.dropCursor!==!1&&s.push(nG()),e.allowMultipleSelections!==!1&&s.push(Vt.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&s.push(wX()),e.syntaxHighlighting!==!1&&s.push(yE(BX,{fallback:!0})),e.bracketMatching!==!1&&s.push(UX()),e.closeBrackets!==!1&&s.push(NZ()),e.autocompletion!==!1&&s.push(LZ()),e.rectangularSelection!==!1&&s.push(SG()),t!==!1&&s.push(jG()),e.highlightActiveLine!==!1&&s.push(mG()),e.highlightSelectionMatches!==!1&&s.push(bK()),e.tabSize&&typeof e.tabSize=="number"&&s.push(d0.of(" ".repeat(e.tabSize))),s.concat([c0.of(r.flat())]).filter(Boolean)};const JZ="#e5c07b",q7="#e06c75",eJ="#56b6c2",tJ="#ffffff",ig="#abb2bf",u4="#7d8799",nJ="#61afef",rJ="#98c379",Q7="#d19a66",sJ="#c678dd",iJ="#21252b",$7="#2c313a",H7="#282c34",tb="#353a42",aJ="#3E4451",U7="#528bff",lJ=Fe.theme({"&":{color:ig,backgroundColor:H7},".cm-content":{caretColor:U7},".cm-cursor, .cm-dropCursor":{borderLeftColor:U7},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:aJ},".cm-panels":{backgroundColor:iJ,color:ig},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:H7,color:u4,border:"none"},".cm-activeLineGutter":{backgroundColor:$7},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:tb},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:tb,borderBottomColor:tb},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:$7,color:ig}}},{dark:!0}),oJ=f0.define([{tag:he.keyword,color:sJ},{tag:[he.name,he.deleted,he.character,he.propertyName,he.macroName],color:q7},{tag:[he.function(he.variableName),he.labelName],color:nJ},{tag:[he.color,he.constant(he.name),he.standard(he.name)],color:Q7},{tag:[he.definition(he.name),he.separator],color:ig},{tag:[he.typeName,he.className,he.number,he.changed,he.annotation,he.modifier,he.self,he.namespace],color:JZ},{tag:[he.operator,he.operatorKeyword,he.url,he.escape,he.regexp,he.link,he.special(he.string)],color:eJ},{tag:[he.meta,he.comment],color:u4},{tag:he.strong,fontWeight:"bold"},{tag:he.emphasis,fontStyle:"italic"},{tag:he.strikethrough,textDecoration:"line-through"},{tag:he.link,color:u4,textDecoration:"underline"},{tag:he.heading,fontWeight:"bold",color:q7},{tag:[he.atom,he.bool,he.special(he.variableName)],color:Q7},{tag:[he.processingInstruction,he.string,he.inserted],color:rJ},{tag:he.invalid,color:tJ}]),D_=[lJ,yE(oJ)];var cJ=Fe.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),uJ=function(e){e===void 0&&(e={});var{indentWithTab:t=!0,editable:r=!0,readOnly:s=!1,theme:i="light",placeholder:l="",basicSetup:c=!0}=e,u=[];switch(t&&u.unshift(c0.of([mK])),c&&(typeof c=="boolean"?u.unshift(F7()):u.unshift(F7(c))),l&&u.unshift(vG(l)),i){case"light":u.push(cJ);break;case"dark":u.push(D_);break;case"none":break;default:u.push(i);break}return r===!1&&u.push(Fe.editable.of(!1)),s&&u.push(Vt.readOnly.of(!0)),[...u]},dJ=n=>({line:n.state.doc.lineAt(n.state.selection.main.from),lineCount:n.state.doc.lines,lineBreak:n.state.lineBreak,length:n.state.doc.length,readOnly:n.state.readOnly,tabSize:n.state.tabSize,selection:n.state.selection,selectionAsSingle:n.state.selection.asSingle().main,ranges:n.state.selection.ranges,selectionCode:n.state.sliceDoc(n.state.selection.main.from,n.state.selection.main.to),selections:n.state.selection.ranges.map(e=>n.state.sliceDoc(e.from,e.to)),selectedText:n.state.selection.ranges.some(e=>!e.empty)});class hJ{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(t=>{try{t()}catch(r){console.error("TimeoutLatch callback error:",r)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class V7{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var nb=null,fJ=()=>typeof window>"u"?new V7:(nb||(nb=new V7),nb),W7=Sa.define(),mJ=200,pJ=[];function gJ(n){var{value:e,selection:t,onChange:r,onStatistics:s,onCreateEditor:i,onUpdate:l,extensions:c=pJ,autoFocus:u,theme:h="light",height:m=null,minHeight:p=null,maxHeight:x=null,width:v=null,minWidth:b=null,maxWidth:O=null,placeholder:k="",editable:j=!0,readOnly:T=!1,indentWithTab:M=!0,basicSetup:_=!0,root:D,initialState:E}=n,[z,Q]=S.useState(),[q,B]=S.useState(),[U,V]=S.useState(),ce=S.useState(()=>({current:null}))[0],W=S.useState(()=>({current:null}))[0],J=Fe.theme({"&":{height:m,minHeight:p,maxHeight:x,width:v,minWidth:b,maxWidth:O},"& .cm-scroller":{height:"100% !important"}}),H=Fe.updateListener.of(ue=>{if(ue.docChanged&&typeof r=="function"&&!ue.transactions.some(Y=>Y.annotation(W7))){ce.current?ce.current.reset():(ce.current=new hJ(()=>{if(W.current){var Y=W.current;W.current=null,Y()}ce.current=null},mJ),fJ().add(ce.current));var R=ue.state.doc,me=R.toString();r(me,ue)}s&&s(dJ(ue))}),ae=uJ({theme:h,editable:j,readOnly:T,placeholder:k,indentWithTab:M,basicSetup:_}),ne=[H,J,...ae];return l&&typeof l=="function"&&ne.push(Fe.updateListener.of(l)),ne=ne.concat(c),S.useLayoutEffect(()=>{if(z&&!U){var ue={doc:e,selection:t,extensions:ne},R=E?Vt.fromJSON(E.json,ue,E.fields):Vt.create(ue);if(V(R),!q){var me=new Fe({state:R,parent:z,root:D});B(me),i&&i(me,R)}}return()=>{q&&(V(void 0),B(void 0))}},[z,U]),S.useEffect(()=>{n.container&&Q(n.container)},[n.container]),S.useEffect(()=>()=>{q&&(q.destroy(),B(void 0)),ce.current&&(ce.current.cancel(),ce.current=null)},[q]),S.useEffect(()=>{u&&q&&q.focus()},[u,q]),S.useEffect(()=>{q&&q.dispatch({effects:xt.reconfigure.of(ne)})},[h,c,m,p,x,v,b,O,k,j,T,M,_,r,l]),S.useEffect(()=>{if(e!==void 0){var ue=q?q.state.doc.toString():"";if(q&&e!==ue){var R=ce.current&&!ce.current.isDone,me=()=>{q&&e!==q.state.doc.toString()&&q.dispatch({changes:{from:0,to:q.state.doc.toString().length,insert:e||""},annotations:[W7.of(!0)]})};R?W.current=me:me()}}},[e,q]),{state:U,setState:V,view:q,setView:B,container:z,setContainer:Q}}var xJ=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],R_=S.forwardRef((n,e)=>{var{className:t,value:r="",selection:s,extensions:i=[],onChange:l,onStatistics:c,onCreateEditor:u,onUpdate:h,autoFocus:m,theme:p="light",height:x,minHeight:v,maxHeight:b,width:O,minWidth:k,maxWidth:j,basicSetup:T,placeholder:M,indentWithTab:_,editable:D,readOnly:E,root:z,initialState:Q}=n,q=JI(n,xJ),B=S.useRef(null),{state:U,view:V,container:ce,setContainer:W}=gJ({root:z,value:r,autoFocus:m,theme:p,height:x,minHeight:v,maxHeight:b,width:O,minWidth:k,maxWidth:j,basicSetup:T,placeholder:M,indentWithTab:_,editable:D,readOnly:E,selection:s,onChange:l,onStatistics:c,onCreateEditor:u,onUpdate:h,extensions:i,initialState:Q});S.useImperativeHandle(e,()=>({editor:B.current,state:U,view:V}),[B,ce,U,V]);var J=S.useCallback(ae=>{B.current=ae,W(ae)},[W]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var H=typeof p=="string"?"cm-theme-"+p:"cm-theme";return a.jsx("div",eF({ref:J,className:""+H+(t?" "+t:"")},q))});R_.displayName="CodeMirror";var G7={};class $g{constructor(e,t,r,s,i,l,c,u,h,m=0,p){this.p=e,this.stack=t,this.state=r,this.reducePos=s,this.pos=i,this.score=l,this.buffer=c,this.bufferBase=u,this.curContext=h,this.lookAhead=m,this.parent=p}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,r=0){let s=e.parser.context;return new $g(e,[],t,r,r,0,[],0,s?new X7(s,s.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let r=e>>19,s=e&65535,{parser:i}=this.p,l=this.reducePos<this.pos-25;l&&this.setLookAhead(this.pos);let c=i.dynamicPrecedence(s);if(c&&(this.score+=c),r==0){this.pushState(i.getGoto(this.state,s,!0),this.reducePos),s<i.minRepeatTerm&&this.storeNode(s,this.reducePos,this.reducePos,l?8:4,!0),this.reduceContext(s,this.reducePos);return}let u=this.stack.length-(r-1)*3-(e&262144?6:0),h=u?this.stack[u-2]:this.p.ranges[0].from,m=this.reducePos-h;m>=2e3&&!(!((t=this.p.parser.nodeSet.types[s])===null||t===void 0)&&t.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=m):this.p.lastBigReductionSize<m&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=h,this.p.lastBigReductionSize=m));let p=u?this.stack[u-1]:0,x=this.bufferBase+this.buffer.length-p;if(s<i.minRepeatTerm||e&131072){let v=i.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(s,h,v,x+4,!0)}if(e&262144)this.state=this.stack[u];else{let v=this.stack[u-3];this.state=i.getGoto(v,s,!0)}for(;this.stack.length>u;)this.stack.pop();this.reduceContext(s,h)}storeNode(e,t,r,s=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let l=this,c=this.buffer.length;if(c==0&&l.parent&&(c=l.bufferBase-l.parent.bufferBase,l=l.parent),c>0&&l.buffer[c-4]==0&&l.buffer[c-1]>-1){if(t==r)return;if(l.buffer[c-2]>=t){l.buffer[c-2]=r;return}}}if(!i||this.pos==r)this.buffer.push(e,t,r,s);else{let l=this.buffer.length;if(l>0&&(this.buffer[l-4]!=0||this.buffer[l-1]<0)){let c=!1;for(let u=l;u>0&&this.buffer[u-2]>r;u-=4)if(this.buffer[u-1]>=0){c=!0;break}if(c)for(;l>0&&this.buffer[l-2]>r;)this.buffer[l]=this.buffer[l-4],this.buffer[l+1]=this.buffer[l-3],this.buffer[l+2]=this.buffer[l-2],this.buffer[l+3]=this.buffer[l-1],l-=4,s>4&&(s-=4)}this.buffer[l]=e,this.buffer[l+1]=t,this.buffer[l+2]=r,this.buffer[l+3]=s}}shift(e,t,r,s){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let i=e,{parser:l}=this.p;(s>this.pos||t<=l.maxNode)&&(this.pos=s,l.stateFlag(i,1)||(this.reducePos=s)),this.pushState(i,r),this.shiftContext(t,r),t<=l.maxNode&&this.buffer.push(t,r,s,4)}else this.pos=s,this.shiftContext(t,r),t<=this.p.parser.maxNode&&this.buffer.push(t,r,s,4)}apply(e,t,r,s){e&65536?this.reduce(e):this.shift(e,t,r,s)}useNode(e,t){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let s=this.pos;this.reducePos=this.pos=s+e.length,this.pushState(t,s),this.buffer.push(r,s,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let r=e.buffer.slice(t),s=e.bufferBase+t;for(;e&&s==e.bufferBase;)e=e.parent;return new $g(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,s,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,r?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new vJ(this);;){let r=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(r==0)return!1;if((r&65536)==0)return!0;t.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let s=[];for(let i=0,l;i<t.length;i+=2)(l=t[i+1])!=this.state&&this.p.parser.hasAction(l,e)&&s.push(t[i],l);if(this.stack.length<120)for(let i=0;s.length<8&&i<t.length;i+=2){let l=t[i+1];s.some((c,u)=>u&1&&c==l)||s.push(t[i],l)}t=s}let r=[];for(let s=0;s<t.length&&r.length<4;s+=2){let i=t[s+1];if(i==this.state)continue;let l=this.split();l.pushState(i,this.pos),l.storeNode(0,l.pos,l.pos,4,!0),l.shiftContext(t[s],this.pos),l.reducePos=this.pos,l.score-=200,r.push(l)}return r}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((t&65536)==0)return!1;if(!e.validAction(this.state,t)){let r=t>>19,s=t&65535,i=this.stack.length-r*3;if(i<0||e.getGoto(this.stack[i],s,!1)<0){let l=this.findForcedReduction();if(l==null)return!1;t=l}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],r=(s,i)=>{if(!t.includes(s))return t.push(s),e.allActions(s,l=>{if(!(l&393216))if(l&65536){let c=(l>>19)-i;if(c>1){let u=l&65535,h=this.stack.length-c*3;if(h>=0&&e.getGoto(this.stack[h],u,!1)>=0)return c<<19|65536|u}}else{let c=r(l,i+1);if(c!=null)return c}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new X7(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class X7{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class vJ{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let s=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=s}}class Hg{constructor(e,t,r){this.stack=e,this.pos=t,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Hg(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Hg(this.stack,this.pos,this.index)}}function Op(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let r=0,s=0;r<n.length;){let i=0;for(;;){let l=n.charCodeAt(r++),c=!1;if(l==126){i=65535;break}l>=92&&l--,l>=34&&l--;let u=l-32;if(u>=46&&(u-=46,c=!0),i+=u,c)break;i*=46}t?t[s++]=i:t=new e(i)}return t}class ag{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Y7=new ag;class yJ{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Y7,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let r=this.range,s=this.rangeIndex,i=this.pos+e;for(;i<r.from;){if(!s)return null;let l=this.ranges[--s];i-=r.from-l.to,r=l}for(;t<0?i>r.to:i>=r.to;){if(s==this.ranges.length-1)return null;let l=this.ranges[++s];i+=l.from-r.to,r=l}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,r,s;if(t>=0&&t<this.chunk.length)r=this.pos+e,s=this.chunk.charCodeAt(t);else{let i=this.resolveOffset(e,1);if(i==null)return-1;if(r=i,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)s=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let l=this.rangeIndex,c=this.range;for(;c.to<=r;)c=this.ranges[++l];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>c.to&&(this.chunk2=this.chunk2.slice(0,c.to-r)),s=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),s}acceptToken(e,t=0){let r=t?this.resolveOffset(t,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Y7,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let r="";for(let s of this.ranges){if(s.from>=t)break;s.to>e&&(r+=this.input.read(Math.max(s.from,e),Math.min(s.to,t)))}return r}}class Ju{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:r}=t.p;bJ(this.data,e,t,this.id,r.data,r.tokenPrecTable)}}Ju.prototype.contextual=Ju.prototype.fallback=Ju.prototype.extend=!1;Ju.prototype.fallback=Ju.prototype.extend=!1;class zx{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function bJ(n,e,t,r,s,i){let l=0,c=1<<r,{dialect:u}=t.p.parser;e:for(;(c&n[l])!=0;){let h=n[l+1];for(let v=l+3;v<h;v+=2)if((n[v+1]&c)>0){let b=n[v];if(u.allows(b)&&(e.token.value==-1||e.token.value==b||wJ(b,e.token.value,s,i))){e.acceptToken(b);break}}let m=e.next,p=0,x=n[l+2];if(e.next<0&&x>p&&n[h+x*3-3]==65535){l=n[h+x*3-1];continue e}for(;p<x;){let v=p+x>>1,b=h+v+(v<<1),O=n[b],k=n[b+1]||65536;if(m<O)x=v;else if(m>=k)p=v+1;else{l=n[b+2],e.advance();continue e}}break}}function K7(n,e,t){for(let r=e,s;(s=n[r])!=65535;r++)if(s==t)return r-e;return-1}function wJ(n,e,t,r){let s=K7(t,r,e);return s<0||K7(t,r,n)<s}const Ys=typeof process<"u"&&G7&&/\bparse\b/.test(G7.LOG);let rb=null;function Z7(n,e,t){let r=n.cursor(kr.IncludeAnonymous);for(r.moveTo(e);;)if(!(t<0?r.childBefore(e):r.childAfter(e)))for(;;){if((t<0?r.to<e:r.from>e)&&!r.type.isError)return t<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(n.length,Math.max(r.from+1,e+25));if(t<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return t<0?0:n.length}}class SJ{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Z7(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Z7(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let r=this.trees[t],s=this.index[t];if(s==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=r.children[s],l=this.start[t]+r.positions[s];if(l>e)return this.nextStart=l,null;if(i instanceof _n){if(l==e){if(l<this.safeFrom)return null;let c=l+i.length;if(c<=this.safeTo){let u=i.prop(Et.lookAhead);if(!u||c+u<this.fragment.to)return i}}this.index[t]++,l+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(l),this.index.push(0))}else this.index[t]++,this.nextStart=l+i.length}}}class OJ{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new ag)}getActions(e){let t=0,r=null,{parser:s}=e.p,{tokenizers:i}=s,l=s.stateSlot(e.state,3),c=e.curContext?e.curContext.hash:0,u=0;for(let h=0;h<i.length;h++){if((1<<h&l)==0)continue;let m=i[h],p=this.tokens[h];if(!(r&&!m.fallback)&&((m.contextual||p.start!=e.pos||p.mask!=l||p.context!=c)&&(this.updateCachedToken(p,m,e),p.mask=l,p.context=c),p.lookAhead>p.end+25&&(u=Math.max(p.lookAhead,u)),p.value!=0)){let x=t;if(p.extended>-1&&(t=this.addActions(e,p.extended,p.end,t)),t=this.addActions(e,p.value,p.end,t),!m.extend&&(r=p,t>x))break}}for(;this.actions.length>t;)this.actions.pop();return u&&e.setLookAhead(u),!r&&e.pos==this.stream.end&&(r=new ag,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,t=this.addActions(e,r.value,r.end,t)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new ag,{pos:r,p:s}=e;return t.start=r,t.end=Math.min(r+1,s.stream.end),t.value=r==s.stream.end?s.parser.eofTerm:0,t}updateCachedToken(e,t,r){let s=this.stream.clipPos(r.pos);if(t.token(this.stream.reset(s,e),r),e.value>-1){let{parser:i}=r.p;for(let l=0;l<i.specialized.length;l++)if(i.specialized[l]==e.value){let c=i.specializers[l](this.stream.read(e.start,e.end),r);if(c>=0&&r.p.parser.dialect.allows(c>>1)){(c&1)==0?e.value=c>>1:e.extended=c>>1;break}}}else e.value=0,e.end=this.stream.clipPos(s+1)}putAction(e,t,r,s){for(let i=0;i<s;i+=3)if(this.actions[i]==e)return s;return this.actions[s++]=e,this.actions[s++]=t,this.actions[s++]=r,s}addActions(e,t,r,s){let{state:i}=e,{parser:l}=e.p,{data:c}=l;for(let u=0;u<2;u++)for(let h=l.stateSlot(i,u?2:1);;h+=3){if(c[h]==65535)if(c[h+1]==1)h=nl(c,h+2);else{s==0&&c[h+1]==2&&(s=this.putAction(nl(c,h+2),t,r,s));break}c[h]==t&&(s=this.putAction(nl(c,h+1),t,r,s))}return s}}class kJ{constructor(e,t,r,s){this.parser=e,this.input=t,this.ranges=s,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new yJ(t,s),this.tokens=new OJ(e,this.stream),this.topTerm=e.top[1];let{from:i}=s[0];this.stacks=[$g.start(this,e.top[0],i)],this.fragments=r.length&&this.stream.end-i>e.bufferLength*4?new SJ(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,r=this.stacks=[],s,i;if(this.bigReductionCount>300&&e.length==1){let[l]=e;for(;l.forceReduce()&&l.stack.length&&l.stack[l.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let l=0;l<e.length;l++){let c=e[l];for(;;){if(this.tokens.mainToken=null,c.pos>t)r.push(c);else{if(this.advanceStack(c,r,e))continue;{s||(s=[],i=[]),s.push(c);let u=this.tokens.getMainToken(c);i.push(u.value,u.end)}}break}}if(!r.length){let l=s&&CJ(s);if(l)return Ys&&console.log("Finish with "+this.stackID(l)),this.stackToTree(l);if(this.parser.strict)throw Ys&&s&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&s){let l=this.stoppedAt!=null&&s[0].pos>this.stoppedAt?s[0]:this.runRecovery(s,i,r);if(l)return Ys&&console.log("Force-finish "+this.stackID(l)),this.stackToTree(l.forceAll())}if(this.recovering){let l=this.recovering==1?1:this.recovering*3;if(r.length>l)for(r.sort((c,u)=>u.score-c.score);r.length>l;)r.pop();r.some(c=>c.reducePos>t)&&this.recovering--}else if(r.length>1){e:for(let l=0;l<r.length-1;l++){let c=r[l];for(let u=l+1;u<r.length;u++){let h=r[u];if(c.sameState(h)||c.buffer.length>500&&h.buffer.length>500)if((c.score-h.score||c.buffer.length-h.buffer.length)>0)r.splice(u--,1);else{r.splice(l--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let l=1;l<r.length;l++)r[l].pos<this.minStackPos&&(this.minStackPos=r[l].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,r){let s=e.pos,{parser:i}=this,l=Ys?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&s>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,m=h?e.curContext.hash:0;for(let p=this.fragments.nodeAt(s);p;){let x=this.parser.nodeSet.types[p.type.id]==p.type?i.getGoto(e.state,p.type.id):-1;if(x>-1&&p.length&&(!h||(p.prop(Et.contextHash)||0)==m))return e.useNode(p,x),Ys&&console.log(l+this.stackID(e)+` (via reuse of ${i.getName(p.type.id)})`),!0;if(!(p instanceof _n)||p.children.length==0||p.positions[0]>0)break;let v=p.children[0];if(v instanceof _n&&p.positions[0]==0)p=v;else break}}let c=i.stateSlot(e.state,4);if(c>0)return e.reduce(c),Ys&&console.log(l+this.stackID(e)+` (via always-reduce ${i.getName(c&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let u=this.tokens.getActions(e);for(let h=0;h<u.length;){let m=u[h++],p=u[h++],x=u[h++],v=h==u.length||!r,b=v?e:e.split(),O=this.tokens.mainToken;if(b.apply(m,p,O?O.start:b.pos,x),Ys&&console.log(l+this.stackID(b)+` (via ${(m&65536)==0?"shift":`reduce of ${i.getName(m&65535)}`} for ${i.getName(p)} @ ${s}${b==e?"":", split"})`),v)return!0;b.pos>s?t.push(b):r.push(b)}return!1}advanceFully(e,t){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return J7(e,t),!0}}runRecovery(e,t,r){let s=null,i=!1;for(let l=0;l<e.length;l++){let c=e[l],u=t[l<<1],h=t[(l<<1)+1],m=Ys?this.stackID(c)+" -> ":"";if(c.deadEnd&&(i||(i=!0,c.restart(),Ys&&console.log(m+this.stackID(c)+" (restarted)"),this.advanceFully(c,r))))continue;let p=c.split(),x=m;for(let v=0;v<10&&p.forceReduce()&&(Ys&&console.log(x+this.stackID(p)+" (via force-reduce)"),!this.advanceFully(p,r));v++)Ys&&(x=this.stackID(p)+" -> ");for(let v of c.recoverByInsert(u))Ys&&console.log(m+this.stackID(v)+" (via recover-insert)"),this.advanceFully(v,r);this.stream.end>c.pos?(h==c.pos&&(h++,u=0),c.recoverByDelete(u,h),Ys&&console.log(m+this.stackID(c)+` (via recover-delete ${this.parser.getName(u)})`),J7(c,r)):(!s||s.score<c.score)&&(s=c)}return s}stackToTree(e){return e.close(),_n.build({buffer:Hg.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(rb||(rb=new WeakMap)).get(e);return t||rb.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function J7(n,e){for(let t=0;t<e.length;t++){let r=e[t];if(r.pos==n.pos&&r.sameState(n)){e[t].score<n.score&&(e[t]=n);return}}e.push(n)}class jJ{constructor(e,t,r){this.source=e,this.flags=t,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}const sb=n=>n;class NJ{constructor(e){this.start=e.start,this.shift=e.shift||sb,this.reduce=e.reduce||sb,this.reuse=e.reuse||sb,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class zf extends Iw{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let c=0;c<e.repeatNodeCount;c++)t.push("");let r=Object.keys(e.topRules).map(c=>e.topRules[c][1]),s=[];for(let c=0;c<t.length;c++)s.push([]);function i(c,u,h){s[c].push([u,u.deserialize(String(h))])}if(e.nodeProps)for(let c of e.nodeProps){let u=c[0];typeof u=="string"&&(u=Et[u]);for(let h=1;h<c.length;){let m=c[h++];if(m>=0)i(m,u,c[h++]);else{let p=c[h+-m];for(let x=-m;x>0;x--)i(c[h++],u,p);h++}}}this.nodeSet=new Nx(t.map((c,u)=>gs.define({name:u>=this.minRepeatTerm?void 0:c,id:u,props:s[u],top:r.indexOf(u)>-1,error:u==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(u)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=JA;let l=Op(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let c=0;c<this.specializerSpecs.length;c++)this.specialized[c]=this.specializerSpecs[c].term;this.specializers=this.specializerSpecs.map(e8),this.states=Op(e.states,Uint32Array),this.data=Op(e.stateData),this.goto=Op(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(c=>typeof c=="number"?new Ju(l,c):c),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,r){let s=new kJ(this,e,t,r);for(let i of this.wrappers)s=i(s,e,t,r);return s}getGoto(e,t,r=!1){let s=this.goto;if(t>=s[0])return-1;for(let i=s[t+1];;){let l=s[i++],c=l&1,u=s[i++];if(c&&r)return u;for(let h=i+(l>>1);i<h;i++)if(s[i]==e)return u;if(c)return-1}}hasAction(e,t){let r=this.data;for(let s=0;s<2;s++)for(let i=this.stateSlot(e,s?2:1),l;;i+=3){if((l=r[i])==65535)if(r[i+1]==1)l=r[i=nl(r,i+2)];else{if(r[i+1]==2)return nl(r,i+2);break}if(l==t||l==0)return nl(r,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,r=>r==t?!0:null)}allActions(e,t){let r=this.stateSlot(e,4),s=r?t(r):void 0;for(let i=this.stateSlot(e,1);s==null;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=nl(this.data,i+2);else break;s=t(nl(this.data,i+1))}return s}nextStates(e){let t=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=nl(this.data,r+2);else break;if((this.data[r+2]&1)==0){let s=this.data[r+1];t.some((i,l)=>l&1&&i==s)||t.push(this.data[r],s)}}return t}configure(e){let t=Object.assign(Object.create(zf.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=r}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(r=>{let s=e.tokenizers.find(i=>i.from==r);return s?s.to:r})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((r,s)=>{let i=e.specializers.find(c=>c.from==r.external);if(!i)return r;let l=Object.assign(Object.assign({},r),{external:i.to});return t.specializers[s]=e8(l),l})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),r=t.map(()=>!1);if(e)for(let i of e.split(" ")){let l=t.indexOf(i);l>=0&&(r[l]=!0)}let s=null;for(let i=0;i<t.length;i++)if(!r[i])for(let l=this.dialects[t[i]],c;(c=this.data[l++])!=65535;)(s||(s=new Uint8Array(this.maxTerm+1)))[c]=1;return new jJ(e,r,s)}static deserialize(e){return new zf(e)}}function nl(n,e){return n[e]|n[e+1]<<16}function CJ(n){let e=null;for(let t of n){let r=t.p.stoppedAt;(t.pos==t.p.stream.end||r!=null&&t.pos>r)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function e8(n){if(n.external){let e=n.extend?1:0;return(t,r)=>n.external(t,r)<<1|e}return n.get}const TJ=1,z_=194,P_=195,MJ=196,t8=197,AJ=198,EJ=199,_J=200,DJ=2,L_=3,n8=201,RJ=24,zJ=25,PJ=49,LJ=50,BJ=55,IJ=56,FJ=57,qJ=59,QJ=60,$J=61,HJ=62,UJ=63,VJ=65,WJ=238,GJ=71,XJ=241,YJ=242,KJ=243,ZJ=244,JJ=245,eee=246,tee=247,nee=248,B_=72,ree=249,see=250,iee=251,aee=252,lee=253,oee=254,cee=255,uee=256,dee=73,hee=77,fee=263,mee=112,pee=130,gee=151,xee=152,vee=155,jc=10,Pf=13,o5=32,Px=9,c5=35,yee=40,bee=46,d4=123,r8=125,I_=39,F_=34,s8=92,wee=111,See=120,Oee=78,kee=117,jee=85,Nee=new Set([zJ,PJ,LJ,fee,VJ,pee,IJ,FJ,WJ,HJ,UJ,B_,dee,hee,QJ,$J,gee,xee,vee,mee]);function ib(n){return n==jc||n==Pf}function ab(n){return n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102}const Cee=new zx((n,e)=>{let t;if(n.next<0)n.acceptToken(EJ);else if(e.context.flags&lg)ib(n.next)&&n.acceptToken(AJ,1);else if(((t=n.peek(-1))<0||ib(t))&&e.canShift(t8)){let r=0;for(;n.next==o5||n.next==Px;)n.advance(),r++;(n.next==jc||n.next==Pf||n.next==c5)&&n.acceptToken(t8,-r)}else ib(n.next)&&n.acceptToken(MJ,1)},{contextual:!0}),Tee=new zx((n,e)=>{let t=e.context;if(t.flags)return;let r=n.peek(-1);if(r==jc||r==Pf){let s=0,i=0;for(;;){if(n.next==o5)s++;else if(n.next==Px)s+=8-s%8;else break;n.advance(),i++}s!=t.indent&&n.next!=jc&&n.next!=Pf&&n.next!=c5&&(s<t.indent?n.acceptToken(P_,-i):n.acceptToken(z_))}}),lg=1,q_=2,Za=4,Ja=8,el=16,tl=32;function og(n,e,t){this.parent=n,this.indent=e,this.flags=t,this.hash=(n?n.hash+n.hash<<8:0)+e+(e<<4)+t+(t<<6)}const Mee=new og(null,0,0);function Aee(n){let e=0;for(let t=0;t<n.length;t++)e+=n.charCodeAt(t)==Px?8-e%8:1;return e}const i8=new Map([[XJ,0],[YJ,Za],[KJ,Ja],[ZJ,Ja|Za],[JJ,el],[eee,el|Za],[tee,el|Ja],[nee,el|Ja|Za],[ree,tl],[see,tl|Za],[iee,tl|Ja],[aee,tl|Ja|Za],[lee,tl|el],[oee,tl|el|Za],[cee,tl|el|Ja],[uee,tl|el|Ja|Za]].map(([n,e])=>[n,e|q_])),Eee=new NJ({start:Mee,reduce(n,e,t,r){return n.flags&lg&&Nee.has(e)||(e==GJ||e==B_)&&n.flags&q_?n.parent:n},shift(n,e,t,r){return e==z_?new og(n,Aee(r.read(r.pos,t.pos)),0):e==P_?n.parent:e==RJ||e==BJ||e==qJ||e==L_?new og(n,0,lg):i8.has(e)?new og(n,0,i8.get(e)|n.flags&lg):n},hash(n){return n.hash}}),_ee=new zx(n=>{for(let e=0;e<5;e++){if(n.next!="print".charCodeAt(e))return;n.advance()}if(!/\w/.test(String.fromCharCode(n.next)))for(let e=0;;e++){let t=n.peek(e);if(!(t==o5||t==Px)){t!=yee&&t!=bee&&t!=jc&&t!=Pf&&t!=c5&&n.acceptToken(TJ);return}}}),Dee=new zx((n,e)=>{let{flags:t}=e.context,r=t&Za?F_:I_,s=(t&Ja)>0,i=!(t&el),l=(t&tl)>0,c=n.pos;for(;!(n.next<0);)if(l&&n.next==d4)if(n.peek(1)==d4)n.advance(2);else{if(n.pos==c){n.acceptToken(L_,1);return}break}else if(i&&n.next==s8){if(n.pos==c){n.advance();let u=n.next;u>=0&&(n.advance(),Ree(n,u)),n.acceptToken(DJ);return}break}else if(n.next==s8&&!i&&n.peek(1)>-1)n.advance(2);else if(n.next==r&&(!s||n.peek(1)==r&&n.peek(2)==r)){if(n.pos==c){n.acceptToken(n8,s?3:1);return}break}else if(n.next==jc){if(s)n.advance();else if(n.pos==c){n.acceptToken(n8);return}break}else n.advance();n.pos>c&&n.acceptToken(_J)});function Ree(n,e){if(e==wee)for(let t=0;t<2&&n.next>=48&&n.next<=55;t++)n.advance();else if(e==See)for(let t=0;t<2&&ab(n.next);t++)n.advance();else if(e==kee)for(let t=0;t<4&&ab(n.next);t++)n.advance();else if(e==jee)for(let t=0;t<8&&ab(n.next);t++)n.advance();else if(e==Oee&&n.next==d4){for(n.advance();n.next>=0&&n.next!=r8&&n.next!=I_&&n.next!=F_&&n.next!=jc;)n.advance();n.next==r8&&n.advance()}}const zee=Fw({'async "*" "**" FormatConversion FormatSpec':he.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":he.controlKeyword,"in not and or is del":he.operatorKeyword,"from def class global nonlocal lambda":he.definitionKeyword,import:he.moduleKeyword,"with as print":he.keyword,Boolean:he.bool,None:he.null,VariableName:he.variableName,"CallExpression/VariableName":he.function(he.variableName),"FunctionDefinition/VariableName":he.function(he.definition(he.variableName)),"ClassDefinition/VariableName":he.definition(he.className),PropertyName:he.propertyName,"CallExpression/MemberExpression/PropertyName":he.function(he.propertyName),Comment:he.lineComment,Number:he.number,String:he.string,FormatString:he.special(he.string),Escape:he.escape,UpdateOp:he.updateOperator,"ArithOp!":he.arithmeticOperator,BitOp:he.bitwiseOperator,CompareOp:he.compareOperator,AssignOp:he.definitionOperator,Ellipsis:he.punctuation,At:he.meta,"( )":he.paren,"[ ]":he.squareBracket,"{ }":he.brace,".":he.derefOperator,", ;":he.separator}),Pee={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},Lee=zf.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:lQdO,59aO'vQdO,59aO:zQdO,59aOOQS,59y,59yO;PQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;_QdO,5:QO;dQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;uQdO,5:UO;zQdO,5:WOOOW'#Fy'#FyO<POWO,5:aOOQS,5:a,5:aO<[QdO'#HwOOOW'#Dw'#DwOOOW'#Fz'#FzO<lOWO,5:bOOQS,5:b,5:bOOQS'#F}'#F}O<zQtO,5:iO?lQtO,5=`O@VQ#xO,5=`O@vQtO,5=`OOQS,5:},5:}OA_QeO'#GWOBqQdO,5;^OOQV,5=^,5=^OB|QtO'#IPOCkQdO,5;tOOQS-E:[-E:[OOQV,5;s,5;sO4dQdO'#FQOOQV-E9o-E9oOCsQtO,59]OEzQtO,59iOFeQdO'#HVOFpQdO'#HVO1XQdO'#HVOF{QdO'#DTOGTQdO,59mOGYQdO'#HZO'vQdO'#HZO0rQdO,5=tOOQS,5=t,5=tO0rQdO'#EROOQS'#ES'#ESOGwQdO'#GPOHXQdO,58|OHXQdO,58|O*xQdO,5:oOHgQtO'#H]OOQS,5:r,5:rOOQS,5:z,5:zOHzQdO,5;OOI]QdO'#IOO1XQdO'#H}OOQS,5;Q,5;QOOQS'#GT'#GTOIqQtO,5;QOJPQdO,5;QOJUQdO'#IQOOQS,5;T,5;TOJdQdO'#H|OOQS,5;W,5;WOJuQdO,5;YO4iQdO,5;`O4iQdO,5;cOJ}QtO'#ITO'vQdO'#ITOKXQdO,5;eO4VQdO,5;eO0rQdO,5;jO1XQdO,5;lOK^QeO'#EuOLjQgO,5;fO!!kQdO'#IUO4iQdO,5;jO!!vQdO,5;lO!#OQdO,5;qO!#ZQtO,5;vO'vQdO,5;vPOOO,5=[,5=[P!#bOSO,5=[P!#jOdO,5=[O!&bQtO1G.jO!&iQtO1G.jO!)YQtO1G.jO!)dQtO1G.jO!+}QtO1G.jO!,bQtO1G.jO!,uQdO'#HcO!-TQtO'#GuO0rQdO'#HcO!-_QdO'#HbOOQS,5:Z,5:ZO!-gQdO,5:ZO!-lQdO'#HeO!-wQdO'#HeO!.[QdO,5>OOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/[QtO1G.|O!/cQtO1G.|O1lQdO1G.|O!0OQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!0VQdO1G/eO!0gQdO1G/eO!0oQdO1G/fO'vQdO'#H[O!0tQdO'#H[O!0yQtO1G.{O!1ZQdO,59iO!2aQdO,5=zO!2qQdO,5=zO!2yQdO1G/mO!3OQtO1G/mOOQS1G/l1G/lO!3`QdO,5=uO!4VQdO,5=uO0rQdO1G/qO!4tQdO1G/sO!4yQtO1G/sO!5ZQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5kQdO'#HxO0rQdO'#HxO!5|QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6[Q#xO1G2zO!6{QtO1G2zO'vQdO,5<jOOQS,5<j,5<jOOQS-E9|-E9|OOQS,5<r,5<rOOQS-E:U-E:UOOQV1G0x1G0xO1XQdO'#GRO!7dQtO,5>kOOQS1G1`1G1`O!8RQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!8WQdO'#FrO!8cQdO,59oO!8kQdO1G/XO!8uQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9fQdO'#GtOOQS,5<k,5<kOOQS-E9}-E9}O!9wQdO1G.hOOQS1G0Z1G0ZO!:VQdO,5=wO!:gQdO,5=wO0rQdO1G0jO0rQdO1G0jO!:xQdO,5>jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!<RQdO,5>lO!<aQdO,5>lO!<oQdO,5>hO!=VQdO,5>hO!=hQdO'#EpO0rQdO1G0tO!=sQdO1G0tO!=xQgO1G0zO!AvQgO1G0}O!EqQdO,5>oO!E{QdO,5>oO!FTQtO,5>oO0rQdO1G1PO!F_QdO1G1PO4iQdO1G1UO!!vQdO1G1WOOQV,5;a,5;aO!FdQfO,5;aO!FiQgO1G1QO!JjQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JzQdO,5>pO!KXQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KaQdO'#FSO!KrQ!fO1G1WO!KzQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!LPQdO1G1]O!LXQdO'#F^OOQV1G1b1G1bO!#ZQtO1G1bPOOO1G2v1G2vP!L^OSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LfQdO,5=|O!LyQdO,5=|OOQS1G/u1G/uO!MRQdO,5>PO!McQdO,5>PO!MkQdO,5>PO!NOQdO,5>PO!N`QdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8kQdO7+$pO#!RQdO1G.|O#!YQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!aQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!qQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!vQdO7+%PO##OQdO7+%QO##TQdO1G3fOOQS7+%X7+%XO##eQdO1G3fO##mQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##rQdO1G3aOOQS-E9q-E9qO#$iQdO7+%]OOQS7+%_7+%_O#$wQdO1G3aO#%fQdO7+%_O#%kQdO1G3gO#%{QdO1G3gO#&TQdO7+%]O#&YQdO,5>dO#&sQdO,5>dO#&sQdO,5>dOOQS'#Dx'#DxO#'UO&jO'#DzO#'aO`O'#HyOOOW1G3}1G3}O#'fQdO1G3}O#'nQdO1G3}O#'yQ#xO7+(fO#(jQtO1G2UP#)TQdO'#GOOOQS,5<m,5<mOOQS-E:P-E:POOQS7+&z7+&zOOQS1G3]1G3]OOQS,5<^,5<^OOQS-E9p-E9pOOQS7+$s7+$sO#)bQdO,5=`O#){QdO,5=`O#*^QtO,5<aO#*qQdO1G3cOOQS-E9s-E9sOOQS7+&U7+&UO#+RQdO7+&UO#+aQdO,5<nO#+uQdO1G4UOOQS-E:Q-E:QO#,WQdO1G4UOOQS1G4T1G4TOOQS7+&W7+&WO#,iQdO7+&WOOQS,5<p,5<pO#,tQdO1G4WOOQS-E:S-E:SOOQS,5<l,5<lO#-SQdO1G4SOOQS-E:O-E:OO1XQdO'#EqO#-jQdO'#EqO#-uQdO'#IRO#-}QdO,5;[OOQS7+&`7+&`O0rQdO7+&`O#.SQgO7+&fO!JmQdO'#GXO4iQdO7+&fO4iQdO7+&iO#2QQtO,5<tO'vQdO,5<tO#2[QdO1G4ZOOQS-E:W-E:WO#2fQdO1G4ZO4iQdO7+&kO0rQdO7+&kOOQV7+&p7+&pO!KrQ!fO7+&rO!KzQdO7+&rO`QeO1G0{OOQV-E:X-E:XO4iQdO7+&lO4iQdO7+&lOOQV,5<u,5<uO#2nQdO,5<uO!JmQdO,5<uOOQV7+&l7+&lO#2yQgO7+&lO#6tQdO,5<vO#7PQdO1G4[OOQS-E:Y-E:YO#7^QdO1G4[O#7fQdO'#IWO#7tQdO'#IWO1XQdO'#IWOOQS'#IW'#IWO#8PQdO'#IVOOQS,5;n,5;nO#8XQdO,5;nO0rQdO'#FUOOQV7+&r7+&rO4iQdO7+&rOOQV7+&w7+&wO4iQdO7+&wO#8^QfO,5;xOOQV7+&|7+&|POOO7+(b7+(bO#8cQdO1G3iOOQS,5<c,5<cO#8qQdO1G3hOOQS-E9u-E9uO#9UQdO,5<dO#9aQdO,5<dO#9tQdO1G3kOOQS-E9v-E9vO#:UQdO1G3kO#:^QdO1G3kO#:nQdO1G3kO#:UQdO1G3kOOQS<<H[<<H[O#:yQtO1G1zOOQS<<Hk<<HkP#;WQdO'#FtO8vQdO1G3bO#;eQdO1G3bO#;jQdO<<HkOOQS<<Hl<<HlO#;zQdO7+)QOOQS<<Hs<<HsO#<[QtO1G1yP#<{QdO'#FsO#=YQdO7+)RO#=jQdO7+)RO#=rQdO<<HwO#=wQdO7+({OOQS<<Hy<<HyO#>nQdO,5<bO'vQdO,5<bOOQS-E9t-E9tOOQS<<Hw<<HwOOQS,5<g,5<gO0rQdO,5<gO#>sQdO1G4OOOQS-E9y-E9yO#?^QdO1G4OO<[QdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?oO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?zQdO7+)iO#@SQdO1G2zO#@mQdO1G2zP'vQdO'#FuO0rQdO<<IpO1XQdO1G2YP1XQdO'#GSO#AOQdO7+)pO#AaQdO7+)pOOQS<<Ir<<IrP1XQdO'#GUP0rQdO'#GQOOQS,5;],5;]O#ArQdO,5>mO#BQQdO,5>mOOQS1G0v1G0vOOQS<<Iz<<IzOOQV-E:V-E:VO4iQdO<<JQOOQV,5<s,5<sO4iQdO,5<sOOQV<<JQ<<JQOOQV<<JT<<JTO#BYQtO1G2`P#BdQdO'#GYO#BkQdO7+)uO#BuQgO<<JVO4iQdO<<JVOOQV<<J^<<J^O4iQdO<<J^O!KrQ!fO<<J^O#FpQgO7+&gOOQV<<JW<<JWO#FzQgO<<JWOOQV1G2a1G2aO1XQdO1G2aO#JuQdO1G2aO4iQdO<<JWO1XQdO1G2bP0rQdO'#G[O#KQQdO7+)vO#K_QdO7+)vOOQS'#FT'#FTO0rQdO,5>rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<<Jc<<JcO#LhQdO1G1dOOQS7+)T7+)TP#LmQdO'#FwO#L}QdO1G2OO#MbQdO1G2OO#MrQdO1G2OP#M}QdO'#FxO#N[QdO7+)VO#NlQdO7+)VO#NlQdO7+)VO#NtQdO7+)VO$ UQdO7+(|O8vQdO7+(|OOQSAN>VAN>VO$ oQdO<<LmOOQSAN>cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<<MT<<MTO$#nQdO7+(fOOQSAN?[AN?[OOQS7+'t7+'tO$$XQdO<<M[OOQS,5<q,5<qO$$jQdO1G4XOOQS-E:T-E:TOOQVAN?lAN?lOOQV1G2_1G2_O4iQdOAN?qO$$xQgOAN?qOOQVAN?xAN?xO4iQdOAN?xOOQV<<JR<<JRO4iQdOAN?rO4iQdO7+'{OOQV7+'{7+'{O1XQdO7+'{OOQVAN?rAN?rOOQS7+'|7+'|O$(sQdO<<MbOOQS1G4^1G4^O0rQdO1G4^OOQS,5<w,5<wO$)QQdO1G4]OOQS-E:Z-E:ZOOQU'#G_'#G_O$)cQfO7+'OO$)nQdO'#F_O$*uQdO7+'jO$+VQdO7+'jOOQS7+'j7+'jO$+bQdO<<LqO$+rQdO<<LqO$+rQdO<<LqO$+zQdO'#H^OOQS<<Lh<<LhO$,UQdO<<LhOOQS7+'h7+'hOOQS'#D|'#D|OOOO1G4R1G4RO$,oQdO1G4RO$,wQdO1G4RP!=hQdO'#GVOOQVG25]G25]O4iQdOG25]OOQVG25dG25dOOQVG25^G25^OOQV<<Kg<<KgO4iQdO<<KgOOQS7+)x7+)xP$-SQdO'#G]OOQU-E:]-E:]OOQV<<Jj<<JjO$-vQtO'#FaOOQS'#Fc'#FcO$.WQdO'#FbO$.xQdO'#FbOOQS'#Fb'#FbO$.}QdO'#IYO$)nQdO'#FiO$)nQdO'#FiO$/fQdO'#FjO$)nQdO'#FkO$/mQdO'#IZOOQS'#IZ'#IZO$0[QdO,5;yOOQS<<KU<<KUO$0dQdO<<KUO$0tQdOANB]O$1UQdOANB]O$1^QdO'#H_OOQS'#H_'#H_O1sQdO'#DcO$1wQdO,5=xOOQSANBSANBSOOOO7+)m7+)mO$2`QdO7+)mOOQVLD*wLD*wOOQVANARANARO5uQ!fO'#GaO$2hQtO,5<SO$)nQdO'#FmOOQS,5<W,5<WOOQS'#Fd'#FdO$3YQdO,5;|O$3_QdO,5;|OOQS'#Fg'#FgO$)nQdO'#G`O$4PQdO,5<QO$4kQdO,5>tO$4{QdO,5>tO1XQdO,5<PO$5^QdO,5<TO$5cQdO,5<TO$)nQdO'#I[O$5hQdO'#I[O$5mQdO,5<UOOQS,5<V,5<VO0rQdO'#FpOOQU1G1e1G1eO4iQdO1G1eOOQSAN@pAN@pO$5rQdOG27wO$6SQdO,59}OOQS1G3d1G3dOOOO<<MX<<MXOOQS,5<{,5<{OOQS-E:_-E:_O$6XQtO'#FaO$6`QdO'#I]O$6nQdO'#I]O$6vQdO,5<XOOQS1G1h1G1hO$6{QdO1G1hO$7QQdO,5<zOOQS-E:^-E:^O$7lQdO,5=OO$8TQdO1G4`OOQS-E:b-E:bOOQS1G1k1G1kOOQS1G1o1G1oO$8eQdO,5>vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5<YO$8sQdO,5>wO$8zQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)nQdO'#GdO$9SQdO1G4bO$9^QdO1G4bO$9fQdO1G4bOOQS7+%T7+%TO$9tQdO1G1tO$:SQtO'#FaO$:ZQdO,5<}OOQS,5<},5<}O$:iQdO1G4cOOQS-E:a-E:aO$)nQdO,5<|O$:pQdO,5<|O$:uQdO7+)|OOQS-E:`-E:`O$;PQdO7+)|O$)nQdO,5<ZP$)nQdO'#GcO$;XQdO1G2hO$)nQdO1G2hP$;gQdO'#GbO$;nQdO<<MhO$;xQdO1G1uO$<WQdO7+(SO8vQdO'#C}O8vQdO,59bO8vQdO,59bO8vQdO,59bO$<fQtO,5=`O8vQdO1G.|O0rQdO1G/XO0rQdO7+$pP$<yQdO'#GOO'vQdO'#GtO$=WQdO,59bO$=]QdO,59bO$=dQdO,59mO$=iQdO1G/UO1sQdO'#DRO8vQdO,59j",stateData:"$>S~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%_$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PEcO%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO%_'hO~OS'iO%['hO%_'hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#uO%kWi~P!#uOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&pO%mWi%nWi~P!&pOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)nOVWi_Wi%qWi%rWi%sWi~P!)nO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.aOlji~P!.aOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/jOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PEcOV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO%_*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!NkOlji~P!NkOV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~O{#{Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/jOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/jO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$-bO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)zOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/jOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)nOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$-bOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)nOz/zO#[/OO%j.yO!['Oa~Og'Pa~P$)nOz0SOg'Pa~Oa0UO!['Oi~P$)zOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$-bO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)nO{0^O~Oa0UO!['Oq~P$)zOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)zOa0UO!['Oy~P$)zO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/jO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=j'QPPPPPP'RP'Z*s+[+t,_,y-fP.SP'Z.r.r'ZPPP'Z2[PPPPPP2[5PPP5PP7b7k=sPP=v>h>kPP'Z'ZPP>zPP'Z'ZPP'Z'Z'Z'Z'Z?O?w'ZP?zP@QDXGuGyPG|HWH['ZPPPH_Hk'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHqH}IVPI^IdPI^PI^I^PPPI^PKrPK{LVL]KrPI^LfPI^PLmLsPLwM]MzNeLwLwNkNxLwLwLwLw! ^! d! g! l! o! y!!P!!]!!o!!u!#P!#V!#s!#y!$P!$Z!$a!$g!$y!%T!%Z!%a!%k!%q!%w!%}!&T!&Z!&e!&k!&u!&{!'U!'[!'k!'s!'}!(UPPPPPPPPPPP!([!(_!(e!(n!(x!)TPPPPPPPPPPPP!-u!/Z!3^!6oPP!6w!7W!7a!8Y!8P!8c!8i!8l!8o!8r!8z!9jPPPPPPPPPPPPPPPPP!9m!9q!9wP!:]!:a!:m!:v!;S!;j!;m!;p!;v!;|!<S!<VP!<_!<h!=d!=g]eOn#g$j)t,P'}`OTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!i!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'm'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0r{!cQ#c#p$R$d$p%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g}!dQ#c#p$R$d$p$u%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g!P!eQ#c#p$R$d$p$u$v%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g!R!fQ#c#p$R$d$p$u$v$w%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g!T!gQ#c#p$R$d$p$u$v$w$x%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g!V!hQ#c#p$R$d$p$u$v$w$x$y%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g!Z!hQ!n#c#p$R$d$p$u$v$w$x$y$z%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g'}TOTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!i!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'm'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0r&eVOYZ[dnprxy}!P!Q!U!i!k!o!p!q!s!t#[#d#g#y#{#}$Q$h$j$}%S%Z%^%`%g%l%n%w%|&Z&_&j&k&u&x'P'W'Z'l'm'p'r's'w(O(W(^(d(g(p(r(z)^)e)g)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+U+V+Y+a+d+k,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0n0r%oXOYZ[dnrxy}!P!Q!U!i!k#[#d#g#y#{#}$Q$h$j$}%S%^%`%g%l%n%w%|&Z&_&j&k&u&x'P'W'Z'l'm'p'r's'w(O(W(^(d(g(p(r(z)^)e)g)p)t)z*O*Y*d*g*h*k*q*t*v*y*z*}+U+V+Y+a+d+k,P,X,Y,],g,h,i,k,l,o,s,u,w,y,z-O-d-f-m-p.f.g/V/Z0i0j0kQ#vqQ/[.kR0o0q't`OTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0rh#jhz{$W$Z&l&q)S)X+f+g-RW#rq&].k0qQ$]|Q$a!OQ$n!VQ$o!WW$|!i'm*d,gS&[#s#tQ'S$iQ(s&UQ)U&nU)Y&s)Z+jW)a&w+m-T-{Q*Q']W*R'_,`-h.TQ+l)`S,_*S*TQ-Q+eQ-_,TQ-c,WQ.R-al.W-l.^._.a.z.|/R/j/o/t/y0U0Z0^Q/S.`Q/a.tQ/l/OU0P/u0S0[X0V/z0W0_0`R&Z#r!_!wYZ!P!Q!k%S%`%g'p'r's(O(W)g*g*h*k*q*t*v,h,i,k,l,o-m-p.f.g/ZR%^!vQ!{YQ%x#[Q&d#}Q&g$QR,{+YT.j-s/s!Y!jQ!n#c#p$R$d$p$u$v$w$x$y$z%e%j%p%q&`'O'g(q(|)j*o*x+w,v0gQ&X#kQ'c$oR*^'dR'l$|Q%V!mR/_.r'|_OTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!i!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'm'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0rS#a_#b!P.[-l.^._.`.a.t.z.|/R/j/o/t/u/y/z0S0U0W0Z0[0^0_0`'|_OTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!i!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'm'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0rT#a_#bT#^^#_R(o%xa(l%x(n(o+`,{-y-z.oT+[(k+]R-z,{Q$PsQ+l)aQ,^*RR-e,_X#}s$O$P&fQ&y$aQ'a$nQ'd$oR)s'SQ)b&wV-S+m-T-{ZgOn$j)t,PXkOn)t,PQ$k!TQ&z$bQ&{$cQ'^$mQ'b$oQ)q'RQ)x'WQ){'XQ)|'YQ*Z'`S*]'c'dQ+s)gQ+u)hQ+v)iQ+z)oS+|)r*[Q,Q)vQ,R)wS,S)y)zQ,d*^Q-V+rQ-W+tQ-Y+{S-Z+},OQ-`,UQ-b,VQ-|-XQ.O-[Q.P-^Q.Q-_Q.p-}Q.q.RQ/W.dR/r/XWkOn)t,PR#mjQ'`$nS)r'S'aR,O)sQ,]*RR-f,^Q*['`Q+})rR-[,OZiOjn)t,PQ'f$pR*`'gT-j,e-ku.c-l.^._.a.t.z.|/R/j/o/t/u/y0S0U0Z0[0^t.c-l.^._.a.t.z.|/R/j/o/t/u/y0S0U0Z0[0^Q/S.`X0V/z0W0_0`!P.Z-l.^._.`.a.t.z.|/R/j/o/t/u/y/z0S0U0W0Z0[0^0_0`Q.w.YR/f.xg.z.].{/b/i/n/|0O0Q0]0a0bu.b-l.^._.a.t.z.|/R/j/o/t/u/y0S0U0Z0[0^X.u.W.b/a0PR/c.tV0R/u0S0[R/X.dQnOS#on,PR,P)tQ&^#uR(x&^S%m#R#wS(_%m(bT(b%p&`Q%a!yQ%h!}W(P%a%h(U(YQ(U%eR(Y%jQ&i$RR)O&iQ(e%qQ*{(`T+R(e*{Q'n%OR*e'nS'q%R%SY*i'q*j,m-q.hU*j'r's'tU,m*k*l*mS-q,n,oR.h-rQ#Y]R%t#YQ#_^R%y#_Q(h%vS+W(h+XR+X(iQ+](kR,|+]Q#b_R%{#bQ#ebQ%}#cW&Q#e%}({+bQ({&cR+b0gQ$OsS&e$O&fR&f$PQ&v$_R)_&vQ&V#jR(t&VQ&m$VS)T&m+hR+h)UQ$Z{R&p$ZQ&t$]R)[&tQ+n)bR-U+nQ#hfR&S#hQ)f&zR+q)fQ&}$dS)m&})nR)n'OQ'V$kR)u'VQ'[$lS*P'[,ZR,Z*QQ,a*VR-i,aWjOn)t,PR#ljQ-k,eR.U-kd.{.]/b/i/n/|0O0Q0]0a0bR/h.{U.s.W/a0PR/`.sQ/{/nS0X/{0YR0Y/|S/v/b/cR0T/vQ.}.]R/k.}R!ZPXmOn)t,PWlOn)t,PR'T$jYfOn$j)t,PR&R#g[sOn#g$j)t,PR&d#}&dQOYZ[dnprxy}!P!Q!U!i!k!o!p!q!s!t#[#d#g#y#{#}$Q$h$j$}%S%Z%^%`%g%l%n%w%|&Z&_&j&k&u&x'P'W'Z'l'm'p'r's'w(O(W(^(d(g(p(r(z)^)e)g)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+U+V+Y+a+d+k,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0n0rQ!nTQ#caQ#poU$Rt%c(SS$d!R$gQ$p!XQ$u!cQ$v!dQ$w!eQ$x!fQ$y!gQ$z!hQ%e!zQ%j#OQ%p#SQ%q#TQ&`#xQ'O$eQ'g$qQ(q&OU(|&h(}+cW)j&|)l+x+yQ*o'|Q*x(]Q+w)kQ,v+QR0g0lQ!yYQ!}ZQ$b!PQ$c!QQ%R!kQ't%S^'{%`%g(O(W*q*t*v^*f'p*h,k,l-p.g/ZQ*l'rQ*m'sQ+t)gQ,j*gQ,n*kQ-n,hQ-o,iQ-r,oQ.e-mR/Y.f[bOn#g$j)t,P!^!vYZ!P!Q!k%S%`%g'p'r's(O(W)g*g*h*k*q*t*v,h,i,k,l,o-m-p.f.g/ZQ#R[Q#fdS#wrxQ$UyW$_}$Q'P)pS$l!U$hW${!i'm*d,gS%v#[+Y`&P#d%|(p(r(z+a-O0kQ&a#yQ&b#{Q&c#}Q'j$}Q'z%^W([%l(^*y*}Q(`%nQ(i%wQ(v&ZS(y&_0iQ)P&jQ)Q&kU)]&u)^+kQ)d&xQ)y'WY)}'Z*O,X,Y-dQ*b'lS*n'w0jW+P(d*z,s,wW+T(g+V,y,zQ+p)eQ,U)zQ,c*YQ,x+UQ-P+dQ-e,]Q-v,uQ.S-fR/q/VhUOn#d#g$j%|&_'w(p(r)t,P%U!uYZ[drxy}!P!Q!U!i!k#[#y#{#}$Q$h$}%S%^%`%g%l%n%w&Z&j&k&u&x'P'W'Z'l'm'p'r's(O(W(^(d(g(z)^)e)g)p)z*O*Y*d*g*h*k*q*t*v*y*z*}+U+V+Y+a+d+k,X,Y,],g,h,i,k,l,o,s,u,w,y,z-O-d-f-m-p.f.g/V/Z0i0j0kQ#qpW%W!o!s0d0nQ%X!pQ%Y!qQ%[!tQ%f0cS'v%Z0hQ'x0eQ'y0fQ,p*rQ-u,qS.i-s/sR0p0rU#uq.k0qR(w&][cOn#g$j)t,PZ!xY#[#}$Q+YQ#W[Q#zrR$TxQ%b!yQ%i!}Q%o#RQ'j${Q(V%eQ(Z%jQ(c%pQ(f%qQ*|(`Q,f*bQ-t,pQ.m-uR/].lQ$StQ(R%cR*s(SQ.l-sR/}/sR#QZR#V[R%Q!iQ%O!iV*c'm*d,g!Z!lQ!n#c#p$R$d$p$u$v$w$x$y$z%e%j%p%q&`'O'g(q(|)j*o*x+w,v0gR%T!kT#]^#_Q%x#[R,{+YQ(m%xS+_(n(oQ,}+`Q-x,{S.n-y-zR/^.oT+Z(k+]Q$`}Q&g$QQ)o'PR+{)pQ$XzQ)W&qR+i)XQ$XzQ&o$WQ)W&qR+i)XQ#khW$Vz$W&q)XQ$[{Q&r$ZZ)R&l)S+f+g-RR$^|R)c&wXlOn)t,PQ$f!RR'Q$gQ$m!UR'R$hR*X'_Q*V'_V-g,`-h.TQ.d-lQ/P.^R/Q._U.]-l.^._Q/U.aQ/b.tQ/g.zU/i.|/j/yQ/n/RQ/|/oQ0O/tU0Q/u0S0[Q0]0UQ0a0ZR0b0^R/T.`R/d.t",nodeNames:"⚠ print Escape { Comment Script AssignStatement * BinaryExpression BitOp BitOp BitOp BitOp ArithOp ArithOp @ ArithOp ** UnaryExpression ArithOp BitOp AwaitExpression await ) ( ParenthesizedExpression BinaryExpression or and CompareOp in not is UnaryExpression ConditionalExpression if else LambdaExpression lambda ParamList VariableName AssignOp , : NamedExpression AssignOp YieldExpression yield from TupleExpression ComprehensionExpression async for LambdaExpression ] [ ArrayExpression ArrayComprehensionExpression } { DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression CallExpression ArgList AssignOp MemberExpression . PropertyName Number String FormatString FormatReplacement FormatSelfDoc FormatConversion FormatSpec FormatReplacement FormatSelfDoc ContinuedString Ellipsis None Boolean TypeDef AssignOp UpdateStatement UpdateOp ExpressionStatement DeleteStatement del PassStatement pass BreakStatement break ContinueStatement continue ReturnStatement return YieldStatement PrintStatement RaiseStatement raise ImportStatement import as ScopeStatement global nonlocal AssertStatement assert TypeDefinition type TypeParamList TypeParam StatementGroup ; IfStatement Body elif WhileStatement while ForStatement TryStatement try except finally WithStatement with FunctionDefinition def ParamList AssignOp TypeDef ClassDefinition class DecoratedStatement Decorator At MatchStatement match MatchBody MatchClause case CapturePattern LiteralPattern ArithOp ArithOp AsPattern OrPattern LogicOp AttributePattern SequencePattern MappingPattern StarPattern ClassPattern PatternArgList KeywordPattern KeywordPattern Guard",maxTerm:277,context:Eee,nodeProps:[["isolate",-5,4,71,72,73,77,""],["group",-15,6,85,87,88,90,92,94,96,98,99,100,102,105,108,110,"Statement Statement",-22,8,18,21,25,40,49,50,56,57,60,61,62,63,64,67,70,71,72,79,80,81,82,"Expression",-10,114,116,119,121,122,126,128,133,135,138,"Statement",-9,143,144,147,148,150,151,152,153,154,"Pattern"],["openedBy",23,"(",54,"[",58,"{"],["closedBy",24,")",55,"]",59,"}"]],propSources:[zee],skippedNodes:[0,4],repeatNodeCount:34,tokenData:"!2|~R!`OX%TXY%oY[%T[]%o]p%Tpq%oqr'ars)Yst*xtu%Tuv,dvw-hwx.Uxy/tyz0[z{0r{|2S|}2p}!O3W!O!P4_!P!Q:Z!Q!R;k!R![>_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[_ee,Tee,Cee,Dee,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:n=>Pee[n]||-1}],tokenPrec:7668}),a8=new eX,Q_=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function kp(n){return(e,t,r)=>{if(r)return!1;let s=e.node.getChild("VariableName");return s&&t(s,n),!0}}const Bee={FunctionDefinition:kp("function"),ClassDefinition:kp("class"),ForStatement(n,e,t){if(t){for(let r=n.node.firstChild;r;r=r.nextSibling)if(r.name=="VariableName")e(r,"variable");else if(r.name=="in")break}},ImportStatement(n,e){var t,r;let{node:s}=n,i=((t=s.firstChild)===null||t===void 0?void 0:t.name)=="from";for(let l=s.getChild("import");l;l=l.nextSibling)l.name=="VariableName"&&((r=l.nextSibling)===null||r===void 0?void 0:r.name)!="as"&&e(l,i?"variable":"namespace")},AssignStatement(n,e){for(let t=n.node.firstChild;t;t=t.nextSibling)if(t.name=="VariableName")e(t,"variable");else if(t.name==":"||t.name=="AssignOp")break},ParamList(n,e){for(let t=null,r=n.node.firstChild;r;r=r.nextSibling)r.name=="VariableName"&&(!t||!/\*|AssignOp/.test(t.name))&&e(r,"variable"),t=r},CapturePattern:kp("variable"),AsPattern:kp("variable"),__proto__:null};function $_(n,e){let t=a8.get(e);if(t)return t;let r=[],s=!0;function i(l,c){let u=n.sliceString(l.from,l.to);r.push({label:u,type:c})}return e.cursor(kr.IncludeAnonymous).iterate(l=>{if(l.name){let c=Bee[l.name];if(c&&c(l,i,s)||!s&&Q_.has(l.name))return!1;s=!1}else if(l.to-l.from>8192){for(let c of $_(n,l.node))r.push(c);return!1}}),a8.set(e,r),r}const l8=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,H_=["String","FormatString","Comment","PropertyName"];function Iee(n){let e=zr(n.state).resolveInner(n.pos,-1);if(H_.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&l8.test(n.state.sliceDoc(e.from,e.to));if(!t&&!n.explicit)return null;let r=[];for(let s=e;s;s=s.parent)Q_.has(s.name)&&(r=r.concat($_(n.state.doc,s)));return{options:r,from:t?e.from:n.pos,validFor:l8}}const Fee=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(n=>({label:n,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(n=>({label:n,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(n=>({label:n,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(n=>({label:n,type:"function"}))),qee=[Xa("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),Xa("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),Xa("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),Xa("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),Xa(`if \${}:
|
||
|
||
`,{label:"if",detail:"block",type:"keyword"}),Xa("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),Xa("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),Xa("import ${module}",{label:"import",detail:"statement",type:"keyword"}),Xa("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],Qee=HK(H_,v_(Fee.concat(qee)));function lb(n){let{node:e,pos:t}=n,r=n.lineIndent(t,-1),s=null;for(;;){let i=e.childBefore(t);if(i)if(i.name=="Comment")t=i.from;else if(i.name=="Body"||i.name=="MatchBody")n.baseIndentFor(i)+n.unit<=r&&(s=i),e=i;else if(i.name=="MatchClause")e=i;else if(i.type.is("Statement"))e=i;else break;else break}return s}function ob(n,e){let t=n.baseIndentFor(e),r=n.lineAt(n.pos,-1),s=r.from+r.text.length;return/^\s*($|#)/.test(r.text)&&n.node.to<s+100&&!/\S/.test(n.state.sliceDoc(s,n.node.to))&&n.lineIndent(n.pos,-1)<=t||/^\s*(else:|elif |except |finally:|case\s+[^=:]+:)/.test(n.textAfter)&&n.lineIndent(n.pos,-1)>t?null:t+n.unit}const cb=Nf.define({name:"python",parser:Lee.configure({props:[Tx.add({Body:n=>{var e;let t=/^\s*(#|$)/.test(n.textAfter)&&lb(n)||n.node;return(e=ob(n,t))!==null&&e!==void 0?e:n.continue()},MatchBody:n=>{var e;let t=lb(n);return(e=ob(n,t||n.node))!==null&&e!==void 0?e:n.continue()},IfStatement:n=>/^\s*(else:|elif )/.test(n.textAfter)?n.baseIndent:n.continue(),"ForStatement WhileStatement":n=>/^\s*else:/.test(n.textAfter)?n.baseIndent:n.continue(),TryStatement:n=>/^\s*(except[ :]|finally:|else:)/.test(n.textAfter)?n.baseIndent:n.continue(),MatchStatement:n=>/^\s*case /.test(n.textAfter)?n.baseIndent+n.unit:n.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":Uy({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":Uy({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":Uy({closing:"]"}),MemberExpression:n=>n.baseIndent+n.unit,"String FormatString":()=>null,Script:n=>{var e;let t=lb(n);return(e=t&&ob(n,t))!==null&&e!==void 0?e:n.continue()}}),$w.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":uE,Body:(n,e)=>({from:n.from+1,to:n.to-(n.to==e.doc.length?0:1)}),"String FormatString":(n,e)=>({from:e.doc.lineAt(n.from).to,to:n.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function $ee(){return new lE(cb,[cb.data.of({autocomplete:Iee}),cb.data.of({autocomplete:Qee})])}const Hee=Fw({String:he.string,Number:he.number,"True False":he.bool,PropertyName:he.propertyName,Null:he.null,", :":he.separator,"[ ]":he.squareBracket,"{ }":he.brace}),Uee=zf.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[Hee],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),Vee=()=>n=>{try{JSON.parse(n.state.doc.toString())}catch(e){if(!(e instanceof SyntaxError))throw e;const t=Wee(e,n.state.doc);return[{from:t,message:e.message,severity:"error",to:t}]}return[]};function Wee(n,e){let t;return(t=n.message.match(/at position (\d+)/))?Math.min(+t[1],e.length):(t=n.message.match(/at line (\d+) column (\d+)/))?Math.min(e.line(+t[1]).from+ +t[2]-1,e.length):0}const Gee=Nf.define({name:"json",parser:Uee.configure({props:[Tx.add({Object:o7({except:/^\s*\}/}),Array:o7({except:/^\s*\]/})}),$w.add({"Object Array":uE})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Xee(){return new lE(Gee)}const Yee={name:"toml",startState:function(){return{inString:!1,stringType:"",lhs:!0,inArray:0}},token:function(n,e){let t;if(!e.inString&&(t=n.match(/^('''|"""|'|")/))&&(e.stringType=t[0],e.inString=!0),n.sol()&&!e.inString&&e.inArray===0&&(e.lhs=!0),e.inString){for(;e.inString;)if(n.match(e.stringType))e.inString=!1;else if(n.peek()==="\\")n.next(),n.next();else{if(n.eol())break;n.match(/^.[^\\\"\']*/)}return e.lhs?"property":"string"}else{if(e.inArray&&n.peek()==="]")return n.next(),e.inArray--,"bracket";if(e.lhs&&n.peek()==="["&&n.skipTo("]"))return n.next(),n.peek()==="]"&&n.next(),"atom";if(n.peek()==="#")return n.skipToEnd(),"comment";if(n.eatSpace())return null;if(e.lhs&&n.eatWhile(function(r){return r!="="&&r!=" "}))return"property";if(e.lhs&&n.peek()==="=")return n.next(),e.lhs=!1,null;if(!e.lhs&&n.match(/^\d\d\d\d[\d\-\:\.T]*Z/))return"atom";if(!e.lhs&&(n.match("true")||n.match("false")))return"atom";if(!e.lhs&&n.peek()==="[")return e.inArray++,n.next(),"bracket";if(!e.lhs&&n.match(/^\-?\d+(?:\.\d+)?/))return"number";n.eatSpace()||n.next()}return null},languageData:{commentTokens:{line:"#"}}},Kee={python:[$ee()],json:[Xee(),Vee()],toml:[Hw.define(Yee)],text:[]};function Zee({value:n,onChange:e,language:t="text",readOnly:r=!1,height:s="400px",minHeight:i,maxHeight:l,placeholder:c,theme:u="dark",className:h=""}){const[m,p]=S.useState(!1);if(S.useEffect(()=>{p(!0)},[]),!m)return a.jsx("div",{className:`rounded-md border bg-muted animate-pulse ${h}`,style:{height:s,minHeight:i,maxHeight:l}});const x=[...Kee[t]||[],Fe.lineWrapping];return r&&x.push(Fe.editable.of(!1)),a.jsx("div",{className:`rounded-md overflow-hidden border ${h}`,children:a.jsx(R_,{value:n,height:s,minHeight:i,maxHeight:l,theme:u==="dark"?D_:void 0,extensions:x,onChange:e,placeholder:c,basicSetup:{lineNumbers:!0,highlightActiveLineGutter:!0,highlightSpecialChars:!0,history:!0,foldGutter:!0,drawSelection:!0,dropCursor:!0,allowMultipleSelections:!0,indentOnInput:!0,syntaxHighlighting:!0,bracketMatching:!0,closeBrackets:!0,autocompletion:!0,rectangularSelection:!0,crosshairCursor:!0,highlightActiveLine:!0,highlightSelectionMatches:!0,closeBracketsKeymap:!0,defaultKeymap:!0,searchKeymap:!0,historyKeymap:!0,foldKeymap:!0,completionKeymap:!0,lintKeymap:!0}})})}function Jee(){const[n,e]=S.useState(!0),[t,r]=S.useState(!1),[s,i]=S.useState(!1),[l,c]=S.useState(!1),[u,h]=S.useState(!1),[m,p]=S.useState(!1),[x,v]=S.useState("visual"),[b,O]=S.useState(""),[k,j]=S.useState(!1),{toast:T}=Pr(),[M,_]=S.useState(null),[D,E]=S.useState(null),[z,Q]=S.useState(null),[q,B]=S.useState(null),[U,V]=S.useState(null),[ce,W]=S.useState(null),[J,H]=S.useState(null),[ae,ne]=S.useState(null),[ue,R]=S.useState(null),[me,Y]=S.useState(null),[P,K]=S.useState(null),[$,fe]=S.useState(null),[ye,Re]=S.useState(null),[de,We]=S.useState(null),[ct,ke]=S.useState(null),[nt,ut]=S.useState(null),[Ct,Bn]=S.useState(null),[Tn,Jn]=S.useState(null),nn=S.useRef(null),_t=S.useRef(!0),Yr=S.useRef({}),In=S.useCallback(async()=>{try{const re=await qU();O(re),j(!1)}catch(re){T({variant:"destructive",title:"加载失败",description:re instanceof Error?re.message:"加载源代码失败"})}},[T]),or=S.useCallback(async()=>{try{e(!0);const re=await FU();Yr.current=re,_(re.bot),E(re.personality);const Me=re.chat;Me.talk_value_rules||(Me.talk_value_rules=[]),Q(Me),B(re.expression),V(re.emoji),W(re.memory),H(re.tool),ne(re.mood),R(re.voice),Y(re.lpmm_knowledge),K(re.keyword_reaction),fe(re.response_post_process),Re(re.chinese_typo),We(re.response_splitter),ke(re.log),ut(re.debug),Bn(re.maim_message),Jn(re.telemetry),c(!1),_t.current=!1,await In()}catch(re){console.error("加载配置失败:",re),T({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}finally{e(!1)}},[T,In]);S.useEffect(()=>{or()},[or]);const yn=S.useCallback(async(re,Me)=>{if(!_t.current)try{i(!0),await $U(re,Me),c(!1)}catch(pt){console.error(`自动保存 ${re} 失败:`,pt),c(!0)}finally{i(!1)}},[]),ft=S.useCallback((re,Me)=>{_t.current||(c(!0),nn.current&&clearTimeout(nn.current),nn.current=setTimeout(()=>{yn(re,Me)},2e3))},[yn]);S.useEffect(()=>{M&&!_t.current&&ft("bot",M)},[M,ft]),S.useEffect(()=>{D&&!_t.current&&ft("personality",D)},[D,ft]),S.useEffect(()=>{z&&!_t.current&&ft("chat",z)},[z,ft]),S.useEffect(()=>{q&&!_t.current&&ft("expression",q)},[q,ft]),S.useEffect(()=>{U&&!_t.current&&ft("emoji",U)},[U,ft]),S.useEffect(()=>{ce&&!_t.current&&ft("memory",ce)},[ce,ft]),S.useEffect(()=>{J&&!_t.current&&ft("tool",J)},[J,ft]),S.useEffect(()=>{ae&&!_t.current&&ft("mood",ae)},[ae,ft]),S.useEffect(()=>{ue&&!_t.current&&ft("voice",ue)},[ue,ft]),S.useEffect(()=>{me&&!_t.current&&ft("lpmm_knowledge",me)},[me,ft]),S.useEffect(()=>{P&&!_t.current&&ft("keyword_reaction",P)},[P,ft]),S.useEffect(()=>{$&&!_t.current&&ft("response_post_process",$)},[$,ft]),S.useEffect(()=>{ye&&!_t.current&&ft("chinese_typo",ye)},[ye,ft]),S.useEffect(()=>{de&&!_t.current&&ft("response_splitter",de)},[de,ft]),S.useEffect(()=>{ct&&!_t.current&&ft("log",ct)},[ct,ft]),S.useEffect(()=>{nt&&!_t.current&&ft("debug",nt)},[nt,ft]),S.useEffect(()=>{Ct&&!_t.current&&ft("maim_message",Ct)},[Ct,ft]),S.useEffect(()=>{Tn&&!_t.current&&ft("telemetry",Tn)},[Tn,ft]);const ee=async()=>{try{r(!0),await QU(b),c(!1),j(!1),T({title:"保存成功",description:"配置已保存"}),await or()}catch(re){j(!0),T({variant:"destructive",title:"保存失败",description:re instanceof Error?re.message:"保存配置失败"})}finally{r(!1)}},Se=async re=>{if(l){T({variant:"destructive",title:"切换失败",description:"请先保存当前更改"});return}v(re),re==="source"?await In():await or()},Le=async()=>{try{r(!0),nn.current&&clearTimeout(nn.current);const re={...Yr.current,bot:M,personality:D,chat:z,expression:q,emoji:U,memory:ce,tool:J,mood:ae,voice:ue,lpmm_knowledge:me,keyword_reaction:P,response_post_process:$,chinese_typo:ye,response_splitter:de,log:ct,debug:nt,maim_message:Ct,telemetry:Tn};await Kk(re),c(!1),T({title:"保存成功",description:"麦麦主程序配置已保存"})}catch(re){console.error("保存配置失败:",re),T({title:"保存失败",description:re.message,variant:"destructive"})}finally{r(!1)}},rt=async()=>{try{h(!0),yw().catch(()=>{}),p(!0)}catch(re){console.error("重启失败:",re),p(!1),T({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),h(!1)}},Tt=async()=>{try{r(!0),nn.current&&clearTimeout(nn.current);const re={...Yr.current,bot:M,personality:D,chat:z,expression:q,emoji:U,memory:ce,tool:J,mood:ae,voice:ue,lpmm_knowledge:me,keyword_reaction:P,response_post_process:$,chinese_typo:ye,response_splitter:de,log:ct,debug:nt,maim_message:Ct,telemetry:Tn};await Kk(re),c(!1),T({title:"保存成功",description:"配置已保存,即将重启麦麦..."}),await new Promise(Me=>setTimeout(Me,500)),await rt()}catch(re){console.error("保存失败:",re),T({title:"保存失败",description:re.message,variant:"destructive"})}finally{r(!1)}},cr=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},Kr=()=>{p(!1),h(!1),T({title:"重启失败",description:"服务器未能在预期时间内恢复,请手动检查",variant:"destructive"})};return n?a.jsx(fn,{className:"h-full",children:a.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):a.jsx(fn,{className:"h-full",children:a.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦主程序配置"}),a.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的核心功能和行为设置"})]}),a.jsxs("div",{className:"flex gap-2 w-full sm:w-auto items-center",children:[a.jsx(dl,{value:x,onValueChange:re=>Se(re),className:"w-auto",children:a.jsxs(va,{className:"h-9",children:[a.jsxs($t,{value:"visual",className:"text-xs sm:text-sm px-2 sm:px-3",children:[a.jsx(CF,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"可视化"]}),a.jsxs($t,{value:"source",className:"text-xs sm:text-sm px-2 sm:px-3",children:[a.jsx(TF,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"源代码"]})]})}),a.jsxs(ie,{onClick:x==="visual"?Le:ee,disabled:t||s||!l||u,size:"sm",variant:"outline",className:"flex-1 sm:flex-none",children:[a.jsx(ox,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),t?"保存中...":s?"自动保存中...":l?"保存配置":"已保存"]}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsxs(ie,{disabled:t||s||u,size:"sm",className:"flex-1 sm:flex-none",children:[a.jsx(ew,{className:"mr-2 h-4 w-4"}),u?"重启中...":l?"保存并重启":"重启麦麦"]})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认重启麦麦?"}),a.jsx(un,{children:l?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:l?Tt:rt,children:l?"保存并重启":"确认重启"})]})]})]})]})]}),a.jsxs(od,{children:[a.jsx(oo,{className:"h-4 w-4"}),a.jsxs(cd,{children:["配置更新后需要",a.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),x==="source"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs(od,{children:[a.jsx(oo,{className:"h-4 w-4"}),a.jsxs(cd,{children:[a.jsx("strong",{children:"源代码模式(高级功能):"}),"直接编辑 TOML 配置文件。此功能仅适用于熟悉 TOML 语法的高级用户。保存时会在后端验证格式,只有格式完全正确才能保存。",k&&a.jsx("span",{className:"text-destructive font-semibold ml-2",children:"⚠️ 上次保存失败,请检查 TOML 格式"})]})]}),a.jsx(Zee,{value:b,onChange:re=>{O(re),c(!0),k&&j(!1)},language:"toml",theme:"dark",height:"calc(100vh - 280px)",minHeight:"500px",placeholder:"TOML 配置内容"})]}),x==="visual"&&a.jsx(a.Fragment,{children:a.jsxs(dl,{defaultValue:"bot",className:"w-full",children:[a.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:a.jsxs(va,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5 lg:grid-cols-10",children:[a.jsx($t,{value:"bot",className:"flex-shrink-0",children:"基本信息"}),a.jsx($t,{value:"personality",className:"flex-shrink-0",children:"人格"}),a.jsx($t,{value:"chat",className:"flex-shrink-0",children:"聊天"}),a.jsx($t,{value:"expression",className:"flex-shrink-0",children:"表达"}),a.jsx($t,{value:"features",className:"flex-shrink-0",children:"功能"}),a.jsx($t,{value:"processing",className:"flex-shrink-0",children:"处理"}),a.jsx($t,{value:"mood",className:"flex-shrink-0",children:"情绪"}),a.jsx($t,{value:"voice",className:"flex-shrink-0",children:"语音"}),a.jsx($t,{value:"lpmm",className:"flex-shrink-0",children:"知识库"}),a.jsx($t,{value:"other",className:"flex-shrink-0",children:"其他"})]})}),a.jsx(On,{value:"bot",className:"space-y-4",children:M&&a.jsx(ete,{config:M,onChange:_})}),a.jsx(On,{value:"personality",className:"space-y-4",children:D&&a.jsx(tte,{config:D,onChange:E})}),a.jsx(On,{value:"chat",className:"space-y-4",children:z&&a.jsx(nte,{config:z,onChange:Q})}),a.jsx(On,{value:"expression",className:"space-y-4",children:q&&a.jsx(rte,{config:q,onChange:B})}),a.jsx(On,{value:"features",className:"space-y-4",children:U&&ce&&J&&a.jsx(ste,{emojiConfig:U,memoryConfig:ce,toolConfig:J,onEmojiChange:V,onMemoryChange:W,onToolChange:H})}),a.jsx(On,{value:"processing",className:"space-y-4",children:P&&$&&ye&&de&&a.jsx(ite,{keywordReactionConfig:P,responsePostProcessConfig:$,chineseTypoConfig:ye,responseSplitterConfig:de,onKeywordReactionChange:K,onResponsePostProcessChange:fe,onChineseTypoChange:Re,onResponseSplitterChange:We})}),a.jsx(On,{value:"mood",className:"space-y-4",children:ae&&a.jsx(ate,{config:ae,onChange:ne})}),a.jsx(On,{value:"voice",className:"space-y-4",children:ue&&a.jsx(lte,{config:ue,onChange:R})}),a.jsx(On,{value:"lpmm",className:"space-y-4",children:me&&a.jsx(ote,{config:me,onChange:Y})}),a.jsxs(On,{value:"other",className:"space-y-4",children:[ct&&a.jsx(cte,{config:ct,onChange:ke}),nt&&a.jsx(ute,{config:nt,onChange:ut}),Ct&&a.jsx(dte,{config:Ct,onChange:Bn}),Tn&&a.jsx(hte,{config:Tn,onChange:Jn})]})]})}),m&&a.jsx(bw,{onRestartComplete:cr,onRestartFailed:Kr})]})})}function ete({config:n,onChange:e}){const t=()=>{e({...n,platforms:[...n.platforms,""]})},r=u=>{e({...n,platforms:n.platforms.filter((h,m)=>m!==u)})},s=(u,h)=>{const m=[...n.platforms];m[u]=h,e({...n,platforms:m})},i=()=>{e({...n,alias_names:[...n.alias_names,""]})},l=u=>{e({...n,alias_names:n.alias_names.filter((h,m)=>m!==u)})},c=(u,h)=>{const m=[...n.alias_names];m[u]=h,e({...n,alias_names:m})};return a.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"基本信息"}),a.jsxs("div",{className:"grid gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"platform",children:"平台"}),a.jsx(Ae,{id:"platform",value:n.platform,onChange:u=>e({...n,platform:u.target.value}),placeholder:"qq"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"qq_account",children:"QQ账号"}),a.jsx(Ae,{id:"qq_account",value:n.qq_account,onChange:u=>e({...n,qq_account:u.target.value}),placeholder:"123456789"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"nickname",children:"昵称"}),a.jsx(Ae,{id:"nickname",value:n.nickname,onChange:u=>e({...n,nickname:u.target.value}),placeholder:"麦麦"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(te,{children:"其他平台账号"}),a.jsxs(ie,{onClick:t,size:"sm",variant:"outline",children:[a.jsx(Wr,{className:"h-4 w-4 mr-1"}),"添加"]})]}),a.jsxs("div",{className:"space-y-2",children:[n.platforms.map((u,h)=>a.jsxs("div",{className:"flex gap-2",children:[a.jsx(Ae,{value:u,onChange:m=>s(h,m.target.value),placeholder:"wx:114514"}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{size:"icon",variant:"outline",children:a.jsx(Ht,{className:"h-4 w-4"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:['确定要删除平台账号 "',u||"(空)",'" 吗?此操作无法撤销。']})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>r(h),children:"删除"})]})]})]})]},h)),n.platforms.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无其他平台账号"})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(te,{children:"别名"}),a.jsxs(ie,{onClick:i,size:"sm",variant:"outline",children:[a.jsx(Wr,{className:"h-4 w-4 mr-1"}),"添加"]})]}),a.jsxs("div",{className:"space-y-2",children:[n.alias_names.map((u,h)=>a.jsxs("div",{className:"flex gap-2",children:[a.jsx(Ae,{value:u,onChange:m=>c(h,m.target.value),placeholder:"小麦"}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{size:"icon",variant:"outline",children:a.jsx(Ht,{className:"h-4 w-4"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:['确定要删除别名 "',u||"(空)",'" 吗?此操作无法撤销。']})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>l(h),children:"删除"})]})]})]})]},h)),n.alias_names.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无别名"})]})]})]})]})})}function tte({config:n,onChange:e}){const t=()=>{e({...n,states:[...n.states,""]})},r=i=>{e({...n,states:n.states.filter((l,c)=>c!==i)})},s=(i,l)=>{const c=[...n.states];c[i]=l,e({...n,states:c})};return a.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"人格设置"}),a.jsxs("div",{className:"grid gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"personality",children:"人格特质"}),a.jsx(kn,{id:"personality",value:n.personality,onChange:i=>e({...n,personality:i.target.value}),placeholder:"描述人格特质和身份特征(建议120字以内)",rows:3}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"建议120字以内,描述人格特质和身份特征"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"reply_style",children:"表达风格"}),a.jsx(kn,{id:"reply_style",value:n.reply_style,onChange:i=>e({...n,reply_style:i.target.value}),placeholder:"描述说话的表达风格和习惯",rows:3})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"interest",children:"兴趣"}),a.jsx(kn,{id:"interest",value:n.interest,onChange:i=>e({...n,interest:i.target.value}),placeholder:"会影响麦麦对什么话题进行回复",rows:2})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"plan_style",children:"说话规则与行为风格"}),a.jsx(kn,{id:"plan_style",value:n.plan_style,onChange:i=>e({...n,plan_style:i.target.value}),placeholder:"麦麦的说话规则和行为风格",rows:5})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"visual_style",children:"识图规则"}),a.jsx(kn,{id:"visual_style",value:n.visual_style,onChange:i=>e({...n,visual_style:i.target.value}),placeholder:"识图时的处理规则",rows:3})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"private_plan_style",children:"私聊规则"}),a.jsx(kn,{id:"private_plan_style",value:n.private_plan_style,onChange:i=>e({...n,private_plan_style:i.target.value}),placeholder:"私聊的说话规则和行为风格",rows:4})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(te,{children:"状态列表(人格多样性)"}),a.jsxs(ie,{onClick:t,size:"sm",variant:"outline",children:[a.jsx(Wr,{className:"h-4 w-4 mr-1"}),"添加状态"]})]}),a.jsx("div",{className:"space-y-2",children:n.states.map((i,l)=>a.jsxs("div",{className:"flex gap-2",children:[a.jsx(kn,{value:i,onChange:c=>s(l,c.target.value),placeholder:"描述一个人格状态",rows:2}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{size:"icon",variant:"outline",children:a.jsx(Ht,{className:"h-4 w-4"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsx(un,{children:"确定要删除这个人格状态吗?此操作无法撤销。"})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>r(l),children:"删除"})]})]})]})]},l))})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"state_probability",children:"状态替换概率"}),a.jsx(Ae,{id:"state_probability",type:"number",step:"0.1",min:"0",max:"1",value:n.state_probability,onChange:i=>e({...n,state_probability:parseFloat(i.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"每次构建人格时替换 personality 的概率(0.0-1.0)"})]})]})]})})}function nte({config:n,onChange:e}){const t=()=>{e({...n,talk_value_rules:[...n.talk_value_rules,{target:"",time:"00:00-23:59",value:1}]})},r=c=>{e({...n,talk_value_rules:n.talk_value_rules.filter((u,h)=>h!==c)})},s=(c,u,h)=>{const m=[...n.talk_value_rules];m[c]={...m[c],[u]:h},e({...n,talk_value_rules:m})},i=({value:c,onChange:u})=>{const[h,m]=S.useState("00"),[p,x]=S.useState("00"),[v,b]=S.useState("23"),[O,k]=S.useState("59");S.useEffect(()=>{const T=c.split("-");if(T.length===2){const[M,_]=T,[D,E]=M.split(":"),[z,Q]=_.split(":");D&&m(D.padStart(2,"0")),E&&x(E.padStart(2,"0")),z&&b(z.padStart(2,"0")),Q&&k(Q.padStart(2,"0"))}},[c]);const j=(T,M,_,D)=>{const E=`${T}:${M}-${_}:${D}`;u(E)};return a.jsxs(co,{children:[a.jsx(uo,{asChild:!0,children:a.jsxs(ie,{variant:"outline",className:"w-full justify-start font-mono text-sm",children:[a.jsx(uc,{className:"h-4 w-4 mr-2"}),c||"选择时间段"]})}),a.jsx(hl,{className:"w-80",children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-sm mb-3",children:"开始时间"}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[a.jsxs("div",{children:[a.jsx(te,{className:"text-xs",children:"小时"}),a.jsxs(Bt,{value:h,onValueChange:T=>{m(T),j(T,p,v,O)},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsx(Rt,{children:Array.from({length:24},(T,M)=>M).map(T=>a.jsx(Pe,{value:T.toString().padStart(2,"0"),children:T.toString().padStart(2,"0")},T))})]})]}),a.jsxs("div",{children:[a.jsx(te,{className:"text-xs",children:"分钟"}),a.jsxs(Bt,{value:p,onValueChange:T=>{x(T),j(h,T,v,O)},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsx(Rt,{children:Array.from({length:60},(T,M)=>M).map(T=>a.jsx(Pe,{value:T.toString().padStart(2,"0"),children:T.toString().padStart(2,"0")},T))})]})]})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-sm mb-3",children:"结束时间"}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[a.jsxs("div",{children:[a.jsx(te,{className:"text-xs",children:"小时"}),a.jsxs(Bt,{value:v,onValueChange:T=>{b(T),j(h,p,T,O)},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsx(Rt,{children:Array.from({length:24},(T,M)=>M).map(T=>a.jsx(Pe,{value:T.toString().padStart(2,"0"),children:T.toString().padStart(2,"0")},T))})]})]}),a.jsxs("div",{children:[a.jsx(te,{className:"text-xs",children:"分钟"}),a.jsxs(Bt,{value:O,onValueChange:T=>{k(T),j(h,p,v,T)},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsx(Rt,{children:Array.from({length:60},(T,M)=>M).map(T=>a.jsx(Pe,{value:T.toString().padStart(2,"0"),children:T.toString().padStart(2,"0")},T))})]})]})]})]})]})})]})},l=({rule:c})=>{const u=`{ target = "${c.target}", time = "${c.time}", value = ${c.value.toFixed(1)} }`;return a.jsxs(co,{children:[a.jsx(uo,{asChild:!0,children:a.jsxs(ie,{variant:"outline",size:"sm",children:[a.jsx(qi,{className:"h-4 w-4 mr-1"}),"预览"]})}),a.jsx(hl,{className:"w-96",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),a.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:u}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return a.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"聊天设置"}),a.jsxs("div",{className:"grid gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"talk_value",children:"聊天频率(基础值)"}),a.jsx(Ae,{id:"talk_value",type:"number",step:"0.1",min:"0",max:"1",value:n.talk_value,onChange:c=>e({...n,talk_value:parseFloat(c.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"越小越沉默,范围 0-1"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"mentioned_bot_reply",children:"提及回复增幅"}),a.jsx(Ae,{id:"mentioned_bot_reply",type:"number",step:"0.1",min:"0",max:"1",value:n.mentioned_bot_reply,onChange:c=>e({...n,mentioned_bot_reply:parseFloat(c.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"提及时回复概率增幅,1 为 100% 回复"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"max_context_size",children:"上下文长度"}),a.jsx(Ae,{id:"max_context_size",type:"number",min:"1",value:n.max_context_size,onChange:c=>e({...n,max_context_size:parseInt(c.target.value)})})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"planner_smooth",children:"规划器平滑"}),a.jsx(Ae,{id:"planner_smooth",type:"number",step:"1",min:"0",value:n.planner_smooth,onChange:c=>e({...n,planner_smooth:parseFloat(c.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"增大数值会减小 planner 负荷,推荐 1-5,0 为关闭"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"enable_talk_value_rules",checked:n.enable_talk_value_rules,onCheckedChange:c=>e({...n,enable_talk_value_rules:c})}),a.jsx(te,{htmlFor:"enable_talk_value_rules",className:"cursor-pointer",children:"启用动态发言频率规则"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"include_planner_reasoning",checked:n.include_planner_reasoning,onCheckedChange:c=>e({...n,include_planner_reasoning:c})}),a.jsx(te,{htmlFor:"include_planner_reasoning",className:"cursor-pointer",children:"将 planner 推理加入 replyer"})]})]})]}),n.enable_talk_value_rules&&a.jsxs("div",{className:"border-t pt-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-base font-semibold",children:"动态发言频率规则"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"按时段或聊天流ID调整发言频率,优先匹配具体聊天,再匹配全局规则"})]}),a.jsxs(ie,{onClick:t,size:"sm",children:[a.jsx(Wr,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),n.talk_value_rules&&n.talk_value_rules.length>0?a.jsx("div",{className:"space-y-4",children:n.talk_value_rules.map((c,u)=>a.jsxs("div",{className:"rounded-lg border p-4 bg-muted/50 space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["规则 #",u+1]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(l,{rule:c}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{variant:"ghost",size:"sm",children:a.jsx(Ht,{className:"h-4 w-4 text-destructive"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:["确定要删除规则 #",u+1," 吗?此操作无法撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>r(u),children:"删除"})]})]})]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"配置类型"}),a.jsxs(Bt,{value:c.target===""?"global":"specific",onValueChange:h=>{h==="global"?s(u,"target",""):s(u,"target","qq::group")},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"global",children:"全局配置"}),a.jsx(Pe,{value:"specific",children:"详细配置"})]})]})]}),c.target!==""&&(()=>{const h=c.target.split(":"),m=h[0]||"qq",p=h[1]||"",x=h[2]||"group";return a.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[a.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"平台"}),a.jsxs(Bt,{value:m,onValueChange:v=>{s(u,"target",`${v}:${p}:${x}`)},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"qq",children:"QQ"}),a.jsx(Pe,{value:"wx",children:"微信"})]})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"群 ID"}),a.jsx(Ae,{value:p,onChange:v=>{s(u,"target",`${m}:${v.target.value}:${x}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"类型"}),a.jsxs(Bt,{value:x,onValueChange:v=>{s(u,"target",`${m}:${p}:${v}`)},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"group",children:"群组(group)"}),a.jsx(Pe,{value:"private",children:"私聊(private)"})]})]})]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",c.target||"(未设置)"]})]})})(),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"时间段 (Time)"}),a.jsx(i,{value:c.time,onChange:h=>s(u,"time",h)}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"支持跨夜区间,例如 23:00-02:00"})]}),a.jsxs("div",{className:"grid gap-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(te,{htmlFor:`rule-value-${u}`,className:"text-xs font-medium",children:"发言频率值 (Value)"}),a.jsx(Ae,{id:`rule-value-${u}`,type:"number",step:"0.01",min:"0",max:"1",value:c.value,onChange:h=>{const m=parseFloat(h.target.value);isNaN(m)||s(u,"value",Math.max(0,Math.min(1,m)))},className:"w-20 h-8 text-xs"})]}),a.jsx(bx,{value:[c.value],onValueChange:h=>s(u,"value",h[0]),min:0,max:1,step:.01,className:"w-full"}),a.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[a.jsx("span",{children:"0 (完全沉默)"}),a.jsx("span",{children:"0.5"}),a.jsx("span",{children:"1.0 (正常)"})]})]})]})]},u))}):a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:a.jsx("p",{className:"text-sm",children:'暂无规则,点击"添加规则"按钮创建'})}),a.jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg",children:[a.jsx("h5",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"📝 规则说明"}),a.jsxs("ul",{className:"text-xs text-blue-800 dark:text-blue-200 space-y-1",children:[a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Target 为空"}),":全局规则,对所有聊天生效"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"Target 指定"}),":仅对特定聊天流生效(格式:platform:id:type)"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"优先级"}),":先匹配具体聊天流规则,再匹配全局规则"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"时间支持跨夜"}),":例如 23:00-02:00 表示晚上11点到次日凌晨2点"]}),a.jsxs("li",{children:["• ",a.jsx("strong",{children:"数值范围"}),":建议 0-1,0 表示完全沉默,1 表示正常发言"]})]})]})]})]})}function rte({config:n,onChange:e}){const t=()=>{e({...n,learning_list:[...n.learning_list,["","enable","enable","1.0"]]})},r=x=>{e({...n,learning_list:n.learning_list.filter((v,b)=>b!==x)})},s=(x,v,b)=>{const O=[...n.learning_list];O[x][v]=b,e({...n,learning_list:O})},i=({rule:x})=>{const v=`["${x[0]}", "${x[1]}", "${x[2]}", "${x[3]}"]`;return a.jsxs(co,{children:[a.jsx(uo,{asChild:!0,children:a.jsxs(ie,{variant:"outline",size:"sm",children:[a.jsx(qi,{className:"h-4 w-4 mr-1"}),"预览"]})}),a.jsx(hl,{className:"w-96",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),a.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:v}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},l=({member:x,groupIndex:v,memberIndex:b,availableChatIds:O})=>{const k=O.includes(x)||x==="*",[j,T]=S.useState(!k);return a.jsxs("div",{className:"flex gap-2",children:[a.jsx("div",{className:"flex-1 flex gap-2",children:j?a.jsxs(a.Fragment,{children:[a.jsx(Ae,{value:x,onChange:M=>p(v,b,M.target.value),placeholder:'输入 "*" 或 "qq:123456:group"',className:"flex-1"}),O.length>0&&a.jsx(ie,{size:"sm",variant:"outline",onClick:()=>T(!1),title:"切换到下拉选择",children:"下拉"})]}):a.jsxs(a.Fragment,{children:[a.jsxs(Bt,{value:x,onValueChange:M=>p(v,b,M),children:[a.jsx(Dt,{className:"flex-1",children:a.jsx(It,{placeholder:"选择聊天流"})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"*",children:"* (全局共享)"}),O.map((M,_)=>a.jsx(Pe,{value:M,children:M},_))]})]}),a.jsx(ie,{size:"sm",variant:"outline",onClick:()=>T(!0),title:"切换到手动输入",children:"输入"})]})}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{size:"icon",variant:"outline",children:a.jsx(Ht,{className:"h-4 w-4"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:['确定要删除组成员 "',x||"(空)",'" 吗?此操作无法撤销。']})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>m(v,b),children:"删除"})]})]})]})]})},c=()=>{e({...n,expression_groups:[...n.expression_groups,[]]})},u=x=>{e({...n,expression_groups:n.expression_groups.filter((v,b)=>b!==x)})},h=x=>{const v=[...n.expression_groups];v[x]=[...v[x],""],e({...n,expression_groups:v})},m=(x,v)=>{const b=[...n.expression_groups];b[x]=b[x].filter((O,k)=>k!==v),e({...n,expression_groups:b})},p=(x,v,b)=>{const O=[...n.expression_groups];O[x][v]=b,e({...n,expression_groups:O})};return a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold",children:"表达学习配置"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置麦麦如何学习和使用表达方式"})]}),a.jsxs(ie,{onClick:t,size:"sm",variant:"outline",children:[a.jsx(Wr,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),a.jsxs("div",{className:"space-y-4",children:[n.learning_list.map((x,v)=>{const b=n.learning_list.some((_,D)=>D!==v&&_[0]===""),O=x[0]==="",k=x[0].split(":"),j=k[0]||"qq",T=k[1]||"",M=k[2]||"group";return a.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"text-sm font-medium",children:["规则 ",v+1," ",O&&"(全局配置)"]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(i,{rule:x}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{size:"sm",variant:"ghost",children:a.jsx(Ht,{className:"h-4 w-4"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:["确定要删除学习规则 ",v+1," 吗?此操作无法撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>r(v),children:"删除"})]})]})]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"配置类型"}),a.jsxs(Bt,{value:O?"global":"specific",onValueChange:_=>{_==="global"?s(v,0,""):s(v,0,"qq::group")},disabled:b&&!O,children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"global",children:"全局配置"}),a.jsx(Pe,{value:"specific",disabled:b&&!O,children:"详细配置"})]})]}),b&&!O&&a.jsx("p",{className:"text-xs text-amber-600",children:"已存在全局配置,无法创建新的全局配置"})]}),!O&&a.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[a.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"平台"}),a.jsxs(Bt,{value:j,onValueChange:_=>{s(v,0,`${_}:${T}:${M}`)},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"qq",children:"QQ"}),a.jsx(Pe,{value:"wx",children:"微信"})]})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"群 ID"}),a.jsx(Ae,{value:T,onChange:_=>{s(v,0,`${j}:${_.target.value}:${M}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"类型"}),a.jsxs(Bt,{value:M,onValueChange:_=>{s(v,0,`${j}:${T}:${_}`)},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"group",children:"群组(group)"}),a.jsx(Pe,{value:"private",children:"私聊(private)"})]})]})]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",x[0]||"(未设置)"]})]}),a.jsx("div",{className:"grid gap-2",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(te,{className:"text-xs font-medium",children:"使用学到的表达"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦使用从聊天中学到的表达方式"})]}),a.jsx(jt,{checked:x[1]==="enable",onCheckedChange:_=>s(v,1,_?"enable":"disable")})]})}),a.jsx("div",{className:"grid gap-2",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(te,{className:"text-xs font-medium",children:"学习表达"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦从聊天中学习新的表达方式"})]}),a.jsx(jt,{checked:x[2]==="enable",onCheckedChange:_=>s(v,2,_?"enable":"disable")})]})}),a.jsxs("div",{className:"grid gap-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(te,{className:"text-xs font-medium",children:"学习强度"}),a.jsx(Ae,{type:"number",step:"0.1",min:"0",max:"5",value:x[3],onChange:_=>{const D=parseFloat(_.target.value);isNaN(D)||s(v,3,Math.max(0,Math.min(5,D)).toFixed(1))},className:"w-20 h-8 text-xs"})]}),a.jsx(bx,{value:[parseFloat(x[3])||1],onValueChange:_=>s(v,3,_[0].toFixed(1)),min:0,max:5,step:.1,className:"w-full"}),a.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[a.jsx("span",{children:"0 (不学习)"}),a.jsx("span",{children:"2.5"}),a.jsx("span",{children:"5.0 (快速学习)"})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"影响学习频率,最短学习间隔 = 300/学习强度(秒)"})]})]})]},v)}),n.learning_list.length===0&&a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无学习规则,点击"添加规则"开始配置'})]})]})}),a.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold",children:"表达共享组配置"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置不同聊天流之间如何共享学到的表达方式"})]}),a.jsxs(ie,{onClick:c,size:"sm",variant:"outline",children:[a.jsx(Wr,{className:"h-4 w-4 mr-1"}),"添加共享组"]})]}),a.jsxs("div",{className:"space-y-4",children:[n.expression_groups.map((x,v)=>{const b=n.learning_list.map(O=>O[0]).filter(O=>O!=="");return a.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"text-sm font-medium",children:["共享组 ",v+1,x.length===1&&x[0]==="*"&&"(全局共享)"]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ie,{onClick:()=>h(v),size:"sm",variant:"outline",children:a.jsx(Wr,{className:"h-4 w-4"})}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{size:"sm",variant:"ghost",children:a.jsx(Ht,{className:"h-4 w-4"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:["确定要删除共享组 ",v+1," 吗?此操作无法撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>u(v),children:"删除"})]})]})]})]})]}),a.jsx("div",{className:"space-y-2",children:x.map((O,k)=>a.jsx(l,{member:O,groupIndex:v,memberIndex:k,availableChatIds:b},k))}),a.jsx("p",{className:"text-xs text-muted-foreground",children:'提示:可以从下拉框选择已配置的聊天流,或手动输入。输入 "*" 启用全局共享'})]},v)}),n.expression_groups.length===0&&a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无共享组,点击"添加共享组"开始配置'})]})]})})]})}function ste({emojiConfig:n,memoryConfig:e,toolConfig:t,onEmojiChange:r,onMemoryChange:s,onToolChange:i}){return a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"工具设置"}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"enable_tool",checked:t.enable_tool,onCheckedChange:l=>i({...t,enable_tool:l})}),a.jsx(te,{htmlFor:"enable_tool",className:"cursor-pointer",children:"启用工具系统"})]}),a.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"允许麦麦使用各种工具来增强功能"})]})}),a.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"记忆设置"}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"max_agent_iterations",children:"记忆思考深度"}),a.jsx(Ae,{id:"max_agent_iterations",type:"number",min:"1",value:e.max_agent_iterations,onChange:l=>s({...e,max_agent_iterations:parseInt(l.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"最低为 1(不深入思考)"})]})]})}),a.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"表情包设置"}),a.jsxs("div",{className:"grid gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"emoji_chance",children:"表情包激活概率"}),a.jsx(Ae,{id:"emoji_chance",type:"number",step:"0.1",min:"0",max:"1",value:n.emoji_chance,onChange:l=>r({...n,emoji_chance:parseFloat(l.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"范围 0-1,越大越容易发送表情包"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"max_reg_num",children:"最大注册数量"}),a.jsx(Ae,{id:"max_reg_num",type:"number",min:"1",value:n.max_reg_num,onChange:l=>r({...n,max_reg_num:parseInt(l.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦最多可以注册的表情包数量"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),a.jsx(Ae,{id:"check_interval",type:"number",min:"1",value:n.check_interval,onChange:l=>r({...n,check_interval:parseInt(l.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包(注册、破损、删除)的时间间隔"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"do_replace",checked:n.do_replace,onCheckedChange:l=>r({...n,do_replace:l})}),a.jsx(te,{htmlFor:"do_replace",className:"cursor-pointer",children:"达到最大数量时替换表情包"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"steal_emoji",checked:n.steal_emoji,onCheckedChange:l=>r({...n,steal_emoji:l})}),a.jsx(te,{htmlFor:"steal_emoji",className:"cursor-pointer",children:"偷取表情包"})]}),a.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"允许麦麦将看到的表情包据为己有"}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"content_filtration",checked:n.content_filtration,onCheckedChange:l=>r({...n,content_filtration:l})}),a.jsx(te,{htmlFor:"content_filtration",className:"cursor-pointer",children:"启用表情包过滤"})]}),n.content_filtration&&a.jsxs("div",{className:"grid gap-2 pl-6 border-l-2 border-primary/20",children:[a.jsx(te,{htmlFor:"filtration_prompt",children:"过滤要求"}),a.jsx(Ae,{id:"filtration_prompt",value:n.filtration_prompt,onChange:l=>r({...n,filtration_prompt:l.target.value}),placeholder:"符合公序良俗"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"只有符合此要求的表情包才会被保存"})]})]})]})})]})}function ite({keywordReactionConfig:n,responsePostProcessConfig:e,chineseTypoConfig:t,responseSplitterConfig:r,onKeywordReactionChange:s,onResponsePostProcessChange:i,onChineseTypoChange:l,onResponseSplitterChange:c}){const u=()=>{s({...n,regex_rules:[...n.regex_rules,{regex:[""],reaction:""}]})},h=_=>{s({...n,regex_rules:n.regex_rules.filter((D,E)=>E!==_)})},m=(_,D,E)=>{const z=[...n.regex_rules];D==="regex"&&typeof E=="string"?z[_]={...z[_],regex:[E]}:D==="reaction"&&typeof E=="string"&&(z[_]={...z[_],reaction:E}),s({...n,regex_rules:z})},p=({regex:_,reaction:D,onRegexChange:E,onReactionChange:z})=>{const[Q,q]=S.useState(!1),[B,U]=S.useState(""),[V,ce]=S.useState(null),[W,J]=S.useState(""),[H,ae]=S.useState({}),[ne,ue]=S.useState(""),R=S.useRef(null),[me,Y]=S.useState("build"),P=ye=>ye.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),K=(ye,Re=0)=>{const de=R.current;if(!de)return;const We=de.selectionStart||0,ct=de.selectionEnd||0,ke=_.substring(0,We)+ye+_.substring(ct);E(ke),setTimeout(()=>{const nt=We+ye.length+Re;de.setSelectionRange(nt,nt),de.focus()},0)};S.useEffect(()=>{if(!_||!B){ce(null),ae({}),ue(D),J("");return}try{const ye=P(_),Re=new RegExp(ye,"g"),de=B.match(Re);ce(de),J("");const ct=new RegExp(ye).exec(B);if(ct&&ct.groups){ae(ct.groups);let ke=D;Object.entries(ct.groups).forEach(([nt,ut])=>{ke=ke.replace(new RegExp(`\\[${nt}\\]`,"g"),ut||"")}),ue(ke)}else ae({}),ue(D)}catch(ye){J(ye.message),ce(null),ae({}),ue(D)}},[_,B,D]);const $=()=>{if(!B||!V||V.length===0)return a.jsx("span",{className:"text-muted-foreground",children:B||"请输入测试文本"});try{const ye=P(_),Re=new RegExp(ye,"g");let de=0;const We=[];let ct;for(;(ct=Re.exec(B))!==null;)ct.index>de&&We.push(a.jsx("span",{children:B.substring(de,ct.index)},`text-${de}`)),We.push(a.jsx("span",{className:"bg-yellow-200 dark:bg-yellow-900 font-semibold",children:ct[0]},`match-${ct.index}`)),de=ct.index+ct[0].length;return de<B.length&&We.push(a.jsx("span",{children:B.substring(de)},`text-${de}`)),a.jsx(a.Fragment,{children:We})}catch{return a.jsx("span",{children:B})}},fe=[{category:"基础匹配",items:[{label:"任意字符",pattern:".",desc:"匹配除换行符外的任意字符"},{label:"数字",pattern:"\\d",desc:"匹配 0-9"},{label:"非数字",pattern:"\\D",desc:"匹配非数字字符"},{label:"字母数字",pattern:"\\w",desc:"匹配字母、数字、下划线"},{label:"非字母数字",pattern:"\\W",desc:"匹配非字母数字字符"},{label:"空白符",pattern:"\\s",desc:"匹配空格、制表符等"},{label:"非空白符",pattern:"\\S",desc:"匹配非空白字符"}]},{category:"位置锚点",items:[{label:"行首",pattern:"^",desc:"匹配行的开始"},{label:"行尾",pattern:"$",desc:"匹配行的结束"},{label:"单词边界",pattern:"\\b",desc:"匹配单词边界"}]},{category:"重复次数",items:[{label:"0或多次",pattern:"*",desc:"匹配前面的元素0次或多次"},{label:"1或多次",pattern:"+",desc:"匹配前面的元素1次或多次"},{label:"0或1次",pattern:"?",desc:"匹配前面的元素0次或1次"},{label:"指定次数",pattern:"{n}",desc:"匹配n次,将n替换为数字"},{label:"次数范围",pattern:"{m,n}",desc:"匹配m到n次"}]},{category:"分组和捕获",items:[{label:"普通分组",pattern:"()",desc:"分组但不捕获",moveCursor:-1},{label:"命名捕获",pattern:"(?P<name>)",desc:"Python风格命名捕获组",moveCursor:-1},{label:"非捕获组",pattern:"(?:)",desc:"分组但不保存匹配结果",moveCursor:-1}]},{category:"字符类",items:[{label:"字符集",pattern:"[]",desc:"匹配括号内的任意字符",moveCursor:-1},{label:"排除字符",pattern:"[^]",desc:"匹配不在括号内的字符",moveCursor:-1},{label:"范围",pattern:"[a-z]",desc:"匹配a到z的字符"},{label:"中文字符",pattern:"[\\u4e00-\\u9fa5]",desc:"匹配中文汉字"}]},{category:"常用模板",items:[{label:"捕获词语",pattern:"(?P<word>\\S+)",desc:"捕获一个词语"},{label:"捕获句子",pattern:"(?P<sentence>.+)",desc:"捕获整个句子"},{label:"捕获数字",pattern:"(?P<num>\\d+)",desc:"捕获一个或多个数字"},{label:"可选词语",pattern:"(?:词语1|词语2)",desc:"匹配多个可选项之一"}]}];return a.jsxs(Rr,{open:Q,onOpenChange:q,children:[a.jsx(gw,{asChild:!0,children:a.jsxs(ie,{variant:"outline",size:"sm",children:[a.jsx(mg,{className:"h-4 w-4 mr-1"}),"正则编辑器"]})}),a.jsxs(Nr,{className:"max-w-[95vw] sm:max-w-[900px] max-h-[90vh]",children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:"正则表达式编辑器"}),a.jsx(Gr,{className:"text-sm",children:"使用可视化工具构建正则表达式,并实时测试效果"})]}),a.jsx(fn,{className:"max-h-[calc(90vh-120px)]",children:a.jsxs(dl,{value:me,onValueChange:ye=>Y(ye),className:"w-full",children:[a.jsxs(va,{className:"grid w-full grid-cols-2",children:[a.jsx($t,{value:"build",children:"🔧 构建器"}),a.jsx($t,{value:"test",children:"🧪 测试器"})]}),a.jsxs(On,{value:"build",className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{className:"text-sm font-medium",children:"正则表达式"}),a.jsx(Ae,{ref:R,value:_,onChange:ye=>E(ye.target.value),className:"font-mono text-sm",placeholder:"点击下方按钮构建正则表达式..."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{className:"text-sm font-medium",children:"Reaction 内容"}),a.jsx(kn,{value:D,onChange:ye=>z(ye.target.value),placeholder:"使用 [捕获组名] 引用捕获的内容...",rows:3,className:"text-sm"})]}),a.jsxs("div",{className:"space-y-4 border-t pt-4",children:[fe.map(ye=>a.jsxs("div",{className:"space-y-2",children:[a.jsx("h5",{className:"text-xs font-semibold text-primary",children:ye.category}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:ye.items.map(Re=>a.jsx(ie,{variant:"outline",size:"sm",className:"justify-start h-auto py-2 px-3",onClick:()=>K(Re.pattern,Re.moveCursor||0),children:a.jsxs("div",{className:"flex flex-col items-start w-full",children:[a.jsxs("div",{className:"flex items-center gap-2 w-full",children:[a.jsx("span",{className:"text-xs font-medium",children:Re.label}),a.jsx("code",{className:"ml-auto text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:Re.pattern})]}),a.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:Re.desc})]})},Re.label))})]},ye.category)),a.jsxs("div",{className:"space-y-2 border-t pt-4",children:[a.jsx("h5",{className:"text-xs font-semibold text-primary",children:"完整示例模板"}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(ie,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>E("^(?P<n>\\S{1,20})是这样的$"),children:a.jsxs("div",{className:"flex flex-col items-start w-full",children:[a.jsxs("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:["^(?P<n>\\S","{1,20}",")是这样的$"]}),a.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「某事物是这样的」并捕获事物名称"})]})}),a.jsx(ie,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>E("(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P<action>.+?)[.。,,]?$"),children:a.jsxs("div",{className:"flex flex-col items-start w-full",children:[a.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P<action>.+?)[.。,,]?$"}),a.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「我没要求你做某事」并捕获具体行为"})]})}),a.jsx(ie,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>E("(?P<subject>.+?)(?:是|为什么|怎么)"),children:a.jsxs("div",{className:"flex flex-col items-start w-full",children:[a.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?P<subject>.+?)(?:是|为什么|怎么)"}),a.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"捕获问题主题词"})]})})]})]})]}),a.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 使用提示"}),a.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[a.jsx("li",{children:"点击输入框设置光标位置,然后点击按钮插入模式"}),a.jsxs("li",{children:["命名捕获组格式:",a.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"(?P<名称>模式)"})]}),a.jsxs("li",{children:["在 reaction 中使用 ",a.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"[名称]"})," 引用捕获的内容"]}),a.jsx("li",{children:"切换到测试器标签页验证正则表达式效果"})]})]})]}),a.jsxs(On,{value:"test",className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{className:"text-sm font-medium",children:"当前正则表达式"}),a.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:_||"(未设置)"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"test-text",className:"text-sm font-medium",children:"测试文本"}),a.jsx(kn,{id:"test-text",value:B,onChange:ye=>U(ye.target.value),placeholder:`在此输入要测试的文本...
|
||
例如:打游戏是这样的`,className:"min-h-[100px] text-sm"})]}),W&&a.jsxs("div",{className:"rounded-md bg-destructive/10 border border-destructive/20 p-3",children:[a.jsx("p",{className:"text-sm text-destructive font-medium",children:"正则表达式错误"}),a.jsx("p",{className:"text-xs text-destructive/80 mt-1",children:W})]}),!W&&B&&a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{className:"flex items-center gap-2",children:V&&V.length>0?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),a.jsxs("span",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:["匹配成功 (",V.length," 处)"]})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-400"}),a.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"无匹配"})]})}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{className:"text-sm font-medium",children:"匹配高亮"}),a.jsx(fn,{className:"h-40 rounded-md bg-muted p-3",children:a.jsx("div",{className:"text-sm break-words",children:$()})})]}),Object.keys(H).length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{className:"text-sm font-medium",children:"命名捕获组"}),a.jsx(fn,{className:"h-32 rounded-md border p-3",children:a.jsx("div",{className:"space-y-2",children:Object.entries(H).map(([ye,Re])=>a.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[a.jsxs("span",{className:"font-mono font-semibold text-primary min-w-[80px]",children:["[",ye,"]"]}),a.jsx("span",{className:"text-muted-foreground",children:"="}),a.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded",children:Re})]},ye))})})]}),Object.keys(H).length>0&&D&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{className:"text-sm font-medium",children:"Reaction 替换预览"}),a.jsx(fn,{className:"h-48 rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3",children:a.jsx("div",{className:"text-sm break-words",children:ne})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"reaction 中的 [name] 已被替换为对应的捕获组值"})]})]}),a.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 测试说明"}),a.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[a.jsx("li",{children:"匹配的文本会以黄色背景高亮显示"}),a.jsx("li",{children:"命名捕获组的值会显示在下方列表中"}),a.jsx("li",{children:"Reaction 替换预览显示最终生成的反应内容"}),a.jsx("li",{children:"如需修改正则,切换回构建器标签页"})]})]})]})]})})]})]})},x=()=>{s({...n,keyword_rules:[...n.keyword_rules,{keywords:[],reaction:""}]})},v=_=>{s({...n,keyword_rules:n.keyword_rules.filter((D,E)=>E!==_)})},b=(_,D,E)=>{const z=[...n.keyword_rules];typeof E=="string"&&(z[_]={...z[_],reaction:E}),s({...n,keyword_rules:z})},O=_=>{const D=[...n.keyword_rules];D[_]={...D[_],keywords:[...D[_].keywords||[],""]},s({...n,keyword_rules:D})},k=(_,D)=>{const E=[...n.keyword_rules];E[_]={...E[_],keywords:(E[_].keywords||[]).filter((z,Q)=>Q!==D)},s({...n,keyword_rules:E})},j=(_,D,E)=>{const z=[...n.keyword_rules],Q=[...z[_].keywords||[]];Q[D]=E,z[_]={...z[_],keywords:Q},s({...n,keyword_rules:z})},T=({rule:_})=>{const D=`{ regex = [${(_.regex||[]).map(E=>`"${E}"`).join(", ")}], reaction = "${_.reaction}" }`;return a.jsxs(co,{children:[a.jsx(uo,{asChild:!0,children:a.jsxs(ie,{variant:"outline",size:"sm",children:[a.jsx(qi,{className:"h-4 w-4 mr-1"}),"预览"]})}),a.jsx(hl,{className:"w-[95vw] sm:w-[500px]",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),a.jsx(fn,{className:"h-60 rounded-md bg-muted p-3",children:a.jsx("pre",{className:"font-mono text-xs break-all",children:D})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},M=({rule:_})=>{const D=`[[keyword_reaction.keyword_rules]]
|
||
keywords = [${(_.keywords||[]).map(E=>`"${E}"`).join(", ")}]
|
||
reaction = "${_.reaction}"`;return a.jsxs(co,{children:[a.jsx(uo,{asChild:!0,children:a.jsxs(ie,{variant:"outline",size:"sm",children:[a.jsx(qi,{className:"h-4 w-4 mr-1"}),"预览"]})}),a.jsx(hl,{className:"w-[95vw] sm:w-[500px]",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),a.jsx(fn,{className:"h-60 rounded-md bg-muted p-3",children:a.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-all",children:D})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-2",children:"关键词反应配置"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"配置触发特定反应的关键词和正则表达式规则"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-base font-semibold",children:"正则表达式规则"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用正则表达式匹配消息内容"})]}),a.jsxs(ie,{onClick:u,size:"sm",variant:"outline",children:[a.jsx(Wr,{className:"h-4 w-4 mr-1"}),"添加正则规则"]})]}),a.jsxs("div",{className:"space-y-3",children:[n.regex_rules.map((_,D)=>a.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"text-sm font-medium",children:["正则规则 ",D+1]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(p,{regex:_.regex&&_.regex[0]||"",reaction:_.reaction,onRegexChange:E=>m(D,"regex",E),onReactionChange:E=>m(D,"reaction",E)}),a.jsx(T,{rule:_}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{size:"sm",variant:"ghost",children:a.jsx(Ht,{className:"h-4 w-4"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:["确定要删除正则规则 ",D+1," 吗?此操作无法撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>h(D),children:"删除"})]})]})]})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"正则表达式(Python 语法)"}),a.jsx(Ae,{value:_.regex&&_.regex[0]||"",onChange:E=>m(D,"regex",E.target.value),placeholder:"例如:^(?P<n>\\\\S{1,20})是这样的$ (点击正则编辑器按钮可视化构建)",className:"font-mono text-sm"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:'支持命名捕获组 (?P<name>pattern),可在 reaction 中使用 [name] 引用。点击"正则编辑器"可视化构建和测试!'})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"反应内容"}),a.jsx(kn,{value:_.reaction,onChange:E=>m(D,"reaction",E.target.value),placeholder:`触发后麦麦的反应...
|
||
可以使用 [捕获组名] 来引用正则表达式中的内容`,rows:3,className:"text-sm"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"使用 [捕获组名] 引用正则表达式中的命名捕获组,例如 [n] 会被替换为捕获的内容"})]})]})]},D)),n.regex_rules.length===0&&a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无正则规则,点击"添加正则规则"开始配置'})]})]}),a.jsxs("div",{className:"space-y-4 border-t pt-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-base font-semibold",children:"关键词规则"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用关键词列表匹配消息内容"})]}),a.jsxs(ie,{onClick:x,size:"sm",variant:"outline",children:[a.jsx(Wr,{className:"h-4 w-4 mr-1"}),"添加关键词规则"]})]}),a.jsxs("div",{className:"space-y-3",children:[n.keyword_rules.map((_,D)=>a.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"text-sm font-medium",children:["关键词规则 ",D+1]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(M,{rule:_}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{size:"sm",variant:"ghost",children:a.jsx(Ht,{className:"h-4 w-4"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:["确定要删除关键词规则 ",D+1," 吗?此操作无法撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>v(D),children:"删除"})]})]})]})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(te,{className:"text-xs font-medium",children:"关键词列表"}),a.jsxs(ie,{onClick:()=>O(D),size:"sm",variant:"ghost",children:[a.jsx(Wr,{className:"h-3 w-3 mr-1"}),"添加关键词"]})]}),a.jsxs("div",{className:"space-y-2",children:[(_.keywords||[]).map((E,z)=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ae,{value:E,onChange:Q=>j(D,z,Q.target.value),placeholder:"关键词",className:"flex-1"}),a.jsx(ie,{onClick:()=>k(D,z),size:"sm",variant:"ghost",children:a.jsx(Ht,{className:"h-4 w-4"})})]},z)),(!_.keywords||_.keywords.length===0)&&a.jsx("p",{className:"text-xs text-muted-foreground text-center py-2",children:'暂无关键词,点击"添加关键词"开始配置'})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-xs font-medium",children:"反应内容"}),a.jsx(kn,{value:_.reaction,onChange:E=>b(D,"reaction",E.target.value),placeholder:"触发后麦麦的反应...",rows:3,className:"text-sm"})]})]})]},D)),n.keyword_rules.length===0&&a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无关键词规则,点击"添加关键词规则"开始配置'})]})]})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"回复后处理配置"}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"enable_response_post_process",checked:e.enable_response_post_process,onCheckedChange:_=>i({...e,enable_response_post_process:_})}),a.jsx(te,{htmlFor:"enable_response_post_process",className:"cursor-pointer",children:"启用回复后处理"})]}),a.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"包括错别字生成器和回复分割器"})]}),e.enable_response_post_process&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"border-t pt-6 space-y-4",children:a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[a.jsx(jt,{id:"enable_chinese_typo",checked:t.enable,onCheckedChange:_=>l({...t,enable:_})}),a.jsx(te,{htmlFor:"enable_chinese_typo",className:"cursor-pointer font-semibold",children:"中文错别字生成器"})]}),a.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"为回复添加随机错别字,让麦麦的回复更自然"}),t.enable&&a.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"error_rate",className:"text-xs font-medium",children:"单字替换概率"}),a.jsx(Ae,{id:"error_rate",type:"number",step:"0.001",min:"0",max:"1",value:t.error_rate,onChange:_=>l({...t,error_rate:parseFloat(_.target.value)})})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"min_freq",className:"text-xs font-medium",children:"最小字频阈值"}),a.jsx(Ae,{id:"min_freq",type:"number",min:"0",value:t.min_freq,onChange:_=>l({...t,min_freq:parseInt(_.target.value)})})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"tone_error_rate",className:"text-xs font-medium",children:"声调错误概率"}),a.jsx(Ae,{id:"tone_error_rate",type:"number",step:"0.01",min:"0",max:"1",value:t.tone_error_rate,onChange:_=>l({...t,tone_error_rate:parseFloat(_.target.value)})})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"word_replace_rate",className:"text-xs font-medium",children:"整词替换概率"}),a.jsx(Ae,{id:"word_replace_rate",type:"number",step:"0.001",min:"0",max:"1",value:t.word_replace_rate,onChange:_=>l({...t,word_replace_rate:parseFloat(_.target.value)})})]})]})]})}),a.jsx("div",{className:"border-t pt-6 space-y-4",children:a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[a.jsx(jt,{id:"enable_response_splitter",checked:r.enable,onCheckedChange:_=>c({...r,enable:_})}),a.jsx(te,{htmlFor:"enable_response_splitter",className:"cursor-pointer font-semibold",children:"回复分割器"})]}),a.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"控制回复的长度和句子数量"}),r.enable&&a.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"max_length",className:"text-xs font-medium",children:"最大长度"}),a.jsx(Ae,{id:"max_length",type:"number",min:"1",value:r.max_length,onChange:_=>c({...r,max_length:parseInt(_.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大字符数"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"max_sentence_num",className:"text-xs font-medium",children:"最大句子数"}),a.jsx(Ae,{id:"max_sentence_num",type:"number",min:"1",value:r.max_sentence_num,onChange:_=>c({...r,max_sentence_num:parseInt(_.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大句子数量"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"enable_kaomoji_protection",checked:r.enable_kaomoji_protection,onCheckedChange:_=>c({...r,enable_kaomoji_protection:_})}),a.jsx(te,{htmlFor:"enable_kaomoji_protection",className:"cursor-pointer",children:"启用颜文字保护"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"enable_overflow_return_all",checked:r.enable_overflow_return_all,onCheckedChange:_=>c({...r,enable_overflow_return_all:_})}),a.jsx(te,{htmlFor:"enable_overflow_return_all",className:"cursor-pointer",children:"超出时一次性返回全部"})]}),a.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"当句子数量超出限制时,合并后一次性返回所有内容"})]})]})})]})]})]})}function ate({config:n,onChange:e}){return a.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"情绪设置"}),a.jsxs("div",{className:"grid gap-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{checked:n.enable_mood,onCheckedChange:t=>e({...n,enable_mood:t})}),a.jsx(te,{className:"cursor-pointer",children:"启用情绪系统"})]}),n.enable_mood&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"情绪更新阈值"}),a.jsx(Ae,{type:"number",min:"1",value:n.mood_update_threshold,onChange:t=>e({...n,mood_update_threshold:parseInt(t.target.value)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"越高,更新越慢"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"情感特征"}),a.jsx(kn,{value:n.emotion_style,onChange:t=>e({...n,emotion_style:t.target.value}),placeholder:"影响情绪的变化情况",rows:2})]})]})]})]})}function lte({config:n,onChange:e}){return a.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"语音设置"}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{checked:n.enable_asr,onCheckedChange:t=>e({...n,enable_asr:t})}),a.jsx(te,{className:"cursor-pointer",children:"启用语音识别"})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"启用后麦麦可以识别语音消息,需要配置语音识别模型"})]})}function ote({config:n,onChange:e}){return a.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库设置"}),a.jsxs("div",{className:"grid gap-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{checked:n.enable,onCheckedChange:t=>e({...n,enable:t})}),a.jsx(te,{className:"cursor-pointer",children:"启用 LPMM 知识库"})]}),n.enable&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"LPMM 模式"}),a.jsxs(Bt,{value:n.lpmm_mode,onValueChange:t=>e({...n,lpmm_mode:t}),children:[a.jsx(Dt,{children:a.jsx(It,{placeholder:"选择 LPMM 模式"})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"classic",children:"经典模式"}),a.jsx(Pe,{value:"agent",children:"Agent 模式"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"同义词搜索 TopK"}),a.jsx(Ae,{type:"number",min:"1",value:n.rag_synonym_search_top_k,onChange:t=>e({...n,rag_synonym_search_top_k:parseInt(t.target.value)})})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"同义词阈值"}),a.jsx(Ae,{type:"number",step:"0.1",min:"0",max:"1",value:n.rag_synonym_threshold,onChange:t=>e({...n,rag_synonym_threshold:parseFloat(t.target.value)})})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"实体提取线程数"}),a.jsx(Ae,{type:"number",min:"1",value:n.info_extraction_workers,onChange:t=>e({...n,info_extraction_workers:parseInt(t.target.value)})})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"嵌入向量维度"}),a.jsx(Ae,{type:"number",min:"1",value:n.embedding_dimension,onChange:t=>e({...n,embedding_dimension:parseInt(t.target.value)})})]})]})]})]})]})}function cte({config:n,onChange:e}){const[t,r]=S.useState(""),[s,i]=S.useState("WARNING"),l=()=>{t&&!n.suppress_libraries.includes(t)&&(e({...n,suppress_libraries:[...n.suppress_libraries,t]}),r(""))},c=v=>{e({...n,suppress_libraries:n.suppress_libraries.filter(b=>b!==v)})},u=()=>{t&&!n.library_log_levels[t]&&(e({...n,library_log_levels:{...n.library_log_levels,[t]:s}}),r(""),i("WARNING"))},h=v=>{const b={...n.library_log_levels};delete b[v],e({...n,library_log_levels:b})},m=["DEBUG","INFO","WARNING","ERROR","CRITICAL"],p=["FULL","compact","lite"],x=["none","title","full"];return a.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"日志配置"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"日期格式"}),a.jsx(Ae,{value:n.date_style,onChange:v=>e({...n,date_style:v.target.value}),placeholder:"例如: m-d H:i:s"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"m=月, d=日, H=时, i=分, s=秒"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"日志级别样式"}),a.jsxs(Bt,{value:n.log_level_style,onValueChange:v=>e({...n,log_level_style:v}),children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsx(Rt,{children:p.map(v=>a.jsx(Pe,{value:v,children:v},v))})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"日志文本颜色"}),a.jsxs(Bt,{value:n.color_text,onValueChange:v=>e({...n,color_text:v}),children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsx(Rt,{children:x.map(v=>a.jsx(Pe,{value:v,children:v},v))})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"全局日志级别"}),a.jsxs(Bt,{value:n.log_level,onValueChange:v=>e({...n,log_level:v}),children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsx(Rt,{children:m.map(v=>a.jsx(Pe,{value:v,children:v},v))})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"控制台日志级别"}),a.jsxs(Bt,{value:n.console_log_level,onValueChange:v=>e({...n,console_log_level:v}),children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsx(Rt,{children:m.map(v=>a.jsx(Pe,{value:v,children:v},v))})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"文件日志级别"}),a.jsxs(Bt,{value:n.file_log_level,onValueChange:v=>e({...n,file_log_level:v}),children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsx(Rt,{children:m.map(v=>a.jsx(Pe,{value:v,children:v},v))})]})]})]})]}),a.jsxs("div",{children:[a.jsx(te,{className:"mb-2 block",children:"完全屏蔽的库"}),a.jsxs("div",{className:"flex gap-2 mb-2",children:[a.jsx(Ae,{value:t,onChange:v=>r(v.target.value),placeholder:"输入库名",className:"flex-1",onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),l())}}),a.jsx(ie,{onClick:l,size:"sm",className:"flex-shrink-0",children:a.jsx(Wr,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),a.jsx("div",{className:"flex flex-wrap gap-2",children:n.suppress_libraries.map(v=>a.jsxs("div",{className:"flex items-center gap-1 bg-secondary px-3 py-1 rounded-md",children:[a.jsx("span",{className:"text-sm",children:v}),a.jsx(ie,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>c(v),children:a.jsx(Ht,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},v))})]}),a.jsxs("div",{children:[a.jsx(te,{className:"mb-2 block",children:"特定库的日志级别"}),a.jsxs("div",{className:"flex gap-2 mb-2",children:[a.jsx(Ae,{value:t,onChange:v=>r(v.target.value),placeholder:"输入库名",className:"flex-1"}),a.jsxs(Bt,{value:s,onValueChange:i,children:[a.jsx(Dt,{className:"w-32",children:a.jsx(It,{})}),a.jsx(Rt,{children:m.map(v=>a.jsx(Pe,{value:v,children:v},v))})]}),a.jsx(ie,{onClick:u,size:"sm",children:a.jsx(Wr,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),a.jsx("div",{className:"space-y-2",children:Object.entries(n.library_log_levels).map(([v,b])=>a.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[a.jsx("span",{className:"text-sm font-medium",children:v}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:b}),a.jsx(ie,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>h(v),children:a.jsx(Ht,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]})]},v))})]})]})}function ute({config:n,onChange:e}){return a.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"调试配置"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5",children:[a.jsx(te,{children:"显示 Prompt"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"是否在日志中显示提示词"})]}),a.jsx(jt,{checked:n.show_prompt,onCheckedChange:t=>e({...n,show_prompt:t})})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5",children:[a.jsx(te,{children:"显示回复器 Prompt"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的提示词"})]}),a.jsx(jt,{checked:n.show_replyer_prompt,onCheckedChange:t=>e({...n,show_replyer_prompt:t})})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5",children:[a.jsx(te,{children:"显示回复器推理"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的推理过程"})]}),a.jsx(jt,{checked:n.show_replyer_reasoning,onCheckedChange:t=>e({...n,show_replyer_reasoning:t})})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5",children:[a.jsx(te,{children:"显示 Jargon Prompt"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示术语相关的提示词"})]}),a.jsx(jt,{checked:n.show_jargon_prompt,onCheckedChange:t=>e({...n,show_jargon_prompt:t})})]})]})]})}function dte({config:n,onChange:e}){const[t,r]=S.useState(""),s=()=>{t&&!n.auth_token.includes(t)&&(e({...n,auth_token:[...n.auth_token,t]}),r(""))},i=l=>{e({...n,auth_token:n.auth_token.filter((c,u)=>u!==l)})};return a.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"MaimMessage 服务配置"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5",children:[a.jsx(te,{children:"启用自定义服务器"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"是否使用自定义的 MaimMessage 服务器"})]}),a.jsx(jt,{checked:n.use_custom,onCheckedChange:l=>e({...n,use_custom:l})})]}),n.use_custom&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"主机地址"}),a.jsx(Ae,{value:n.host,onChange:l=>e({...n,host:l.target.value}),placeholder:"127.0.0.1"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"端口号"}),a.jsx(Ae,{type:"number",value:n.port,onChange:l=>e({...n,port:parseInt(l.target.value)}),placeholder:"8090"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"连接模式"}),a.jsxs(Bt,{value:n.mode,onValueChange:l=>e({...n,mode:l}),children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"ws",children:"WebSocket (ws)"}),a.jsx(Pe,{value:"tcp",children:"TCP"})]})]})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{checked:n.use_wss,onCheckedChange:l=>e({...n,use_wss:l}),disabled:n.mode!=="ws"}),a.jsx(te,{children:"使用 WSS 安全连接"})]})]}),n.use_wss&&n.mode==="ws"&&a.jsxs("div",{className:"grid gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"SSL 证书文件路径"}),a.jsx(Ae,{value:n.cert_file,onChange:l=>e({...n,cert_file:l.target.value}),placeholder:"cert.pem"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"SSL 密钥文件路径"}),a.jsx(Ae,{value:n.key_file,onChange:l=>e({...n,key_file:l.target.value}),placeholder:"key.pem"})]})]})]})]})]}),a.jsxs("div",{children:[a.jsx(te,{className:"mb-2 block",children:"认证令牌"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"用于 API 验证,为空则不启用验证"}),a.jsxs("div",{className:"flex gap-2 mb-2",children:[a.jsx(Ae,{value:t,onChange:l=>r(l.target.value),placeholder:"输入认证令牌",onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),s())}}),a.jsx(ie,{onClick:s,size:"sm",children:a.jsx(Wr,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),a.jsx("div",{className:"space-y-2",children:n.auth_token.map((l,c)=>a.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[a.jsx("span",{className:"text-sm font-mono",children:l}),a.jsx(ie,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>i(c),children:a.jsx(Ht,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},c))})]})]})}function hte({config:n,onChange:e}){return a.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"统计信息"}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5",children:[a.jsx(te,{children:"启用统计信息发送"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"发送匿名统计信息,帮助我们了解全球有多少只麦麦在运行"})]}),a.jsx(jt,{checked:n.enable,onCheckedChange:t=>e({...n,enable:t})})]})]})}const Ac=S.forwardRef(({className:n,...e},t)=>a.jsx("div",{className:"relative w-full overflow-auto",children:a.jsx("table",{ref:t,className:ve("w-full caption-bottom text-sm",n),...e})}));Ac.displayName="Table";const Ec=S.forwardRef(({className:n,...e},t)=>a.jsx("thead",{ref:t,className:ve("[&_tr]:border-b",n),...e}));Ec.displayName="TableHeader";const _c=S.forwardRef(({className:n,...e},t)=>a.jsx("tbody",{ref:t,className:ve("[&_tr:last-child]:border-0",n),...e}));_c.displayName="TableBody";const fte=S.forwardRef(({className:n,...e},t)=>a.jsx("tfoot",{ref:t,className:ve("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",n),...e}));fte.displayName="TableFooter";const xr=S.forwardRef(({className:n,...e},t)=>a.jsx("tr",{ref:t,className:ve("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",n),...e}));xr.displayName="TableRow";const gt=S.forwardRef(({className:n,...e},t)=>a.jsx("th",{ref:t,className:ve("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",n),...e}));gt.displayName="TableHead";const it=S.forwardRef(({className:n,...e},t)=>a.jsx("td",{ref:t,className:ve("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",n),...e}));it.displayName="TableCell";const mte=S.forwardRef(({className:n,...e},t)=>a.jsx("caption",{ref:t,className:ve("mt-4 text-sm text-muted-foreground",n),...e}));mte.displayName="TableCaption";const ss=S.forwardRef(({className:n,...e},t)=>a.jsx(L9,{ref:t,className:ve("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",n),...e,children:a.jsx(uF,{className:ve("grid place-content-center text-current"),children:a.jsx(hc,{className:"h-4 w-4"})})}));ss.displayName=L9.displayName;function pte(){const[n,e]=S.useState([]),[t,r]=S.useState(!0),[s,i]=S.useState(!1),[l,c]=S.useState(!1),[u,h]=S.useState(!1),[m,p]=S.useState(!1),[x,v]=S.useState(!1),[b,O]=S.useState(!1),[k,j]=S.useState(null),[T,M]=S.useState(null),[_,D]=S.useState(!1),[E,z]=S.useState(null),[Q,q]=S.useState(!1),[B,U]=S.useState(""),[V,ce]=S.useState(new Set),[W,J]=S.useState(!1),[H,ae]=S.useState(1),[ne,ue]=S.useState(20),[R,me]=S.useState(""),{toast:Y}=Pr(),P=S.useRef(null),K=S.useRef(!0);S.useEffect(()=>{$()},[]);const $=async()=>{try{r(!0);const ee=await Wu();e(ee.api_providers||[]),h(!1),K.current=!1}catch(ee){console.error("加载配置失败:",ee)}finally{r(!1)}},fe=async()=>{try{p(!0),yw().catch(()=>{}),v(!0)}catch(ee){console.error("重启失败:",ee),v(!1),Y({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),p(!1)}},ye=async()=>{try{i(!0),P.current&&clearTimeout(P.current);const ee=await Wu();ee.api_providers=n,await Sg(ee),h(!1),Y({title:"保存成功",description:"正在重启麦麦..."}),await fe()}catch(ee){console.error("保存配置失败:",ee),Y({title:"保存失败",description:ee.message,variant:"destructive"}),i(!1)}},Re=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},de=()=>{v(!1),p(!1),Y({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},We=S.useCallback(async ee=>{if(!K.current)try{c(!0),await m2("api_providers",ee),h(!1)}catch(Se){console.error("自动保存失败:",Se),h(!0)}finally{c(!1)}},[]);S.useEffect(()=>{if(!K.current)return h(!0),P.current&&clearTimeout(P.current),P.current=setTimeout(()=>{We(n)},2e3),()=>{P.current&&clearTimeout(P.current)}},[n,We]);const ct=async()=>{try{i(!0),P.current&&clearTimeout(P.current);const ee=await Wu();ee.api_providers=n,await Sg(ee),h(!1),Y({title:"保存成功",description:"模型提供商配置已保存"})}catch(ee){console.error("保存配置失败:",ee),Y({title:"保存失败",description:ee.message,variant:"destructive"})}finally{i(!1)}},ke=(ee,Se)=>{j(ee||{name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10}),M(Se),q(!1),O(!0)},nt=async()=>{if(k?.api_key)try{await navigator.clipboard.writeText(k.api_key),Y({title:"复制成功",description:"API Key 已复制到剪贴板"})}catch{Y({title:"复制失败",description:"无法访问剪贴板",variant:"destructive"})}},ut=()=>{if(!k)return;const ee={...k,max_retry:k.max_retry??2,timeout:k.timeout??30,retry_interval:k.retry_interval??10};if(T!==null){const Se=[...n];Se[T]=ee,e(Se)}else e([...n,ee]);O(!1),j(null),M(null)},Ct=ee=>{if(!ee&&k){const Se={...k,max_retry:k.max_retry??2,timeout:k.timeout??30,retry_interval:k.retry_interval??10};j(Se)}O(ee)},Bn=ee=>{z(ee),D(!0)},Tn=()=>{if(E!==null){const ee=n.filter((Se,Le)=>Le!==E);e(ee),Y({title:"删除成功",description:"提供商已从列表中移除"})}D(!1),z(null)},Jn=ee=>{const Se=new Set(V);Se.has(ee)?Se.delete(ee):Se.add(ee),ce(Se)},nn=()=>{if(V.size===In.length)ce(new Set);else{const ee=In.map((Se,Le)=>n.findIndex(rt=>rt===In[Le]));ce(new Set(ee))}},_t=()=>{if(V.size===0){Y({title:"提示",description:"请先选择要删除的提供商",variant:"default"});return}J(!0)},Yr=()=>{const ee=n.filter((Se,Le)=>!V.has(Le));e(ee),ce(new Set),J(!1),Y({title:"批量删除成功",description:`已删除 ${V.size} 个提供商`})},In=n.filter(ee=>{if(!B)return!0;const Se=B.toLowerCase();return ee.name.toLowerCase().includes(Se)||ee.base_url.toLowerCase().includes(Se)||ee.client_type.toLowerCase().includes(Se)}),or=Math.ceil(In.length/ne),yn=In.slice((H-1)*ne,H*ne),ft=()=>{const ee=parseInt(R);ee>=1&&ee<=or&&(ae(ee),me(""))};return t?a.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):a.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型提供商配置"}),a.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理 API 提供商配置"})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[V.size>0&&a.jsxs(ie,{onClick:_t,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[a.jsx(Ht,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",V.size,")"]}),a.jsxs(ie,{onClick:()=>ke(null,null),size:"sm",className:"w-full sm:w-auto",children:[a.jsx(Wr,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加提供商"]}),a.jsxs(ie,{onClick:ct,disabled:s||l||!u||m,size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[a.jsx(ox,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),s?"保存中...":l?"自动保存中...":u?"保存配置":"已保存"]}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsxs(ie,{disabled:s||l||m,size:"sm",className:"w-full sm:w-auto",children:[a.jsx(ew,{className:"mr-2 h-4 w-4"}),m?"重启中...":u?"保存并重启":"重启麦麦"]})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认重启麦麦?"}),a.jsx(un,{children:u?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:u?ye:fe,children:u?"保存并重启":"确认重启"})]})]})]})]})]}),a.jsxs(od,{children:[a.jsx(oo,{className:"h-4 w-4"}),a.jsxs(cd,{children:["配置更新后需要",a.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),a.jsxs(fn,{className:"h-[calc(100vh-260px)]",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 mb-4",children:[a.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[a.jsx(Ps,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),a.jsx(Ae,{placeholder:"搜索提供商名称、URL 或类型...",value:B,onChange:ee=>U(ee.target.value),className:"pl-9"})]}),B&&a.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",In.length," 个结果"]})]}),a.jsx("div",{className:"md:hidden space-y-3",children:In.length===0?a.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:B?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'}):yn.map((ee,Se)=>{const Le=n.findIndex(rt=>rt===ee);return a.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h3",{className:"font-semibold text-base truncate",children:ee.name}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:ee.base_url})]}),a.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>ke(ee,Le),children:[a.jsx(rd,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),a.jsxs(ie,{size:"sm",onClick:()=>Bn(Le),className:"bg-red-600 hover:bg-red-700 text-white",children:[a.jsx(Ht,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"客户端类型"}),a.jsx("p",{className:"font-medium",children:ee.client_type})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"最大重试"}),a.jsx("p",{className:"font-medium",children:ee.max_retry})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"超时(秒)"}),a.jsx("p",{className:"font-medium",children:ee.timeout})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"重试间隔(秒)"}),a.jsx("p",{className:"font-medium",children:ee.retry_interval})]})]})]},Se)})}),a.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(Ac,{children:[a.jsx(Ec,{children:a.jsxs(xr,{children:[a.jsx(gt,{className:"w-12",children:a.jsx(ss,{checked:V.size===In.length&&In.length>0,onCheckedChange:nn})}),a.jsx(gt,{children:"名称"}),a.jsx(gt,{children:"基础URL"}),a.jsx(gt,{children:"客户端类型"}),a.jsx(gt,{className:"text-right",children:"最大重试"}),a.jsx(gt,{className:"text-right",children:"超时(秒)"}),a.jsx(gt,{className:"text-right",children:"重试间隔(秒)"}),a.jsx(gt,{className:"text-right",children:"操作"})]})}),a.jsx(_c,{children:yn.length===0?a.jsx(xr,{children:a.jsx(it,{colSpan:8,className:"text-center text-muted-foreground py-8",children:B?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'})}):yn.map((ee,Se)=>{const Le=n.findIndex(rt=>rt===ee);return a.jsxs(xr,{children:[a.jsx(it,{children:a.jsx(ss,{checked:V.has(Le),onCheckedChange:()=>Jn(Le)})}),a.jsx(it,{className:"font-medium",children:ee.name}),a.jsx(it,{className:"max-w-xs truncate",title:ee.base_url,children:ee.base_url}),a.jsx(it,{children:ee.client_type}),a.jsx(it,{className:"text-right",children:ee.max_retry}),a.jsx(it,{className:"text-right",children:ee.timeout}),a.jsx(it,{className:"text-right",children:ee.retry_interval}),a.jsx(it,{className:"text-right",children:a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>ke(ee,Le),children:[a.jsx(rd,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),a.jsxs(ie,{size:"sm",onClick:()=>Bn(Le),className:"bg-red-600 hover:bg-red-700 text-white",children:[a.jsx(Ht,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},Se)})})]})})}),In.length>0&&a.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(te,{htmlFor:"page-size-provider",className:"text-sm whitespace-nowrap",children:"每页显示"}),a.jsxs(Bt,{value:ne.toString(),onValueChange:ee=>{ue(parseInt(ee)),ae(1),ce(new Set)},children:[a.jsx(Dt,{id:"page-size-provider",className:"w-20",children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"10",children:"10"}),a.jsx(Pe,{value:"20",children:"20"}),a.jsx(Pe,{value:"50",children:"50"}),a.jsx(Pe,{value:"100",children:"100"})]})]}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(H-1)*ne+1," 到"," ",Math.min(H*ne,In.length)," 条,共 ",In.length," 条"]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>ae(1),disabled:H===1,className:"hidden sm:flex",children:a.jsx(Yf,{className:"h-4 w-4"})}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>ae(ee=>Math.max(1,ee-1)),disabled:H===1,children:[a.jsx(Tc,{className:"h-4 w-4 sm:mr-1"}),a.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ae,{type:"number",value:R,onChange:ee=>me(ee.target.value),onKeyDown:ee=>ee.key==="Enter"&&ft(),placeholder:H.toString(),className:"w-16 h-8 text-center",min:1,max:or}),a.jsx(ie,{variant:"outline",size:"sm",onClick:ft,disabled:!R,className:"h-8",children:"跳转"})]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>ae(ee=>ee+1),disabled:H>=or,children:[a.jsx("span",{className:"hidden sm:inline",children:"下一页"}),a.jsx(Mc,{className:"h-4 w-4 sm:ml-1"})]}),a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>ae(or),disabled:H>=or,className:"hidden sm:flex",children:a.jsx(Kf,{className:"h-4 w-4"})})]})]})]}),a.jsx(Rr,{open:b,onOpenChange:Ct,children:a.jsxs(Nr,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:T!==null?"编辑提供商":"添加提供商"}),a.jsx(Gr,{children:"配置 API 提供商的连接信息和参数"})]}),a.jsxs("div",{className:"grid gap-4 py-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"name",children:"名称 *"}),a.jsx(Ae,{id:"name",value:k?.name||"",onChange:ee=>j(Se=>Se?{...Se,name:ee.target.value}:null),placeholder:"例如: DeepSeek, SiliconFlow"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"base_url",children:"基础 URL *"}),a.jsx(Ae,{id:"base_url",value:k?.base_url||"",onChange:ee=>j(Se=>Se?{...Se,base_url:ee.target.value}:null),placeholder:"https://api.example.com/v1"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"api_key",children:"API Key *"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(Ae,{id:"api_key",type:Q?"text":"password",value:k?.api_key||"",onChange:ee=>j(Se=>Se?{...Se,api_key:ee.target.value}:null),placeholder:"sk-...",className:"flex-1"}),a.jsx(ie,{type:"button",variant:"outline",size:"icon",onClick:()=>q(!Q),title:Q?"隐藏密钥":"显示密钥",children:Q?a.jsx(Kb,{className:"h-4 w-4"}):a.jsx(qi,{className:"h-4 w-4"})}),a.jsx(ie,{type:"button",variant:"outline",size:"icon",onClick:nt,title:"复制密钥",children:a.jsx(Yb,{className:"h-4 w-4"})})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"client_type",children:"客户端类型"}),a.jsxs(Bt,{value:k?.client_type||"openai",onValueChange:ee=>j(Se=>Se?{...Se,client_type:ee}:null),children:[a.jsx(Dt,{id:"client_type",children:a.jsx(It,{placeholder:"选择客户端类型"})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"openai",children:"OpenAI"}),a.jsx(Pe,{value:"gemini",children:"Gemini"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"max_retry",children:"最大重试"}),a.jsx(Ae,{id:"max_retry",type:"number",min:"0",value:k?.max_retry??"",onChange:ee=>{const Se=ee.target.value===""?null:parseInt(ee.target.value);j(Le=>Le?{...Le,max_retry:Se}:null)},placeholder:"默认: 2"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"timeout",children:"超时(秒)"}),a.jsx(Ae,{id:"timeout",type:"number",min:"1",value:k?.timeout??"",onChange:ee=>{const Se=ee.target.value===""?null:parseInt(ee.target.value);j(Le=>Le?{...Le,timeout:Se}:null)},placeholder:"默认: 30"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"retry_interval",children:"重试间隔(秒)"}),a.jsx(Ae,{id:"retry_interval",type:"number",min:"1",value:k?.retry_interval??"",onChange:ee=>{const Se=ee.target.value===""?null:parseInt(ee.target.value);j(Le=>Le?{...Le,retry_interval:Se}:null)},placeholder:"默认: 10"})]})]})]}),a.jsxs(ps,{children:[a.jsx(ie,{variant:"outline",onClick:()=>O(!1),children:"取消"}),a.jsx(ie,{onClick:ut,children:"保存"})]})]})}),a.jsx(mn,{open:_,onOpenChange:D,children:a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:['确定要删除提供商 "',E!==null?n[E]?.name:"",'" 吗? 此操作无法撤销。']})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:Tn,children:"删除"})]})]})}),a.jsx(mn,{open:W,onOpenChange:J,children:a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认批量删除"}),a.jsxs(un,{children:["确定要删除选中的 ",V.size," 个提供商吗? 此操作无法撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:Yr,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),x&&a.jsx(bw,{onRestartComplete:Re,onRestartFailed:de})]})}var o8=1,gte=.9,xte=.8,vte=.17,ub=.1,db=.999,yte=.9999,bte=.99,wte=/[\\\/_+.#"@\[\(\{&]/,Ste=/[\\\/_+.#"@\[\(\{&]/g,Ote=/[\s-]/,U_=/[\s-]/g;function h4(n,e,t,r,s,i,l){if(i===e.length)return s===n.length?o8:bte;var c=`${s},${i}`;if(l[c]!==void 0)return l[c];for(var u=r.charAt(i),h=t.indexOf(u,s),m=0,p,x,v,b;h>=0;)p=h4(n,e,t,r,h+1,i+1,l),p>m&&(h===s?p*=o8:wte.test(n.charAt(h-1))?(p*=xte,v=n.slice(s,h-1).match(Ste),v&&s>0&&(p*=Math.pow(db,v.length))):Ote.test(n.charAt(h-1))?(p*=gte,b=n.slice(s,h-1).match(U_),b&&s>0&&(p*=Math.pow(db,b.length))):(p*=vte,s>0&&(p*=Math.pow(db,h-s))),n.charAt(h)!==e.charAt(i)&&(p*=yte)),(p<ub&&t.charAt(h-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&t.charAt(h-1)!==r.charAt(i))&&(x=h4(n,e,t,r,h+1,i+2,l),x*ub>p&&(p=x*ub)),p>m&&(m=p),h=t.indexOf(u,h+1);return l[c]=m,m}function c8(n){return n.toLowerCase().replace(U_," ")}function kte(n,e,t){return n=t&&t.length>0?`${n+" "+t.join(" ")}`:n,h4(n,e,c8(n),c8(e),0,0,{})}var jte=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Co=jte.reduce((n,e)=>{const t=H4(`Primitive.${e}`),r=S.forwardRef((s,i)=>{const{asChild:l,...c}=s,u=l?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...c,ref:i})});return r.displayName=`Primitive.${e}`,{...n,[e]:r}},{}),Bh='[cmdk-group=""]',hb='[cmdk-group-items=""]',Nte='[cmdk-group-heading=""]',V_='[cmdk-item=""]',u8=`${V_}:not([aria-disabled="true"])`,f4="cmdk-item-select",Lu="data-value",Cte=(n,e,t)=>kte(n,e,t),W_=S.createContext(void 0),x0=()=>S.useContext(W_),G_=S.createContext(void 0),u5=()=>S.useContext(G_),X_=S.createContext(void 0),Y_=S.forwardRef((n,e)=>{let t=Bu(()=>{var Y,P;return{search:"",value:(P=(Y=n.value)!=null?Y:n.defaultValue)!=null?P:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Bu(()=>new Set),s=Bu(()=>new Map),i=Bu(()=>new Map),l=Bu(()=>new Set),c=K_(n),{label:u,children:h,value:m,onValueChange:p,filter:x,shouldFilter:v,loop:b,disablePointerSelection:O=!1,vimBindings:k=!0,...j}=n,T=ki(),M=ki(),_=ki(),D=S.useRef(null),E=Bte();Nc(()=>{if(m!==void 0){let Y=m.trim();t.current.value=Y,z.emit()}},[m]),Nc(()=>{E(6,ce)},[]);let z=S.useMemo(()=>({subscribe:Y=>(l.current.add(Y),()=>l.current.delete(Y)),snapshot:()=>t.current,setState:(Y,P,K)=>{var $,fe,ye,Re;if(!Object.is(t.current[Y],P)){if(t.current[Y]=P,Y==="search")V(),B(),E(1,U);else if(Y==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let de=document.getElementById(_);de?de.focus():($=document.getElementById(T))==null||$.focus()}if(E(7,()=>{var de;t.current.selectedItemId=(de=W())==null?void 0:de.id,z.emit()}),K||E(5,ce),((fe=c.current)==null?void 0:fe.value)!==void 0){let de=P??"";(Re=(ye=c.current).onValueChange)==null||Re.call(ye,de);return}}z.emit()}},emit:()=>{l.current.forEach(Y=>Y())}}),[]),Q=S.useMemo(()=>({value:(Y,P,K)=>{var $;P!==(($=i.current.get(Y))==null?void 0:$.value)&&(i.current.set(Y,{value:P,keywords:K}),t.current.filtered.items.set(Y,q(P,K)),E(2,()=>{B(),z.emit()}))},item:(Y,P)=>(r.current.add(Y),P&&(s.current.has(P)?s.current.get(P).add(Y):s.current.set(P,new Set([Y]))),E(3,()=>{V(),B(),t.current.value||U(),z.emit()}),()=>{i.current.delete(Y),r.current.delete(Y),t.current.filtered.items.delete(Y);let K=W();E(4,()=>{V(),K?.getAttribute("id")===Y&&U(),z.emit()})}),group:Y=>(s.current.has(Y)||s.current.set(Y,new Set),()=>{i.current.delete(Y),s.current.delete(Y)}),filter:()=>c.current.shouldFilter,label:u||n["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:T,inputId:_,labelId:M,listInnerRef:D}),[]);function q(Y,P){var K,$;let fe=($=(K=c.current)==null?void 0:K.filter)!=null?$:Cte;return Y?fe(Y,t.current.search,P):0}function B(){if(!t.current.search||c.current.shouldFilter===!1)return;let Y=t.current.filtered.items,P=[];t.current.filtered.groups.forEach($=>{let fe=s.current.get($),ye=0;fe.forEach(Re=>{let de=Y.get(Re);ye=Math.max(de,ye)}),P.push([$,ye])});let K=D.current;J().sort(($,fe)=>{var ye,Re;let de=$.getAttribute("id"),We=fe.getAttribute("id");return((ye=Y.get(We))!=null?ye:0)-((Re=Y.get(de))!=null?Re:0)}).forEach($=>{let fe=$.closest(hb);fe?fe.appendChild($.parentElement===fe?$:$.closest(`${hb} > *`)):K.appendChild($.parentElement===K?$:$.closest(`${hb} > *`))}),P.sort(($,fe)=>fe[1]-$[1]).forEach($=>{var fe;let ye=(fe=D.current)==null?void 0:fe.querySelector(`${Bh}[${Lu}="${encodeURIComponent($[0])}"]`);ye?.parentElement.appendChild(ye)})}function U(){let Y=J().find(K=>K.getAttribute("aria-disabled")!=="true"),P=Y?.getAttribute(Lu);z.setState("value",P||void 0)}function V(){var Y,P,K,$;if(!t.current.search||c.current.shouldFilter===!1){t.current.filtered.count=r.current.size;return}t.current.filtered.groups=new Set;let fe=0;for(let ye of r.current){let Re=(P=(Y=i.current.get(ye))==null?void 0:Y.value)!=null?P:"",de=($=(K=i.current.get(ye))==null?void 0:K.keywords)!=null?$:[],We=q(Re,de);t.current.filtered.items.set(ye,We),We>0&&fe++}for(let[ye,Re]of s.current)for(let de of Re)if(t.current.filtered.items.get(de)>0){t.current.filtered.groups.add(ye);break}t.current.filtered.count=fe}function ce(){var Y,P,K;let $=W();$&&(((Y=$.parentElement)==null?void 0:Y.firstChild)===$&&((K=(P=$.closest(Bh))==null?void 0:P.querySelector(Nte))==null||K.scrollIntoView({block:"nearest"})),$.scrollIntoView({block:"nearest"}))}function W(){var Y;return(Y=D.current)==null?void 0:Y.querySelector(`${V_}[aria-selected="true"]`)}function J(){var Y;return Array.from(((Y=D.current)==null?void 0:Y.querySelectorAll(u8))||[])}function H(Y){let P=J()[Y];P&&z.setState("value",P.getAttribute(Lu))}function ae(Y){var P;let K=W(),$=J(),fe=$.findIndex(Re=>Re===K),ye=$[fe+Y];(P=c.current)!=null&&P.loop&&(ye=fe+Y<0?$[$.length-1]:fe+Y===$.length?$[0]:$[fe+Y]),ye&&z.setState("value",ye.getAttribute(Lu))}function ne(Y){let P=W(),K=P?.closest(Bh),$;for(;K&&!$;)K=Y>0?Pte(K,Bh):Lte(K,Bh),$=K?.querySelector(u8);$?z.setState("value",$.getAttribute(Lu)):ae(Y)}let ue=()=>H(J().length-1),R=Y=>{Y.preventDefault(),Y.metaKey?ue():Y.altKey?ne(1):ae(1)},me=Y=>{Y.preventDefault(),Y.metaKey?H(0):Y.altKey?ne(-1):ae(-1)};return S.createElement(Co.div,{ref:e,tabIndex:-1,...j,"cmdk-root":"",onKeyDown:Y=>{var P;(P=j.onKeyDown)==null||P.call(j,Y);let K=Y.nativeEvent.isComposing||Y.keyCode===229;if(!(Y.defaultPrevented||K))switch(Y.key){case"n":case"j":{k&&Y.ctrlKey&&R(Y);break}case"ArrowDown":{R(Y);break}case"p":case"k":{k&&Y.ctrlKey&&me(Y);break}case"ArrowUp":{me(Y);break}case"Home":{Y.preventDefault(),H(0);break}case"End":{Y.preventDefault(),ue();break}case"Enter":{Y.preventDefault();let $=W();if($){let fe=new Event(f4);$.dispatchEvent(fe)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:Q.inputId,id:Q.labelId,style:Fte},u),Lx(n,Y=>S.createElement(G_.Provider,{value:z},S.createElement(W_.Provider,{value:Q},Y))))}),Tte=S.forwardRef((n,e)=>{var t,r;let s=ki(),i=S.useRef(null),l=S.useContext(X_),c=x0(),u=K_(n),h=(r=(t=u.current)==null?void 0:t.forceMount)!=null?r:l?.forceMount;Nc(()=>{if(!h)return c.item(s,l?.id)},[h]);let m=Z_(s,i,[n.value,n.children,i],n.keywords),p=u5(),x=xo(E=>E.value&&E.value===m.current),v=xo(E=>h||c.filter()===!1?!0:E.search?E.filtered.items.get(s)>0:!0);S.useEffect(()=>{let E=i.current;if(!(!E||n.disabled))return E.addEventListener(f4,b),()=>E.removeEventListener(f4,b)},[v,n.onSelect,n.disabled]);function b(){var E,z;O(),(z=(E=u.current).onSelect)==null||z.call(E,m.current)}function O(){p.setState("value",m.current,!0)}if(!v)return null;let{disabled:k,value:j,onSelect:T,forceMount:M,keywords:_,...D}=n;return S.createElement(Co.div,{ref:lo(i,e),...D,id:s,"cmdk-item":"",role:"option","aria-disabled":!!k,"aria-selected":!!x,"data-disabled":!!k,"data-selected":!!x,onPointerMove:k||c.getDisablePointerSelection()?void 0:O,onClick:k?void 0:b},n.children)}),Mte=S.forwardRef((n,e)=>{let{heading:t,children:r,forceMount:s,...i}=n,l=ki(),c=S.useRef(null),u=S.useRef(null),h=ki(),m=x0(),p=xo(v=>s||m.filter()===!1?!0:v.search?v.filtered.groups.has(l):!0);Nc(()=>m.group(l),[]),Z_(l,c,[n.value,n.heading,u]);let x=S.useMemo(()=>({id:l,forceMount:s}),[s]);return S.createElement(Co.div,{ref:lo(c,e),...i,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},t&&S.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:h},t),Lx(n,v=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":t?h:void 0},S.createElement(X_.Provider,{value:x},v))))}),Ate=S.forwardRef((n,e)=>{let{alwaysRender:t,...r}=n,s=S.useRef(null),i=xo(l=>!l.search);return!t&&!i?null:S.createElement(Co.div,{ref:lo(s,e),...r,"cmdk-separator":"",role:"separator"})}),Ete=S.forwardRef((n,e)=>{let{onValueChange:t,...r}=n,s=n.value!=null,i=u5(),l=xo(h=>h.search),c=xo(h=>h.selectedItemId),u=x0();return S.useEffect(()=>{n.value!=null&&i.setState("search",n.value)},[n.value]),S.createElement(Co.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":c,id:u.inputId,type:"text",value:s?n.value:l,onChange:h=>{s||i.setState("search",h.target.value),t?.(h.target.value)}})}),_te=S.forwardRef((n,e)=>{let{children:t,label:r="Suggestions",...s}=n,i=S.useRef(null),l=S.useRef(null),c=xo(h=>h.selectedItemId),u=x0();return S.useEffect(()=>{if(l.current&&i.current){let h=l.current,m=i.current,p,x=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let v=h.offsetHeight;m.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return x.observe(h),()=>{cancelAnimationFrame(p),x.unobserve(h)}}},[]),S.createElement(Co.div,{ref:lo(i,e),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:u.listId},Lx(n,h=>S.createElement("div",{ref:lo(l,u.listInnerRef),"cmdk-list-sizer":""},h)))}),Dte=S.forwardRef((n,e)=>{let{open:t,onOpenChange:r,overlayClassName:s,contentClassName:i,container:l,...c}=n;return S.createElement(X4,{open:t,onOpenChange:r},S.createElement(U4,{container:l},S.createElement(rx,{"cmdk-overlay":"",className:s}),S.createElement(sx,{"aria-label":n.label,"cmdk-dialog":"",className:i},S.createElement(Y_,{ref:e,...c}))))}),Rte=S.forwardRef((n,e)=>xo(t=>t.filtered.count===0)?S.createElement(Co.div,{ref:e,...n,"cmdk-empty":"",role:"presentation"}):null),zte=S.forwardRef((n,e)=>{let{progress:t,children:r,label:s="Loading...",...i}=n;return S.createElement(Co.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Lx(n,l=>S.createElement("div",{"aria-hidden":!0},l)))}),Bs=Object.assign(Y_,{List:_te,Item:Tte,Input:Ete,Group:Mte,Separator:Ate,Dialog:Dte,Empty:Rte,Loading:zte});function Pte(n,e){let t=n.nextElementSibling;for(;t;){if(t.matches(e))return t;t=t.nextElementSibling}}function Lte(n,e){let t=n.previousElementSibling;for(;t;){if(t.matches(e))return t;t=t.previousElementSibling}}function K_(n){let e=S.useRef(n);return Nc(()=>{e.current=n}),e}var Nc=typeof window>"u"?S.useEffect:S.useLayoutEffect;function Bu(n){let e=S.useRef();return e.current===void 0&&(e.current=n()),e}function xo(n){let e=u5(),t=()=>n(e.snapshot());return S.useSyncExternalStore(e.subscribe,t,t)}function Z_(n,e,t,r=[]){let s=S.useRef(),i=x0();return Nc(()=>{var l;let c=(()=>{var h;for(let m of t){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(h=m.current.textContent)==null?void 0:h.trim():s.current}})(),u=r.map(h=>h.trim());i.value(n,c,u),(l=e.current)==null||l.setAttribute(Lu,c),s.current=c}),s}var Bte=()=>{let[n,e]=S.useState(),t=Bu(()=>new Map);return Nc(()=>{t.current.forEach(r=>r()),t.current=new Map},[n]),(r,s)=>{t.current.set(r,s),e({})}};function Ite(n){let e=n.type;return typeof e=="function"?e(n.props):"render"in e?e.render(n.props):n}function Lx({asChild:n,children:e},t){return n&&S.isValidElement(e)?S.cloneElement(Ite(e),{ref:e.ref},t(e.props.children)):t(e)}var Fte={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const J_=S.forwardRef(({className:n,...e},t)=>a.jsx(Bs,{ref:t,className:ve("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",n),...e}));J_.displayName=Bs.displayName;const eD=S.forwardRef(({className:n,...e},t)=>a.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[a.jsx(Ps,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),a.jsx(Bs.Input,{ref:t,className:ve("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",n),...e})]}));eD.displayName=Bs.Input.displayName;const tD=S.forwardRef(({className:n,...e},t)=>a.jsx(Bs.List,{ref:t,className:ve("max-h-[300px] overflow-y-auto overflow-x-hidden",n),...e}));tD.displayName=Bs.List.displayName;const nD=S.forwardRef((n,e)=>a.jsx(Bs.Empty,{ref:e,className:"py-6 text-center text-sm",...n}));nD.displayName=Bs.Empty.displayName;const rD=S.forwardRef(({className:n,...e},t)=>a.jsx(Bs.Group,{ref:t,className:ve("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",n),...e}));rD.displayName=Bs.Group.displayName;const qte=S.forwardRef(({className:n,...e},t)=>a.jsx(Bs.Separator,{ref:t,className:ve("-mx-1 h-px bg-border",n),...e}));qte.displayName=Bs.Separator.displayName;const sD=S.forwardRef(({className:n,...e},t)=>a.jsx(Bs.Item,{ref:t,className:ve("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n),...e}));sD.displayName=Bs.Item.displayName;function Qte({options:n,selected:e,onChange:t,placeholder:r="选择选项...",emptyText:s="未找到选项",className:i}){const[l,c]=S.useState(!1),u=m=>{e.includes(m)?t(e.filter(p=>p!==m)):t([...e,m])},h=m=>{t(e.filter(p=>p!==m))};return a.jsxs(co,{open:l,onOpenChange:c,children:[a.jsx(uo,{asChild:!0,children:a.jsxs(ie,{variant:"outline",role:"combobox","aria-expanded":l,className:ve("w-full justify-between min-h-10 h-auto",i),children:[a.jsx("div",{className:"flex gap-1 flex-wrap flex-1",children:e.length===0?a.jsx("span",{className:"text-muted-foreground",children:r}):e.map(m=>{const p=n.find(x=>x.value===m);return a.jsxs($n,{variant:"secondary",className:"cursor-pointer hover:bg-secondary/80",onClick:x=>{x.stopPropagation(),h(m)},children:[p?.label||m,a.jsx(Xf,{className:"ml-1 h-3 w-3",strokeWidth:2,fill:"none"})]},m)})}),a.jsx(MF,{className:"ml-2 h-4 w-4 shrink-0 opacity-50",strokeWidth:2,fill:"none"})]})}),a.jsx(hl,{className:"w-full p-0",align:"start",children:a.jsxs(J_,{children:[a.jsx(eD,{placeholder:"搜索...",className:"h-9"}),a.jsxs(tD,{children:[a.jsx(nD,{children:s}),a.jsx(rD,{children:n.map(m=>{const p=e.includes(m.value);return a.jsxs(sD,{value:m.value,onSelect:()=>u(m.value),children:[a.jsx("div",{className:ve("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",p?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:a.jsx(hc,{className:"h-3 w-3",strokeWidth:2,fill:"none"})}),a.jsx("span",{children:m.label})]},m.value)})})]})]})})]})}function $te(){const[n,e]=S.useState([]),[t,r]=S.useState([]),[s,i]=S.useState([]),[l,c]=S.useState(null),[u,h]=S.useState(!0),[m,p]=S.useState(!1),[x,v]=S.useState(!1),[b,O]=S.useState(!1),[k,j]=S.useState(!1),[T,M]=S.useState(!1),[_,D]=S.useState(!1),[E,z]=S.useState(null),[Q,q]=S.useState(null),[B,U]=S.useState(!1),[V,ce]=S.useState(null),[W,J]=S.useState(""),[H,ae]=S.useState(new Set),[ne,ue]=S.useState(!1),[R,me]=S.useState(1),[Y,P]=S.useState(20),[K,$]=S.useState(""),{toast:fe}=Pr(),ye=S.useRef(null),Re=S.useRef(null),de=S.useRef(!0);S.useEffect(()=>{We()},[]);const We=async()=>{try{h(!0);const re=await Wu(),Me=re.models||[];e(Me),i(Me.map(vt=>vt.name));const pt=re.api_providers||[];r(pt.map(vt=>vt.name)),c(re.model_task_config||null),O(!1),de.current=!1}catch(re){console.error("加载配置失败:",re)}finally{h(!1)}},ct=async()=>{try{j(!0),yw().catch(()=>{}),M(!0)}catch(re){console.error("重启失败:",re),M(!1),fe({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),j(!1)}},ke=async()=>{try{p(!0),ye.current&&clearTimeout(ye.current),Re.current&&clearTimeout(Re.current);const re=await Wu();re.models=n,re.model_task_config=l,await Sg(re),O(!1),fe({title:"保存成功",description:"正在重启麦麦..."}),await ct()}catch(re){console.error("保存配置失败:",re),fe({title:"保存失败",description:re.message,variant:"destructive"}),p(!1)}},nt=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},ut=()=>{M(!1),j(!1),fe({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},Ct=S.useCallback(async re=>{if(!de.current)try{v(!0),await m2("models",re),O(!1)}catch(Me){console.error("自动保存模型列表失败:",Me),O(!0)}finally{v(!1)}},[]),Bn=S.useCallback(async re=>{if(!de.current)try{v(!0),await m2("model_task_config",re),O(!1)}catch(Me){console.error("自动保存任务配置失败:",Me),O(!0)}finally{v(!1)}},[]);S.useEffect(()=>{if(!de.current)return O(!0),ye.current&&clearTimeout(ye.current),ye.current=setTimeout(()=>{Ct(n)},2e3),()=>{ye.current&&clearTimeout(ye.current)}},[n,Ct]),S.useEffect(()=>{if(!(de.current||!l))return O(!0),Re.current&&clearTimeout(Re.current),Re.current=setTimeout(()=>{Bn(l)},2e3),()=>{Re.current&&clearTimeout(Re.current)}},[l,Bn]);const Tn=async()=>{try{p(!0),ye.current&&clearTimeout(ye.current),Re.current&&clearTimeout(Re.current);const re=await Wu();re.models=n,re.model_task_config=l,await Sg(re),O(!1),fe({title:"保存成功",description:"模型配置已保存"}),await We()}catch(re){console.error("保存配置失败:",re),fe({title:"保存失败",description:re.message,variant:"destructive"})}finally{p(!1)}},Jn=(re,Me)=>{z(re||{model_identifier:"",name:"",api_provider:t[0]||"",price_in:0,price_out:0,force_stream_mode:!1,extra_params:{}}),q(Me),D(!0)},nn=()=>{if(!E)return;const re={...E,price_in:E.price_in??0,price_out:E.price_out??0};let Me;Q!==null?(Me=[...n],Me[Q]=re):Me=[...n,re],e(Me),i(Me.map(pt=>pt.name)),D(!1),z(null),q(null)},_t=re=>{if(!re&&E){const Me={...E,price_in:E.price_in??0,price_out:E.price_out??0};z(Me)}D(re)},Yr=re=>{ce(re),U(!0)},In=()=>{if(V!==null){const re=n.filter((Me,pt)=>pt!==V);e(re),i(re.map(Me=>Me.name)),fe({title:"删除成功",description:"模型已从列表中移除"})}U(!1),ce(null)},or=re=>{const Me=new Set(H);Me.has(re)?Me.delete(re):Me.add(re),ae(Me)},yn=()=>{if(H.size===Le.length)ae(new Set);else{const re=Le.map((Me,pt)=>n.findIndex(vt=>vt===Le[pt]));ae(new Set(re))}},ft=()=>{if(H.size===0){fe({title:"提示",description:"请先选择要删除的模型",variant:"default"});return}ue(!0)},ee=()=>{const re=n.filter((Me,pt)=>!H.has(pt));e(re),i(re.map(Me=>Me.name)),ae(new Set),ue(!1),fe({title:"批量删除成功",description:`已删除 ${H.size} 个模型`})},Se=(re,Me,pt)=>{l&&c({...l,[re]:{...l[re],[Me]:pt}})},Le=n.filter(re=>{if(!W)return!0;const Me=W.toLowerCase();return re.name.toLowerCase().includes(Me)||re.model_identifier.toLowerCase().includes(Me)||re.api_provider.toLowerCase().includes(Me)}),rt=Math.ceil(Le.length/Y),Tt=Le.slice((R-1)*Y,R*Y),cr=()=>{const re=parseInt(K);re>=1&&re<=rt&&(me(re),$(""))},Kr=re=>l?[l.utils?.model_list||[],l.utils_small?.model_list||[],l.tool_use?.model_list||[],l.replyer?.model_list||[],l.planner?.model_list||[],l.vlm?.model_list||[],l.voice?.model_list||[],l.embedding?.model_list||[],l.lpmm_entity_extract?.model_list||[],l.lpmm_rdf_build?.model_list||[],l.lpmm_qa?.model_list||[]].some(pt=>pt.includes(re)):!1;return u?a.jsx(fn,{className:"h-full",children:a.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):a.jsx(fn,{className:"h-full",children:a.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型配置"}),a.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理模型和任务配置"})]}),a.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[a.jsxs(ie,{onClick:Tn,disabled:m||x||!b||k,size:"sm",variant:"outline",className:"flex-1 sm:flex-none",children:[a.jsx(ox,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),m?"保存中...":x?"自动保存中...":b?"保存配置":"已保存"]}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsxs(ie,{disabled:m||x||k,size:"sm",className:"flex-1 sm:flex-none",children:[a.jsx(ew,{className:"mr-2 h-4 w-4"}),k?"重启中...":b?"保存并重启":"重启麦麦"]})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认重启麦麦?"}),a.jsx(un,{children:b?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:b?ke:ct,children:b?"保存并重启":"确认重启"})]})]})]})]})]}),a.jsxs(od,{children:[a.jsx(oo,{className:"h-4 w-4"}),a.jsxs(cd,{children:["配置更新后需要",a.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),a.jsxs(dl,{defaultValue:"models",className:"w-full",children:[a.jsxs(va,{className:"grid w-full max-w-full sm:max-w-md grid-cols-2",children:[a.jsx($t,{value:"models",children:"模型配置"}),a.jsx($t,{value:"tasks",children:"模型任务配置"})]}),a.jsxs(On,{value:"models",className:"space-y-4 mt-0",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"配置可用的模型列表"}),a.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[H.size>0&&a.jsxs(ie,{onClick:ft,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[a.jsx(Ht,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",H.size,")"]}),a.jsxs(ie,{onClick:()=>Jn(null,null),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[a.jsx(Wr,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加模型"]})]})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2",children:[a.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[a.jsx(Ps,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),a.jsx(Ae,{placeholder:"搜索模型名称、标识符或提供商...",value:W,onChange:re=>J(re.target.value),className:"pl-9"})]}),W&&a.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",Le.length," 个结果"]})]}),a.jsx("div",{className:"md:hidden space-y-3",children:Tt.length===0?a.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:W?"未找到匹配的模型":"暂无模型配置"}):Tt.map((re,Me)=>{const pt=n.findIndex(vs=>vs===re),vt=Kr(re.name);return a.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("h3",{className:"font-semibold text-base",children:re.name}),a.jsx($n,{variant:vt?"default":"secondary",className:vt?"bg-green-600 hover:bg-green-700":"",children:vt?"已使用":"未使用"})]}),a.jsx("p",{className:"text-xs text-muted-foreground break-all",title:re.model_identifier,children:re.model_identifier})]}),a.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>Jn(re,pt),children:[a.jsx(rd,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),a.jsxs(ie,{size:"sm",onClick:()=>Yr(pt),className:"bg-red-600 hover:bg-red-700 text-white",children:[a.jsx(Ht,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"提供商"}),a.jsx("p",{className:"font-medium",children:re.api_provider})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"强制流式"}),a.jsx("p",{className:"font-medium",children:re.force_stream_mode?"是":"否"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"输入价格"}),a.jsxs("p",{className:"font-medium",children:["¥",re.price_in,"/M"]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"输出价格"}),a.jsxs("p",{className:"font-medium",children:["¥",re.price_out,"/M"]})]})]})]},Me)})}),a.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(Ac,{children:[a.jsx(Ec,{children:a.jsxs(xr,{children:[a.jsx(gt,{className:"w-12",children:a.jsx(ss,{checked:H.size===Le.length&&Le.length>0,onCheckedChange:yn})}),a.jsx(gt,{className:"w-24",children:"使用状态"}),a.jsx(gt,{children:"模型名称"}),a.jsx(gt,{children:"模型标识符"}),a.jsx(gt,{children:"提供商"}),a.jsx(gt,{className:"text-right",children:"输入价格"}),a.jsx(gt,{className:"text-right",children:"输出价格"}),a.jsx(gt,{className:"text-center",children:"强制流式"}),a.jsx(gt,{className:"text-right",children:"操作"})]})}),a.jsx(_c,{children:Tt.length===0?a.jsx(xr,{children:a.jsx(it,{colSpan:9,className:"text-center text-muted-foreground py-8",children:W?"未找到匹配的模型":"暂无模型配置"})}):Tt.map((re,Me)=>{const pt=n.findIndex(vs=>vs===re),vt=Kr(re.name);return a.jsxs(xr,{children:[a.jsx(it,{children:a.jsx(ss,{checked:H.has(pt),onCheckedChange:()=>or(pt)})}),a.jsx(it,{children:a.jsx($n,{variant:vt?"default":"secondary",className:vt?"bg-green-600 hover:bg-green-700":"",children:vt?"已使用":"未使用"})}),a.jsx(it,{className:"font-medium",children:re.name}),a.jsx(it,{className:"max-w-xs truncate",title:re.model_identifier,children:re.model_identifier}),a.jsx(it,{children:re.api_provider}),a.jsxs(it,{className:"text-right",children:["¥",re.price_in,"/M"]}),a.jsxs(it,{className:"text-right",children:["¥",re.price_out,"/M"]}),a.jsx(it,{className:"text-center",children:re.force_stream_mode?"是":"否"}),a.jsx(it,{className:"text-right",children:a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>Jn(re,pt),children:[a.jsx(rd,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),a.jsxs(ie,{size:"sm",onClick:()=>Yr(pt),className:"bg-red-600 hover:bg-red-700 text-white",children:[a.jsx(Ht,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},Me)})})]})})}),Le.length>0&&a.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(te,{htmlFor:"page-size-model",className:"text-sm whitespace-nowrap",children:"每页显示"}),a.jsxs(Bt,{value:Y.toString(),onValueChange:re=>{P(parseInt(re)),me(1),ae(new Set)},children:[a.jsx(Dt,{id:"page-size-model",className:"w-20",children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"10",children:"10"}),a.jsx(Pe,{value:"20",children:"20"}),a.jsx(Pe,{value:"50",children:"50"}),a.jsx(Pe,{value:"100",children:"100"})]})]}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(R-1)*Y+1," 到"," ",Math.min(R*Y,Le.length)," 条,共 ",Le.length," 条"]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>me(1),disabled:R===1,className:"hidden sm:flex",children:a.jsx(Yf,{className:"h-4 w-4"})}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>me(re=>Math.max(1,re-1)),disabled:R===1,children:[a.jsx(Tc,{className:"h-4 w-4 sm:mr-1"}),a.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ae,{type:"number",value:K,onChange:re=>$(re.target.value),onKeyDown:re=>re.key==="Enter"&&cr(),placeholder:R.toString(),className:"w-16 h-8 text-center",min:1,max:rt}),a.jsx(ie,{variant:"outline",size:"sm",onClick:cr,disabled:!K,className:"h-8",children:"跳转"})]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>me(re=>re+1),disabled:R>=rt,children:[a.jsx("span",{className:"hidden sm:inline",children:"下一页"}),a.jsx(Mc,{className:"h-4 w-4 sm:ml-1"})]}),a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>me(rt),disabled:R>=rt,className:"hidden sm:flex",children:a.jsx(Kf,{className:"h-4 w-4"})})]})]})]}),a.jsxs(On,{value:"tasks",className:"space-y-6 mt-0",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"为不同的任务配置使用的模型和参数"}),l&&a.jsxs("div",{className:"grid gap-4 sm:gap-6",children:[a.jsx(zi,{title:"组件模型 (utils)",description:"用于表情包、取名、关系、情绪变化等组件",taskConfig:l.utils,modelNames:s,onChange:(re,Me)=>Se("utils",re,Me)}),a.jsx(zi,{title:"组件小模型 (utils_small)",description:"消耗量较大的组件,建议使用速度较快的小模型",taskConfig:l.utils_small,modelNames:s,onChange:(re,Me)=>Se("utils_small",re,Me)}),a.jsx(zi,{title:"工具调用模型 (tool_use)",description:"需要使用支持工具调用的模型",taskConfig:l.tool_use,modelNames:s,onChange:(re,Me)=>Se("tool_use",re,Me)}),a.jsx(zi,{title:"首要回复模型 (replyer)",description:"用于表达器和表达方式学习",taskConfig:l.replyer,modelNames:s,onChange:(re,Me)=>Se("replyer",re,Me)}),a.jsx(zi,{title:"决策模型 (planner)",description:"负责决定麦麦该什么时候回复",taskConfig:l.planner,modelNames:s,onChange:(re,Me)=>Se("planner",re,Me)}),a.jsx(zi,{title:"图像识别模型 (vlm)",description:"视觉语言模型",taskConfig:l.vlm,modelNames:s,onChange:(re,Me)=>Se("vlm",re,Me),hideTemperature:!0}),a.jsx(zi,{title:"语音识别模型 (voice)",description:"语音转文字",taskConfig:l.voice,modelNames:s,onChange:(re,Me)=>Se("voice",re,Me),hideTemperature:!0,hideMaxTokens:!0}),a.jsx(zi,{title:"嵌入模型 (embedding)",description:"用于向量化",taskConfig:l.embedding,modelNames:s,onChange:(re,Me)=>Se("embedding",re,Me),hideTemperature:!0,hideMaxTokens:!0}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库模型"}),a.jsx(zi,{title:"实体提取模型 (lpmm_entity_extract)",description:"从文本中提取实体",taskConfig:l.lpmm_entity_extract,modelNames:s,onChange:(re,Me)=>Se("lpmm_entity_extract",re,Me)}),a.jsx(zi,{title:"RDF 构建模型 (lpmm_rdf_build)",description:"构建知识图谱",taskConfig:l.lpmm_rdf_build,modelNames:s,onChange:(re,Me)=>Se("lpmm_rdf_build",re,Me)}),a.jsx(zi,{title:"问答模型 (lpmm_qa)",description:"知识库问答",taskConfig:l.lpmm_qa,modelNames:s,onChange:(re,Me)=>Se("lpmm_qa",re,Me)})]})]})]})]}),a.jsx(Rr,{open:_,onOpenChange:_t,children:a.jsxs(Nr,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:Q!==null?"编辑模型":"添加模型"}),a.jsx(Gr,{children:"配置模型的基本信息和参数"})]}),a.jsxs("div",{className:"grid gap-4 py-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"model_name",children:"模型名称 *"}),a.jsx(Ae,{id:"model_name",value:E?.name||"",onChange:re=>z(Me=>Me?{...Me,name:re.target.value}:null),placeholder:"例如: qwen3-30b"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"用于在任务配置中引用此模型"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"model_identifier",children:"模型标识符 *"}),a.jsx(Ae,{id:"model_identifier",value:E?.model_identifier||"",onChange:re=>z(Me=>Me?{...Me,model_identifier:re.target.value}:null),placeholder:"Qwen/Qwen3-30B-A3B-Instruct-2507"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"API 提供商提供的模型 ID"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"api_provider",children:"API 提供商 *"}),a.jsxs(Bt,{value:E?.api_provider||"",onValueChange:re=>z(Me=>Me?{...Me,api_provider:re}:null),children:[a.jsx(Dt,{id:"api_provider",children:a.jsx(It,{placeholder:"选择提供商"})}),a.jsx(Rt,{children:t.map(re=>a.jsx(Pe,{value:re,children:re},re))})]})]}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"price_in",children:"输入价格 (¥/M token)"}),a.jsx(Ae,{id:"price_in",type:"number",step:"0.1",min:"0",value:E?.price_in??"",onChange:re=>{const Me=re.target.value===""?null:parseFloat(re.target.value);z(pt=>pt?{...pt,price_in:Me}:null)},placeholder:"默认: 0"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"price_out",children:"输出价格 (¥/M token)"}),a.jsx(Ae,{id:"price_out",type:"number",step:"0.1",min:"0",value:E?.price_out??"",onChange:re=>{const Me=re.target.value===""?null:parseFloat(re.target.value);z(pt=>pt?{...pt,price_out:Me}:null)},placeholder:"默认: 0"})]})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"force_stream_mode",checked:E?.force_stream_mode||!1,onCheckedChange:re=>z(Me=>Me?{...Me,force_stream_mode:re}:null)}),a.jsx(te,{htmlFor:"force_stream_mode",className:"cursor-pointer",children:"强制流式输出模式"})]})]}),a.jsxs(ps,{children:[a.jsx(ie,{variant:"outline",onClick:()=>D(!1),children:"取消"}),a.jsx(ie,{onClick:nn,children:"保存"})]})]})}),a.jsx(mn,{open:B,onOpenChange:U,children:a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:['确定要删除模型 "',V!==null?n[V]?.name:"",'" 吗? 此操作无法撤销。']})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:In,children:"删除"})]})]})}),a.jsx(mn,{open:ne,onOpenChange:ue,children:a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认批量删除"}),a.jsxs(un,{children:["确定要删除选中的 ",H.size," 个模型吗? 此操作无法撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:ee,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),T&&a.jsx(bw,{onRestartComplete:nt,onRestartFailed:ut})]})})}function zi({title:n,description:e,taskConfig:t,modelNames:r,onChange:s,hideTemperature:i=!1,hideMaxTokens:l=!1}){const c=u=>{s("model_list",u)};return a.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"font-semibold text-base sm:text-lg",children:n}),a.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:e})]}),a.jsxs("div",{className:"grid gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"模型列表"}),a.jsx(Qte,{options:r.map(u=>({label:u,value:u})),selected:t.model_list||[],onChange:c,placeholder:"选择模型...",emptyText:"暂无可用模型"})]}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[!i&&a.jsxs("div",{className:"grid gap-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(te,{children:"温度"}),a.jsx(Ae,{type:"number",step:"0.1",min:"0",max:"1",value:t.temperature??.3,onChange:u=>{const h=parseFloat(u.target.value);!isNaN(h)&&h>=0&&h<=1&&s("temperature",h)},className:"w-20 h-8 text-sm"})]}),a.jsx(bx,{value:[t.temperature??.3],onValueChange:u=>s("temperature",u[0]),min:0,max:1,step:.1,className:"w-full"})]}),!l&&a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{children:"最大 Token"}),a.jsx(Ae,{type:"number",step:"1",min:"1",value:t.max_tokens??1024,onChange:u=>s("max_tokens",parseInt(u.target.value))})]})]})]})]})}const Bx="/api/webui/config";async function Hte(){const e=await(await ot(`${Bx}/adapter-config/path`)).json();return!e.success||!e.path?null:{path:e.path,lastModified:e.lastModified}}async function Ute(n){const t=await(await ot(`${Bx}/adapter-config/path`,{method:"POST",headers:bt(),body:JSON.stringify({path:n})})).json();if(!t.success)throw new Error(t.message||"保存路径失败")}async function Vte(n){const t=await(await ot(`${Bx}/adapter-config?path=${encodeURIComponent(n)}`)).json();if(!t.success)throw new Error("读取配置文件失败");return t.content}async function d8(n,e){const r=await(await ot(`${Bx}/adapter-config`,{method:"POST",headers:bt(),body:JSON.stringify({path:n,content:e})})).json();if(!r.success)throw new Error(r.message||"保存配置失败")}const Ks={inner:{version:"0.1.2"},nickname:{nickname:""},napcat_server:{host:"localhost",port:8095,token:"",heartbeat_interval:30},maibot_server:{host:"localhost",port:8e3},chat:{group_list_type:"whitelist",group_list:[],private_list_type:"whitelist",private_list:[],ban_user_id:[],ban_qq_bot:!1,enable_poke:!0},voice:{use_tts:!1},debug:{level:"INFO"}};function Wte(){const[n,e]=S.useState("upload"),[t,r]=S.useState(null),[s,i]=S.useState(""),[l,c]=S.useState(""),[u,h]=S.useState(""),[m,p]=S.useState(!1),[x,v]=S.useState(!1),[b,O]=S.useState(!1),[k,j]=S.useState(!1),[T,M]=S.useState(null),_=S.useRef(null),{toast:D}=Pr(),E=S.useRef(null),z=K=>{if(!K.trim())return{valid:!1,error:"路径不能为空"};const $=/^([a-zA-Z]:\\|\\\\[^\\]+\\[^\\]+\\).+\.toml$/i,fe=/^(\/|~\/).+\.toml$/i,ye=$.test(K),Re=fe.test(K);return!ye&&!Re?{valid:!1,error:"路径格式错误。Windows: C:\\path\\file.toml,Linux: /path/file.toml"}:K.toLowerCase().endsWith(".toml")?/[<>"|?*\x00-\x1F]/.test(K)?{valid:!1,error:"路径包含非法字符"}:{valid:!0,error:""}:{valid:!1,error:"文件必须是 .toml 格式"}},Q=K=>{if(c(K),K.trim()){const $=z(K);h($.error)}else h("")};S.useEffect(()=>{(async()=>{try{const $=await Hte();$&&$.path&&(c($.path),e("path"),await q($.path))}catch($){console.error("加载保存的路径失败:",$)}})()},[]);const q=async K=>{const $=z(K);if(!$.valid){h($.error),D({title:"路径无效",description:$.error,variant:"destructive"});return}h(""),v(!0);try{const fe=await Vte(K),ye=ue(fe);r(ye),c(K),await Ute(K),D({title:"加载成功",description:"已从配置文件加载"})}catch(fe){console.error("加载配置失败:",fe),D({title:"加载失败",description:fe instanceof Error?fe.message:"无法读取配置文件",variant:"destructive"})}finally{v(!1)}},B=S.useCallback(K=>{n!=="path"||!l||(E.current&&clearTimeout(E.current),E.current=setTimeout(async()=>{p(!0);try{const $=R(K);await d8(l,$),D({title:"自动保存成功",description:"配置已保存到文件"})}catch($){console.error("自动保存失败:",$),D({title:"自动保存失败",description:$ instanceof Error?$.message:"保存配置失败",variant:"destructive"})}finally{p(!1)}},1e3))},[n,l,D]),U=async()=>{if(!t||!l)return;const K=z(l);if(!K.valid){D({title:"保存失败",description:K.error,variant:"destructive"});return}p(!0);try{const $=R(t);await d8(l,$),D({title:"保存成功",description:"配置已保存到文件"})}catch($){console.error("保存失败:",$),D({title:"保存失败",description:$ instanceof Error?$.message:"保存配置失败",variant:"destructive"})}finally{p(!1)}},V=async()=>{l&&await q(l)},ce=K=>{if(K!==n){if(t){M(K),O(!0);return}W(K)}},W=K=>{r(null),i(""),h(""),e(K),D({title:"已切换模式",description:K==="upload"?"现在可以上传配置文件":"现在可以指定配置文件路径"})},J=()=>{T&&(W(T),M(null)),O(!1)},H=()=>{if(t){j(!0);return}ae()},ae=()=>{c(""),r(null),h(""),D({title:"已清空",description:"路径和配置已清空"})},ne=()=>{ae(),j(!1)},ue=K=>{const $=JSON.parse(JSON.stringify(Ks)),fe=K.split(`
|
||
`);let ye="";for(const Re of fe){const de=Re.trim();if(!de||de.startsWith("#"))continue;const We=de.match(/^\[(\w+)\]$/);if(We){ye=We[1];continue}const ct=de.match(/^(\w+)\s*=\s*(.+)$/);if(ct&&ye){const[,ke,nt]=ct,ut=nt.trim();let Ct;if(ut==="true")Ct=!0;else if(ut==="false")Ct=!1;else if(ut.startsWith("[")&&ut.endsWith("]")){const Bn=ut.slice(1,-1).trim();if(Bn){const Tn=Bn.split(",").map(nn=>{const _t=nn.trim();return isNaN(Number(_t))?_t.replace(/"/g,""):Number(_t)}),Jn=typeof Tn[0];Ct=Tn.every(nn=>typeof nn===Jn)?Tn:Tn.filter(nn=>typeof nn=="number")}else Ct=[]}else ut.startsWith('"')&&ut.endsWith('"')?Ct=ut.slice(1,-1):isNaN(Number(ut))?Ct=ut.replace(/"/g,""):Ct=Number(ut);if(ye in $){const Bn=$[ye];Bn[ke]=Ct}}}return $},R=K=>{const $=[],fe=(ye,Re)=>ye===""||ye===null||ye===void 0?Re:ye;return $.push("[inner]"),$.push(`version = "${fe(K.inner.version,Ks.inner.version)}" # 版本号`),$.push("# 请勿修改版本号,除非你知道自己在做什么"),$.push(""),$.push("[nickname] # 现在没用"),$.push(`nickname = "${fe(K.nickname.nickname,Ks.nickname.nickname)}"`),$.push(""),$.push("[napcat_server] # Napcat连接的ws服务设置"),$.push(`host = "${fe(K.napcat_server.host,Ks.napcat_server.host)}" # Napcat设定的主机地址`),$.push(`port = ${fe(K.napcat_server.port||0,Ks.napcat_server.port)} # Napcat设定的端口`),$.push(`token = "${fe(K.napcat_server.token,Ks.napcat_server.token)}" # Napcat设定的访问令牌,若无则留空`),$.push(`heartbeat_interval = ${fe(K.napcat_server.heartbeat_interval||0,Ks.napcat_server.heartbeat_interval)} # 与Napcat设置的心跳相同(按秒计)`),$.push(""),$.push("[maibot_server] # 连接麦麦的ws服务设置"),$.push(`host = "${fe(K.maibot_server.host,Ks.maibot_server.host)}" # 麦麦在.env文件中设置的主机地址,即HOST字段`),$.push(`port = ${fe(K.maibot_server.port||0,Ks.maibot_server.port)} # 麦麦在.env文件中设置的端口,即PORT字段`),$.push(""),$.push("[chat] # 黑白名单功能"),$.push(`group_list_type = "${fe(K.chat.group_list_type,Ks.chat.group_list_type)}" # 群组名单类型,可选为:whitelist, blacklist`),$.push(`group_list = [${K.chat.group_list.join(", ")}] # 群组名单`),$.push("# 当group_list_type为whitelist时,只有群组名单中的群组可以聊天"),$.push("# 当group_list_type为blacklist时,群组名单中的任何群组无法聊天"),$.push(`private_list_type = "${fe(K.chat.private_list_type,Ks.chat.private_list_type)}" # 私聊名单类型,可选为:whitelist, blacklist`),$.push(`private_list = [${K.chat.private_list.join(", ")}] # 私聊名单`),$.push("# 当private_list_type为whitelist时,只有私聊名单中的用户可以聊天"),$.push("# 当private_list_type为blacklist时,私聊名单中的任何用户无法聊天"),$.push(`ban_user_id = [${K.chat.ban_user_id.join(", ")}] # 全局禁止名单(全局禁止名单中的用户无法进行任何聊天)`),$.push(`ban_qq_bot = ${K.chat.ban_qq_bot} # 是否屏蔽QQ官方机器人`),$.push(`enable_poke = ${K.chat.enable_poke} # 是否启用戳一戳功能`),$.push(""),$.push("[voice] # 发送语音设置"),$.push(`use_tts = ${K.voice.use_tts} # 是否使用tts语音(请确保你配置了tts并有对应的adapter)`),$.push(""),$.push("[debug]"),$.push(`level = "${fe(K.debug.level,Ks.debug.level)}" # 日志等级(DEBUG, INFO, WARNING, ERROR, CRITICAL)`),$.join(`
|
||
`)},me=K=>{const $=K.target.files?.[0];if(!$)return;const fe=new FileReader;fe.onload=ye=>{try{const Re=ye.target?.result,de=ue(Re);r(de),i($.name),D({title:"上传成功",description:`已加载配置文件:${$.name}`})}catch(Re){console.error("解析配置文件失败:",Re),D({title:"解析失败",description:"配置文件格式错误,请检查文件内容",variant:"destructive"})}},fe.readAsText($)},Y=()=>{if(!t)return;const K=R(t),$=new Blob([K],{type:"text/plain;charset=utf-8"}),fe=URL.createObjectURL($),ye=document.createElement("a");ye.href=fe,ye.download=s||"config.toml",document.body.appendChild(ye),ye.click(),document.body.removeChild(ye),URL.revokeObjectURL(fe),D({title:"下载成功",description:"配置文件已下载,请手动覆盖并重启适配器"})},P=()=>{r(JSON.parse(JSON.stringify(Ks))),i("config.toml"),D({title:"已加载默认配置",description:"可以开始编辑配置"})};return a.jsx(fn,{className:"h-full",children:a.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[a.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦适配器配置"}),a.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的 QQ 适配器的配置文件"})]})}),a.jsxs(yt,{children:[a.jsxs(Jt,{children:[a.jsx(en,{children:"工作模式"}),a.jsx(Sr,{children:"选择配置文件的管理方式"})]}),a.jsxs(vn,{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 md:gap-4",children:[a.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${n==="upload"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>ce("upload"),children:a.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[a.jsx(uk,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"上传文件模式"}),a.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"上传配置文件,编辑后下载并手动覆盖"})]})]})}),a.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${n==="path"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>ce("path"),children:a.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[a.jsx(AF,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"指定路径模式"}),a.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"指定配置文件路径,自动加载和保存"})]})]})})]}),n==="path"&&a.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"config-path",className:"text-sm md:text-base",children:"配置文件路径"}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[a.jsxs("div",{className:"flex-1 space-y-1",children:[a.jsx(Ae,{id:"config-path",value:l,onChange:K=>Q(K.target.value),placeholder:"例: C:\\Adapter\\config.toml",className:`text-sm ${u?"border-destructive":""}`}),u&&a.jsx("p",{className:"text-xs text-destructive",children:u})]}),a.jsx(ie,{onClick:()=>q(l),disabled:x||!l||!!u,className:"w-full sm:w-auto",children:x?a.jsxs(a.Fragment,{children:[a.jsx(Ii,{className:"h-4 w-4 animate-spin mr-2"}),a.jsx("span",{className:"sm:hidden",children:"加载中..."})]}):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sm:hidden",children:"加载配置"}),a.jsx("span",{className:"hidden sm:inline",children:"加载"})]})})]})]}),a.jsxs("details",{className:"rounded-lg bg-muted/50 p-3 group",children:[a.jsxs("summary",{className:"text-xs font-medium cursor-pointer select-none list-none flex items-center justify-between",children:[a.jsx("span",{children:"路径格式说明"}),a.jsx("svg",{className:"h-4 w-4 transition-transform group-open:rotate-180",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),a.jsxs("div",{className:"mt-2 space-y-2 text-xs text-muted-foreground",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"flex items-center gap-2",children:a.jsx("span",{className:"font-mono bg-background px-1.5 py-0.5 rounded text-[10px] md:text-xs whitespace-nowrap",children:"Windows"})}),a.jsxs("div",{className:"pl-2 space-y-0.5 text-[10px] md:text-xs break-all",children:[a.jsx("div",{children:"C:\\Adapter\\config.toml"}),a.jsx("div",{className:"hidden sm:block",children:"D:\\MaiBot\\adapter\\config.toml"}),a.jsx("div",{className:"hidden sm:block",children:"\\\\server\\share\\config.toml"})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"flex items-center gap-2",children:a.jsx("span",{className:"font-mono bg-background px-1.5 py-0.5 rounded text-[10px] md:text-xs whitespace-nowrap",children:"Linux"})}),a.jsxs("div",{className:"pl-2 space-y-0.5 text-[10px] md:text-xs break-all",children:[a.jsx("div",{children:"/opt/adapter/config.toml"}),a.jsx("div",{className:"hidden sm:block",children:"/home/user/adapter/config.toml"}),a.jsx("div",{className:"hidden sm:block",children:"~/adapter/config.toml"})]})]}),a.jsx("p",{className:"pt-1 border-t text-[10px] md:text-xs",children:"💡 配置会自动保存到指定文件,修改后 1 秒自动保存"})]})]})]})]})]}),a.jsxs(od,{children:[a.jsx(oo,{className:"h-4 w-4"}),a.jsx(cd,{children:n==="upload"?a.jsxs(a.Fragment,{children:[a.jsx("strong",{children:"上传文件模式:"}),"上传配置文件 → 在线编辑 → 下载文件 → 手动覆盖并重启适配器"]}):a.jsxs(a.Fragment,{children:[a.jsx("strong",{children:"指定路径模式:"}),"指定配置文件路径后,配置会自动加载,修改后 1 秒自动保存",m&&" (正在保存...)"]})})]}),n==="upload"&&!t&&a.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[a.jsx("input",{ref:_,type:"file",accept:".toml",className:"hidden",onChange:me}),a.jsxs(ie,{onClick:()=>_.current?.click(),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[a.jsx(uk,{className:"mr-2 h-4 w-4"}),"上传配置"]}),a.jsxs(ie,{onClick:P,size:"sm",className:"w-full sm:w-auto",children:[a.jsx(io,{className:"mr-2 h-4 w-4"}),"使用默认配置"]})]}),n==="upload"&&t&&a.jsx("div",{className:"flex gap-2",children:a.jsxs(ie,{onClick:Y,size:"sm",className:"w-full sm:w-auto",children:[a.jsx(fc,{className:"mr-2 h-4 w-4"}),"下载配置"]})}),n==="path"&&t&&a.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[a.jsxs(ie,{onClick:U,size:"sm",disabled:m||!!u,className:"w-full sm:w-auto",children:[a.jsx(ox,{className:"mr-2 h-4 w-4"}),m?"保存中...":"立即保存"]}),a.jsxs(ie,{onClick:V,size:"sm",variant:"outline",disabled:x,className:"w-full sm:w-auto",children:[a.jsx(Ii,{className:`mr-2 h-4 w-4 ${x?"animate-spin":""}`}),"刷新"]}),a.jsxs(ie,{onClick:H,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[a.jsx(Ht,{className:"mr-2 h-4 w-4"}),"清空路径"]})]}),t?a.jsxs(dl,{defaultValue:"napcat",className:"w-full",children:[a.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:a.jsxs(va,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5",children:[a.jsxs($t,{value:"napcat",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[a.jsx("span",{className:"hidden sm:inline",children:"Napcat 连接"}),a.jsx("span",{className:"sm:hidden",children:"Napcat"})]}),a.jsxs($t,{value:"maibot",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[a.jsx("span",{className:"hidden sm:inline",children:"麦麦连接"}),a.jsx("span",{className:"sm:hidden",children:"麦麦"})]}),a.jsxs($t,{value:"chat",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[a.jsx("span",{className:"hidden sm:inline",children:"聊天控制"}),a.jsx("span",{className:"sm:hidden",children:"聊天"})]}),a.jsxs($t,{value:"voice",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[a.jsx("span",{className:"hidden sm:inline",children:"语音设置"}),a.jsx("span",{className:"sm:hidden",children:"语音"})]}),a.jsx($t,{value:"debug",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:"调试"})]})}),a.jsx(On,{value:"napcat",className:"space-y-4",children:a.jsx(Gte,{config:t,onChange:K=>{r(K),B(K)}})}),a.jsx(On,{value:"maibot",className:"space-y-4",children:a.jsx(Xte,{config:t,onChange:K=>{r(K),B(K)}})}),a.jsx(On,{value:"chat",className:"space-y-4",children:a.jsx(Yte,{config:t,onChange:K=>{r(K),B(K)}})}),a.jsx(On,{value:"voice",className:"space-y-4",children:a.jsx(Kte,{config:t,onChange:K=>{r(K),B(K)}})}),a.jsx(On,{value:"debug",className:"space-y-4",children:a.jsx(Zte,{config:t,onChange:K=>{r(K),B(K)}})})]}):a.jsx("div",{className:"rounded-lg border bg-card p-6 md:p-12",children:a.jsxs("div",{className:"text-center space-y-3 md:space-y-4",children:[a.jsx(io,{className:"h-12 w-12 md:h-16 md:w-16 mx-auto text-muted-foreground"}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-base md:text-lg font-semibold",children:"尚未加载配置"}),a.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-2 px-4",children:n==="upload"?"请上传现有配置文件,或使用默认配置开始编辑":"请指定配置文件路径并点击加载按钮"})]})]})}),a.jsx(mn,{open:b,onOpenChange:O,children:a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认切换模式"}),a.jsxs(un,{children:["切换模式将清空当前配置,确定要继续吗?",a.jsx("br",{}),a.jsx("span",{className:"text-destructive font-medium",children:"请确保已保存重要配置"})]})]}),a.jsxs(on,{children:[a.jsx(hn,{onClick:()=>{O(!1),M(null)},children:"取消"}),a.jsx(dn,{onClick:J,children:"确认切换"})]})]})}),a.jsx(mn,{open:k,onOpenChange:j,children:a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认清空路径"}),a.jsxs(un,{children:["清空路径将清除当前配置,确定要继续吗?",a.jsx("br",{}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"此操作不会删除配置文件,只是清除界面中的配置"})]})]}),a.jsxs(on,{children:[a.jsx(hn,{onClick:()=>j(!1),children:"取消"}),a.jsx(dn,{onClick:ne,className:"bg-destructive hover:bg-destructive/90",children:"确认清空"})]})]})})]})})}function Gte({config:n,onChange:e}){return a.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"Napcat WebSocket 服务设置"}),a.jsxs("div",{className:"grid gap-3 md:gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"napcat-host",className:"text-sm md:text-base",children:"主机地址"}),a.jsx(Ae,{id:"napcat-host",value:n.napcat_server.host,onChange:t=>e({...n,napcat_server:{...n.napcat_server,host:t.target.value}}),placeholder:"localhost",className:"text-sm md:text-base"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的主机地址"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"napcat-port",className:"text-sm md:text-base",children:"端口"}),a.jsx(Ae,{id:"napcat-port",type:"number",value:n.napcat_server.port||"",onChange:t=>e({...n,napcat_server:{...n.napcat_server,port:t.target.value?parseInt(t.target.value):0}}),placeholder:"8095",className:"text-sm md:text-base"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的端口(留空使用默认值 8095)"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"napcat-token",className:"text-sm md:text-base",children:"访问令牌(Token)"}),a.jsx(Ae,{id:"napcat-token",type:"password",value:n.napcat_server.token,onChange:t=>e({...n,napcat_server:{...n.napcat_server,token:t.target.value}}),placeholder:"留空表示无需令牌",className:"text-sm md:text-base"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的访问令牌,若无则留空"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"napcat-heartbeat",className:"text-sm md:text-base",children:"心跳间隔(秒)"}),a.jsx(Ae,{id:"napcat-heartbeat",type:"number",value:n.napcat_server.heartbeat_interval||"",onChange:t=>e({...n,napcat_server:{...n.napcat_server,heartbeat_interval:t.target.value?parseInt(t.target.value):0}}),placeholder:"30",className:"text-sm md:text-base"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"与 Napcat 设置的心跳间隔保持一致(留空使用默认值 30)"})]})]})]})})}function Xte({config:n,onChange:e}){return a.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"麦麦 WebSocket 服务设置"}),a.jsxs("div",{className:"grid gap-3 md:gap-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"maibot-host",className:"text-sm md:text-base",children:"主机地址"}),a.jsx(Ae,{id:"maibot-host",value:n.maibot_server.host,onChange:t=>e({...n,maibot_server:{...n.maibot_server,host:t.target.value}}),placeholder:"localhost",className:"text-sm md:text-base"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 HOST 字段"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{htmlFor:"maibot-port",className:"text-sm md:text-base",children:"端口"}),a.jsx(Ae,{id:"maibot-port",type:"number",value:n.maibot_server.port||"",onChange:t=>e({...n,maibot_server:{...n.maibot_server,port:t.target.value?parseInt(t.target.value):0}}),placeholder:"8000",className:"text-sm md:text-base"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 PORT 字段(留空使用默认值 8000)"})]})]})]})})}function Yte({config:n,onChange:e}){const t=i=>{const l={...n};i==="group"?l.chat.group_list=[...l.chat.group_list,0]:i==="private"?l.chat.private_list=[...l.chat.private_list,0]:l.chat.ban_user_id=[...l.chat.ban_user_id,0],e(l)},r=(i,l)=>{const c={...n};i==="group"?c.chat.group_list=c.chat.group_list.filter((u,h)=>h!==l):i==="private"?c.chat.private_list=c.chat.private_list.filter((u,h)=>h!==l):c.chat.ban_user_id=c.chat.ban_user_id.filter((u,h)=>h!==l),e(c)},s=(i,l,c)=>{const u={...n};i==="group"?u.chat.group_list[l]=c:i==="private"?u.chat.private_list[l]=c:u.chat.ban_user_id[l]=c,e(u)};return a.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"聊天黑白名单功能"}),a.jsxs("div",{className:"grid gap-4 md:gap-6",children:[a.jsxs("div",{className:"space-y-3 md:space-y-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-sm md:text-base",children:"群组名单类型"}),a.jsxs(Bt,{value:n.chat.group_list_type,onValueChange:i=>e({...n,chat:{...n.chat,group_list_type:i}}),children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),a.jsx(Pe,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[a.jsx(te,{className:"text-sm md:text-base",children:"群组列表"}),a.jsxs(ie,{onClick:()=>t("group"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[a.jsx(io,{className:"mr-1 h-4 w-4"}),"添加群号"]})]}),n.chat.group_list.map((i,l)=>a.jsxs("div",{className:"flex gap-2",children:[a.jsx(Ae,{type:"number",value:i,onChange:c=>s("group",l,parseInt(c.target.value)||0),placeholder:"输入群号",className:"text-sm md:text-base"}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{size:"icon",variant:"outline",children:a.jsx(Ht,{className:"h-4 w-4"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:["确定要删除群号 ",i," 吗?此操作无法撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>r("group",l),children:"删除"})]})]})]})]},l)),n.chat.group_list.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无群组"})]})]}),a.jsxs("div",{className:"space-y-3 md:space-y-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-sm md:text-base",children:"私聊名单类型"}),a.jsxs(Bt,{value:n.chat.private_list_type,onValueChange:i=>e({...n,chat:{...n.chat,private_list_type:i}}),children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),a.jsx(Pe,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[a.jsx(te,{className:"text-sm md:text-base",children:"私聊列表"}),a.jsxs(ie,{onClick:()=>t("private"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[a.jsx(io,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),n.chat.private_list.map((i,l)=>a.jsxs("div",{className:"flex gap-2",children:[a.jsx(Ae,{type:"number",value:i,onChange:c=>s("private",l,parseInt(c.target.value)||0),placeholder:"输入QQ号",className:"text-sm md:text-base"}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{size:"icon",variant:"outline",children:a.jsx(Ht,{className:"h-4 w-4"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:["确定要删除用户 ",i," 吗?此操作无法撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>r("private",l),children:"删除"})]})]})]})]},l)),n.chat.private_list.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无用户"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[a.jsxs("div",{children:[a.jsx(te,{className:"text-sm md:text-base",children:"全局禁止名单"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"名单中的用户无法进行任何聊天"})]}),a.jsxs(ie,{onClick:()=>t("ban"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[a.jsx(io,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),n.chat.ban_user_id.map((i,l)=>a.jsxs("div",{className:"flex gap-2",children:[a.jsx(Ae,{type:"number",value:i,onChange:c=>s("ban",l,parseInt(c.target.value)||0),placeholder:"输入QQ号",className:"text-sm md:text-base"}),a.jsxs(mn,{children:[a.jsx(jr,{asChild:!0,children:a.jsx(ie,{size:"icon",variant:"outline",children:a.jsx(Ht,{className:"h-4 w-4"})})}),a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:["确定要从全局禁止名单中删除用户 ",i," 吗?此操作无法撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>r("ban",l),children:"删除"})]})]})]})]},l)),n.chat.ban_user_id.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无禁止用户"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(te,{className:"text-sm md:text-base",children:"屏蔽QQ官方机器人"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否屏蔽来自QQ官方机器人的消息"})]}),a.jsx(jt,{checked:n.chat.ban_qq_bot,onCheckedChange:i=>e({...n,chat:{...n.chat,ban_qq_bot:i}})})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(te,{className:"text-sm md:text-base",children:"启用戳一戳功能"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否响应戳一戳消息"})]}),a.jsx(jt,{checked:n.chat.enable_poke,onCheckedChange:i=>e({...n,chat:{...n.chat,enable_poke:i}})})]})]})]})})}function Kte({config:n,onChange:e}){return a.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"发送语音设置"}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(te,{className:"text-sm md:text-base",children:"使用 TTS 语音"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"请确保已配置 TTS 并有对应的适配器"})]}),a.jsx(jt,{checked:n.voice.use_tts,onCheckedChange:t=>e({...n,voice:{use_tts:t}})})]})]})})}function Zte({config:n,onChange:e}){return a.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"调试设置"}),a.jsx("div",{className:"grid gap-3 md:gap-4",children:a.jsxs("div",{className:"grid gap-2",children:[a.jsx(te,{className:"text-sm md:text-base",children:"日志等级"}),a.jsxs(Bt,{value:n.debug.level,onValueChange:t=>e({...n,debug:{level:t}}),children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"DEBUG",children:"DEBUG(调试)"}),a.jsx(Pe,{value:"INFO",children:"INFO(信息)"}),a.jsx(Pe,{value:"WARNING",children:"WARNING(警告)"}),a.jsx(Pe,{value:"ERROR",children:"ERROR(错误)"}),a.jsx(Pe,{value:"CRITICAL",children:"CRITICAL(严重)"})]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"设置适配器的日志输出等级"})]})})]})})}function h8(n){const e=[],t=String(n||"");let r=t.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=t.length,i=!0);const l=t.slice(s,r).trim();(l||!i)&&e.push(l),s=r+1,r=t.indexOf(",",s)}return e}function Jte(n,e){const t={};return(n[n.length-1]===""?[...n,""]:n).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const ene=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tne=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nne={};function f8(n,e){return(nne.jsx?tne:ene).test(n)}const rne=/[ \t\n\f\r]/g;function sne(n){return typeof n=="object"?n.type==="text"?m8(n.value):!1:m8(n)}function m8(n){return n.replace(rne,"")===""}class v0{constructor(e,t,r){this.normal=t,this.property=e,r&&(this.space=r)}}v0.prototype.normal={};v0.prototype.property={};v0.prototype.space=void 0;function iD(n,e){const t={},r={};for(const s of n)Object.assign(t,s.property),Object.assign(r,s.normal);return new v0(t,r,e)}function Lf(n){return n.toLowerCase()}class Is{constructor(e,t){this.attribute=t,this.property=e}}Is.prototype.attribute="";Is.prototype.booleanish=!1;Is.prototype.boolean=!1;Is.prototype.commaOrSpaceSeparated=!1;Is.prototype.commaSeparated=!1;Is.prototype.defined=!1;Is.prototype.mustUseProperty=!1;Is.prototype.number=!1;Is.prototype.overloadedBoolean=!1;Is.prototype.property="";Is.prototype.spaceSeparated=!1;Is.prototype.space=void 0;let ine=0;const kt=Dc(),mr=Dc(),m4=Dc(),ze=Dc(),Pn=Dc(),ed=Dc(),Zs=Dc();function Dc(){return 2**++ine}const p4=Object.freeze(Object.defineProperty({__proto__:null,boolean:kt,booleanish:mr,commaOrSpaceSeparated:Zs,commaSeparated:ed,number:ze,overloadedBoolean:m4,spaceSeparated:Pn},Symbol.toStringTag,{value:"Module"})),fb=Object.keys(p4);class d5 extends Is{constructor(e,t,r,s){let i=-1;if(super(e,t),p8(this,"space",s),typeof r=="number")for(;++i<fb.length;){const l=fb[i];p8(this,fb[i],(r&p4[l])===p4[l])}}}d5.prototype.defined=!0;function p8(n,e,t){t&&(n[e]=t)}function Dd(n){const e={},t={};for(const[r,s]of Object.entries(n.properties)){const i=new d5(r,n.transform(n.attributes||{},r),s,n.space);n.mustUseProperty&&n.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),e[r]=i,t[Lf(r)]=r,t[Lf(i.attribute)]=r}return new v0(e,t,n.space)}const aD=Dd({properties:{ariaActiveDescendant:null,ariaAtomic:mr,ariaAutoComplete:null,ariaBusy:mr,ariaChecked:mr,ariaColCount:ze,ariaColIndex:ze,ariaColSpan:ze,ariaControls:Pn,ariaCurrent:null,ariaDescribedBy:Pn,ariaDetails:null,ariaDisabled:mr,ariaDropEffect:Pn,ariaErrorMessage:null,ariaExpanded:mr,ariaFlowTo:Pn,ariaGrabbed:mr,ariaHasPopup:null,ariaHidden:mr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Pn,ariaLevel:ze,ariaLive:null,ariaModal:mr,ariaMultiLine:mr,ariaMultiSelectable:mr,ariaOrientation:null,ariaOwns:Pn,ariaPlaceholder:null,ariaPosInSet:ze,ariaPressed:mr,ariaReadOnly:mr,ariaRelevant:null,ariaRequired:mr,ariaRoleDescription:Pn,ariaRowCount:ze,ariaRowIndex:ze,ariaRowSpan:ze,ariaSelected:mr,ariaSetSize:ze,ariaSort:null,ariaValueMax:ze,ariaValueMin:ze,ariaValueNow:ze,ariaValueText:null,role:null},transform(n,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function lD(n,e){return e in n?n[e]:e}function oD(n,e){return lD(n,e.toLowerCase())}const ane=Dd({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ed,acceptCharset:Pn,accessKey:Pn,action:null,allow:null,allowFullScreen:kt,allowPaymentRequest:kt,allowUserMedia:kt,alt:null,as:null,async:kt,autoCapitalize:null,autoComplete:Pn,autoFocus:kt,autoPlay:kt,blocking:Pn,capture:null,charSet:null,checked:kt,cite:null,className:Pn,cols:ze,colSpan:null,content:null,contentEditable:mr,controls:kt,controlsList:Pn,coords:ze|ed,crossOrigin:null,data:null,dateTime:null,decoding:null,default:kt,defer:kt,dir:null,dirName:null,disabled:kt,download:m4,draggable:mr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:kt,formTarget:null,headers:Pn,height:ze,hidden:m4,high:ze,href:null,hrefLang:null,htmlFor:Pn,httpEquiv:Pn,id:null,imageSizes:null,imageSrcSet:null,inert:kt,inputMode:null,integrity:null,is:null,isMap:kt,itemId:null,itemProp:Pn,itemRef:Pn,itemScope:kt,itemType:Pn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:kt,low:ze,manifest:null,max:null,maxLength:ze,media:null,method:null,min:null,minLength:ze,multiple:kt,muted:kt,name:null,nonce:null,noModule:kt,noValidate:kt,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:kt,optimum:ze,pattern:null,ping:Pn,placeholder:null,playsInline:kt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:kt,referrerPolicy:null,rel:Pn,required:kt,reversed:kt,rows:ze,rowSpan:ze,sandbox:Pn,scope:null,scoped:kt,seamless:kt,selected:kt,shadowRootClonable:kt,shadowRootDelegatesFocus:kt,shadowRootMode:null,shape:null,size:ze,sizes:null,slot:null,span:ze,spellCheck:mr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ze,step:null,style:null,tabIndex:ze,target:null,title:null,translate:null,type:null,typeMustMatch:kt,useMap:null,value:mr,width:ze,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Pn,axis:null,background:null,bgColor:null,border:ze,borderColor:null,bottomMargin:ze,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:kt,declare:kt,event:null,face:null,frame:null,frameBorder:null,hSpace:ze,leftMargin:ze,link:null,longDesc:null,lowSrc:null,marginHeight:ze,marginWidth:ze,noResize:kt,noHref:kt,noShade:kt,noWrap:kt,object:null,profile:null,prompt:null,rev:null,rightMargin:ze,rules:null,scheme:null,scrolling:mr,standby:null,summary:null,text:null,topMargin:ze,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ze,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:kt,disableRemotePlayback:kt,prefix:null,property:null,results:ze,security:null,unselectable:null},space:"html",transform:oD}),lne=Dd({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",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:Zs,accentHeight:ze,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ze,amplitude:ze,arabicForm:null,ascent:ze,attributeName:null,attributeType:null,azimuth:ze,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ze,by:null,calcMode:null,capHeight:ze,className:Pn,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:ze,diffuseConstant:ze,direction:null,display:null,dur:null,divisor:ze,dominantBaseline:null,download:kt,dx:null,dy:null,edgeMode:null,editable:null,elevation:ze,enableBackground:null,end:null,event:null,exponent:ze,externalResourcesRequired:null,fill:null,fillOpacity:ze,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:ed,g2:ed,glyphName:ed,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ze,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ze,horizOriginX:ze,horizOriginY:ze,id:null,ideographic:ze,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ze,k:ze,k1:ze,k2:ze,k3:ze,k4:ze,kernelMatrix:Zs,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ze,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ze,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:ze,overlineThickness:ze,paintOrder:null,panose1:null,path:null,pathLength:ze,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Pn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ze,pointsAtY:ze,pointsAtZ:ze,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Zs,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Zs,rev:Zs,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Zs,requiredFeatures:Zs,requiredFonts:Zs,requiredFormats:Zs,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:ze,specularExponent:ze,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ze,strikethroughThickness:ze,string:null,stroke:null,strokeDashArray:Zs,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ze,strokeOpacity:ze,strokeWidth:null,style:null,surfaceScale:ze,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Zs,tabIndex:ze,tableValues:null,target:null,targetX:ze,targetY:ze,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Zs,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ze,underlineThickness:ze,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ze,values:null,vAlphabetic:ze,vMathematical:ze,vectorEffect:null,vHanging:ze,vIdeographic:ze,version:null,vertAdvY:ze,vertOriginX:ze,vertOriginY:ze,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ze,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:lD}),cD=Dd({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(n,e){return"xlink:"+e.slice(5).toLowerCase()}}),uD=Dd({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:oD}),dD=Dd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(n,e){return"xml:"+e.slice(3).toLowerCase()}}),one={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"},cne=/[A-Z]/g,g8=/-[a-z]/g,une=/^data[-\w.:]+$/i;function hD(n,e){const t=Lf(e);let r=e,s=Is;if(t in n.normal)return n.property[n.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&une.test(e)){if(e.charAt(4)==="-"){const i=e.slice(5).replace(g8,hne);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=e.slice(4);if(!g8.test(i)){let l=i.replace(cne,dne);l.charAt(0)!=="-"&&(l="-"+l),e="data"+l}}s=d5}return new s(r,e)}function dne(n){return"-"+n.toLowerCase()}function hne(n){return n.charAt(1).toUpperCase()}const fD=iD([aD,ane,cD,uD,dD],"html"),Ix=iD([aD,lne,cD,uD,dD],"svg");function x8(n){const e=String(n||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function fne(n){return n.join(" ").trim()}var Nu={},mb,v8;function mne(){if(v8)return mb;v8=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,u=`
|
||
`,h="/",m="*",p="",x="comment",v="declaration";function b(k,j){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];j=j||{};var T=1,M=1;function _(W){var J=W.match(e);J&&(T+=J.length);var H=W.lastIndexOf(u);M=~H?W.length-H:M+W.length}function D(){var W={line:T,column:M};return function(J){return J.position=new E(W),q(),J}}function E(W){this.start=W,this.end={line:T,column:M},this.source=j.source}E.prototype.content=k;function z(W){var J=new Error(j.source+":"+T+":"+M+": "+W);if(J.reason=W,J.filename=j.source,J.line=T,J.column=M,J.source=k,!j.silent)throw J}function Q(W){var J=W.exec(k);if(J){var H=J[0];return _(H),k=k.slice(H.length),J}}function q(){Q(t)}function B(W){var J;for(W=W||[];J=U();)J!==!1&&W.push(J);return W}function U(){var W=D();if(!(h!=k.charAt(0)||m!=k.charAt(1))){for(var J=2;p!=k.charAt(J)&&(m!=k.charAt(J)||h!=k.charAt(J+1));)++J;if(J+=2,p===k.charAt(J-1))return z("End of comment missing");var H=k.slice(2,J-2);return M+=2,_(H),k=k.slice(J),M+=2,W({type:x,comment:H})}}function V(){var W=D(),J=Q(r);if(J){if(U(),!Q(s))return z("property missing ':'");var H=Q(i),ae=W({type:v,property:O(J[0].replace(n,p)),value:H?O(H[0].replace(n,p)):p});return Q(l),ae}}function ce(){var W=[];B(W);for(var J;J=V();)J!==!1&&(W.push(J),B(W));return W}return q(),ce()}function O(k){return k?k.replace(c,p):p}return mb=b,mb}var y8;function pne(){if(y8)return Nu;y8=1;var n=Nu&&Nu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Nu,"__esModule",{value:!0}),Nu.default=t;const e=n(mne());function t(r,s){let i=null;if(!r||typeof r!="string")return i;const l=(0,e.default)(r),c=typeof s=="function";return l.forEach(u=>{if(u.type!=="declaration")return;const{property:h,value:m}=u;c?s(h,m,u):m&&(i=i||{},i[h]=m)}),i}return Nu}var Ih={},b8;function gne(){if(b8)return Ih;b8=1,Object.defineProperty(Ih,"__esModule",{value:!0}),Ih.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(h){return!h||t.test(h)||n.test(h)},l=function(h,m){return m.toUpperCase()},c=function(h,m){return"".concat(m,"-")},u=function(h,m){return m===void 0&&(m={}),i(h)?h:(h=h.toLowerCase(),m.reactCompat?h=h.replace(s,c):h=h.replace(r,c),h.replace(e,l))};return Ih.camelCase=u,Ih}var Fh,w8;function xne(){if(w8)return Fh;w8=1;var n=Fh&&Fh.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},e=n(pne()),t=gne();function r(s,i){var l={};return!s||typeof s!="string"||(0,e.default)(s,function(c,u){c&&u&&(l[(0,t.camelCase)(c,i)]=u)}),l}return r.default=r,Fh=r,Fh}var vne=xne();const yne=v9(vne),mD=pD("end"),h5=pD("start");function pD(n){return e;function e(t){const r=t&&t.position&&t.position[n]||{};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 bne(n){const e=h5(n),t=mD(n);if(e&&t)return{start:e,end:t}}function lf(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?S8(n.position):"start"in n||"end"in n?S8(n):"line"in n||"column"in n?g4(n):""}function g4(n){return O8(n&&n.line)+":"+O8(n&&n.column)}function S8(n){return g4(n&&n.start)+"-"+g4(n&&n.end)}function O8(n){return n&&typeof n=="number"?n:1}class as extends Error{constructor(e,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let s="",i={},l=!1;if(t&&("line"in t&&"column"in t?i={place:t}:"start"in t&&"end"in t?i={place:t}:"type"in t?i={ancestors:[t],place:t.position}:i={...t}),typeof e=="string"?s=e:!i.cause&&e&&(l=!0,s=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?i.ruleId=r:(i.source=r.slice(0,u),i.ruleId=r.slice(u+1))}if(!i.place&&i.ancestors&&i.ancestors){const u=i.ancestors[i.ancestors.length-1];u&&(i.place=u.position)}const c=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=c?c.line:void 0,this.name=lf(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=l&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}as.prototype.file="";as.prototype.name="";as.prototype.reason="";as.prototype.message="";as.prototype.stack="";as.prototype.column=void 0;as.prototype.line=void 0;as.prototype.ancestors=void 0;as.prototype.cause=void 0;as.prototype.fatal=void 0;as.prototype.place=void 0;as.prototype.ruleId=void 0;as.prototype.source=void 0;const f5={}.hasOwnProperty,wne=new Map,Sne=/[A-Z]/g,One=new Set(["table","tbody","thead","tfoot","tr"]),kne=new Set(["td","th"]),gD="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function jne(n,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Dne(t,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=_ne(t,e.jsx,e.jsxs)}const s={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Ix:fD,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},i=xD(s,n,void 0);return i&&typeof i!="string"?i:s.create(n,s.Fragment,{children:i||void 0},void 0)}function xD(n,e,t){if(e.type==="element")return Nne(n,e,t);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return Cne(n,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Mne(n,e,t);if(e.type==="mdxjsEsm")return Tne(n,e);if(e.type==="root")return Ane(n,e,t);if(e.type==="text")return Ene(n,e)}function Nne(n,e,t){const r=n.schema;let s=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Ix,n.schema=s),n.ancestors.push(e);const i=yD(n,e.tagName,!1),l=Rne(n,e);let c=p5(n,e);return One.has(e.tagName)&&(c=c.filter(function(u){return typeof u=="string"?!sne(u):!0})),vD(n,l,i,e),m5(l,c),n.ancestors.pop(),n.schema=r,n.create(e,i,l,t)}function Cne(n,e){if(e.data&&e.data.estree&&n.evaluater){const r=e.data.estree.body[0];return r.type,n.evaluater.evaluateExpression(r.expression)}Bf(n,e.position)}function Tne(n,e){if(e.data&&e.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(e.data.estree);Bf(n,e.position)}function Mne(n,e,t){const r=n.schema;let s=r;e.name==="svg"&&r.space==="html"&&(s=Ix,n.schema=s),n.ancestors.push(e);const i=e.name===null?n.Fragment:yD(n,e.name,!0),l=zne(n,e),c=p5(n,e);return vD(n,l,i,e),m5(l,c),n.ancestors.pop(),n.schema=r,n.create(e,i,l,t)}function Ane(n,e,t){const r={};return m5(r,p5(n,e)),n.create(e,n.Fragment,r,t)}function Ene(n,e){return e.value}function vD(n,e,t,r){typeof t!="string"&&t!==n.Fragment&&n.passNode&&(e.node=r)}function m5(n,e){if(e.length>0){const t=e.length>1?e:e[0];t&&(n.children=t)}}function _ne(n,e,t){return r;function r(s,i,l,c){const h=Array.isArray(l.children)?t:e;return c?h(i,l,c):h(i,l)}}function Dne(n,e){return t;function t(r,s,i,l){const c=Array.isArray(i.children),u=h5(r);return e(s,i,l,c,{columnNumber:u?u.column-1:void 0,fileName:n,lineNumber:u?u.line:void 0},void 0)}}function Rne(n,e){const t={};let r,s;for(s in e.properties)if(s!=="children"&&f5.call(e.properties,s)){const i=Pne(n,s,e.properties[s]);if(i){const[l,c]=i;n.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&kne.has(e.tagName)?r=c:t[l]=c}}if(r){const i=t.style||(t.style={});i[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function zne(n,e){const t={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&n.evaluater){const i=r.data.estree.body[0];i.type;const l=i.expression;l.type;const c=l.properties[0];c.type,Object.assign(t,n.evaluater.evaluateExpression(c.argument))}else Bf(n,e.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&n.evaluater){const c=r.value.data.estree.body[0];c.type,i=n.evaluater.evaluateExpression(c.expression)}else Bf(n,e.position);else i=r.value===null?!0:r.value;t[s]=i}return t}function p5(n,e){const t=[];let r=-1;const s=n.passKeys?new Map:wne;for(;++r<e.children.length;){const i=e.children[r];let l;if(n.passKeys){const u=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(u){const h=s.get(u)||0;l=u+"-"+h,s.set(u,h+1)}}const c=xD(n,i,l);c!==void 0&&t.push(c)}return t}function Pne(n,e,t){const r=hD(n.schema,e);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?Jte(t):fne(t)),r.property==="style"){let s=typeof t=="object"?t:Lne(n,String(t));return n.stylePropertyNameCase==="css"&&(s=Bne(s)),["style",s]}return[n.elementAttributeNameCase==="react"&&r.space?one[r.property]||r.property:r.attribute,t]}}function Lne(n,e){try{return yne(e,{reactCompat:!0})}catch(t){if(n.ignoreInvalidStyle)return{};const r=t,s=new as("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=n.filePath||void 0,s.url=gD+"#cannot-parse-style-attribute",s}}function yD(n,e,t){let r;if(!t)r={type:"Literal",value:e};else if(e.includes(".")){const s=e.split(".");let i=-1,l;for(;++i<s.length;){const c=f8(s[i])?{type:"Identifier",name:s[i]}:{type:"Literal",value:s[i]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(i&&c.type==="Literal"),optional:!1}:c}r=l}else r=f8(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const s=r.value;return f5.call(n.components,s)?n.components[s]:s}if(n.evaluater)return n.evaluater.evaluateExpression(r);Bf(n)}function Bf(n,e){const t=new as("Cannot handle MDX estrees without `createEvaluater`",{ancestors:n.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=n.filePath||void 0,t.url=gD+"#cannot-handle-mdx-estrees-without-createevaluater",t}function Bne(n){const e={};let t;for(t in n)f5.call(n,t)&&(e[Ine(t)]=n[t]);return e}function Ine(n){let e=n.replace(Sne,Fne);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function Fne(n){return"-"+n.toLowerCase()}const pb={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},qne={};function g5(n,e){const t=qne,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,s=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return bD(n,r,s)}function bD(n,e,t){if(Qne(n)){if("value"in n)return n.type==="html"&&!t?"":n.value;if(e&&"alt"in n&&n.alt)return n.alt;if("children"in n)return k8(n.children,e,t)}return Array.isArray(n)?k8(n,e,t):""}function k8(n,e,t){const r=[];let s=-1;for(;++s<n.length;)r[s]=bD(n[s],e,t);return r.join("")}function Qne(n){return!!(n&&typeof n=="object")}const j8=document.createElement("i");function x5(n){const e="&"+n+";";j8.innerHTML=e;const t=j8.textContent;return t.charCodeAt(t.length-1)===59&&n!=="semi"||t===e?!1:t}function ri(n,e,t,r){const s=n.length;let i=0,l;if(e<0?e=-e>s?0:s+e:e=e>s?s:e,t=t>0?t:0,r.length<1e4)l=Array.from(r),l.unshift(e,t),n.splice(...l);else for(t&&n.splice(e,t);i<r.length;)l=r.slice(i,i+1e4),l.unshift(e,0),n.splice(...l),i+=1e4,e+=1e4}function yi(n,e){return n.length>0?(ri(n,n.length,0,e),n):e}const N8={}.hasOwnProperty;function wD(n){const e={};let t=-1;for(;++t<n.length;)$ne(e,n[t]);return e}function $ne(n,e){let t;for(t in e){const s=(N8.call(n,t)?n[t]:void 0)||(n[t]={}),i=e[t];let l;if(i)for(l in i){N8.call(s,l)||(s[l]=[]);const c=i[l];Hne(s[l],Array.isArray(c)?c:c?[c]:[])}}}function Hne(n,e){let t=-1;const r=[];for(;++t<e.length;)(e[t].add==="after"?n:r).push(e[t]);ri(n,0,0,r)}function SD(n,e){const t=Number.parseInt(n,e);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"<22>":String.fromCodePoint(t)}function Fi(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ds=To(/[A-Za-z]/),rs=To(/[\dA-Za-z]/),Une=To(/[#-'*+\--9=?A-Z^-~]/);function Ug(n){return n!==null&&(n<32||n===127)}const x4=To(/\d/),Vne=To(/[\dA-Fa-f]/),Wne=To(/[!-/:-@[-`{-~]/);function Ze(n){return n!==null&&n<-2}function Dn(n){return n!==null&&(n<0||n===32)}function Ft(n){return n===-2||n===-1||n===32}const Fx=To(new RegExp("\\p{P}|\\p{S}","u")),Cc=To(/\s/);function To(n){return e;function e(t){return t!==null&&t>-1&&n.test(String.fromCharCode(t))}}function Rd(n){const e=[];let t=-1,r=0,s=0;for(;++t<n.length;){const i=n.charCodeAt(t);let l="";if(i===37&&rs(n.charCodeAt(t+1))&&rs(n.charCodeAt(t+2)))s=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(l=String.fromCharCode(i));else if(i>55295&&i<57344){const c=n.charCodeAt(t+1);i<56320&&c>56319&&c<57344?(l=String.fromCharCode(i,c),s=1):l="<22>"}else l=String.fromCharCode(i);l&&(e.push(n.slice(r,t),encodeURIComponent(l)),r=t+s+1,l=""),s&&(t+=s,s=0)}return e.join("")+n.slice(r)}function zt(n,e,t,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return l;function l(u){return Ft(u)?(n.enter(t),c(u)):e(u)}function c(u){return Ft(u)&&i++<s?(n.consume(u),c):(n.exit(t),e(u))}}const Gne={tokenize:Xne};function Xne(n){const e=n.attempt(this.parser.constructs.contentInitial,r,s);let t;return e;function r(c){if(c===null){n.consume(c);return}return n.enter("lineEnding"),n.consume(c),n.exit("lineEnding"),zt(n,e,"linePrefix")}function s(c){return n.enter("paragraph"),i(c)}function i(c){const u=n.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=u),t=u,l(c)}function l(c){if(c===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(c);return}return Ze(c)?(n.consume(c),n.exit("chunkText"),i):(n.consume(c),l)}}const Yne={tokenize:Kne},C8={tokenize:Zne};function Kne(n){const e=this,t=[];let r=0,s,i,l;return c;function c(M){if(r<t.length){const _=t[r];return e.containerState=_[1],n.attempt(_[0].continuation,u,h)(M)}return h(M)}function u(M){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,s&&T();const _=e.events.length;let D=_,E;for(;D--;)if(e.events[D][0]==="exit"&&e.events[D][1].type==="chunkFlow"){E=e.events[D][1].end;break}j(r);let z=_;for(;z<e.events.length;)e.events[z][1].end={...E},z++;return ri(e.events,D+1,0,e.events.slice(_)),e.events.length=z,h(M)}return c(M)}function h(M){if(r===t.length){if(!s)return x(M);if(s.currentConstruct&&s.currentConstruct.concrete)return b(M);e.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return e.containerState={},n.check(C8,m,p)(M)}function m(M){return s&&T(),j(r),x(M)}function p(M){return e.parser.lazy[e.now().line]=r!==t.length,l=e.now().offset,b(M)}function x(M){return e.containerState={},n.attempt(C8,v,b)(M)}function v(M){return r++,t.push([e.currentConstruct,e.containerState]),x(M)}function b(M){if(M===null){s&&T(),j(0),n.consume(M);return}return s=s||e.parser.flow(e.now()),n.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),O(M)}function O(M){if(M===null){k(n.exit("chunkFlow"),!0),j(0),n.consume(M);return}return Ze(M)?(n.consume(M),k(n.exit("chunkFlow")),r=0,e.interrupt=void 0,c):(n.consume(M),O)}function k(M,_){const D=e.sliceStream(M);if(_&&D.push(null),M.previous=i,i&&(i.next=M),i=M,s.defineSkip(M.start),s.write(D),e.parser.lazy[M.start.line]){let E=s.events.length;for(;E--;)if(s.events[E][1].start.offset<l&&(!s.events[E][1].end||s.events[E][1].end.offset>l))return;const z=e.events.length;let Q=z,q,B;for(;Q--;)if(e.events[Q][0]==="exit"&&e.events[Q][1].type==="chunkFlow"){if(q){B=e.events[Q][1].end;break}q=!0}for(j(r),E=z;E<e.events.length;)e.events[E][1].end={...B},E++;ri(e.events,Q+1,0,e.events.slice(z)),e.events.length=E}}function j(M){let _=t.length;for(;_-- >M;){const D=t[_];e.containerState=D[1],D[0].exit.call(e,n)}t.length=M}function T(){s.write([null]),i=void 0,s=void 0,e.containerState._closeFlow=void 0}}function Zne(n,e,t){return zt(n,n.attempt(this.parser.constructs.document,e,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function yd(n){if(n===null||Dn(n)||Cc(n))return 1;if(Fx(n))return 2}function qx(n,e,t){const r=[];let s=-1;for(;++s<n.length;){const i=n[s].resolveAll;i&&!r.includes(i)&&(e=i(e,t),r.push(i))}return e}const v4={name:"attention",resolveAll:Jne,tokenize:ere};function Jne(n,e){let t=-1,r,s,i,l,c,u,h,m;for(;++t<n.length;)if(n[t][0]==="enter"&&n[t][1].type==="attentionSequence"&&n[t][1]._close){for(r=t;r--;)if(n[r][0]==="exit"&&n[r][1].type==="attentionSequence"&&n[r][1]._open&&e.sliceSerialize(n[r][1]).charCodeAt(0)===e.sliceSerialize(n[t][1]).charCodeAt(0)){if((n[r][1]._close||n[t][1]._open)&&(n[t][1].end.offset-n[t][1].start.offset)%3&&!((n[r][1].end.offset-n[r][1].start.offset+n[t][1].end.offset-n[t][1].start.offset)%3))continue;u=n[r][1].end.offset-n[r][1].start.offset>1&&n[t][1].end.offset-n[t][1].start.offset>1?2:1;const p={...n[r][1].end},x={...n[t][1].start};T8(p,-u),T8(x,u),l={type:u>1?"strongSequence":"emphasisSequence",start:p,end:{...n[r][1].end}},c={type:u>1?"strongSequence":"emphasisSequence",start:{...n[t][1].start},end:x},i={type:u>1?"strongText":"emphasisText",start:{...n[r][1].end},end:{...n[t][1].start}},s={type:u>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},n[r][1].end={...l.start},n[t][1].start={...c.end},h=[],n[r][1].end.offset-n[r][1].start.offset&&(h=yi(h,[["enter",n[r][1],e],["exit",n[r][1],e]])),h=yi(h,[["enter",s,e],["enter",l,e],["exit",l,e],["enter",i,e]]),h=yi(h,qx(e.parser.constructs.insideSpan.null,n.slice(r+1,t),e)),h=yi(h,[["exit",i,e],["enter",c,e],["exit",c,e],["exit",s,e]]),n[t][1].end.offset-n[t][1].start.offset?(m=2,h=yi(h,[["enter",n[t][1],e],["exit",n[t][1],e]])):m=0,ri(n,r-1,t-r+3,h),t=r+h.length-m-2;break}}for(t=-1;++t<n.length;)n[t][1].type==="attentionSequence"&&(n[t][1].type="data");return n}function ere(n,e){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,s=yd(r);let i;return l;function l(u){return i=u,n.enter("attentionSequence"),c(u)}function c(u){if(u===i)return n.consume(u),c;const h=n.exit("attentionSequence"),m=yd(u),p=!m||m===2&&s||t.includes(u),x=!s||s===2&&m||t.includes(r);return h._open=!!(i===42?p:p&&(s||!x)),h._close=!!(i===42?x:x&&(m||!p)),e(u)}}function T8(n,e){n.column+=e,n.offset+=e,n._bufferIndex+=e}const tre={name:"autolink",tokenize:nre};function nre(n,e,t){let r=0;return s;function s(v){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(v),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),i}function i(v){return ds(v)?(n.consume(v),l):v===64?t(v):h(v)}function l(v){return v===43||v===45||v===46||rs(v)?(r=1,c(v)):h(v)}function c(v){return v===58?(n.consume(v),r=0,u):(v===43||v===45||v===46||rs(v))&&r++<32?(n.consume(v),c):(r=0,h(v))}function u(v){return v===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(v),n.exit("autolinkMarker"),n.exit("autolink"),e):v===null||v===32||v===60||Ug(v)?t(v):(n.consume(v),u)}function h(v){return v===64?(n.consume(v),m):Une(v)?(n.consume(v),h):t(v)}function m(v){return rs(v)?p(v):t(v)}function p(v){return v===46?(n.consume(v),r=0,m):v===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(v),n.exit("autolinkMarker"),n.exit("autolink"),e):x(v)}function x(v){if((v===45||rs(v))&&r++<63){const b=v===45?x:p;return n.consume(v),b}return t(v)}}const y0={partial:!0,tokenize:rre};function rre(n,e,t){return r;function r(i){return Ft(i)?zt(n,s,"linePrefix")(i):s(i)}function s(i){return i===null||Ze(i)?e(i):t(i)}}const OD={continuation:{tokenize:ire},exit:are,name:"blockQuote",tokenize:sre};function sre(n,e,t){const r=this;return s;function s(l){if(l===62){const c=r.containerState;return c.open||(n.enter("blockQuote",{_container:!0}),c.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(l),n.exit("blockQuoteMarker"),i}return t(l)}function i(l){return Ft(l)?(n.enter("blockQuotePrefixWhitespace"),n.consume(l),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),e):(n.exit("blockQuotePrefix"),e(l))}}function ire(n,e,t){const r=this;return s;function s(l){return Ft(l)?zt(n,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):i(l)}function i(l){return n.attempt(OD,e,t)(l)}}function are(n){n.exit("blockQuote")}const kD={name:"characterEscape",tokenize:lre};function lre(n,e,t){return r;function r(i){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(i),n.exit("escapeMarker"),s}function s(i){return Wne(i)?(n.enter("characterEscapeValue"),n.consume(i),n.exit("characterEscapeValue"),n.exit("characterEscape"),e):t(i)}}const jD={name:"characterReference",tokenize:ore};function ore(n,e,t){const r=this;let s=0,i,l;return c;function c(p){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(p),n.exit("characterReferenceMarker"),u}function u(p){return p===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(p),n.exit("characterReferenceMarkerNumeric"),h):(n.enter("characterReferenceValue"),i=31,l=rs,m(p))}function h(p){return p===88||p===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(p),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),i=6,l=Vne,m):(n.enter("characterReferenceValue"),i=7,l=x4,m(p))}function m(p){if(p===59&&s){const x=n.exit("characterReferenceValue");return l===rs&&!x5(r.sliceSerialize(x))?t(p):(n.enter("characterReferenceMarker"),n.consume(p),n.exit("characterReferenceMarker"),n.exit("characterReference"),e)}return l(p)&&s++<i?(n.consume(p),m):t(p)}}const M8={partial:!0,tokenize:ure},A8={concrete:!0,name:"codeFenced",tokenize:cre};function cre(n,e,t){const r=this,s={partial:!0,tokenize:D};let i=0,l=0,c;return u;function u(E){return h(E)}function h(E){const z=r.events[r.events.length-1];return i=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,c=E,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),m(E)}function m(E){return E===c?(l++,n.consume(E),m):l<3?t(E):(n.exit("codeFencedFenceSequence"),Ft(E)?zt(n,p,"whitespace")(E):p(E))}function p(E){return E===null||Ze(E)?(n.exit("codeFencedFence"),r.interrupt?e(E):n.check(M8,O,_)(E)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),x(E))}function x(E){return E===null||Ze(E)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),p(E)):Ft(E)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),zt(n,v,"whitespace")(E)):E===96&&E===c?t(E):(n.consume(E),x)}function v(E){return E===null||Ze(E)?p(E):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),b(E))}function b(E){return E===null||Ze(E)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),p(E)):E===96&&E===c?t(E):(n.consume(E),b)}function O(E){return n.attempt(s,_,k)(E)}function k(E){return n.enter("lineEnding"),n.consume(E),n.exit("lineEnding"),j}function j(E){return i>0&&Ft(E)?zt(n,T,"linePrefix",i+1)(E):T(E)}function T(E){return E===null||Ze(E)?n.check(M8,O,_)(E):(n.enter("codeFlowValue"),M(E))}function M(E){return E===null||Ze(E)?(n.exit("codeFlowValue"),T(E)):(n.consume(E),M)}function _(E){return n.exit("codeFenced"),e(E)}function D(E,z,Q){let q=0;return B;function B(J){return E.enter("lineEnding"),E.consume(J),E.exit("lineEnding"),U}function U(J){return E.enter("codeFencedFence"),Ft(J)?zt(E,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(J):V(J)}function V(J){return J===c?(E.enter("codeFencedFenceSequence"),ce(J)):Q(J)}function ce(J){return J===c?(q++,E.consume(J),ce):q>=l?(E.exit("codeFencedFenceSequence"),Ft(J)?zt(E,W,"whitespace")(J):W(J)):Q(J)}function W(J){return J===null||Ze(J)?(E.exit("codeFencedFence"),z(J)):Q(J)}}}function ure(n,e,t){const r=this;return s;function s(l){return l===null?t(l):(n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),i)}function i(l){return r.parser.lazy[r.now().line]?t(l):e(l)}}const gb={name:"codeIndented",tokenize:hre},dre={partial:!0,tokenize:fre};function hre(n,e,t){const r=this;return s;function s(h){return n.enter("codeIndented"),zt(n,i,"linePrefix",5)(h)}function i(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):t(h)}function l(h){return h===null?u(h):Ze(h)?n.attempt(dre,l,u)(h):(n.enter("codeFlowValue"),c(h))}function c(h){return h===null||Ze(h)?(n.exit("codeFlowValue"),l(h)):(n.consume(h),c)}function u(h){return n.exit("codeIndented"),e(h)}}function fre(n,e,t){const r=this;return s;function s(l){return r.parser.lazy[r.now().line]?t(l):Ze(l)?(n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),s):zt(n,i,"linePrefix",5)(l)}function i(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?e(l):Ze(l)?s(l):t(l)}}const mre={name:"codeText",previous:gre,resolve:pre,tokenize:xre};function pre(n){let e=n.length-4,t=3,r,s;if((n[t][1].type==="lineEnding"||n[t][1].type==="space")&&(n[e][1].type==="lineEnding"||n[e][1].type==="space")){for(r=t;++r<e;)if(n[r][1].type==="codeTextData"){n[t][1].type="codeTextPadding",n[e][1].type="codeTextPadding",t+=2,e-=2;break}}for(r=t-1,e++;++r<=e;)s===void 0?r!==e&&n[r][1].type!=="lineEnding"&&(s=r):(r===e||n[r][1].type==="lineEnding")&&(n[s][1].type="codeTextData",r!==s+2&&(n[s][1].end=n[r-1][1].end,n.splice(s+2,r-s-2),e-=r-s-2,r=s+2),s=void 0);return n}function gre(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function xre(n,e,t){let r=0,s,i;return l;function l(p){return n.enter("codeText"),n.enter("codeTextSequence"),c(p)}function c(p){return p===96?(n.consume(p),r++,c):(n.exit("codeTextSequence"),u(p))}function u(p){return p===null?t(p):p===32?(n.enter("space"),n.consume(p),n.exit("space"),u):p===96?(i=n.enter("codeTextSequence"),s=0,m(p)):Ze(p)?(n.enter("lineEnding"),n.consume(p),n.exit("lineEnding"),u):(n.enter("codeTextData"),h(p))}function h(p){return p===null||p===32||p===96||Ze(p)?(n.exit("codeTextData"),u(p)):(n.consume(p),h)}function m(p){return p===96?(n.consume(p),s++,m):s===r?(n.exit("codeTextSequence"),n.exit("codeText"),e(p)):(i.type="codeTextData",h(p))}}class vre{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,t,r){const s=t||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&qh(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),qh(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),qh(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);qh(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);qh(this.left,t.reverse())}}}function qh(n,e){let t=0;if(e.length<1e4)n.push(...e);else for(;t<e.length;)n.push(...e.slice(t,t+1e4)),t+=1e4}function ND(n){const e={};let t=-1,r,s,i,l,c,u,h;const m=new vre(n);for(;++t<m.length;){for(;t in e;)t=e[t];if(r=m.get(t),t&&r[1].type==="chunkFlow"&&m.get(t-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,i=0,i<u.length&&u[i][1].type==="lineEndingBlank"&&(i+=2),i<u.length&&u[i][1].type==="content"))for(;++i<u.length&&u[i][1].type!=="content";)u[i][1].type==="chunkText"&&(u[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,yre(m,t)),t=e[t],h=!0);else if(r[1]._container){for(i=t,s=void 0;i--;)if(l=m.get(i),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(s&&(m.get(s)[1].type="lineEndingBlank"),l[1].type="lineEnding",s=i);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;s&&(r[1].end={...m.get(s)[1].start},c=m.slice(s,t),c.unshift(r),m.splice(s,t-s+1,c))}}return ri(n,0,Number.POSITIVE_INFINITY,m.slice(0)),!h}function yre(n,e){const t=n.get(e)[1],r=n.get(e)[2];let s=e-1;const i=[];let l=t._tokenizer;l||(l=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,u=[],h={};let m,p,x=-1,v=t,b=0,O=0;const k=[O];for(;v;){for(;n.get(++s)[1]!==v;);i.push(s),v._tokenizer||(m=r.sliceStream(v),v.next||m.push(null),p&&l.defineSkip(v.start),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),p=v,v=v.next}for(v=t;++x<c.length;)c[x][0]==="exit"&&c[x-1][0]==="enter"&&c[x][1].type===c[x-1][1].type&&c[x][1].start.line!==c[x][1].end.line&&(O=x+1,k.push(O),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(l.events=[],v?(v._tokenizer=void 0,v.previous=void 0):k.pop(),x=k.length;x--;){const j=c.slice(k[x],k[x+1]),T=i.pop();u.push([T,T+j.length-1]),n.splice(T,2,j)}for(u.reverse(),x=-1;++x<u.length;)h[b+u[x][0]]=b+u[x][1],b+=u[x][1]-u[x][0]-1;return h}const bre={resolve:Sre,tokenize:Ore},wre={partial:!0,tokenize:kre};function Sre(n){return ND(n),n}function Ore(n,e){let t;return r;function r(c){return n.enter("content"),t=n.enter("chunkContent",{contentType:"content"}),s(c)}function s(c){return c===null?i(c):Ze(c)?n.check(wre,l,i)(c):(n.consume(c),s)}function i(c){return n.exit("chunkContent"),n.exit("content"),e(c)}function l(c){return n.consume(c),n.exit("chunkContent"),t.next=n.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,s}}function kre(n,e,t){const r=this;return s;function s(l){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),zt(n,i,"linePrefix")}function i(l){if(l===null||Ze(l))return t(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?e(l):n.interrupt(r.parser.constructs.flow,t,e)(l)}}function CD(n,e,t,r,s,i,l,c,u){const h=u||Number.POSITIVE_INFINITY;let m=0;return p;function p(j){return j===60?(n.enter(r),n.enter(s),n.enter(i),n.consume(j),n.exit(i),x):j===null||j===32||j===41||Ug(j)?t(j):(n.enter(r),n.enter(l),n.enter(c),n.enter("chunkString",{contentType:"string"}),O(j))}function x(j){return j===62?(n.enter(i),n.consume(j),n.exit(i),n.exit(s),n.exit(r),e):(n.enter(c),n.enter("chunkString",{contentType:"string"}),v(j))}function v(j){return j===62?(n.exit("chunkString"),n.exit(c),x(j)):j===null||j===60||Ze(j)?t(j):(n.consume(j),j===92?b:v)}function b(j){return j===60||j===62||j===92?(n.consume(j),v):v(j)}function O(j){return!m&&(j===null||j===41||Dn(j))?(n.exit("chunkString"),n.exit(c),n.exit(l),n.exit(r),e(j)):m<h&&j===40?(n.consume(j),m++,O):j===41?(n.consume(j),m--,O):j===null||j===32||j===40||Ug(j)?t(j):(n.consume(j),j===92?k:O)}function k(j){return j===40||j===41||j===92?(n.consume(j),O):O(j)}}function TD(n,e,t,r,s,i){const l=this;let c=0,u;return h;function h(v){return n.enter(r),n.enter(s),n.consume(v),n.exit(s),n.enter(i),m}function m(v){return c>999||v===null||v===91||v===93&&!u||v===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?t(v):v===93?(n.exit(i),n.enter(s),n.consume(v),n.exit(s),n.exit(r),e):Ze(v)?(n.enter("lineEnding"),n.consume(v),n.exit("lineEnding"),m):(n.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===null||v===91||v===93||Ze(v)||c++>999?(n.exit("chunkString"),m(v)):(n.consume(v),u||(u=!Ft(v)),v===92?x:p)}function x(v){return v===91||v===92||v===93?(n.consume(v),c++,p):p(v)}}function MD(n,e,t,r,s,i){let l;return c;function c(x){return x===34||x===39||x===40?(n.enter(r),n.enter(s),n.consume(x),n.exit(s),l=x===40?41:x,u):t(x)}function u(x){return x===l?(n.enter(s),n.consume(x),n.exit(s),n.exit(r),e):(n.enter(i),h(x))}function h(x){return x===l?(n.exit(i),u(l)):x===null?t(x):Ze(x)?(n.enter("lineEnding"),n.consume(x),n.exit("lineEnding"),zt(n,h,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===l||x===null||Ze(x)?(n.exit("chunkString"),h(x)):(n.consume(x),x===92?p:m)}function p(x){return x===l||x===92?(n.consume(x),m):m(x)}}function of(n,e){let t;return r;function r(s){return Ze(s)?(n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),t=!0,r):Ft(s)?zt(n,r,t?"linePrefix":"lineSuffix")(s):e(s)}}const jre={name:"definition",tokenize:Cre},Nre={partial:!0,tokenize:Tre};function Cre(n,e,t){const r=this;let s;return i;function i(v){return n.enter("definition"),l(v)}function l(v){return TD.call(r,n,c,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return s=Fi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(n.enter("definitionMarker"),n.consume(v),n.exit("definitionMarker"),u):t(v)}function u(v){return Dn(v)?of(n,h)(v):h(v)}function h(v){return CD(n,m,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function m(v){return n.attempt(Nre,p,p)(v)}function p(v){return Ft(v)?zt(n,x,"whitespace")(v):x(v)}function x(v){return v===null||Ze(v)?(n.exit("definition"),r.parser.defined.push(s),e(v)):t(v)}}function Tre(n,e,t){return r;function r(c){return Dn(c)?of(n,s)(c):t(c)}function s(c){return MD(n,i,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function i(c){return Ft(c)?zt(n,l,"whitespace")(c):l(c)}function l(c){return c===null||Ze(c)?e(c):t(c)}}const Mre={name:"hardBreakEscape",tokenize:Are};function Are(n,e,t){return r;function r(i){return n.enter("hardBreakEscape"),n.consume(i),s}function s(i){return Ze(i)?(n.exit("hardBreakEscape"),e(i)):t(i)}}const Ere={name:"headingAtx",resolve:_re,tokenize:Dre};function _re(n,e){let t=n.length-2,r=3,s,i;return n[r][1].type==="whitespace"&&(r+=2),t-2>r&&n[t][1].type==="whitespace"&&(t-=2),n[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&n[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(s={type:"atxHeadingText",start:n[r][1].start,end:n[t][1].end},i={type:"chunkText",start:n[r][1].start,end:n[t][1].end,contentType:"text"},ri(n,r,t-r+1,[["enter",s,e],["enter",i,e],["exit",i,e],["exit",s,e]])),n}function Dre(n,e,t){let r=0;return s;function s(m){return n.enter("atxHeading"),i(m)}function i(m){return n.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&r++<6?(n.consume(m),l):m===null||Dn(m)?(n.exit("atxHeadingSequence"),c(m)):t(m)}function c(m){return m===35?(n.enter("atxHeadingSequence"),u(m)):m===null||Ze(m)?(n.exit("atxHeading"),e(m)):Ft(m)?zt(n,c,"whitespace")(m):(n.enter("atxHeadingText"),h(m))}function u(m){return m===35?(n.consume(m),u):(n.exit("atxHeadingSequence"),c(m))}function h(m){return m===null||m===35||Dn(m)?(n.exit("atxHeadingText"),c(m)):(n.consume(m),h)}}const Rre=["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"],E8=["pre","script","style","textarea"],zre={concrete:!0,name:"htmlFlow",resolveTo:Bre,tokenize:Ire},Pre={partial:!0,tokenize:qre},Lre={partial:!0,tokenize:Fre};function Bre(n){let e=n.length;for(;e--&&!(n[e][0]==="enter"&&n[e][1].type==="htmlFlow"););return e>1&&n[e-2][1].type==="linePrefix"&&(n[e][1].start=n[e-2][1].start,n[e+1][1].start=n[e-2][1].start,n.splice(e-2,2)),n}function Ire(n,e,t){const r=this;let s,i,l,c,u;return h;function h(P){return m(P)}function m(P){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(P),p}function p(P){return P===33?(n.consume(P),x):P===47?(n.consume(P),i=!0,O):P===63?(n.consume(P),s=3,r.interrupt?e:R):ds(P)?(n.consume(P),l=String.fromCharCode(P),k):t(P)}function x(P){return P===45?(n.consume(P),s=2,v):P===91?(n.consume(P),s=5,c=0,b):ds(P)?(n.consume(P),s=4,r.interrupt?e:R):t(P)}function v(P){return P===45?(n.consume(P),r.interrupt?e:R):t(P)}function b(P){const K="CDATA[";return P===K.charCodeAt(c++)?(n.consume(P),c===K.length?r.interrupt?e:V:b):t(P)}function O(P){return ds(P)?(n.consume(P),l=String.fromCharCode(P),k):t(P)}function k(P){if(P===null||P===47||P===62||Dn(P)){const K=P===47,$=l.toLowerCase();return!K&&!i&&E8.includes($)?(s=1,r.interrupt?e(P):V(P)):Rre.includes(l.toLowerCase())?(s=6,K?(n.consume(P),j):r.interrupt?e(P):V(P)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(P):i?T(P):M(P))}return P===45||rs(P)?(n.consume(P),l+=String.fromCharCode(P),k):t(P)}function j(P){return P===62?(n.consume(P),r.interrupt?e:V):t(P)}function T(P){return Ft(P)?(n.consume(P),T):B(P)}function M(P){return P===47?(n.consume(P),B):P===58||P===95||ds(P)?(n.consume(P),_):Ft(P)?(n.consume(P),M):B(P)}function _(P){return P===45||P===46||P===58||P===95||rs(P)?(n.consume(P),_):D(P)}function D(P){return P===61?(n.consume(P),E):Ft(P)?(n.consume(P),D):M(P)}function E(P){return P===null||P===60||P===61||P===62||P===96?t(P):P===34||P===39?(n.consume(P),u=P,z):Ft(P)?(n.consume(P),E):Q(P)}function z(P){return P===u?(n.consume(P),u=null,q):P===null||Ze(P)?t(P):(n.consume(P),z)}function Q(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||Dn(P)?D(P):(n.consume(P),Q)}function q(P){return P===47||P===62||Ft(P)?M(P):t(P)}function B(P){return P===62?(n.consume(P),U):t(P)}function U(P){return P===null||Ze(P)?V(P):Ft(P)?(n.consume(P),U):t(P)}function V(P){return P===45&&s===2?(n.consume(P),H):P===60&&s===1?(n.consume(P),ae):P===62&&s===4?(n.consume(P),me):P===63&&s===3?(n.consume(P),R):P===93&&s===5?(n.consume(P),ue):Ze(P)&&(s===6||s===7)?(n.exit("htmlFlowData"),n.check(Pre,Y,ce)(P)):P===null||Ze(P)?(n.exit("htmlFlowData"),ce(P)):(n.consume(P),V)}function ce(P){return n.check(Lre,W,Y)(P)}function W(P){return n.enter("lineEnding"),n.consume(P),n.exit("lineEnding"),J}function J(P){return P===null||Ze(P)?ce(P):(n.enter("htmlFlowData"),V(P))}function H(P){return P===45?(n.consume(P),R):V(P)}function ae(P){return P===47?(n.consume(P),l="",ne):V(P)}function ne(P){if(P===62){const K=l.toLowerCase();return E8.includes(K)?(n.consume(P),me):V(P)}return ds(P)&&l.length<8?(n.consume(P),l+=String.fromCharCode(P),ne):V(P)}function ue(P){return P===93?(n.consume(P),R):V(P)}function R(P){return P===62?(n.consume(P),me):P===45&&s===2?(n.consume(P),R):V(P)}function me(P){return P===null||Ze(P)?(n.exit("htmlFlowData"),Y(P)):(n.consume(P),me)}function Y(P){return n.exit("htmlFlow"),e(P)}}function Fre(n,e,t){const r=this;return s;function s(l){return Ze(l)?(n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),i):t(l)}function i(l){return r.parser.lazy[r.now().line]?t(l):e(l)}}function qre(n,e,t){return r;function r(s){return n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),n.attempt(y0,e,t)}}const Qre={name:"htmlText",tokenize:$re};function $re(n,e,t){const r=this;let s,i,l;return c;function c(R){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(R),u}function u(R){return R===33?(n.consume(R),h):R===47?(n.consume(R),D):R===63?(n.consume(R),M):ds(R)?(n.consume(R),Q):t(R)}function h(R){return R===45?(n.consume(R),m):R===91?(n.consume(R),i=0,b):ds(R)?(n.consume(R),T):t(R)}function m(R){return R===45?(n.consume(R),v):t(R)}function p(R){return R===null?t(R):R===45?(n.consume(R),x):Ze(R)?(l=p,ae(R)):(n.consume(R),p)}function x(R){return R===45?(n.consume(R),v):p(R)}function v(R){return R===62?H(R):R===45?x(R):p(R)}function b(R){const me="CDATA[";return R===me.charCodeAt(i++)?(n.consume(R),i===me.length?O:b):t(R)}function O(R){return R===null?t(R):R===93?(n.consume(R),k):Ze(R)?(l=O,ae(R)):(n.consume(R),O)}function k(R){return R===93?(n.consume(R),j):O(R)}function j(R){return R===62?H(R):R===93?(n.consume(R),j):O(R)}function T(R){return R===null||R===62?H(R):Ze(R)?(l=T,ae(R)):(n.consume(R),T)}function M(R){return R===null?t(R):R===63?(n.consume(R),_):Ze(R)?(l=M,ae(R)):(n.consume(R),M)}function _(R){return R===62?H(R):M(R)}function D(R){return ds(R)?(n.consume(R),E):t(R)}function E(R){return R===45||rs(R)?(n.consume(R),E):z(R)}function z(R){return Ze(R)?(l=z,ae(R)):Ft(R)?(n.consume(R),z):H(R)}function Q(R){return R===45||rs(R)?(n.consume(R),Q):R===47||R===62||Dn(R)?q(R):t(R)}function q(R){return R===47?(n.consume(R),H):R===58||R===95||ds(R)?(n.consume(R),B):Ze(R)?(l=q,ae(R)):Ft(R)?(n.consume(R),q):H(R)}function B(R){return R===45||R===46||R===58||R===95||rs(R)?(n.consume(R),B):U(R)}function U(R){return R===61?(n.consume(R),V):Ze(R)?(l=U,ae(R)):Ft(R)?(n.consume(R),U):q(R)}function V(R){return R===null||R===60||R===61||R===62||R===96?t(R):R===34||R===39?(n.consume(R),s=R,ce):Ze(R)?(l=V,ae(R)):Ft(R)?(n.consume(R),V):(n.consume(R),W)}function ce(R){return R===s?(n.consume(R),s=void 0,J):R===null?t(R):Ze(R)?(l=ce,ae(R)):(n.consume(R),ce)}function W(R){return R===null||R===34||R===39||R===60||R===61||R===96?t(R):R===47||R===62||Dn(R)?q(R):(n.consume(R),W)}function J(R){return R===47||R===62||Dn(R)?q(R):t(R)}function H(R){return R===62?(n.consume(R),n.exit("htmlTextData"),n.exit("htmlText"),e):t(R)}function ae(R){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(R),n.exit("lineEnding"),ne}function ne(R){return Ft(R)?zt(n,ue,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):ue(R)}function ue(R){return n.enter("htmlTextData"),l(R)}}const v5={name:"labelEnd",resolveAll:Wre,resolveTo:Gre,tokenize:Xre},Hre={tokenize:Yre},Ure={tokenize:Kre},Vre={tokenize:Zre};function Wre(n){let e=-1;const t=[];for(;++e<n.length;){const r=n[e][1];if(t.push(n[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",e+=s}}return n.length!==t.length&&ri(n,0,n.length,t),n}function Gre(n,e){let t=n.length,r=0,s,i,l,c;for(;t--;)if(s=n[t][1],i){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;n[t][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(l){if(n[t][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(i=t,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(l=t);const u={type:n[i][1].type==="labelLink"?"link":"image",start:{...n[i][1].start},end:{...n[n.length-1][1].end}},h={type:"label",start:{...n[i][1].start},end:{...n[l][1].end}},m={type:"labelText",start:{...n[i+r+2][1].end},end:{...n[l-2][1].start}};return c=[["enter",u,e],["enter",h,e]],c=yi(c,n.slice(i+1,i+r+3)),c=yi(c,[["enter",m,e]]),c=yi(c,qx(e.parser.constructs.insideSpan.null,n.slice(i+r+4,l-3),e)),c=yi(c,[["exit",m,e],n[l-2],n[l-1],["exit",h,e]]),c=yi(c,n.slice(l+1)),c=yi(c,[["exit",u,e]]),ri(n,i,n.length,c),n}function Xre(n,e,t){const r=this;let s=r.events.length,i,l;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){i=r.events[s][1];break}return c;function c(x){return i?i._inactive?p(x):(l=r.parser.defined.includes(Fi(r.sliceSerialize({start:i.end,end:r.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(x),n.exit("labelMarker"),n.exit("labelEnd"),u):t(x)}function u(x){return x===40?n.attempt(Hre,m,l?m:p)(x):x===91?n.attempt(Ure,m,l?h:p)(x):l?m(x):p(x)}function h(x){return n.attempt(Vre,m,p)(x)}function m(x){return e(x)}function p(x){return i._balanced=!0,t(x)}}function Yre(n,e,t){return r;function r(p){return n.enter("resource"),n.enter("resourceMarker"),n.consume(p),n.exit("resourceMarker"),s}function s(p){return Dn(p)?of(n,i)(p):i(p)}function i(p){return p===41?m(p):CD(n,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return Dn(p)?of(n,u)(p):m(p)}function c(p){return t(p)}function u(p){return p===34||p===39||p===40?MD(n,h,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function h(p){return Dn(p)?of(n,m)(p):m(p)}function m(p){return p===41?(n.enter("resourceMarker"),n.consume(p),n.exit("resourceMarker"),n.exit("resource"),e):t(p)}}function Kre(n,e,t){const r=this;return s;function s(c){return TD.call(r,n,i,l,"reference","referenceMarker","referenceString")(c)}function i(c){return r.parser.defined.includes(Fi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(c):t(c)}function l(c){return t(c)}}function Zre(n,e,t){return r;function r(i){return n.enter("reference"),n.enter("referenceMarker"),n.consume(i),n.exit("referenceMarker"),s}function s(i){return i===93?(n.enter("referenceMarker"),n.consume(i),n.exit("referenceMarker"),n.exit("reference"),e):t(i)}}const Jre={name:"labelStartImage",resolveAll:v5.resolveAll,tokenize:ese};function ese(n,e,t){const r=this;return s;function s(c){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(c),n.exit("labelImageMarker"),i}function i(c){return c===91?(n.enter("labelMarker"),n.consume(c),n.exit("labelMarker"),n.exit("labelImage"),l):t(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(c):e(c)}}const tse={name:"labelStartLink",resolveAll:v5.resolveAll,tokenize:nse};function nse(n,e,t){const r=this;return s;function s(l){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(l),n.exit("labelMarker"),n.exit("labelLink"),i}function i(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(l):e(l)}}const xb={name:"lineEnding",tokenize:rse};function rse(n,e){return t;function t(r){return n.enter("lineEnding"),n.consume(r),n.exit("lineEnding"),zt(n,e,"linePrefix")}}const cg={name:"thematicBreak",tokenize:sse};function sse(n,e,t){let r=0,s;return i;function i(h){return n.enter("thematicBreak"),l(h)}function l(h){return s=h,c(h)}function c(h){return h===s?(n.enter("thematicBreakSequence"),u(h)):r>=3&&(h===null||Ze(h))?(n.exit("thematicBreak"),e(h)):t(h)}function u(h){return h===s?(n.consume(h),r++,u):(n.exit("thematicBreakSequence"),Ft(h)?zt(n,c,"whitespace")(h):c(h))}}const Ns={continuation:{tokenize:ose},exit:use,name:"list",tokenize:lse},ise={partial:!0,tokenize:dse},ase={partial:!0,tokenize:cse};function lse(n,e,t){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return c;function c(v){const b=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:x4(v)){if(r.containerState.type||(r.containerState.type=b,n.enter(b,{_container:!0})),b==="listUnordered")return n.enter("listItemPrefix"),v===42||v===45?n.check(cg,t,h)(v):h(v);if(!r.interrupt||v===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),u(v)}return t(v)}function u(v){return x4(v)&&++l<10?(n.consume(v),u):(!r.interrupt||l<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(n.exit("listItemValue"),h(v)):t(v)}function h(v){return n.enter("listItemMarker"),n.consume(v),n.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,n.check(y0,r.interrupt?t:m,n.attempt(ise,x,p))}function m(v){return r.containerState.initialBlankLine=!0,i++,x(v)}function p(v){return Ft(v)?(n.enter("listItemPrefixWhitespace"),n.consume(v),n.exit("listItemPrefixWhitespace"),x):t(v)}function x(v){return r.containerState.size=i+r.sliceSerialize(n.exit("listItemPrefix"),!0).length,e(v)}}function ose(n,e,t){const r=this;return r.containerState._closeFlow=void 0,n.check(y0,s,i);function s(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,zt(n,e,"listItemIndent",r.containerState.size+1)(c)}function i(c){return r.containerState.furtherBlankLines||!Ft(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,n.attempt(ase,e,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,zt(n,n.attempt(Ns,e,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function cse(n,e,t){const r=this;return zt(n,s,"listItemIndent",r.containerState.size+1);function s(i){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?e(i):t(i)}}function use(n){n.exit(this.containerState.type)}function dse(n,e,t){const r=this;return zt(n,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const l=r.events[r.events.length-1];return!Ft(i)&&l&&l[1].type==="listItemPrefixWhitespace"?e(i):t(i)}}const _8={name:"setextUnderline",resolveTo:hse,tokenize:fse};function hse(n,e){let t=n.length,r,s,i;for(;t--;)if(n[t][0]==="enter"){if(n[t][1].type==="content"){r=t;break}n[t][1].type==="paragraph"&&(s=t)}else n[t][1].type==="content"&&n.splice(t,1),!i&&n[t][1].type==="definition"&&(i=t);const l={type:"setextHeading",start:{...n[r][1].start},end:{...n[n.length-1][1].end}};return n[s][1].type="setextHeadingText",i?(n.splice(s,0,["enter",l,e]),n.splice(i+1,0,["exit",n[r][1],e]),n[r][1].end={...n[i][1].end}):n[r][1]=l,n.push(["exit",l,e]),n}function fse(n,e,t){const r=this;let s;return i;function i(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)?(n.enter("setextHeadingLine"),s=h,l(h)):t(h)}function l(h){return n.enter("setextHeadingLineSequence"),c(h)}function c(h){return h===s?(n.consume(h),c):(n.exit("setextHeadingLineSequence"),Ft(h)?zt(n,u,"lineSuffix")(h):u(h))}function u(h){return h===null||Ze(h)?(n.exit("setextHeadingLine"),e(h)):t(h)}}const mse={tokenize:pse};function pse(n){const e=this,t=n.attempt(y0,r,n.attempt(this.parser.constructs.flowInitial,s,zt(n,n.attempt(this.parser.constructs.flow,s,n.attempt(bre,s)),"linePrefix")));return t;function r(i){if(i===null){n.consume(i);return}return n.enter("lineEndingBlank"),n.consume(i),n.exit("lineEndingBlank"),e.currentConstruct=void 0,t}function s(i){if(i===null){n.consume(i);return}return n.enter("lineEnding"),n.consume(i),n.exit("lineEnding"),e.currentConstruct=void 0,t}}const gse={resolveAll:ED()},xse=AD("string"),vse=AD("text");function AD(n){return{resolveAll:ED(n==="text"?yse:void 0),tokenize:e};function e(t){const r=this,s=this.parser.constructs[n],i=t.attempt(s,l,c);return l;function l(m){return h(m)?i(m):c(m)}function c(m){if(m===null){t.consume(m);return}return t.enter("data"),t.consume(m),u}function u(m){return h(m)?(t.exit("data"),i(m)):(t.consume(m),u)}function h(m){if(m===null)return!0;const p=s[m];let x=-1;if(p)for(;++x<p.length;){const v=p[x];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function ED(n){return e;function e(t,r){let s=-1,i;for(;++s<=t.length;)i===void 0?t[s]&&t[s][1].type==="data"&&(i=s,s++):(!t[s]||t[s][1].type!=="data")&&(s!==i+2&&(t[i][1].end=t[s-1][1].end,t.splice(i+2,s-i-2),s=i+2),i=void 0);return n?n(t,r):t}}function yse(n,e){let t=0;for(;++t<=n.length;)if((t===n.length||n[t][1].type==="lineEnding")&&n[t-1][1].type==="data"){const r=n[t-1][1],s=e.sliceStream(r);let i=s.length,l=-1,c=0,u;for(;i--;){const h=s[i];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(h===-2)u=!0,c++;else if(h!==-1){i++;break}}if(e._contentTypeTextTrailing&&t===n.length&&(c=0),c){const h={type:t===n.length||u||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?l:r.start._bufferIndex+l,_index:r.start._index+i,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(n.splice(t,0,["enter",h,e],["exit",h,e]),t+=2)}t++}return n}const bse={42:Ns,43:Ns,45:Ns,48:Ns,49:Ns,50:Ns,51:Ns,52:Ns,53:Ns,54:Ns,55:Ns,56:Ns,57:Ns,62:OD},wse={91:jre},Sse={[-2]:gb,[-1]:gb,32:gb},Ose={35:Ere,42:cg,45:[_8,cg],60:zre,61:_8,95:cg,96:A8,126:A8},kse={38:jD,92:kD},jse={[-5]:xb,[-4]:xb,[-3]:xb,33:Jre,38:jD,42:v4,60:[tre,Qre],91:tse,92:[Mre,kD],93:v5,95:v4,96:mre},Nse={null:[v4,gse]},Cse={null:[42,95]},Tse={null:[]},Mse=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Cse,contentInitial:wse,disable:Tse,document:bse,flow:Ose,flowInitial:Sse,insideSpan:Nse,string:kse,text:jse},Symbol.toStringTag,{value:"Module"}));function Ase(n,e,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const s={},i=[];let l=[],c=[];const u={attempt:z(D),check:z(E),consume:T,enter:M,exit:_,interrupt:z(E,{interrupt:!0})},h={code:null,containerState:{},defineSkip:O,events:[],now:b,parser:n,previous:null,sliceSerialize:x,sliceStream:v,write:p};let m=e.tokenize.call(h,u);return e.resolveAll&&i.push(e),h;function p(U){return l=yi(l,U),k(),l[l.length-1]!==null?[]:(Q(e,0),h.events=qx(i,h.events,h),h.events)}function x(U,V){return _se(v(U),V)}function v(U){return Ese(l,U)}function b(){const{_bufferIndex:U,_index:V,line:ce,column:W,offset:J}=r;return{_bufferIndex:U,_index:V,line:ce,column:W,offset:J}}function O(U){s[U.line]=U.column,B()}function k(){let U;for(;r._index<l.length;){const V=l[r._index];if(typeof V=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<V.length;)j(V.charCodeAt(r._bufferIndex));else j(V)}}function j(U){m=m(U)}function T(U){Ze(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,B()):U!==-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=U}function M(U,V){const ce=V||{};return ce.type=U,ce.start=b(),h.events.push(["enter",ce,h]),c.push(ce),ce}function _(U){const V=c.pop();return V.end=b(),h.events.push(["exit",V,h]),V}function D(U,V){Q(U,V.from)}function E(U,V){V.restore()}function z(U,V){return ce;function ce(W,J,H){let ae,ne,ue,R;return Array.isArray(W)?Y(W):"tokenize"in W?Y([W]):me(W);function me(fe){return ye;function ye(Re){const de=Re!==null&&fe[Re],We=Re!==null&&fe.null,ct=[...Array.isArray(de)?de:de?[de]:[],...Array.isArray(We)?We:We?[We]:[]];return Y(ct)(Re)}}function Y(fe){return ae=fe,ne=0,fe.length===0?H:P(fe[ne])}function P(fe){return ye;function ye(Re){return R=q(),ue=fe,fe.partial||(h.currentConstruct=fe),fe.name&&h.parser.constructs.disable.null.includes(fe.name)?$():fe.tokenize.call(V?Object.assign(Object.create(h),V):h,u,K,$)(Re)}}function K(fe){return U(ue,R),J}function $(fe){return R.restore(),++ne<ae.length?P(ae[ne]):H}}}function Q(U,V){U.resolveAll&&!i.includes(U)&&i.push(U),U.resolve&&ri(h.events,V,h.events.length-V,U.resolve(h.events.slice(V),h)),U.resolveTo&&(h.events=U.resolveTo(h.events,h))}function q(){const U=b(),V=h.previous,ce=h.currentConstruct,W=h.events.length,J=Array.from(c);return{from:W,restore:H};function H(){r=U,h.previous=V,h.currentConstruct=ce,h.events.length=W,c=J,B()}}function B(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function Ese(n,e){const t=e.start._index,r=e.start._bufferIndex,s=e.end._index,i=e.end._bufferIndex;let l;if(t===s)l=[n[t].slice(r,i)];else{if(l=n.slice(t,s),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}i>0&&l.push(n[s].slice(0,i))}return l}function _se(n,e){let t=-1;const r=[];let s;for(;++t<n.length;){const i=n[t];let l;if(typeof i=="string")l=i;else switch(i){case-5:{l="\r";break}case-4:{l=`
|
||
`;break}case-3:{l=`\r
|
||
`;break}case-2:{l=e?" ":" ";break}case-1:{if(!e&&s)continue;l=" ";break}default:l=String.fromCharCode(i)}s=i===-2,r.push(l)}return r.join("")}function Dse(n){const r={constructs:wD([Mse,...(n||{}).extensions||[]]),content:s(Gne),defined:[],document:s(Yne),flow:s(mse),lazy:{},string:s(xse),text:s(vse)};return r;function s(i){return l;function l(c){return Ase(r,i,c)}}}function Rse(n){for(;!ND(n););return n}const D8=/[\0\t\n\r]/g;function zse(){let n=1,e="",t=!0,r;return s;function s(i,l,c){const u=[];let h,m,p,x,v;for(i=e+(typeof i=="string"?i.toString():new TextDecoder(l||void 0).decode(i)),p=0,e="",t&&(i.charCodeAt(0)===65279&&p++,t=void 0);p<i.length;){if(D8.lastIndex=p,h=D8.exec(i),x=h&&h.index!==void 0?h.index:i.length,v=i.charCodeAt(x),!h){e=i.slice(p);break}if(v===10&&p===x&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),p<x&&(u.push(i.slice(p,x)),n+=x-p),v){case 0:{u.push(65533),n++;break}case 9:{for(m=Math.ceil(n/4)*4,u.push(-2);n++<m;)u.push(-1);break}case 10:{u.push(-4),n=1;break}default:r=!0,n=1}p=x+1}return c&&(r&&u.push(-5),e&&u.push(e),u.push(null)),u}}const Pse=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Lse(n){return n.replace(Pse,Bse)}function Bse(n,e,t){if(e)return e;if(t.charCodeAt(0)===35){const s=t.charCodeAt(1),i=s===120||s===88;return SD(t.slice(i?2:1),i?16:10)}return x5(t)||n}const _D={}.hasOwnProperty;function Ise(n,e,t){return typeof e!="string"&&(t=e,e=void 0),Fse(t)(Rse(Dse(t).document().write(zse()(n,e,!0))))}function Fse(n){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(nn),autolinkProtocol:q,autolinkEmail:q,atxHeading:i(Ct),blockQuote:i(We),characterEscape:q,characterReference:q,codeFenced:i(ct),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:i(ct,l),codeText:i(ke,l),codeTextData:q,data:q,codeFlowValue:q,definition:i(nt),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:i(ut),hardBreakEscape:i(Bn),hardBreakTrailing:i(Bn),htmlFlow:i(Tn,l),htmlFlowData:q,htmlText:i(Tn,l),htmlTextData:q,image:i(Jn),label:l,link:i(nn),listItem:i(Yr),listItemValue:x,listOrdered:i(_t,p),listUnordered:i(_t),paragraph:i(In),reference:P,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:i(Ct),strong:i(or),thematicBreak:i(ft)},exit:{atxHeading:u(),atxHeadingSequence:D,autolink:u(),autolinkEmail:de,autolinkProtocol:Re,blockQuote:u(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:$,characterReferenceMarkerNumeric:$,characterReferenceValue:fe,characterReference:ye,codeFenced:u(k),codeFencedFence:O,codeFencedFenceInfo:v,codeFencedFenceMeta:b,codeFlowValue:B,codeIndented:u(j),codeText:u(J),codeTextData:B,data:B,definition:u(),definitionDestinationString:_,definitionLabelString:T,definitionTitleString:M,emphasis:u(),hardBreakEscape:u(V),hardBreakTrailing:u(V),htmlFlow:u(ce),htmlFlowData:B,htmlText:u(W),htmlTextData:B,image:u(ae),label:ue,labelText:ne,lineEnding:U,link:u(H),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:K,resourceDestinationString:R,resourceTitleString:me,resource:Y,setextHeading:u(Q),setextHeadingLineSequence:z,setextHeadingText:E,strong:u(),thematicBreak:u()}};DD(e,(n||{}).mdastExtensions||[]);const t={};return r;function r(ee){let Se={type:"root",children:[]};const Le={stack:[Se],tokenStack:[],config:e,enter:c,exit:h,buffer:l,resume:m,data:t},rt=[];let Tt=-1;for(;++Tt<ee.length;)if(ee[Tt][1].type==="listOrdered"||ee[Tt][1].type==="listUnordered")if(ee[Tt][0]==="enter")rt.push(Tt);else{const cr=rt.pop();Tt=s(ee,cr,Tt)}for(Tt=-1;++Tt<ee.length;){const cr=e[ee[Tt][0]];_D.call(cr,ee[Tt][1].type)&&cr[ee[Tt][1].type].call(Object.assign({sliceSerialize:ee[Tt][2].sliceSerialize},Le),ee[Tt][1])}if(Le.tokenStack.length>0){const cr=Le.tokenStack[Le.tokenStack.length-1];(cr[1]||R8).call(Le,void 0,cr[0])}for(Se.position={start:Gl(ee.length>0?ee[0][1].start:{line:1,column:1,offset:0}),end:Gl(ee.length>0?ee[ee.length-2][1].end:{line:1,column:1,offset:0})},Tt=-1;++Tt<e.transforms.length;)Se=e.transforms[Tt](Se)||Se;return Se}function s(ee,Se,Le){let rt=Se-1,Tt=-1,cr=!1,Kr,re,Me,pt;for(;++rt<=Le;){const vt=ee[rt];switch(vt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{vt[0]==="enter"?Tt++:Tt--,pt=void 0;break}case"lineEndingBlank":{vt[0]==="enter"&&(Kr&&!pt&&!Tt&&!Me&&(Me=rt),pt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:pt=void 0}if(!Tt&&vt[0]==="enter"&&vt[1].type==="listItemPrefix"||Tt===-1&&vt[0]==="exit"&&(vt[1].type==="listUnordered"||vt[1].type==="listOrdered")){if(Kr){let vs=rt;for(re=void 0;vs--;){const dt=ee[vs];if(dt[1].type==="lineEnding"||dt[1].type==="lineEndingBlank"){if(dt[0]==="exit")continue;re&&(ee[re][1].type="lineEndingBlank",cr=!0),dt[1].type="lineEnding",re=vs}else if(!(dt[1].type==="linePrefix"||dt[1].type==="blockQuotePrefix"||dt[1].type==="blockQuotePrefixWhitespace"||dt[1].type==="blockQuoteMarker"||dt[1].type==="listItemIndent"))break}Me&&(!re||Me<re)&&(Kr._spread=!0),Kr.end=Object.assign({},re?ee[re][1].start:vt[1].end),ee.splice(re||rt,0,["exit",Kr,vt[2]]),rt++,Le++}if(vt[1].type==="listItemPrefix"){const vs={type:"listItem",_spread:!1,start:Object.assign({},vt[1].start),end:void 0};Kr=vs,ee.splice(rt,0,["enter",vs,vt[2]]),rt++,Le++,Me=void 0,pt=!0}}}return ee[Se][1]._spread=cr,Le}function i(ee,Se){return Le;function Le(rt){c.call(this,ee(rt),rt),Se&&Se.call(this,rt)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(ee,Se,Le){this.stack[this.stack.length-1].children.push(ee),this.stack.push(ee),this.tokenStack.push([Se,Le||void 0]),ee.position={start:Gl(Se.start),end:void 0}}function u(ee){return Se;function Se(Le){ee&&ee.call(this,Le),h.call(this,Le)}}function h(ee,Se){const Le=this.stack.pop(),rt=this.tokenStack.pop();if(rt)rt[0].type!==ee.type&&(Se?Se.call(this,ee,rt[0]):(rt[1]||R8).call(this,ee,rt[0]));else throw new Error("Cannot close `"+ee.type+"` ("+lf({start:ee.start,end:ee.end})+"): it’s not open");Le.position.end=Gl(ee.end)}function m(){return g5(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function x(ee){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(ee),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ee=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=ee}function b(){const ee=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=ee}function O(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const ee=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ee.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function j(){const ee=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ee.replace(/(\r?\n|\r)$/g,"")}function T(ee){const Se=this.resume(),Le=this.stack[this.stack.length-1];Le.label=Se,Le.identifier=Fi(this.sliceSerialize(ee)).toLowerCase()}function M(){const ee=this.resume(),Se=this.stack[this.stack.length-1];Se.title=ee}function _(){const ee=this.resume(),Se=this.stack[this.stack.length-1];Se.url=ee}function D(ee){const Se=this.stack[this.stack.length-1];if(!Se.depth){const Le=this.sliceSerialize(ee).length;Se.depth=Le}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function z(ee){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(ee).codePointAt(0)===61?1:2}function Q(){this.data.setextHeadingSlurpLineEnding=void 0}function q(ee){const Le=this.stack[this.stack.length-1].children;let rt=Le[Le.length-1];(!rt||rt.type!=="text")&&(rt=yn(),rt.position={start:Gl(ee.start),end:void 0},Le.push(rt)),this.stack.push(rt)}function B(ee){const Se=this.stack.pop();Se.value+=this.sliceSerialize(ee),Se.position.end=Gl(ee.end)}function U(ee){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=Se.children[Se.children.length-1];Le.position.end=Gl(ee.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(Se.type)&&(q.call(this,ee),B.call(this,ee))}function V(){this.data.atHardBreak=!0}function ce(){const ee=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ee}function W(){const ee=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ee}function J(){const ee=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ee}function H(){const ee=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";ee.type+="Reference",ee.referenceType=Se,delete ee.url,delete ee.title}else delete ee.identifier,delete ee.label;this.data.referenceType=void 0}function ae(){const ee=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";ee.type+="Reference",ee.referenceType=Se,delete ee.url,delete ee.title}else delete ee.identifier,delete ee.label;this.data.referenceType=void 0}function ne(ee){const Se=this.sliceSerialize(ee),Le=this.stack[this.stack.length-2];Le.label=Lse(Se),Le.identifier=Fi(Se).toLowerCase()}function ue(){const ee=this.stack[this.stack.length-1],Se=this.resume(),Le=this.stack[this.stack.length-1];if(this.data.inReference=!0,Le.type==="link"){const rt=ee.children;Le.children=rt}else Le.alt=Se}function R(){const ee=this.resume(),Se=this.stack[this.stack.length-1];Se.url=ee}function me(){const ee=this.resume(),Se=this.stack[this.stack.length-1];Se.title=ee}function Y(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function K(ee){const Se=this.resume(),Le=this.stack[this.stack.length-1];Le.label=Se,Le.identifier=Fi(this.sliceSerialize(ee)).toLowerCase(),this.data.referenceType="full"}function $(ee){this.data.characterReferenceType=ee.type}function fe(ee){const Se=this.sliceSerialize(ee),Le=this.data.characterReferenceType;let rt;Le?(rt=SD(Se,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):rt=x5(Se);const Tt=this.stack[this.stack.length-1];Tt.value+=rt}function ye(ee){const Se=this.stack.pop();Se.position.end=Gl(ee.end)}function Re(ee){B.call(this,ee);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(ee)}function de(ee){B.call(this,ee);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(ee)}function We(){return{type:"blockquote",children:[]}}function ct(){return{type:"code",lang:null,meta:null,value:""}}function ke(){return{type:"inlineCode",value:""}}function nt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ut(){return{type:"emphasis",children:[]}}function Ct(){return{type:"heading",depth:0,children:[]}}function Bn(){return{type:"break"}}function Tn(){return{type:"html",value:""}}function Jn(){return{type:"image",title:null,url:"",alt:null}}function nn(){return{type:"link",title:null,url:"",children:[]}}function _t(ee){return{type:"list",ordered:ee.type==="listOrdered",start:null,spread:ee._spread,children:[]}}function Yr(ee){return{type:"listItem",spread:ee._spread,checked:null,children:[]}}function In(){return{type:"paragraph",children:[]}}function or(){return{type:"strong",children:[]}}function yn(){return{type:"text",value:""}}function ft(){return{type:"thematicBreak"}}}function Gl(n){return{line:n.line,column:n.column,offset:n.offset}}function DD(n,e){let t=-1;for(;++t<e.length;){const r=e[t];Array.isArray(r)?DD(n,r):qse(n,r)}}function qse(n,e){let t;for(t in e)if(_D.call(e,t))switch(t){case"canContainEols":{const r=e[t];r&&n[t].push(...r);break}case"transforms":{const r=e[t];r&&n[t].push(...r);break}case"enter":case"exit":{const r=e[t];r&&Object.assign(n[t],r);break}}}function R8(n,e){throw n?new Error("Cannot close `"+n.type+"` ("+lf({start:n.start,end:n.end})+"): a different token (`"+e.type+"`, "+lf({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+lf({start:e.start,end:e.end})+") is still open")}function Qse(n){const e=this;e.parser=t;function t(r){return Ise(r,{...e.data("settings"),...n,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function $se(n,e){const t={type:"element",tagName:"blockquote",properties:{},children:n.wrap(n.all(e),!0)};return n.patch(e,t),n.applyData(e,t)}function Hse(n,e){const t={type:"element",tagName:"br",properties:{},children:[]};return n.patch(e,t),[n.applyData(e,t),{type:"text",value:`
|
||
`}]}function Use(n,e){const t=e.value?e.value+`
|
||
`:"",r={};e.lang&&(r.className=["language-"+e.lang]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return e.meta&&(s.data={meta:e.meta}),n.patch(e,s),s=n.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},n.patch(e,s),s}function Vse(n,e){const t={type:"element",tagName:"del",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function Wse(n,e){const t={type:"element",tagName:"em",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function Gse(n,e){const t=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),s=Rd(r.toLowerCase()),i=n.footnoteOrder.indexOf(r);let l,c=n.footnoteCounts.get(r);c===void 0?(c=0,n.footnoteOrder.push(r),l=n.footnoteOrder.length):l=i+1,c+=1,n.footnoteCounts.set(r,c);const u={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+s,id:t+"fnref-"+s+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};n.patch(e,u);const h={type:"element",tagName:"sup",properties:{},children:[u]};return n.patch(e,h),n.applyData(e,h)}function Xse(n,e){const t={type:"element",tagName:"h"+e.depth,properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function Yse(n,e){if(n.options.allowDangerousHtml){const t={type:"raw",value:e.value};return n.patch(e,t),n.applyData(e,t)}}function RD(n,e){const t=e.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const s=n.all(e),i=s[0];i&&i.type==="text"?i.value="["+i.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 Kse(n,e){const t=String(e.identifier).toUpperCase(),r=n.definitionById.get(t);if(!r)return RD(n,e);const s={src:Rd(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return n.patch(e,i),n.applyData(e,i)}function Zse(n,e){const t={src:Rd(e.url)};e.alt!==null&&e.alt!==void 0&&(t.alt=e.alt),e.title!==null&&e.title!==void 0&&(t.title=e.title);const r={type:"element",tagName:"img",properties:t,children:[]};return n.patch(e,r),n.applyData(e,r)}function Jse(n,e){const t={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};n.patch(e,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return n.patch(e,r),n.applyData(e,r)}function eie(n,e){const t=String(e.identifier).toUpperCase(),r=n.definitionById.get(t);if(!r)return RD(n,e);const s={href:Rd(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:n.all(e)};return n.patch(e,i),n.applyData(e,i)}function tie(n,e){const t={href:Rd(e.url)};e.title!==null&&e.title!==void 0&&(t.title=e.title);const r={type:"element",tagName:"a",properties:t,children:n.all(e)};return n.patch(e,r),n.applyData(e,r)}function nie(n,e,t){const r=n.all(e),s=t?rie(t):zD(e),i={},l=[];if(typeof e.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:e.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const m=r[c];(s||c!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
|
||
`}),m.type==="element"&&m.tagName==="p"&&!s?l.push(...m.children):l.push(m)}const u=r[r.length-1];u&&(s||u.type!=="element"||u.tagName!=="p")&&l.push({type:"text",value:`
|
||
`});const h={type:"element",tagName:"li",properties:i,children:l};return n.patch(e,h),n.applyData(e,h)}function rie(n){let e=!1;if(n.type==="list"){e=n.spread||!1;const t=n.children;let r=-1;for(;!e&&++r<t.length;)e=zD(t[r])}return e}function zD(n){const e=n.spread;return e??n.children.length>1}function sie(n,e){const t={},r=n.all(e);let s=-1;for(typeof e.start=="number"&&e.start!==1&&(t.start=e.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")){t.className=["contains-task-list"];break}}const i={type:"element",tagName:e.ordered?"ol":"ul",properties:t,children:n.wrap(r,!0)};return n.patch(e,i),n.applyData(e,i)}function iie(n,e){const t={type:"element",tagName:"p",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function aie(n,e){const t={type:"root",children:n.wrap(n.all(e))};return n.patch(e,t),n.applyData(e,t)}function lie(n,e){const t={type:"element",tagName:"strong",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}function oie(n,e){const t=n.all(e),r=t.shift(),s=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:n.wrap([r],!0)};n.patch(e.children[0],l),s.push(l)}if(t.length>0){const l={type:"element",tagName:"tbody",properties:{},children:n.wrap(t,!0)},c=h5(e.children[1]),u=mD(e.children[e.children.length-1]);c&&u&&(l.position={start:c,end:u}),s.push(l)}const i={type:"element",tagName:"table",properties:{},children:n.wrap(s,!0)};return n.patch(e,i),n.applyData(e,i)}function cie(n,e,t){const r=t?t.children:void 0,i=(r?r.indexOf(e):1)===0?"th":"td",l=t&&t.type==="table"?t.align:void 0,c=l?l.length:e.children.length;let u=-1;const h=[];for(;++u<c;){const p=e.children[u],x={},v=l?l[u]:void 0;v&&(x.align=v);let b={type:"element",tagName:i,properties:x,children:[]};p&&(b.children=n.all(p),n.patch(p,b),b=n.applyData(p,b)),h.push(b)}const m={type:"element",tagName:"tr",properties:{},children:n.wrap(h,!0)};return n.patch(e,m),n.applyData(e,m)}function uie(n,e){const t={type:"element",tagName:"td",properties:{},children:n.all(e)};return n.patch(e,t),n.applyData(e,t)}const z8=9,P8=32;function die(n){const e=String(n),t=/\r?\n|\r/g;let r=t.exec(e),s=0;const i=[];for(;r;)i.push(L8(e.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=t.exec(e);return i.push(L8(e.slice(s),s>0,!1)),i.join("")}function L8(n,e,t){let r=0,s=n.length;if(e){let i=n.codePointAt(r);for(;i===z8||i===P8;)r++,i=n.codePointAt(r)}if(t){let i=n.codePointAt(s-1);for(;i===z8||i===P8;)s--,i=n.codePointAt(s-1)}return s>r?n.slice(r,s):""}function hie(n,e){const t={type:"text",value:die(String(e.value))};return n.patch(e,t),n.applyData(e,t)}function fie(n,e){const t={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(e,t),n.applyData(e,t)}const mie={blockquote:$se,break:Hse,code:Use,delete:Vse,emphasis:Wse,footnoteReference:Gse,heading:Xse,html:Yse,imageReference:Kse,image:Zse,inlineCode:Jse,linkReference:eie,link:tie,listItem:nie,list:sie,paragraph:iie,root:aie,strong:lie,table:oie,tableCell:uie,tableRow:cie,text:hie,thematicBreak:fie,toml:jp,yaml:jp,definition:jp,footnoteDefinition:jp};function jp(){}const PD=-1,Qx=0,cf=1,Vg=2,y5=3,b5=4,w5=5,S5=6,LD=7,BD=8,B8=typeof self=="object"?self:globalThis,pie=(n,e)=>{const t=(s,i)=>(n.set(i,s),s),r=s=>{if(n.has(s))return n.get(s);const[i,l]=e[s];switch(i){case Qx:case PD:return t(l,s);case cf:{const c=t([],s);for(const u of l)c.push(r(u));return c}case Vg:{const c=t({},s);for(const[u,h]of l)c[r(u)]=r(h);return c}case y5:return t(new Date(l),s);case b5:{const{source:c,flags:u}=l;return t(new RegExp(c,u),s)}case w5:{const c=t(new Map,s);for(const[u,h]of l)c.set(r(u),r(h));return c}case S5:{const c=t(new Set,s);for(const u of l)c.add(r(u));return c}case LD:{const{name:c,message:u}=l;return t(new B8[c](u),s)}case BD:return t(BigInt(l),s);case"BigInt":return t(Object(BigInt(l)),s);case"ArrayBuffer":return t(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return t(new DataView(c),l)}}return t(new B8[i](l),s)};return r},I8=n=>pie(new Map,n)(0),Cu="",{toString:gie}={},{keys:xie}=Object,Qh=n=>{const e=typeof n;if(e!=="object"||!n)return[Qx,e];const t=gie.call(n).slice(8,-1);switch(t){case"Array":return[cf,Cu];case"Object":return[Vg,Cu];case"Date":return[y5,Cu];case"RegExp":return[b5,Cu];case"Map":return[w5,Cu];case"Set":return[S5,Cu];case"DataView":return[cf,t]}return t.includes("Array")?[cf,t]:t.includes("Error")?[LD,t]:[Vg,t]},Np=([n,e])=>n===Qx&&(e==="function"||e==="symbol"),vie=(n,e,t,r)=>{const s=(l,c)=>{const u=r.push(l)-1;return t.set(c,u),u},i=l=>{if(t.has(l))return t.get(l);let[c,u]=Qh(l);switch(c){case Qx:{let m=l;switch(u){case"bigint":c=BD,m=l.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+u);m=null;break;case"undefined":return s([PD],l)}return s([c,m],l)}case cf:{if(u){let x=l;return u==="DataView"?x=new Uint8Array(l.buffer):u==="ArrayBuffer"&&(x=new Uint8Array(l)),s([u,[...x]],l)}const m=[],p=s([c,m],l);for(const x of l)m.push(i(x));return p}case Vg:{if(u)switch(u){case"BigInt":return s([u,l.toString()],l);case"Boolean":case"Number":case"String":return s([u,l.valueOf()],l)}if(e&&"toJSON"in l)return i(l.toJSON());const m=[],p=s([c,m],l);for(const x of xie(l))(n||!Np(Qh(l[x])))&&m.push([i(x),i(l[x])]);return p}case y5:return s([c,l.toISOString()],l);case b5:{const{source:m,flags:p}=l;return s([c,{source:m,flags:p}],l)}case w5:{const m=[],p=s([c,m],l);for(const[x,v]of l)(n||!(Np(Qh(x))||Np(Qh(v))))&&m.push([i(x),i(v)]);return p}case S5:{const m=[],p=s([c,m],l);for(const x of l)(n||!Np(Qh(x)))&&m.push(i(x));return p}}const{message:h}=l;return s([c,{name:u,message:h}],l)};return i},F8=(n,{json:e,lossy:t}={})=>{const r=[];return vie(!(e||t),!!e,new Map,r)(n),r},Wg=typeof structuredClone=="function"?(n,e)=>e&&("json"in e||"lossy"in e)?I8(F8(n,e)):structuredClone(n):(n,e)=>I8(F8(n,e));function yie(n,e){const t=[{type:"text",value:"↩"}];return e>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),t}function bie(n,e){return"Back to reference "+(n+1)+(e>1?"-"+e:"")}function wie(n){const e=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",t=n.options.footnoteBackContent||yie,r=n.options.footnoteBackLabel||bie,s=n.options.footnoteLabel||"Footnotes",i=n.options.footnoteLabelTagName||"h2",l=n.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let u=-1;for(;++u<n.footnoteOrder.length;){const h=n.footnoteById.get(n.footnoteOrder[u]);if(!h)continue;const m=n.all(h),p=String(h.identifier).toUpperCase(),x=Rd(p.toLowerCase());let v=0;const b=[],O=n.footnoteCounts.get(p);for(;O!==void 0&&++v<=O;){b.length>0&&b.push({type:"text",value:" "});let T=typeof t=="string"?t:t(u,v);typeof T=="string"&&(T={type:"text",value:T}),b.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+x+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,v),className:["data-footnote-backref"]},children:Array.isArray(T)?T:[T]})}const k=m[m.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const T=k.children[k.children.length-1];T&&T.type==="text"?T.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...b)}else m.push(...b);const j={type:"element",tagName:"li",properties:{id:e+"fn-"+x},children:n.wrap(m,!0)};n.patch(h,j),c.push(j)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...Wg(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
||
`},{type:"element",tagName:"ol",properties:{},children:n.wrap(c,!0)},{type:"text",value:`
|
||
`}]}}const b0=(function(n){if(n==null)return jie;if(typeof n=="function")return $x(n);if(typeof n=="object")return Array.isArray(n)?Sie(n):Oie(n);if(typeof n=="string")return kie(n);throw new Error("Expected function, string, or object as test")});function Sie(n){const e=[];let t=-1;for(;++t<n.length;)e[t]=b0(n[t]);return $x(r);function r(...s){let i=-1;for(;++i<e.length;)if(e[i].apply(this,s))return!0;return!1}}function Oie(n){const e=n;return $x(t);function t(r){const s=r;let i;for(i in n)if(s[i]!==e[i])return!1;return!0}}function kie(n){return $x(e);function e(t){return t&&t.type===n}}function $x(n){return e;function e(t,r,s){return!!(Nie(t)&&n.call(this,t,typeof r=="number"?r:void 0,s||void 0))}}function jie(){return!0}function Nie(n){return n!==null&&typeof n=="object"&&"type"in n}const ID=[],Cie=!0,y4=!1,FD="skip";function O5(n,e,t,r){let s;typeof e=="function"&&typeof t!="function"?(r=t,t=e):s=e;const i=b0(s),l=r?-1:1;c(n,void 0,[])();function c(u,h,m){const p=u&&typeof u=="object"?u:{};if(typeof p.type=="string"){const v=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(u.type+(v?"<"+v+">":""))+")"})}return x;function x(){let v=ID,b,O,k;if((!e||i(u,h,m[m.length-1]||void 0))&&(v=Tie(t(u,m)),v[0]===y4))return v;if("children"in u&&u.children){const j=u;if(j.children&&v[0]!==FD)for(O=(r?j.children.length:-1)+l,k=m.concat(j);O>-1&&O<j.children.length;){const T=j.children[O];if(b=c(T,O,k)(),b[0]===y4)return b;O=typeof b[1]=="number"?b[1]:O+l}}return v}}}function Tie(n){return Array.isArray(n)?n:typeof n=="number"?[Cie,n]:n==null?ID:[n]}function k5(n,e,t,r){let s,i,l;typeof e=="function"&&typeof t!="function"?(i=void 0,l=e,s=t):(i=e,l=t,s=r),O5(n,i,c,s);function c(u,h){const m=h[h.length-1],p=m?m.children.indexOf(u):void 0;return l(u,p,m)}}const b4={}.hasOwnProperty,Mie={};function Aie(n,e){const t=e||Mie,r=new Map,s=new Map,i=new Map,l={...mie,...t.handlers},c={all:h,applyData:_ie,definitionById:r,footnoteById:s,footnoteCounts:i,footnoteOrder:[],handlers:l,one:u,options:t,patch:Eie,wrap:Rie};return k5(n,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const p=m.type==="definition"?r:s,x=String(m.identifier).toUpperCase();p.has(x)||p.set(x,m)}}),c;function u(m,p){const x=m.type,v=c.handlers[x];if(b4.call(c.handlers,x)&&v)return v(c,m,p);if(c.options.passThrough&&c.options.passThrough.includes(x)){if("children"in m){const{children:O,...k}=m,j=Wg(k);return j.children=c.all(m),j}return Wg(m)}return(c.options.unknownHandler||Die)(c,m,p)}function h(m){const p=[];if("children"in m){const x=m.children;let v=-1;for(;++v<x.length;){const b=c.one(x[v],m);if(b){if(v&&x[v-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=q8(b.value)),!Array.isArray(b)&&b.type==="element")){const O=b.children[0];O&&O.type==="text"&&(O.value=q8(O.value))}Array.isArray(b)?p.push(...b):p.push(b)}}}return p}}function Eie(n,e){n.position&&(e.position=bne(n))}function _ie(n,e){let t=e;if(n&&n.data){const r=n.data.hName,s=n.data.hChildren,i=n.data.hProperties;if(typeof r=="string")if(t.type==="element")t.tagName=r;else{const l="children"in t?t.children:[t];t={type:"element",tagName:r,properties:{},children:l}}t.type==="element"&&i&&Object.assign(t.properties,Wg(i)),"children"in t&&t.children&&s!==null&&s!==void 0&&(t.children=s)}return t}function Die(n,e){const t=e.data||{},r="value"in e&&!(b4.call(t,"hProperties")||b4.call(t,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:n.all(e)};return n.patch(e,r),n.applyData(e,r)}function Rie(n,e){const t=[];let r=-1;for(e&&t.push({type:"text",value:`
|
||
`});++r<n.length;)r&&t.push({type:"text",value:`
|
||
`}),t.push(n[r]);return e&&n.length>0&&t.push({type:"text",value:`
|
||
`}),t}function q8(n){let e=0,t=n.charCodeAt(e);for(;t===9||t===32;)e++,t=n.charCodeAt(e);return n.slice(e)}function Q8(n,e){const t=Aie(n,e),r=t.one(n,void 0),s=wie(t),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:`
|
||
`},s),i}function zie(n,e){return n&&"run"in n?async function(t,r){const s=Q8(t,{file:r,...e});await n.run(s,r)}:function(t,r){return Q8(t,{file:r,...n||e})}}function $8(n){if(n)throw n}var vb,H8;function Pie(){if(H8)return vb;H8=1;var n=Object.prototype.hasOwnProperty,e=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(h){return typeof Array.isArray=="function"?Array.isArray(h):e.call(h)==="[object Array]"},i=function(h){if(!h||e.call(h)!=="[object Object]")return!1;var m=n.call(h,"constructor"),p=h.constructor&&h.constructor.prototype&&n.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!m&&!p)return!1;var x;for(x in h);return typeof x>"u"||n.call(h,x)},l=function(h,m){t&&m.name==="__proto__"?t(h,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):h[m.name]=m.newValue},c=function(h,m){if(m==="__proto__")if(n.call(h,m)){if(r)return r(h,m).value}else return;return h[m]};return vb=function u(){var h,m,p,x,v,b,O=arguments[0],k=1,j=arguments.length,T=!1;for(typeof O=="boolean"&&(T=O,O=arguments[1]||{},k=2),(O==null||typeof O!="object"&&typeof O!="function")&&(O={});k<j;++k)if(h=arguments[k],h!=null)for(m in h)p=c(O,m),x=c(h,m),O!==x&&(T&&x&&(i(x)||(v=s(x)))?(v?(v=!1,b=p&&s(p)?p:[]):b=p&&i(p)?p:{},l(O,{name:m,newValue:u(T,b,x)})):typeof x<"u"&&l(O,{name:m,newValue:x}));return O},vb}var Lie=Pie();const yb=v9(Lie);function w4(n){if(typeof n!="object"||n===null)return!1;const e=Object.getPrototypeOf(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)}function Bie(){const n=[],e={run:t,use:r};return e;function t(...s){let i=-1;const l=s.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...s);function c(u,...h){const m=n[++i];let p=-1;if(u){l(u);return}for(;++p<s.length;)(h[p]===null||h[p]===void 0)&&(h[p]=s[p]);s=h,m?Iie(m,c)(...h):l(null,...h)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return n.push(s),e}}function Iie(n,e){let t;return r;function r(...l){const c=n.length>l.length;let u;c&&l.push(s);try{u=n.apply(this,l)}catch(h){const m=h;if(c&&t)throw m;return s(m)}c||(u&&u.then&&typeof u.then=="function"?u.then(i,s):u instanceof Error?s(u):i(u))}function s(l,...c){t||(t=!0,e(l,...c))}function i(l){s(null,l)}}const ra={basename:Fie,dirname:qie,extname:Qie,join:$ie,sep:"/"};function Fie(n,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');w0(n);let t=0,r=-1,s=n.length,i;if(e===void 0||e.length===0||e.length>n.length){for(;s--;)if(n.codePointAt(s)===47){if(i){t=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":n.slice(t,r)}if(e===n)return"";let l=-1,c=e.length-1;for(;s--;)if(n.codePointAt(s)===47){if(i){t=s+1;break}}else l<0&&(i=!0,l=s+1),c>-1&&(n.codePointAt(s)===e.codePointAt(c--)?c<0&&(r=s):(c=-1,r=l));return t===r?r=l:r<0&&(r=n.length),n.slice(t,r)}function qie(n){if(w0(n),n.length===0)return".";let e=-1,t=n.length,r;for(;--t;)if(n.codePointAt(t)===47){if(r){e=t;break}}else r||(r=!0);return e<0?n.codePointAt(0)===47?"/":".":e===1&&n.codePointAt(0)===47?"//":n.slice(0,e)}function Qie(n){w0(n);let e=n.length,t=-1,r=0,s=-1,i=0,l;for(;e--;){const c=n.codePointAt(e);if(c===47){if(l){r=e+1;break}continue}t<0&&(l=!0,t=e+1),c===46?s<0?s=e:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||t<0||i===0||i===1&&s===t-1&&s===r+1?"":n.slice(s,t)}function $ie(...n){let e=-1,t;for(;++e<n.length;)w0(n[e]),n[e]&&(t=t===void 0?n[e]:t+"/"+n[e]);return t===void 0?".":Hie(t)}function Hie(n){w0(n);const e=n.codePointAt(0)===47;let t=Uie(n,!e);return t.length===0&&!e&&(t="."),t.length>0&&n.codePointAt(n.length-1)===47&&(t+="/"),e?"/"+t:t}function Uie(n,e){let t="",r=0,s=-1,i=0,l=-1,c,u;for(;++l<=n.length;){if(l<n.length)c=n.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(s===l-1||i===1))if(s!==l-1&&i===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(u=t.lastIndexOf("/"),u!==t.length-1){u<0?(t="",r=0):(t=t.slice(0,u),r=t.length-1-t.lastIndexOf("/")),s=l,i=0;continue}}else if(t.length>0){t="",r=0,s=l,i=0;continue}}e&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+n.slice(s+1,l):t=n.slice(s+1,l),r=l-s-1;s=l,i=0}else c===46&&i>-1?i++:i=-1}return t}function w0(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const Vie={cwd:Wie};function Wie(){return"/"}function S4(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function Gie(n){if(typeof n=="string")n=new URL(n);else if(!S4(n)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(n.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Xie(n)}function Xie(n){if(n.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 e=n.pathname;let t=-1;for(;++t<e.length;)if(e.codePointAt(t)===37&&e.codePointAt(t+1)===50){const r=e.codePointAt(t+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(e)}const bb=["history","path","basename","stem","extname","dirname"];class qD{constructor(e){let t;e?S4(e)?t={path:e}:typeof e=="string"||Yie(e)?t={value:e}:t=e:t={},this.cwd="cwd"in t?"":Vie.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<bb.length;){const i=bb[r];i in t&&t[i]!==void 0&&t[i]!==null&&(this[i]=i==="history"?[...t[i]]:t[i])}let s;for(s in t)bb.includes(s)||(this[s]=t[s])}get basename(){return typeof this.path=="string"?ra.basename(this.path):void 0}set basename(e){Sb(e,"basename"),wb(e,"basename"),this.path=ra.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?ra.dirname(this.path):void 0}set dirname(e){U8(this.basename,"dirname"),this.path=ra.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?ra.extname(this.path):void 0}set extname(e){if(wb(e,"extname"),U8(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ra.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){S4(e)&&(e=Gie(e)),Sb(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?ra.basename(this.path,this.extname):void 0}set stem(e){Sb(e,"stem"),wb(e,"stem"),this.path=ra.join(this.dirname||"",e+(this.extname||""))}fail(e,t,r){const s=this.message(e,t,r);throw s.fatal=!0,s}info(e,t,r){const s=this.message(e,t,r);return s.fatal=void 0,s}message(e,t,r){const s=new as(e,t,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function wb(n,e){if(n&&n.includes(ra.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+ra.sep+"`")}function Sb(n,e){if(!n)throw new Error("`"+e+"` cannot be empty")}function U8(n,e){if(!n)throw new Error("Setting `"+e+"` requires `path` to be set too")}function Yie(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const Kie=(function(n){const r=this.constructor.prototype,s=r[n],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),Zie={}.hasOwnProperty;class j5 extends Kie{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=Bie()}copy(){const e=new j5;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];e.use(...r)}return e.data(yb(!0,{},this.namespace)),e}data(e,t){return typeof e=="string"?arguments.length===2?(jb("data",this.frozen),this.namespace[e]=t,this):Zie.call(this.namespace,e)&&this.namespace[e]||void 0:e?(jb("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=t.call(e,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=Cp(e),r=this.parser||this.Parser;return Ob("parse",r),r(String(t),t)}process(e,t){const r=this;return this.freeze(),Ob("process",this.parser||this.Parser),kb("process",this.compiler||this.Compiler),t?s(void 0,t):new Promise(s);function s(i,l){const c=Cp(e),u=r.parse(c);r.run(u,c,function(m,p,x){if(m||!p||!x)return h(m);const v=p,b=r.stringify(v,x);tae(b)?x.value=b:x.result=b,h(m,x)});function h(m,p){m||!p?l(m):i?i(p):t(void 0,p)}}}processSync(e){let t=!1,r;return this.freeze(),Ob("processSync",this.parser||this.Parser),kb("processSync",this.compiler||this.Compiler),this.process(e,s),W8("processSync","process",t),r;function s(i,l){t=!0,$8(i),r=l}}run(e,t,r){V8(e),this.freeze();const s=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?i(void 0,r):new Promise(i);function i(l,c){const u=Cp(t);s.run(e,u,h);function h(m,p,x){const v=p||e;m?c(m):l?l(v):r(void 0,v,x)}}}runSync(e,t){let r=!1,s;return this.run(e,t,i),W8("runSync","run",r),s;function i(l,c){$8(l),s=c,r=!0}}stringify(e,t){this.freeze();const r=Cp(t),s=this.compiler||this.Compiler;return kb("stringify",s),V8(e),s(e,r)}use(e,...t){const r=this.attachers,s=this.namespace;if(jb("use",this.frozen),e!=null)if(typeof e=="function")u(e,t);else if(typeof e=="object")Array.isArray(e)?c(e):l(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function i(h){if(typeof h=="function")u(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[m,...p]=h;u(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");c(h.plugins),h.settings&&(s.settings=yb(!0,s.settings,h.settings))}function c(h){let m=-1;if(h!=null)if(Array.isArray(h))for(;++m<h.length;){const p=h[m];i(p)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function u(h,m){let p=-1,x=-1;for(;++p<r.length;)if(r[p][0]===h){x=p;break}if(x===-1)r.push([h,...m]);else if(m.length>0){let[v,...b]=m;const O=r[x][1];w4(O)&&w4(v)&&(v=yb(!0,O,v)),r[x]=[h,v,...b]}}}}const Jie=new j5().freeze();function Ob(n,e){if(typeof e!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function kb(n,e){if(typeof e!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function jb(n,e){if(e)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function V8(n){if(!w4(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function W8(n,e,t){if(!t)throw new Error("`"+n+"` finished async. Use `"+e+"` instead")}function Cp(n){return eae(n)?n:new qD(n)}function eae(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function tae(n){return typeof n=="string"||nae(n)}function nae(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const rae="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",G8=[],X8={allowDangerousHtml:!0},sae=/^(https?|ircs?|mailto|xmpp)$/i,iae=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function aae(n){const e=lae(n),t=oae(n);return cae(e.runSync(e.parse(t),t),n)}function lae(n){const e=n.rehypePlugins||G8,t=n.remarkPlugins||G8,r=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...X8}:X8;return Jie().use(Qse).use(t).use(zie,r).use(e)}function oae(n){const e=n.children||"",t=new qD;return typeof e=="string"&&(t.value=e),t}function cae(n,e){const t=e.allowedElements,r=e.allowElement,s=e.components,i=e.disallowedElements,l=e.skipHtml,c=e.unwrapDisallowed,u=e.urlTransform||uae;for(const m of iae)Object.hasOwn(e,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+rae+m.id,void 0);return k5(n,h),jne(n,{Fragment:a.Fragment,components:s,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function h(m,p,x){if(m.type==="raw"&&x&&typeof p=="number")return l?x.children.splice(p,1):x.children[p]={type:"text",value:m.value},p;if(m.type==="element"){let v;for(v in pb)if(Object.hasOwn(pb,v)&&Object.hasOwn(m.properties,v)){const b=m.properties[v],O=pb[v];(O===null||O.includes(m.tagName))&&(m.properties[v]=u(String(b||""),v,m))}}if(m.type==="element"){let v=t?!t.includes(m.tagName):i?i.includes(m.tagName):!1;if(!v&&r&&typeof p=="number"&&(v=!r(m,p,x)),v&&x&&typeof p=="number")return c&&m.children?x.children.splice(p,1,...m.children):x.children.splice(p,1),p}}}function uae(n){const e=n.indexOf(":"),t=n.indexOf("?"),r=n.indexOf("#"),s=n.indexOf("/");return e===-1||s!==-1&&e>s||t!==-1&&e>t||r!==-1&&e>r||sae.test(n.slice(0,e))?n:""}function Y8(n,e){const t=String(n);if(typeof e!="string")throw new TypeError("Expected character");let r=0,s=t.indexOf(e);for(;s!==-1;)r++,s=t.indexOf(e,s+e.length);return r}function dae(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function hae(n,e,t){const s=b0((t||{}).ignore||[]),i=fae(e);let l=-1;for(;++l<i.length;)O5(n,"text",c);function c(h,m){let p=-1,x;for(;++p<m.length;){const v=m[p],b=x?x.children:void 0;if(s(v,b?b.indexOf(v):void 0,x))return;x=v}if(x)return u(h,m)}function u(h,m){const p=m[m.length-1],x=i[l][0],v=i[l][1];let b=0;const k=p.children.indexOf(h);let j=!1,T=[];x.lastIndex=0;let M=x.exec(h.value);for(;M;){const _=M.index,D={index:M.index,input:M.input,stack:[...m,h]};let E=v(...M,D);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?x.lastIndex=_+1:(b!==_&&T.push({type:"text",value:h.value.slice(b,_)}),Array.isArray(E)?T.push(...E):E&&T.push(E),b=_+M[0].length,j=!0),!x.global)break;M=x.exec(h.value)}return j?(b<h.value.length&&T.push({type:"text",value:h.value.slice(b)}),p.children.splice(k,1,...T)):T=[h],k+T.length}}function fae(n){const e=[];if(!Array.isArray(n))throw new TypeError("Expected find and replace tuple or list of tuples");const t=!n[0]||Array.isArray(n[0])?n:[n];let r=-1;for(;++r<t.length;){const s=t[r];e.push([mae(s[0]),pae(s[1])])}return e}function mae(n){return typeof n=="string"?new RegExp(dae(n),"g"):n}function pae(n){return typeof n=="function"?n:function(){return n}}const Nb="phrasing",Cb=["autolink","link","image","label"];function gae(){return{transforms:[Oae],enter:{literalAutolink:vae,literalAutolinkEmail:Tb,literalAutolinkHttp:Tb,literalAutolinkWww:Tb},exit:{literalAutolink:Sae,literalAutolinkEmail:wae,literalAutolinkHttp:yae,literalAutolinkWww:bae}}}function xae(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Nb,notInConstruct:Cb},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Nb,notInConstruct:Cb},{character:":",before:"[ps]",after:"\\/",inConstruct:Nb,notInConstruct:Cb}]}}function vae(n){this.enter({type:"link",title:null,url:"",children:[]},n)}function Tb(n){this.config.enter.autolinkProtocol.call(this,n)}function yae(n){this.config.exit.autolinkProtocol.call(this,n)}function bae(n){this.config.exit.data.call(this,n);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(n)}function wae(n){this.config.exit.autolinkEmail.call(this,n)}function Sae(n){this.exit(n)}function Oae(n){hae(n,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,kae],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),jae]],{ignore:["link","linkReference"]})}function kae(n,e,t,r,s){let i="";if(!QD(s)||(/^w/i.test(e)&&(t=e+t,e="",i="http://"),!Nae(t)))return!1;const l=Cae(t+r);if(!l[0])return!1;const c={type:"link",title:null,url:i+e+l[0],children:[{type:"text",value:e+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function jae(n,e,t,r){return!QD(r,!0)||/[-\d_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+t,children:[{type:"text",value:e+"@"+t}]}}function Nae(n){const e=n.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function Cae(n){const e=/[!"&'),.:;<>?\]}]+$/.exec(n);if(!e)return[n,void 0];n=n.slice(0,e.index);let t=e[0],r=t.indexOf(")");const s=Y8(n,"(");let i=Y8(n,")");for(;r!==-1&&s>i;)n+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),i++;return[n,t]}function QD(n,e){const t=n.input.charCodeAt(n.index-1);return(n.index===0||Cc(t)||Fx(t))&&(!e||t!==47)}$D.peek=Pae;function Tae(){this.buffer()}function Mae(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function Aae(){this.buffer()}function Eae(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function _ae(n){const e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Fi(this.sliceSerialize(n)).toLowerCase(),t.label=e}function Dae(n){this.exit(n)}function Rae(n){const e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Fi(this.sliceSerialize(n)).toLowerCase(),t.label=e}function zae(n){this.exit(n)}function Pae(){return"["}function $D(n,e,t,r){const s=t.createTracker(r);let i=s.move("[^");const l=t.enter("footnoteReference"),c=t.enter("reference");return i+=s.move(t.safe(t.associationId(n),{after:"]",before:i})),c(),l(),i+=s.move("]"),i}function Lae(){return{enter:{gfmFootnoteCallString:Tae,gfmFootnoteCall:Mae,gfmFootnoteDefinitionLabelString:Aae,gfmFootnoteDefinition:Eae},exit:{gfmFootnoteCallString:_ae,gfmFootnoteCall:Dae,gfmFootnoteDefinitionLabelString:Rae,gfmFootnoteDefinition:zae}}}function Bae(n){let e=!1;return n&&n.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:t,footnoteReference:$D},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,s,i,l){const c=i.createTracker(l);let u=c.move("[^");const h=i.enter("footnoteDefinition"),m=i.enter("label");return u+=c.move(i.safe(i.associationId(r),{before:u,after:"]"})),m(),u+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),u+=c.move((e?`
|
||
`:" ")+i.indentLines(i.containerFlow(r,c.current()),e?HD:Iae))),h(),u}}function Iae(n,e,t){return e===0?n:HD(n,e,t)}function HD(n,e,t){return(t?"":" ")+n}const Fae=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];UD.peek=Uae;function qae(){return{canContainEols:["delete"],enter:{strikethrough:$ae},exit:{strikethrough:Hae}}}function Qae(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Fae}],handlers:{delete:UD}}}function $ae(n){this.enter({type:"delete",children:[]},n)}function Hae(n){this.exit(n)}function UD(n,e,t,r){const s=t.createTracker(r),i=t.enter("strikethrough");let l=s.move("~~");return l+=t.containerPhrasing(n,{...s.current(),before:l,after:"~"}),l+=s.move("~~"),i(),l}function Uae(){return"~"}function Vae(n){return n.length}function Wae(n,e){const t=e||{},r=(t.align||[]).concat(),s=t.stringLength||Vae,i=[],l=[],c=[],u=[];let h=0,m=-1;for(;++m<n.length;){const O=[],k=[];let j=-1;for(n[m].length>h&&(h=n[m].length);++j<n[m].length;){const T=Gae(n[m][j]);if(t.alignDelimiters!==!1){const M=s(T);k[j]=M,(u[j]===void 0||M>u[j])&&(u[j]=M)}O.push(T)}l[m]=O,c[m]=k}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<h;)i[p]=K8(r[p]);else{const O=K8(r);for(;++p<h;)i[p]=O}p=-1;const x=[],v=[];for(;++p<h;){const O=i[p];let k="",j="";O===99?(k=":",j=":"):O===108?k=":":O===114&&(j=":");let T=t.alignDelimiters===!1?1:Math.max(1,u[p]-k.length-j.length);const M=k+"-".repeat(T)+j;t.alignDelimiters!==!1&&(T=k.length+T+j.length,T>u[p]&&(u[p]=T),v[p]=T),x[p]=M}l.splice(1,0,x),c.splice(1,0,v),m=-1;const b=[];for(;++m<l.length;){const O=l[m],k=c[m];p=-1;const j=[];for(;++p<h;){const T=O[p]||"";let M="",_="";if(t.alignDelimiters!==!1){const D=u[p]-(k[p]||0),E=i[p];E===114?M=" ".repeat(D):E===99?D%2?(M=" ".repeat(D/2+.5),_=" ".repeat(D/2-.5)):(M=" ".repeat(D/2),_=M):_=" ".repeat(D)}t.delimiterStart!==!1&&!p&&j.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&T==="")&&(t.delimiterStart!==!1||p)&&j.push(" "),t.alignDelimiters!==!1&&j.push(M),j.push(T),t.alignDelimiters!==!1&&j.push(_),t.padding!==!1&&j.push(" "),(t.delimiterEnd!==!1||p!==h-1)&&j.push("|")}b.push(t.delimiterEnd===!1?j.join("").replace(/ +$/,""):j.join(""))}return b.join(`
|
||
`)}function Gae(n){return n==null?"":String(n)}function K8(n){const e=typeof n=="string"?n.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function Xae(n,e,t,r){const s=t.enter("blockquote"),i=t.createTracker(r);i.move("> "),i.shift(2);const l=t.indentLines(t.containerFlow(n,i.current()),Yae);return s(),l}function Yae(n,e,t){return">"+(t?"":" ")+n}function Kae(n,e){return Z8(n,e.inConstruct,!0)&&!Z8(n,e.notInConstruct,!1)}function Z8(n,e,t){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return t;let r=-1;for(;++r<e.length;)if(n.includes(e[r]))return!0;return!1}function J8(n,e,t,r){let s=-1;for(;++s<t.unsafe.length;)if(t.unsafe[s].character===`
|
||
`&&Kae(t.stack,t.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
||
`}function VD(n,e){const t=String(n);let r=t.indexOf(e),s=r,i=0,l=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++i>l&&(l=i):i=1,s=r+e.length,r=t.indexOf(e,s);return l}function Zae(n,e){return!!(e.options.fences===!1&&n.value&&!n.lang&&/[^ \r\n]/.test(n.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(n.value))}function Jae(n){const e=n.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function ele(n,e,t,r){const s=Jae(t),i=n.value||"",l=s==="`"?"GraveAccent":"Tilde";if(Zae(n,t)){const p=t.enter("codeIndented"),x=t.indentLines(i,tle);return p(),x}const c=t.createTracker(r),u=s.repeat(Math.max(VD(i,s)+1,3)),h=t.enter("codeFenced");let m=c.move(u);if(n.lang){const p=t.enter(`codeFencedLang${l}`);m+=c.move(t.safe(n.lang,{before:m,after:" ",encode:["`"],...c.current()})),p()}if(n.lang&&n.meta){const p=t.enter(`codeFencedMeta${l}`);m+=c.move(" "),m+=c.move(t.safe(n.meta,{before:m,after:`
|
||
`,encode:["`"],...c.current()})),p()}return m+=c.move(`
|
||
`),i&&(m+=c.move(i+`
|
||
`)),m+=c.move(u),h(),m}function tle(n,e,t){return(t?"":" ")+n}function N5(n){const e=n.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function nle(n,e,t,r){const s=N5(t),i=s==='"'?"Quote":"Apostrophe",l=t.enter("definition");let c=t.enter("label");const u=t.createTracker(r);let h=u.move("[");return h+=u.move(t.safe(t.associationId(n),{before:h,after:"]",...u.current()})),h+=u.move("]: "),c(),!n.url||/[\0- \u007F]/.test(n.url)?(c=t.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(t.safe(n.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(c=t.enter("destinationRaw"),h+=u.move(t.safe(n.url,{before:h,after:n.title?" ":`
|
||
`,...u.current()}))),c(),n.title&&(c=t.enter(`title${i}`),h+=u.move(" "+s),h+=u.move(t.safe(n.title,{before:h,after:s,...u.current()})),h+=u.move(s),c()),l(),h}function rle(n){const e=n.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function If(n){return"&#x"+n.toString(16).toUpperCase()+";"}function Gg(n,e,t){const r=yd(n),s=yd(e);return r===void 0?s===void 0?t==="_"?{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}}WD.peek=sle;function WD(n,e,t,r){const s=rle(t),i=t.enter("emphasis"),l=t.createTracker(r),c=l.move(s);let u=l.move(t.containerPhrasing(n,{after:s,before:c,...l.current()}));const h=u.charCodeAt(0),m=Gg(r.before.charCodeAt(r.before.length-1),h,s);m.inside&&(u=If(h)+u.slice(1));const p=u.charCodeAt(u.length-1),x=Gg(r.after.charCodeAt(0),p,s);x.inside&&(u=u.slice(0,-1)+If(p));const v=l.move(s);return i(),t.attentionEncodeSurroundingInfo={after:x.outside,before:m.outside},c+u+v}function sle(n,e,t){return t.options.emphasis||"*"}function ile(n,e){let t=!1;return k5(n,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,y4}),!!((!n.depth||n.depth<3)&&g5(n)&&(e.options.setext||t))}function ale(n,e,t,r){const s=Math.max(Math.min(6,n.depth||1),1),i=t.createTracker(r);if(ile(n,t)){const m=t.enter("headingSetext"),p=t.enter("phrasing"),x=t.containerPhrasing(n,{...i.current(),before:`
|
||
`,after:`
|
||
`});return p(),m(),x+`
|
||
`+(s===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
|
||
`))+1))}const l="#".repeat(s),c=t.enter("headingAtx"),u=t.enter("phrasing");i.move(l+" ");let h=t.containerPhrasing(n,{before:"# ",after:`
|
||
`,...i.current()});return/^[\t ]/.test(h)&&(h=If(h.charCodeAt(0))+h.slice(1)),h=h?l+" "+h:l,t.options.closeAtx&&(h+=" "+l),u(),c(),h}GD.peek=lle;function GD(n){return n.value||""}function lle(){return"<"}XD.peek=ole;function XD(n,e,t,r){const s=N5(t),i=s==='"'?"Quote":"Apostrophe",l=t.enter("image");let c=t.enter("label");const u=t.createTracker(r);let h=u.move("![");return h+=u.move(t.safe(n.alt,{before:h,after:"]",...u.current()})),h+=u.move("]("),c(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(c=t.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(t.safe(n.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(c=t.enter("destinationRaw"),h+=u.move(t.safe(n.url,{before:h,after:n.title?" ":")",...u.current()}))),c(),n.title&&(c=t.enter(`title${i}`),h+=u.move(" "+s),h+=u.move(t.safe(n.title,{before:h,after:s,...u.current()})),h+=u.move(s),c()),h+=u.move(")"),l(),h}function ole(){return"!"}YD.peek=cle;function YD(n,e,t,r){const s=n.referenceType,i=t.enter("imageReference");let l=t.enter("label");const c=t.createTracker(r);let u=c.move("![");const h=t.safe(n.alt,{before:u,after:"]",...c.current()});u+=c.move(h+"]["),l();const m=t.stack;t.stack=[],l=t.enter("reference");const p=t.safe(t.associationId(n),{before:u,after:"]",...c.current()});return l(),t.stack=m,i(),s==="full"||!h||h!==p?u+=c.move(p+"]"):s==="shortcut"?u=u.slice(0,-1):u+=c.move("]"),u}function cle(){return"!"}KD.peek=ule;function KD(n,e,t){let r=n.value||"",s="`",i=-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+" ");++i<t.unsafe.length;){const l=t.unsafe[i],c=t.compilePattern(l);let u;if(l.atBreak)for(;u=c.exec(r);){let h=u.index;r.charCodeAt(h)===10&&r.charCodeAt(h-1)===13&&h--,r=r.slice(0,h)+" "+r.slice(u.index+1)}}return s+r+s}function ule(){return"`"}function ZD(n,e){const t=g5(n);return!!(!e.options.resourceLink&&n.url&&!n.title&&n.children&&n.children.length===1&&n.children[0].type==="text"&&(t===n.url||"mailto:"+t===n.url)&&/^[a-z][a-z+.-]+:/i.test(n.url)&&!/[\0- <>\u007F]/.test(n.url))}JD.peek=dle;function JD(n,e,t,r){const s=N5(t),i=s==='"'?"Quote":"Apostrophe",l=t.createTracker(r);let c,u;if(ZD(n,t)){const m=t.stack;t.stack=[],c=t.enter("autolink");let p=l.move("<");return p+=l.move(t.containerPhrasing(n,{before:p,after:">",...l.current()})),p+=l.move(">"),c(),t.stack=m,p}c=t.enter("link"),u=t.enter("label");let h=l.move("[");return h+=l.move(t.containerPhrasing(n,{before:h,after:"](",...l.current()})),h+=l.move("]("),u(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(u=t.enter("destinationLiteral"),h+=l.move("<"),h+=l.move(t.safe(n.url,{before:h,after:">",...l.current()})),h+=l.move(">")):(u=t.enter("destinationRaw"),h+=l.move(t.safe(n.url,{before:h,after:n.title?" ":")",...l.current()}))),u(),n.title&&(u=t.enter(`title${i}`),h+=l.move(" "+s),h+=l.move(t.safe(n.title,{before:h,after:s,...l.current()})),h+=l.move(s),u()),h+=l.move(")"),c(),h}function dle(n,e,t){return ZD(n,t)?"<":"["}eR.peek=hle;function eR(n,e,t,r){const s=n.referenceType,i=t.enter("linkReference");let l=t.enter("label");const c=t.createTracker(r);let u=c.move("[");const h=t.containerPhrasing(n,{before:u,after:"]",...c.current()});u+=c.move(h+"]["),l();const m=t.stack;t.stack=[],l=t.enter("reference");const p=t.safe(t.associationId(n),{before:u,after:"]",...c.current()});return l(),t.stack=m,i(),s==="full"||!h||h!==p?u+=c.move(p+"]"):s==="shortcut"?u=u.slice(0,-1):u+=c.move("]"),u}function hle(){return"["}function C5(n){const e=n.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function fle(n){const e=C5(n),t=n.options.bulletOther;if(!t)return e==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+t+"`) to be different");return t}function mle(n){const e=n.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function tR(n){const e=n.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function ple(n,e,t,r){const s=t.enter("list"),i=t.bulletCurrent;let l=n.ordered?mle(t):C5(t);const c=n.ordered?l==="."?")":".":fle(t);let u=e&&t.bulletLastUsed?l===t.bulletLastUsed:!1;if(!n.ordered){const m=n.children?n.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(u=!0),tR(t)===l&&m){let p=-1;for(;++p<n.children.length;){const x=n.children[p];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(l=c),t.bulletCurrent=l;const h=t.containerFlow(n,r);return t.bulletLastUsed=l,t.bulletCurrent=i,s(),h}function gle(n){const e=n.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function xle(n,e,t,r){const s=gle(t);let i=t.bulletCurrent||C5(t);e&&e.type==="list"&&e.ordered&&(i=(typeof e.start=="number"&&e.start>-1?e.start:1)+(t.options.incrementListMarker===!1?0:e.children.indexOf(n))+i);let l=i.length+1;(s==="tab"||s==="mixed"&&(e&&e.type==="list"&&e.spread||n.spread))&&(l=Math.ceil(l/4)*4);const c=t.createTracker(r);c.move(i+" ".repeat(l-i.length)),c.shift(l);const u=t.enter("listItem"),h=t.indentLines(t.containerFlow(n,c.current()),m);return u(),h;function m(p,x,v){return x?(v?"":" ".repeat(l))+p:(v?i:i+" ".repeat(l-i.length))+p}}function vle(n,e,t,r){const s=t.enter("paragraph"),i=t.enter("phrasing"),l=t.containerPhrasing(n,r);return i(),s(),l}const yle=b0(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ble(n,e,t,r){return(n.children.some(function(l){return yle(l)})?t.containerPhrasing:t.containerFlow).call(t,n,r)}function wle(n){const e=n.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}nR.peek=Sle;function nR(n,e,t,r){const s=wle(t),i=t.enter("strong"),l=t.createTracker(r),c=l.move(s+s);let u=l.move(t.containerPhrasing(n,{after:s,before:c,...l.current()}));const h=u.charCodeAt(0),m=Gg(r.before.charCodeAt(r.before.length-1),h,s);m.inside&&(u=If(h)+u.slice(1));const p=u.charCodeAt(u.length-1),x=Gg(r.after.charCodeAt(0),p,s);x.inside&&(u=u.slice(0,-1)+If(p));const v=l.move(s+s);return i(),t.attentionEncodeSurroundingInfo={after:x.outside,before:m.outside},c+u+v}function Sle(n,e,t){return t.options.strong||"*"}function Ole(n,e,t,r){return t.safe(n.value,r)}function kle(n){const e=n.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function jle(n,e,t){const r=(tR(t)+(t.options.ruleSpaces?" ":"")).repeat(kle(t));return t.options.ruleSpaces?r.slice(0,-1):r}const rR={blockquote:Xae,break:J8,code:ele,definition:nle,emphasis:WD,hardBreak:J8,heading:ale,html:GD,image:XD,imageReference:YD,inlineCode:KD,link:JD,linkReference:eR,list:ple,listItem:xle,paragraph:vle,root:ble,strong:nR,text:Ole,thematicBreak:jle};function Nle(){return{enter:{table:Cle,tableData:eN,tableHeader:eN,tableRow:Mle},exit:{codeText:Ale,table:Tle,tableData:Mb,tableHeader:Mb,tableRow:Mb}}}function Cle(n){const e=n._align;this.enter({type:"table",align:e.map(function(t){return t==="none"?null:t}),children:[]},n),this.data.inTable=!0}function Tle(n){this.exit(n),this.data.inTable=void 0}function Mle(n){this.enter({type:"tableRow",children:[]},n)}function Mb(n){this.exit(n)}function eN(n){this.enter({type:"tableCell",children:[]},n)}function Ale(n){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,Ele));const t=this.stack[this.stack.length-1];t.type,t.value=e,this.exit(n)}function Ele(n,e){return e==="|"?e:n}function _le(n){const e=n||{},t=e.tableCellPadding,r=e.tablePipeAlign,s=e.stringLength,i=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
||
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:l,tableCell:u,tableRow:c}};function l(v,b,O,k){return h(m(v,O,k),v.align)}function c(v,b,O,k){const j=p(v,O,k),T=h([j]);return T.slice(0,T.indexOf(`
|
||
`))}function u(v,b,O,k){const j=O.enter("tableCell"),T=O.enter("phrasing"),M=O.containerPhrasing(v,{...k,before:i,after:i});return T(),j(),M}function h(v,b){return Wae(v,{align:b,alignDelimiters:r,padding:t,stringLength:s})}function m(v,b,O){const k=v.children;let j=-1;const T=[],M=b.enter("table");for(;++j<k.length;)T[j]=p(k[j],b,O);return M(),T}function p(v,b,O){const k=v.children;let j=-1;const T=[],M=b.enter("tableRow");for(;++j<k.length;)T[j]=u(k[j],v,b,O);return M(),T}function x(v,b,O){let k=rR.inlineCode(v,b,O);return O.stack.includes("tableCell")&&(k=k.replace(/\|/g,"\\$&")),k}}function Dle(){return{exit:{taskListCheckValueChecked:tN,taskListCheckValueUnchecked:tN,paragraph:zle}}}function Rle(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Ple}}}function tN(n){const e=this.stack[this.stack.length-2];e.type,e.checked=n.type==="taskListCheckValueChecked"}function zle(n){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const t=this.stack[this.stack.length-1];t.type;const r=t.children[0];if(r&&r.type==="text"){const s=e.children;let i=-1,l;for(;++i<s.length;){const c=s[i];if(c.type==="paragraph"){l=c;break}}l===t&&(r.value=r.value.slice(1),r.value.length===0?t.children.shift():t.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,t.position.start=Object.assign({},r.position.start)))}}this.exit(n)}function Ple(n,e,t,r){const s=n.children[0],i=typeof n.checked=="boolean"&&s&&s.type==="paragraph",l="["+(n.checked?"x":" ")+"] ",c=t.createTracker(r);i&&c.move(l);let u=rR.listItem(n,e,t,{...r,...c.current()});return i&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),u;function h(m){return m+l}}function Lle(){return[gae(),Lae(),qae(),Nle(),Dle()]}function Ble(n){return{extensions:[xae(),Bae(n),Qae(),_le(n),Rle()]}}const Ile={tokenize:Ule,partial:!0},sR={tokenize:Vle,partial:!0},iR={tokenize:Wle,partial:!0},aR={tokenize:Gle,partial:!0},Fle={tokenize:Xle,partial:!0},lR={name:"wwwAutolink",tokenize:$le,previous:cR},oR={name:"protocolAutolink",tokenize:Hle,previous:uR},bl={name:"emailAutolink",tokenize:Qle,previous:dR},ja={};function qle(){return{text:ja}}let Zo=48;for(;Zo<123;)ja[Zo]=bl,Zo++,Zo===58?Zo=65:Zo===91&&(Zo=97);ja[43]=bl;ja[45]=bl;ja[46]=bl;ja[95]=bl;ja[72]=[bl,oR];ja[104]=[bl,oR];ja[87]=[bl,lR];ja[119]=[bl,lR];function Qle(n,e,t){const r=this;let s,i;return l;function l(p){return!O4(p)||!dR.call(r,r.previous)||T5(r.events)?t(p):(n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),c(p))}function c(p){return O4(p)?(n.consume(p),c):p===64?(n.consume(p),u):t(p)}function u(p){return p===46?n.check(Fle,m,h)(p):p===45||p===95||rs(p)?(i=!0,n.consume(p),u):m(p)}function h(p){return n.consume(p),s=!0,u}function m(p){return i&&s&&ds(r.previous)?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),e(p)):t(p)}}function $le(n,e,t){const r=this;return s;function s(l){return l!==87&&l!==119||!cR.call(r,r.previous)||T5(r.events)?t(l):(n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(Ile,n.attempt(sR,n.attempt(iR,i),t),t)(l))}function i(l){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),e(l)}}function Hle(n,e,t){const r=this;let s="",i=!1;return l;function l(p){return(p===72||p===104)&&uR.call(r,r.previous)&&!T5(r.events)?(n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),s+=String.fromCodePoint(p),n.consume(p),c):t(p)}function c(p){if(ds(p)&&s.length<5)return s+=String.fromCodePoint(p),n.consume(p),c;if(p===58){const x=s.toLowerCase();if(x==="http"||x==="https")return n.consume(p),u}return t(p)}function u(p){return p===47?(n.consume(p),i?h:(i=!0,u)):t(p)}function h(p){return p===null||Ug(p)||Dn(p)||Cc(p)||Fx(p)?t(p):n.attempt(sR,n.attempt(iR,m),t)(p)}function m(p){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),e(p)}}function Ule(n,e,t){let r=0;return s;function s(l){return(l===87||l===119)&&r<3?(r++,n.consume(l),s):l===46&&r===3?(n.consume(l),i):t(l)}function i(l){return l===null?t(l):e(l)}}function Vle(n,e,t){let r,s,i;return l;function l(h){return h===46||h===95?n.check(aR,u,c)(h):h===null||Dn(h)||Cc(h)||h!==45&&Fx(h)?u(h):(i=!0,n.consume(h),l)}function c(h){return h===95?r=!0:(s=r,r=void 0),n.consume(h),l}function u(h){return s||r||!i?t(h):e(h)}}function Wle(n,e){let t=0,r=0;return s;function s(l){return l===40?(t++,n.consume(l),s):l===41&&r<t?i(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?n.check(aR,e,i)(l):l===null||Dn(l)||Cc(l)?e(l):(n.consume(l),s)}function i(l){return l===41&&r++,n.consume(l),s}}function Gle(n,e,t){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(n.consume(c),r):c===38?(n.consume(c),i):c===93?(n.consume(c),s):c===60||c===null||Dn(c)||Cc(c)?e(c):t(c)}function s(c){return c===null||c===40||c===91||Dn(c)||Cc(c)?e(c):r(c)}function i(c){return ds(c)?l(c):t(c)}function l(c){return c===59?(n.consume(c),r):ds(c)?(n.consume(c),l):t(c)}}function Xle(n,e,t){return r;function r(i){return n.consume(i),s}function s(i){return rs(i)?t(i):e(i)}}function cR(n){return n===null||n===40||n===42||n===95||n===91||n===93||n===126||Dn(n)}function uR(n){return!ds(n)}function dR(n){return!(n===47||O4(n))}function O4(n){return n===43||n===45||n===46||n===95||rs(n)}function T5(n){let e=n.length,t=!1;for(;e--;){const r=n[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){t=!0;break}if(r._gfmAutolinkLiteralWalkedInto){t=!1;break}}return n.length>0&&!t&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const Yle={tokenize:soe,partial:!0};function Kle(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:toe,continuation:{tokenize:noe},exit:roe}},text:{91:{name:"gfmFootnoteCall",tokenize:eoe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Zle,resolveTo:Jle}}}}function Zle(n,e,t){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;s--;){const u=r.events[s][1];if(u.type==="labelImage"){l=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return c;function c(u){if(!l||!l._balanced)return t(u);const h=Fi(r.sliceSerialize({start:l.end,end:r.now()}));return h.codePointAt(0)!==94||!i.includes(h.slice(1))?t(u):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(u),n.exit("gfmFootnoteCallLabelMarker"),e(u))}}function Jle(n,e){let t=n.length;for(;t--;)if(n[t][1].type==="labelImage"&&n[t][0]==="enter"){n[t][1];break}n[t+1][1].type="data",n[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},n[t+3][1].start),end:Object.assign({},n[n.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},n[t+3][1].end),end:Object.assign({},n[t+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},n[n.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},c=[n[t+1],n[t+2],["enter",r,e],n[t+3],n[t+4],["enter",s,e],["exit",s,e],["enter",i,e],["enter",l,e],["exit",l,e],["exit",i,e],n[n.length-2],n[n.length-1],["exit",r,e]];return n.splice(t,n.length-t+1,...c),n}function eoe(n,e,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,l;return c;function c(p){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(p),n.exit("gfmFootnoteCallLabelMarker"),u}function u(p){return p!==94?t(p):(n.enter("gfmFootnoteCallMarker"),n.consume(p),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",h)}function h(p){if(i>999||p===93&&!l||p===null||p===91||Dn(p))return t(p);if(p===93){n.exit("chunkString");const x=n.exit("gfmFootnoteCallString");return s.includes(Fi(r.sliceSerialize(x)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(p),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),e):t(p)}return Dn(p)||(l=!0),i++,n.consume(p),p===92?m:h}function m(p){return p===91||p===92||p===93?(n.consume(p),i++,h):h(p)}}function toe(n,e,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,l=0,c;return u;function u(b){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(b),n.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(b){return b===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(b),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",m):t(b)}function m(b){if(l>999||b===93&&!c||b===null||b===91||Dn(b))return t(b);if(b===93){n.exit("chunkString");const O=n.exit("gfmFootnoteDefinitionLabelString");return i=Fi(r.sliceSerialize(O)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(b),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),x}return Dn(b)||(c=!0),l++,n.consume(b),b===92?p:m}function p(b){return b===91||b===92||b===93?(n.consume(b),l++,m):m(b)}function x(b){return b===58?(n.enter("definitionMarker"),n.consume(b),n.exit("definitionMarker"),s.includes(i)||s.push(i),zt(n,v,"gfmFootnoteDefinitionWhitespace")):t(b)}function v(b){return e(b)}}function noe(n,e,t){return n.check(y0,e,n.attempt(Yle,e,t))}function roe(n){n.exit("gfmFootnoteDefinition")}function soe(n,e,t){const r=this;return zt(n,s,"gfmFootnoteDefinitionIndent",5);function s(i){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?e(i):t(i)}}function ioe(n){let t=(n||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(l,c){let u=-1;for(;++u<l.length;)if(l[u][0]==="enter"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._close){let h=u;for(;h--;)if(l[h][0]==="exit"&&l[h][1].type==="strikethroughSequenceTemporary"&&l[h][1]._open&&l[u][1].end.offset-l[u][1].start.offset===l[h][1].end.offset-l[h][1].start.offset){l[u][1].type="strikethroughSequence",l[h][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[h][1].start),end:Object.assign({},l[u][1].end)},p={type:"strikethroughText",start:Object.assign({},l[h][1].end),end:Object.assign({},l[u][1].start)},x=[["enter",m,c],["enter",l[h][1],c],["exit",l[h][1],c],["enter",p,c]],v=c.parser.constructs.insideSpan.null;v&&ri(x,x.length,0,qx(v,l.slice(h+1,u),c)),ri(x,x.length,0,[["exit",p,c],["enter",l[u][1],c],["exit",l[u][1],c],["exit",m,c]]),ri(l,h-1,u-h+3,x),u=h+x.length-2;break}}for(u=-1;++u<l.length;)l[u][1].type==="strikethroughSequenceTemporary"&&(l[u][1].type="data");return l}function i(l,c,u){const h=this.previous,m=this.events;let p=0;return x;function x(b){return h===126&&m[m.length-1][1].type!=="characterEscape"?u(b):(l.enter("strikethroughSequenceTemporary"),v(b))}function v(b){const O=yd(h);if(b===126)return p>1?u(b):(l.consume(b),p++,v);if(p<2&&!t)return u(b);const k=l.exit("strikethroughSequenceTemporary"),j=yd(b);return k._open=!j||j===2&&!!O,k._close=!O||O===2&&!!j,c(b)}}}class aoe{constructor(){this.map=[]}add(e,t,r){loe(this,e,t,r)}consume(e){if(this.map.sort(function(i,l){return i[0]-l[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];r.push(e.slice()),e.length=0;let s=r.pop();for(;s;){for(const i of s)e.push(i);s=r.pop()}this.map.length=0}}function loe(n,e,t,r){let s=0;if(!(t===0&&r.length===0)){for(;s<n.map.length;){if(n.map[s][0]===e){n.map[s][1]+=t,n.map[s][2].push(...r);return}s+=1}n.map.push([e,t,r])}}function ooe(n,e){let t=!1;const r=[];for(;e<n.length;){const s=n[e];if(t){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(n[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(n[e-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(t=!0);e+=1}return r}function coe(){return{flow:{null:{name:"table",tokenize:uoe,resolveAll:doe}}}}function uoe(n,e,t){const r=this;let s=0,i=0,l;return c;function c(B){let U=r.events.length-1;for(;U>-1;){const W=r.events[U][1].type;if(W==="lineEnding"||W==="linePrefix")U--;else break}const V=U>-1?r.events[U][1].type:null,ce=V==="tableHead"||V==="tableRow"?E:u;return ce===E&&r.parser.lazy[r.now().line]?t(B):ce(B)}function u(B){return n.enter("tableHead"),n.enter("tableRow"),h(B)}function h(B){return B===124||(l=!0,i+=1),m(B)}function m(B){return B===null?t(B):Ze(B)?i>1?(i=0,r.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(B),n.exit("lineEnding"),v):t(B):Ft(B)?zt(n,m,"whitespace")(B):(i+=1,l&&(l=!1,s+=1),B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),l=!0,m):(n.enter("data"),p(B)))}function p(B){return B===null||B===124||Dn(B)?(n.exit("data"),m(B)):(n.consume(B),B===92?x:p)}function x(B){return B===92||B===124?(n.consume(B),p):p(B)}function v(B){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(B):(n.enter("tableDelimiterRow"),l=!1,Ft(B)?zt(n,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):b(B))}function b(B){return B===45||B===58?k(B):B===124?(l=!0,n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),O):D(B)}function O(B){return Ft(B)?zt(n,k,"whitespace")(B):k(B)}function k(B){return B===58?(i+=1,l=!0,n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),j):B===45?(i+=1,j(B)):B===null||Ze(B)?_(B):D(B)}function j(B){return B===45?(n.enter("tableDelimiterFiller"),T(B)):D(B)}function T(B){return B===45?(n.consume(B),T):B===58?(l=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),M):(n.exit("tableDelimiterFiller"),M(B))}function M(B){return Ft(B)?zt(n,_,"whitespace")(B):_(B)}function _(B){return B===124?b(B):B===null||Ze(B)?!l||s!==i?D(B):(n.exit("tableDelimiterRow"),n.exit("tableHead"),e(B)):D(B)}function D(B){return t(B)}function E(B){return n.enter("tableRow"),z(B)}function z(B){return B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),z):B===null||Ze(B)?(n.exit("tableRow"),e(B)):Ft(B)?zt(n,z,"whitespace")(B):(n.enter("data"),Q(B))}function Q(B){return B===null||B===124||Dn(B)?(n.exit("data"),z(B)):(n.consume(B),B===92?q:Q)}function q(B){return B===92||B===124?(n.consume(B),Q):Q(B)}}function doe(n,e){let t=-1,r=!0,s=0,i=[0,0,0,0],l=[0,0,0,0],c=!1,u=0,h,m,p;const x=new aoe;for(;++t<n.length;){const v=n[t],b=v[1];v[0]==="enter"?b.type==="tableHead"?(c=!1,u!==0&&(nN(x,e,u,h,m),m=void 0,u=0),h={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},x.add(t,0,[["enter",h,e]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(r=!0,p=void 0,i=[0,0,0,0],l=[0,t+1,0,0],c&&(c=!1,m={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},x.add(t,0,[["enter",m,e]])),s=b.type==="tableDelimiterRow"?2:m?3:1):s&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(i[1]!==0&&(l[0]=l[1],p=Tp(x,e,i,s,void 0,p),i=[0,0,0,0]),l[2]=t)):b.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(l[0]=l[1],p=Tp(x,e,i,s,void 0,p)),i=l,l=[i[1],t,0,0])):b.type==="tableHead"?(c=!0,u=t):b.type==="tableRow"||b.type==="tableDelimiterRow"?(u=t,i[1]!==0?(l[0]=l[1],p=Tp(x,e,i,s,t,p)):l[1]!==0&&(p=Tp(x,e,l,s,t,p)),s=0):s&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(l[3]=t)}for(u!==0&&nN(x,e,u,h,m),x.consume(e.events),t=-1;++t<e.events.length;){const v=e.events[t];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=ooe(e.events,t))}return n}function Tp(n,e,t,r,s,i){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";t[0]!==0&&(i.end=Object.assign({},Iu(e.events,t[0])),n.add(t[0],0,[["exit",i,e]]));const u=Iu(e.events,t[1]);if(i={type:l,start:Object.assign({},u),end:Object.assign({},u)},n.add(t[1],0,[["enter",i,e]]),t[2]!==0){const h=Iu(e.events,t[2]),m=Iu(e.events,t[3]),p={type:c,start:Object.assign({},h),end:Object.assign({},m)};if(n.add(t[2],0,[["enter",p,e]]),r!==2){const x=e.events[t[2]],v=e.events[t[3]];if(x[1].end=Object.assign({},v[1].end),x[1].type="chunkText",x[1].contentType="text",t[3]>t[2]+1){const b=t[2]+1,O=t[3]-t[2]-1;n.add(b,O,[])}}n.add(t[3]+1,0,[["exit",p,e]])}return s!==void 0&&(i.end=Object.assign({},Iu(e.events,s)),n.add(s,0,[["exit",i,e]]),i=void 0),i}function nN(n,e,t,r,s){const i=[],l=Iu(e.events,t);s&&(s.end=Object.assign({},l),i.push(["exit",s,e])),r.end=Object.assign({},l),i.push(["exit",r,e]),n.add(t+1,0,i)}function Iu(n,e){const t=n[e],r=t[0]==="enter"?"start":"end";return t[1][r]}const hoe={name:"tasklistCheck",tokenize:moe};function foe(){return{text:{91:hoe}}}function moe(n,e,t){const r=this;return s;function s(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(u):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(u),n.exit("taskListCheckMarker"),i)}function i(u){return Dn(u)?(n.enter("taskListCheckValueUnchecked"),n.consume(u),n.exit("taskListCheckValueUnchecked"),l):u===88||u===120?(n.enter("taskListCheckValueChecked"),n.consume(u),n.exit("taskListCheckValueChecked"),l):t(u)}function l(u){return u===93?(n.enter("taskListCheckMarker"),n.consume(u),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),c):t(u)}function c(u){return Ze(u)?e(u):Ft(u)?n.check({tokenize:poe},e,t)(u):t(u)}}function poe(n,e,t){return zt(n,r,"whitespace");function r(s){return s===null?t(s):e(s)}}function goe(n){return wD([qle(),Kle(),ioe(n),coe(),foe()])}const xoe={};function voe(n){const e=this,t=n||xoe,r=e.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(goe(t)),i.push(Lle()),l.push(Ble(t))}function yoe(){return{enter:{mathFlow:n,mathFlowFenceMeta:e,mathText:i},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:t,mathFlowValue:c,mathText:l,mathTextData:c}};function n(u){const h={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[h]}},u)}function e(){this.buffer()}function t(){const u=this.resume(),h=this.stack[this.stack.length-1];h.type,h.meta=u}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(u){const h=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),m=this.stack[this.stack.length-1];m.type,this.exit(u),m.value=h;const p=m.data.hChildren[0];p.type,p.tagName,p.children.push({type:"text",value:h}),this.data.mathFlowInside=void 0}function i(u){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},u),this.buffer()}function l(u){const h=this.resume(),m=this.stack[this.stack.length-1];m.type,this.exit(u),m.value=h,m.data.hChildren.push({type:"text",value:h})}function c(u){this.config.enter.data.call(this,u),this.config.exit.data.call(this,u)}}function boe(n){let e=(n||{}).singleDollarTextMath;return e==null&&(e=!0),r.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
|
||
`,inConstruct:"mathFlowMeta"},{character:"$",after:e?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:t,inlineMath:r}};function t(i,l,c,u){const h=i.value||"",m=c.createTracker(u),p="$".repeat(Math.max(VD(h,"$")+1,2)),x=c.enter("mathFlow");let v=m.move(p);if(i.meta){const b=c.enter("mathFlowMeta");v+=m.move(c.safe(i.meta,{after:`
|
||
`,before:v,encode:["$"],...m.current()})),b()}return v+=m.move(`
|
||
`),h&&(v+=m.move(h+`
|
||
`)),v+=m.move(p),x(),v}function r(i,l,c){let u=i.value||"",h=1;for(e||h++;new RegExp("(^|[^$])"+"\\$".repeat(h)+"([^$]|$)").test(u);)h++;const m="$".repeat(h);/[^ \r\n]/.test(u)&&(/^[ \r\n]/.test(u)&&/[ \r\n]$/.test(u)||/^\$|\$$/.test(u))&&(u=" "+u+" ");let p=-1;for(;++p<c.unsafe.length;){const x=c.unsafe[p];if(!x.atBreak)continue;const v=c.compilePattern(x);let b;for(;b=v.exec(u);){let O=b.index;u.codePointAt(O)===10&&u.codePointAt(O-1)===13&&O--,u=u.slice(0,O)+" "+u.slice(b.index+1)}}return m+u+m}function s(){return"$"}}const woe={tokenize:Soe,concrete:!0,name:"mathFlow"},rN={tokenize:Ooe,partial:!0};function Soe(n,e,t){const r=this,s=r.events[r.events.length-1],i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0;let l=0;return c;function c(T){return n.enter("mathFlow"),n.enter("mathFlowFence"),n.enter("mathFlowFenceSequence"),u(T)}function u(T){return T===36?(n.consume(T),l++,u):l<2?t(T):(n.exit("mathFlowFenceSequence"),zt(n,h,"whitespace")(T))}function h(T){return T===null||Ze(T)?p(T):(n.enter("mathFlowFenceMeta"),n.enter("chunkString",{contentType:"string"}),m(T))}function m(T){return T===null||Ze(T)?(n.exit("chunkString"),n.exit("mathFlowFenceMeta"),p(T)):T===36?t(T):(n.consume(T),m)}function p(T){return n.exit("mathFlowFence"),r.interrupt?e(T):n.attempt(rN,x,k)(T)}function x(T){return n.attempt({tokenize:j,partial:!0},k,v)(T)}function v(T){return(i?zt(n,b,"linePrefix",i+1):b)(T)}function b(T){return T===null?k(T):Ze(T)?n.attempt(rN,x,k)(T):(n.enter("mathFlowValue"),O(T))}function O(T){return T===null||Ze(T)?(n.exit("mathFlowValue"),b(T)):(n.consume(T),O)}function k(T){return n.exit("mathFlow"),e(T)}function j(T,M,_){let D=0;return zt(T,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function E(q){return T.enter("mathFlowFence"),T.enter("mathFlowFenceSequence"),z(q)}function z(q){return q===36?(D++,T.consume(q),z):D<l?_(q):(T.exit("mathFlowFenceSequence"),zt(T,Q,"whitespace")(q))}function Q(q){return q===null||Ze(q)?(T.exit("mathFlowFence"),M(q)):_(q)}}}function Ooe(n,e,t){const r=this;return s;function s(l){return l===null?e(l):(n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),i)}function i(l){return r.parser.lazy[r.now().line]?t(l):e(l)}}function koe(n){let t=(n||{}).singleDollarTextMath;return t==null&&(t=!0),{tokenize:r,resolve:joe,previous:Noe,name:"mathText"};function r(s,i,l){let c=0,u,h;return m;function m(O){return s.enter("mathText"),s.enter("mathTextSequence"),p(O)}function p(O){return O===36?(s.consume(O),c++,p):c<2&&!t?l(O):(s.exit("mathTextSequence"),x(O))}function x(O){return O===null?l(O):O===36?(h=s.enter("mathTextSequence"),u=0,b(O)):O===32?(s.enter("space"),s.consume(O),s.exit("space"),x):Ze(O)?(s.enter("lineEnding"),s.consume(O),s.exit("lineEnding"),x):(s.enter("mathTextData"),v(O))}function v(O){return O===null||O===32||O===36||Ze(O)?(s.exit("mathTextData"),x(O)):(s.consume(O),v)}function b(O){return O===36?(s.consume(O),u++,b):u===c?(s.exit("mathTextSequence"),s.exit("mathText"),i(O)):(h.type="mathTextData",v(O))}}}function joe(n){let e=n.length-4,t=3,r,s;if((n[t][1].type==="lineEnding"||n[t][1].type==="space")&&(n[e][1].type==="lineEnding"||n[e][1].type==="space")){for(r=t;++r<e;)if(n[r][1].type==="mathTextData"){n[e][1].type="mathTextPadding",n[t][1].type="mathTextPadding",t+=2,e-=2;break}}for(r=t-1,e++;++r<=e;)s===void 0?r!==e&&n[r][1].type!=="lineEnding"&&(s=r):(r===e||n[r][1].type==="lineEnding")&&(n[s][1].type="mathTextData",r!==s+2&&(n[s][1].end=n[r-1][1].end,n.splice(s+2,r-s-2),e-=r-s-2,r=s+2),s=void 0);return n}function Noe(n){return n!==36||this.events[this.events.length-1][1].type==="characterEscape"}function Coe(n){return{flow:{36:woe},text:{36:koe(n)}}}class Ts{constructor(e,t,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=r}static range(e,t){return t?!e||!e.loc||!t.loc||e.loc.lexer!==t.loc.lexer?null:new Ts(e.loc.lexer,e.loc.start,t.loc.end):e&&e.loc}}class si{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new si(t,Ts.range(this,e))}}class De{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var r="KaTeX parse error: "+e,s,i,l=t&&t.loc;if(l&&l.start<=l.end){var c=l.lexer.input;s=l.start,i=l.end,s===c.length?r+=" at end of input: ":r+=" at position "+(s+1)+": ";var u=c.slice(s,i).replace(/[^]/g,"$&̲"),h;s>15?h="…"+c.slice(s-15,s):h=c.slice(0,s);var m;i+15<c.length?m=c.slice(i,i+15)+"…":m=c.slice(i),r+=h+u+m}var p=new Error(r);return p.name="ParseError",p.__proto__=De.prototype,p.position=s,s!=null&&i!=null&&(p.length=i-s),p.rawMessage=e,p}}De.prototype.__proto__=Error.prototype;var Toe=function(e,t){return e===void 0?t:e},Moe=/([A-Z])/g,Aoe=function(e){return e.replace(Moe,"-$1").toLowerCase()},Eoe={"&":"&",">":">","<":"<",'"':""","'":"'"},_oe=/[&><"']/g;function Doe(n){return String(n).replace(_oe,e=>Eoe[e])}var hR=function n(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?n(e.body[0]):e:e.type==="font"?n(e.body):e},Roe=function(e){var t=hR(e);return t.type==="mathord"||t.type==="textord"||t.type==="atom"},zoe=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},Poe=function(e){var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},tn={deflt:Toe,escape:Doe,hyphenate:Aoe,getBaseElem:hR,isCharacterBox:Roe,protocolFromUrl:Poe},ug={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:n=>"#"+n},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(n,e)=>(e.push(n),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:n=>Math.max(0,n),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:n=>Math.max(0,n),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:n=>Math.max(0,n),cli:"-e, --max-expand <n>",cliProcessor:n=>n==="Infinity"?1/0:parseInt(n)},globalGroup:{type:"boolean",cli:!1}};function Loe(n){if(n.default)return n.default;var e=n.type,t=Array.isArray(e)?e[0]:e;if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class M5{constructor(e){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var t in ug)if(ug.hasOwnProperty(t)){var r=ug[t];this[t]=e[t]!==void 0?r.processor?r.processor(e[t]):e[t]:Loe(r)}}reportNonstrict(e,t,r){var s=this.strict;if(typeof s=="function"&&(s=s(e,t,r)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new De("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+e+"]"),r);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+e+"]"))}}useStrictBehavior(e,t,r){var s=this.strict;if(typeof s=="function")try{s=s(e,t,r)}catch{s="error"}return!s||s==="ignore"?!1:s===!0||s==="error"?!0:s==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var t=tn.protocolFromUrl(e.url);if(t==null)return!1;e.protocol=t}var r=typeof this.trust=="function"?this.trust(e):this.trust;return!!r}}class Xl{constructor(e,t,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=r}sup(){return ia[Boe[this.id]]}sub(){return ia[Ioe[this.id]]}fracNum(){return ia[Foe[this.id]]}fracDen(){return ia[qoe[this.id]]}cramp(){return ia[Qoe[this.id]]}text(){return ia[$oe[this.id]]}isTight(){return this.size>=2}}var A5=0,Xg=1,td=2,cl=3,Ff=4,Oi=5,bd=6,hs=7,ia=[new Xl(A5,0,!1),new Xl(Xg,0,!0),new Xl(td,1,!1),new Xl(cl,1,!0),new Xl(Ff,2,!1),new Xl(Oi,2,!0),new Xl(bd,3,!1),new Xl(hs,3,!0)],Boe=[Ff,Oi,Ff,Oi,bd,hs,bd,hs],Ioe=[Oi,Oi,Oi,Oi,hs,hs,hs,hs],Foe=[td,cl,Ff,Oi,bd,hs,bd,hs],qoe=[cl,cl,Oi,Oi,hs,hs,hs,hs],Qoe=[Xg,Xg,cl,cl,Oi,Oi,hs,hs],$oe=[A5,Xg,td,cl,td,cl,td,cl],at={DISPLAY:ia[A5],TEXT:ia[td],SCRIPT:ia[Ff],SCRIPTSCRIPT:ia[bd]},k4=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function Hoe(n){for(var e=0;e<k4.length;e++)for(var t=k4[e],r=0;r<t.blocks.length;r++){var s=t.blocks[r];if(n>=s[0]&&n<=s[1])return t.name}return null}var dg=[];k4.forEach(n=>n.blocks.forEach(e=>dg.push(...e)));function fR(n){for(var e=0;e<dg.length;e+=2)if(n>=dg[e]&&n<=dg[e+1])return!0;return!1}var Tu=80,Uoe=function(e,t){return"M95,"+(622+e+t)+`
|
||
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
||
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
||
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
||
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
|
||
c69,-144,104.5,-217.7,106.5,-221
|
||
l`+e/2.075+" -"+e+`
|
||
c5.3,-9.3,12,-14,20,-14
|
||
H400000v`+(40+e)+`H845.2724
|
||
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
||
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
||
M`+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},Voe=function(e,t){return"M263,"+(601+e+t)+`c0.7,0,18,39.7,52,119
|
||
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
||
c340,-704.7,510.7,-1060.3,512,-1067
|
||
l`+e/2.084+" -"+e+`
|
||
c4.7,-7.3,11,-11,19,-11
|
||
H40000v`+(40+e)+`H1012.3
|
||
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
|
||
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
|
||
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
||
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
||
M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},Woe=function(e,t){return"M983 "+(10+e+t)+`
|
||
l`+e/3.13+" -"+e+`
|
||
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
|
||
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
|
||
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
|
||
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
||
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
||
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
||
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
||
M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},Goe=function(e,t){return"M424,"+(2398+e+t)+`
|
||
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
||
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
|
||
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
||
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
|
||
l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000
|
||
v`+(40+e)+`H1014.6
|
||
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
||
c-2,6,-10,9,-24,9
|
||
c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+t+`
|
||
h400000v`+(40+e)+"h-400000z"},Xoe=function(e,t){return"M473,"+(2713+e+t)+`
|
||
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
|
||
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
|
||
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
||
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
|
||
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
|
||
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
||
606zM`+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"},Yoe=function(e){var t=e/2;return"M400000 "+e+" H0 L"+t+" 0 l65 45 L145 "+(e-80)+" H400000z"},Koe=function(e,t,r){var s=r-54-t-e;return"M702 "+(e+t)+"H400000"+(40+e)+`
|
||
H742v`+s+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
|
||
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
||
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
||
219 661 l218 661zM702 `+t+"H400000v"+(40+e)+"H742z"},Zoe=function(e,t,r){t=1e3*t;var s="";switch(e){case"sqrtMain":s=Uoe(t,Tu);break;case"sqrtSize1":s=Voe(t,Tu);break;case"sqrtSize2":s=Woe(t,Tu);break;case"sqrtSize3":s=Goe(t,Tu);break;case"sqrtSize4":s=Xoe(t,Tu);break;case"sqrtTall":s=Koe(t,Tu,r)}return s},Joe=function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"∣":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z"+("M367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z");case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257z"+("M478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z");default:return""}},sN={doubleleftarrow:`M262 157
|
||
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
||
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
||
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
||
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
|
||
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
|
||
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
||
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
||
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
||
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
|
||
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
|
||
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
|
||
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
|
||
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
||
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
|
||
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
||
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
|
||
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
|
||
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
|
||
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
|
||
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
|
||
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
||
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
||
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
|
||
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
|
||
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
||
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
|
||
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
|
||
435 0h399565z`,leftgroupunder:`M400000 262
|
||
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
|
||
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
||
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
|
||
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
|
||
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
|
||
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
|
||
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
|
||
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
||
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
||
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
||
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
|
||
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
|
||
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
|
||
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
||
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
|
||
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
|
||
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
|
||
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
|
||
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
|
||
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
||
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
||
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
|
||
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
|
||
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
|
||
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
|
||
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
||
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
|
||
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
||
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
|
||
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
||
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
|
||
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
|
||
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
||
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
|
||
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
|
||
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
||
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
||
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
|
||
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
||
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
|
||
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
|
||
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
||
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
||
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
|
||
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
|
||
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
|
||
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
|
||
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
||
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
||
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
||
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
|
||
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
|
||
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
|
||
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
||
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
|
||
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
|
||
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
|
||
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
|
||
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
|
||
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
|
||
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
|
||
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
|
||
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
|
||
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
|
||
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
|
||
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
|
||
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
|
||
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
|
||
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
||
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
|
||
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
|
||
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
|
||
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
|
||
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
|
||
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
||
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
|
||
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
||
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
|
||
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
||
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
||
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
||
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
|
||
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
|
||
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
|
||
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
||
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
||
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
|
||
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
|
||
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
|
||
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
||
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
||
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
|
||
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
||
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
|
||
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
|
||
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
||
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
||
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
||
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
||
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
||
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
||
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
||
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
|
||
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
||
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
|
||
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
|
||
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
||
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
||
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
|
||
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
|
||
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
|
||
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
|
||
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
|
||
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
||
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
||
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
||
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
|
||
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
||
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
|
||
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
|
||
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
|
||
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
|
||
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
||
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
||
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
|
||
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
|
||
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
|
||
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
||
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
||
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
||
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
||
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
|
||
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
||
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
||
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
||
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
||
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
||
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
||
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
||
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
|
||
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
|
||
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
||
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
|
||
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
||
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
||
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
||
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},ece=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v1759 h347 v-84
|
||
H403z M403 1759 V0 H319 V1759 v`+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v1759 H0 v84 H347z
|
||
M347 1759 V0 H263 V1759 v`+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15
|
||
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
||
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15
|
||
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
||
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z
|
||
M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
|
||
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
||
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+` v1715 h263 v84 H319z
|
||
MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+` v1799 H0 v-84 H319z
|
||
MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v602 h84z
|
||
M403 1759 V0 H319 V1759 v`+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v602 h84z
|
||
M347 1759 V0 h-84 V1759 v`+t+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
|
||
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
|
||
-36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
|
||
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
|
||
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
|
||
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
|
||
l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
|
||
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
|
||
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
|
||
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+`
|
||
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
|
||
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
|
||
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
|
||
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
||
l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
||
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class S0{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){var e=t=>t.toText();return this.children.map(e).join("")}}var ma={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Mp={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},iN={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function tce(n,e){ma[n]=e}function E5(n,e,t){if(!ma[e])throw new Error("Font metrics not found for font: "+e+".");var r=n.charCodeAt(0),s=ma[e][r];if(!s&&n[0]in iN&&(r=iN[n[0]].charCodeAt(0),s=ma[e][r]),!s&&t==="text"&&fR(r)&&(s=ma[e][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var Ab={};function nce(n){var e;if(n>=5?e=0:n>=3?e=1:e=2,!Ab[e]){var t=Ab[e]={cssEmPerMu:Mp.quad[e]/18};for(var r in Mp)Mp.hasOwnProperty(r)&&(t[r]=Mp[r][e])}return Ab[e]}var rce=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],aN=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],lN=function(e,t){return t.size<2?e:rce[e-1][t.size-1]};class rl{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||rl.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=aN[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return new rl(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:lN(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:aN[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=lN(rl.BASESIZE,e);return this.size===t&&this.textSize===rl.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==rl.BASESIZE?["sizing","reset-size"+this.size,"size"+rl.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=nce(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}rl.BASESIZE=6;var j4={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},sce={ex:!0,em:!0,mu:!0},mR=function(e){return typeof e!="string"&&(e=e.unit),e in j4||e in sce||e==="ex"},Kn=function(e,t){var r;if(e.unit in j4)r=j4[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit==="mu")r=t.fontMetrics().cssEmPerMu;else{var s;if(t.style.isTight()?s=t.havingStyle(t.style.text()):s=t,e.unit==="ex")r=s.fontMetrics().xHeight;else if(e.unit==="em")r=s.fontMetrics().quad;else throw new De("Invalid unit: '"+e.unit+"'");s!==t&&(r*=s.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*r,t.maxSize)},Be=function(e){return+e.toFixed(4)+"em"},vo=function(e){return e.filter(t=>t).join(" ")},pR=function(e,t,r){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");var s=t.getColor();s&&(this.style.color=s)}},gR=function(e){var t=document.createElement(e);t.className=vo(this.classes);for(var r in this.style)this.style.hasOwnProperty(r)&&(t.style[r]=this.style[r]);for(var s in this.attributes)this.attributes.hasOwnProperty(s)&&t.setAttribute(s,this.attributes[s]);for(var i=0;i<this.children.length;i++)t.appendChild(this.children[i].toNode());return t},ice=/[\s"'>/=\x00-\x1f]/,xR=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+tn.escape(vo(this.classes))+'"');var r="";for(var s in this.style)this.style.hasOwnProperty(s)&&(r+=tn.hyphenate(s)+":"+this.style[s]+";");r&&(t+=' style="'+tn.escape(r)+'"');for(var i in this.attributes)if(this.attributes.hasOwnProperty(i)){if(ice.test(i))throw new De("Invalid attribute name '"+i+"'");t+=" "+i+'="'+tn.escape(this.attributes[i])+'"'}t+=">";for(var l=0;l<this.children.length;l++)t+=this.children[l].toMarkup();return t+="</"+e+">",t};class O0{constructor(e,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,pR.call(this,e,r,s),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return gR.call(this,"span")}toMarkup(){return xR.call(this,"span")}}class _5{constructor(e,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,pR.call(this,t,s),this.children=r||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return gR.call(this,"a")}toMarkup(){return xR.call(this,"a")}}class ace{constructor(e,t,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=r}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var t in this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e='<img src="'+tn.escape(this.src)+'"'+(' alt="'+tn.escape(this.alt)+'"'),t="";for(var r in this.style)this.style.hasOwnProperty(r)&&(t+=tn.hyphenate(r)+":"+this.style[r]+";");return t&&(e+=' style="'+tn.escape(t)+'"'),e+="'/>",e}}var lce={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Ti{constructor(e,t,r,s,i,l,c,u){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=r||0,this.italic=s||0,this.skew=i||0,this.width=l||0,this.classes=c||[],this.style=u||{},this.maxFontSize=0;var h=Hoe(this.text.charCodeAt(0));h&&this.classes.push(h+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=lce[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;this.italic>0&&(t=document.createElement("span"),t.style.marginRight=Be(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=vo(this.classes));for(var r in this.style)this.style.hasOwnProperty(r)&&(t=t||document.createElement("span"),t.style[r]=this.style[r]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=tn.escape(vo(this.classes)),t+='"');var r="";this.italic>0&&(r+="margin-right:"+this.italic+"em;");for(var s in this.style)this.style.hasOwnProperty(s)&&(r+=tn.hyphenate(s)+":"+this.style[s]+";");r&&(e=!0,t+=' style="'+tn.escape(r)+'"');var i=tn.escape(this.text);return e?(t+=">",t+=i,t+="</span>",t):i}}class gl{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&t.setAttribute(r,this.attributes[r]);for(var s=0;s<this.children.length;s++)t.appendChild(this.children[s].toNode());return t}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+tn.escape(this.attributes[t])+'"');e+=">";for(var r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e+="</svg>",e}}class yo{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"path");return this.alternate?t.setAttribute("d",this.alternate):t.setAttribute("d",sN[this.pathName]),t}toMarkup(){return this.alternate?'<path d="'+tn.escape(this.alternate)+'"/>':'<path d="'+tn.escape(sN[this.pathName])+'"/>'}}class N4{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"line");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&t.setAttribute(r,this.attributes[r]);return t}toMarkup(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+tn.escape(this.attributes[t])+'"');return e+="/>",e}}function oN(n){if(n instanceof Ti)return n;throw new Error("Expected symbolNode but got "+String(n)+".")}function oce(n){if(n instanceof O0)return n;throw new Error("Expected span<HtmlDomNode> but got "+String(n)+".")}var cce={bin:1,close:1,inner:1,open:1,punct:1,rel:1},uce={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Ln={math:{},text:{}};function N(n,e,t,r,s,i){Ln[n][s]={font:e,group:t,replace:r},i&&r&&(Ln[n][r]=Ln[n][s])}var C="math",Ee="text",L="main",G="ams",Wn="accent-token",Ve="bin",xs="close",zd="inner",st="mathord",yr="op-token",ai="open",Hx="punct",X="rel",wl="spacing",le="textord";N(C,L,X,"≡","\\equiv",!0);N(C,L,X,"≺","\\prec",!0);N(C,L,X,"≻","\\succ",!0);N(C,L,X,"∼","\\sim",!0);N(C,L,X,"⊥","\\perp");N(C,L,X,"⪯","\\preceq",!0);N(C,L,X,"⪰","\\succeq",!0);N(C,L,X,"≃","\\simeq",!0);N(C,L,X,"∣","\\mid",!0);N(C,L,X,"≪","\\ll",!0);N(C,L,X,"≫","\\gg",!0);N(C,L,X,"≍","\\asymp",!0);N(C,L,X,"∥","\\parallel");N(C,L,X,"⋈","\\bowtie",!0);N(C,L,X,"⌣","\\smile",!0);N(C,L,X,"⊑","\\sqsubseteq",!0);N(C,L,X,"⊒","\\sqsupseteq",!0);N(C,L,X,"≐","\\doteq",!0);N(C,L,X,"⌢","\\frown",!0);N(C,L,X,"∋","\\ni",!0);N(C,L,X,"∝","\\propto",!0);N(C,L,X,"⊢","\\vdash",!0);N(C,L,X,"⊣","\\dashv",!0);N(C,L,X,"∋","\\owns");N(C,L,Hx,".","\\ldotp");N(C,L,Hx,"⋅","\\cdotp");N(C,L,le,"#","\\#");N(Ee,L,le,"#","\\#");N(C,L,le,"&","\\&");N(Ee,L,le,"&","\\&");N(C,L,le,"ℵ","\\aleph",!0);N(C,L,le,"∀","\\forall",!0);N(C,L,le,"ℏ","\\hbar",!0);N(C,L,le,"∃","\\exists",!0);N(C,L,le,"∇","\\nabla",!0);N(C,L,le,"♭","\\flat",!0);N(C,L,le,"ℓ","\\ell",!0);N(C,L,le,"♮","\\natural",!0);N(C,L,le,"♣","\\clubsuit",!0);N(C,L,le,"℘","\\wp",!0);N(C,L,le,"♯","\\sharp",!0);N(C,L,le,"♢","\\diamondsuit",!0);N(C,L,le,"ℜ","\\Re",!0);N(C,L,le,"♡","\\heartsuit",!0);N(C,L,le,"ℑ","\\Im",!0);N(C,L,le,"♠","\\spadesuit",!0);N(C,L,le,"§","\\S",!0);N(Ee,L,le,"§","\\S");N(C,L,le,"¶","\\P",!0);N(Ee,L,le,"¶","\\P");N(C,L,le,"†","\\dag");N(Ee,L,le,"†","\\dag");N(Ee,L,le,"†","\\textdagger");N(C,L,le,"‡","\\ddag");N(Ee,L,le,"‡","\\ddag");N(Ee,L,le,"‡","\\textdaggerdbl");N(C,L,xs,"⎱","\\rmoustache",!0);N(C,L,ai,"⎰","\\lmoustache",!0);N(C,L,xs,"⟯","\\rgroup",!0);N(C,L,ai,"⟮","\\lgroup",!0);N(C,L,Ve,"∓","\\mp",!0);N(C,L,Ve,"⊖","\\ominus",!0);N(C,L,Ve,"⊎","\\uplus",!0);N(C,L,Ve,"⊓","\\sqcap",!0);N(C,L,Ve,"∗","\\ast");N(C,L,Ve,"⊔","\\sqcup",!0);N(C,L,Ve,"◯","\\bigcirc",!0);N(C,L,Ve,"∙","\\bullet",!0);N(C,L,Ve,"‡","\\ddagger");N(C,L,Ve,"≀","\\wr",!0);N(C,L,Ve,"⨿","\\amalg");N(C,L,Ve,"&","\\And");N(C,L,X,"⟵","\\longleftarrow",!0);N(C,L,X,"⇐","\\Leftarrow",!0);N(C,L,X,"⟸","\\Longleftarrow",!0);N(C,L,X,"⟶","\\longrightarrow",!0);N(C,L,X,"⇒","\\Rightarrow",!0);N(C,L,X,"⟹","\\Longrightarrow",!0);N(C,L,X,"↔","\\leftrightarrow",!0);N(C,L,X,"⟷","\\longleftrightarrow",!0);N(C,L,X,"⇔","\\Leftrightarrow",!0);N(C,L,X,"⟺","\\Longleftrightarrow",!0);N(C,L,X,"↦","\\mapsto",!0);N(C,L,X,"⟼","\\longmapsto",!0);N(C,L,X,"↗","\\nearrow",!0);N(C,L,X,"↩","\\hookleftarrow",!0);N(C,L,X,"↪","\\hookrightarrow",!0);N(C,L,X,"↘","\\searrow",!0);N(C,L,X,"↼","\\leftharpoonup",!0);N(C,L,X,"⇀","\\rightharpoonup",!0);N(C,L,X,"↙","\\swarrow",!0);N(C,L,X,"↽","\\leftharpoondown",!0);N(C,L,X,"⇁","\\rightharpoondown",!0);N(C,L,X,"↖","\\nwarrow",!0);N(C,L,X,"⇌","\\rightleftharpoons",!0);N(C,G,X,"≮","\\nless",!0);N(C,G,X,"","\\@nleqslant");N(C,G,X,"","\\@nleqq");N(C,G,X,"⪇","\\lneq",!0);N(C,G,X,"≨","\\lneqq",!0);N(C,G,X,"","\\@lvertneqq");N(C,G,X,"⋦","\\lnsim",!0);N(C,G,X,"⪉","\\lnapprox",!0);N(C,G,X,"⊀","\\nprec",!0);N(C,G,X,"⋠","\\npreceq",!0);N(C,G,X,"⋨","\\precnsim",!0);N(C,G,X,"⪹","\\precnapprox",!0);N(C,G,X,"≁","\\nsim",!0);N(C,G,X,"","\\@nshortmid");N(C,G,X,"∤","\\nmid",!0);N(C,G,X,"⊬","\\nvdash",!0);N(C,G,X,"⊭","\\nvDash",!0);N(C,G,X,"⋪","\\ntriangleleft");N(C,G,X,"⋬","\\ntrianglelefteq",!0);N(C,G,X,"⊊","\\subsetneq",!0);N(C,G,X,"","\\@varsubsetneq");N(C,G,X,"⫋","\\subsetneqq",!0);N(C,G,X,"","\\@varsubsetneqq");N(C,G,X,"≯","\\ngtr",!0);N(C,G,X,"","\\@ngeqslant");N(C,G,X,"","\\@ngeqq");N(C,G,X,"⪈","\\gneq",!0);N(C,G,X,"≩","\\gneqq",!0);N(C,G,X,"","\\@gvertneqq");N(C,G,X,"⋧","\\gnsim",!0);N(C,G,X,"⪊","\\gnapprox",!0);N(C,G,X,"⊁","\\nsucc",!0);N(C,G,X,"⋡","\\nsucceq",!0);N(C,G,X,"⋩","\\succnsim",!0);N(C,G,X,"⪺","\\succnapprox",!0);N(C,G,X,"≆","\\ncong",!0);N(C,G,X,"","\\@nshortparallel");N(C,G,X,"∦","\\nparallel",!0);N(C,G,X,"⊯","\\nVDash",!0);N(C,G,X,"⋫","\\ntriangleright");N(C,G,X,"⋭","\\ntrianglerighteq",!0);N(C,G,X,"","\\@nsupseteqq");N(C,G,X,"⊋","\\supsetneq",!0);N(C,G,X,"","\\@varsupsetneq");N(C,G,X,"⫌","\\supsetneqq",!0);N(C,G,X,"","\\@varsupsetneqq");N(C,G,X,"⊮","\\nVdash",!0);N(C,G,X,"⪵","\\precneqq",!0);N(C,G,X,"⪶","\\succneqq",!0);N(C,G,X,"","\\@nsubseteqq");N(C,G,Ve,"⊴","\\unlhd");N(C,G,Ve,"⊵","\\unrhd");N(C,G,X,"↚","\\nleftarrow",!0);N(C,G,X,"↛","\\nrightarrow",!0);N(C,G,X,"⇍","\\nLeftarrow",!0);N(C,G,X,"⇏","\\nRightarrow",!0);N(C,G,X,"↮","\\nleftrightarrow",!0);N(C,G,X,"⇎","\\nLeftrightarrow",!0);N(C,G,X,"△","\\vartriangle");N(C,G,le,"ℏ","\\hslash");N(C,G,le,"▽","\\triangledown");N(C,G,le,"◊","\\lozenge");N(C,G,le,"Ⓢ","\\circledS");N(C,G,le,"®","\\circledR");N(Ee,G,le,"®","\\circledR");N(C,G,le,"∡","\\measuredangle",!0);N(C,G,le,"∄","\\nexists");N(C,G,le,"℧","\\mho");N(C,G,le,"Ⅎ","\\Finv",!0);N(C,G,le,"⅁","\\Game",!0);N(C,G,le,"‵","\\backprime");N(C,G,le,"▲","\\blacktriangle");N(C,G,le,"▼","\\blacktriangledown");N(C,G,le,"■","\\blacksquare");N(C,G,le,"⧫","\\blacklozenge");N(C,G,le,"★","\\bigstar");N(C,G,le,"∢","\\sphericalangle",!0);N(C,G,le,"∁","\\complement",!0);N(C,G,le,"ð","\\eth",!0);N(Ee,L,le,"ð","ð");N(C,G,le,"╱","\\diagup");N(C,G,le,"╲","\\diagdown");N(C,G,le,"□","\\square");N(C,G,le,"□","\\Box");N(C,G,le,"◊","\\Diamond");N(C,G,le,"¥","\\yen",!0);N(Ee,G,le,"¥","\\yen",!0);N(C,G,le,"✓","\\checkmark",!0);N(Ee,G,le,"✓","\\checkmark");N(C,G,le,"ℶ","\\beth",!0);N(C,G,le,"ℸ","\\daleth",!0);N(C,G,le,"ℷ","\\gimel",!0);N(C,G,le,"ϝ","\\digamma",!0);N(C,G,le,"ϰ","\\varkappa");N(C,G,ai,"┌","\\@ulcorner",!0);N(C,G,xs,"┐","\\@urcorner",!0);N(C,G,ai,"└","\\@llcorner",!0);N(C,G,xs,"┘","\\@lrcorner",!0);N(C,G,X,"≦","\\leqq",!0);N(C,G,X,"⩽","\\leqslant",!0);N(C,G,X,"⪕","\\eqslantless",!0);N(C,G,X,"≲","\\lesssim",!0);N(C,G,X,"⪅","\\lessapprox",!0);N(C,G,X,"≊","\\approxeq",!0);N(C,G,Ve,"⋖","\\lessdot");N(C,G,X,"⋘","\\lll",!0);N(C,G,X,"≶","\\lessgtr",!0);N(C,G,X,"⋚","\\lesseqgtr",!0);N(C,G,X,"⪋","\\lesseqqgtr",!0);N(C,G,X,"≑","\\doteqdot");N(C,G,X,"≓","\\risingdotseq",!0);N(C,G,X,"≒","\\fallingdotseq",!0);N(C,G,X,"∽","\\backsim",!0);N(C,G,X,"⋍","\\backsimeq",!0);N(C,G,X,"⫅","\\subseteqq",!0);N(C,G,X,"⋐","\\Subset",!0);N(C,G,X,"⊏","\\sqsubset",!0);N(C,G,X,"≼","\\preccurlyeq",!0);N(C,G,X,"⋞","\\curlyeqprec",!0);N(C,G,X,"≾","\\precsim",!0);N(C,G,X,"⪷","\\precapprox",!0);N(C,G,X,"⊲","\\vartriangleleft");N(C,G,X,"⊴","\\trianglelefteq");N(C,G,X,"⊨","\\vDash",!0);N(C,G,X,"⊪","\\Vvdash",!0);N(C,G,X,"⌣","\\smallsmile");N(C,G,X,"⌢","\\smallfrown");N(C,G,X,"≏","\\bumpeq",!0);N(C,G,X,"≎","\\Bumpeq",!0);N(C,G,X,"≧","\\geqq",!0);N(C,G,X,"⩾","\\geqslant",!0);N(C,G,X,"⪖","\\eqslantgtr",!0);N(C,G,X,"≳","\\gtrsim",!0);N(C,G,X,"⪆","\\gtrapprox",!0);N(C,G,Ve,"⋗","\\gtrdot");N(C,G,X,"⋙","\\ggg",!0);N(C,G,X,"≷","\\gtrless",!0);N(C,G,X,"⋛","\\gtreqless",!0);N(C,G,X,"⪌","\\gtreqqless",!0);N(C,G,X,"≖","\\eqcirc",!0);N(C,G,X,"≗","\\circeq",!0);N(C,G,X,"≜","\\triangleq",!0);N(C,G,X,"∼","\\thicksim");N(C,G,X,"≈","\\thickapprox");N(C,G,X,"⫆","\\supseteqq",!0);N(C,G,X,"⋑","\\Supset",!0);N(C,G,X,"⊐","\\sqsupset",!0);N(C,G,X,"≽","\\succcurlyeq",!0);N(C,G,X,"⋟","\\curlyeqsucc",!0);N(C,G,X,"≿","\\succsim",!0);N(C,G,X,"⪸","\\succapprox",!0);N(C,G,X,"⊳","\\vartriangleright");N(C,G,X,"⊵","\\trianglerighteq");N(C,G,X,"⊩","\\Vdash",!0);N(C,G,X,"∣","\\shortmid");N(C,G,X,"∥","\\shortparallel");N(C,G,X,"≬","\\between",!0);N(C,G,X,"⋔","\\pitchfork",!0);N(C,G,X,"∝","\\varpropto");N(C,G,X,"◀","\\blacktriangleleft");N(C,G,X,"∴","\\therefore",!0);N(C,G,X,"∍","\\backepsilon");N(C,G,X,"▶","\\blacktriangleright");N(C,G,X,"∵","\\because",!0);N(C,G,X,"⋘","\\llless");N(C,G,X,"⋙","\\gggtr");N(C,G,Ve,"⊲","\\lhd");N(C,G,Ve,"⊳","\\rhd");N(C,G,X,"≂","\\eqsim",!0);N(C,L,X,"⋈","\\Join");N(C,G,X,"≑","\\Doteq",!0);N(C,G,Ve,"∔","\\dotplus",!0);N(C,G,Ve,"∖","\\smallsetminus");N(C,G,Ve,"⋒","\\Cap",!0);N(C,G,Ve,"⋓","\\Cup",!0);N(C,G,Ve,"⩞","\\doublebarwedge",!0);N(C,G,Ve,"⊟","\\boxminus",!0);N(C,G,Ve,"⊞","\\boxplus",!0);N(C,G,Ve,"⋇","\\divideontimes",!0);N(C,G,Ve,"⋉","\\ltimes",!0);N(C,G,Ve,"⋊","\\rtimes",!0);N(C,G,Ve,"⋋","\\leftthreetimes",!0);N(C,G,Ve,"⋌","\\rightthreetimes",!0);N(C,G,Ve,"⋏","\\curlywedge",!0);N(C,G,Ve,"⋎","\\curlyvee",!0);N(C,G,Ve,"⊝","\\circleddash",!0);N(C,G,Ve,"⊛","\\circledast",!0);N(C,G,Ve,"⋅","\\centerdot");N(C,G,Ve,"⊺","\\intercal",!0);N(C,G,Ve,"⋒","\\doublecap");N(C,G,Ve,"⋓","\\doublecup");N(C,G,Ve,"⊠","\\boxtimes",!0);N(C,G,X,"⇢","\\dashrightarrow",!0);N(C,G,X,"⇠","\\dashleftarrow",!0);N(C,G,X,"⇇","\\leftleftarrows",!0);N(C,G,X,"⇆","\\leftrightarrows",!0);N(C,G,X,"⇚","\\Lleftarrow",!0);N(C,G,X,"↞","\\twoheadleftarrow",!0);N(C,G,X,"↢","\\leftarrowtail",!0);N(C,G,X,"↫","\\looparrowleft",!0);N(C,G,X,"⇋","\\leftrightharpoons",!0);N(C,G,X,"↶","\\curvearrowleft",!0);N(C,G,X,"↺","\\circlearrowleft",!0);N(C,G,X,"↰","\\Lsh",!0);N(C,G,X,"⇈","\\upuparrows",!0);N(C,G,X,"↿","\\upharpoonleft",!0);N(C,G,X,"⇃","\\downharpoonleft",!0);N(C,L,X,"⊶","\\origof",!0);N(C,L,X,"⊷","\\imageof",!0);N(C,G,X,"⊸","\\multimap",!0);N(C,G,X,"↭","\\leftrightsquigarrow",!0);N(C,G,X,"⇉","\\rightrightarrows",!0);N(C,G,X,"⇄","\\rightleftarrows",!0);N(C,G,X,"↠","\\twoheadrightarrow",!0);N(C,G,X,"↣","\\rightarrowtail",!0);N(C,G,X,"↬","\\looparrowright",!0);N(C,G,X,"↷","\\curvearrowright",!0);N(C,G,X,"↻","\\circlearrowright",!0);N(C,G,X,"↱","\\Rsh",!0);N(C,G,X,"⇊","\\downdownarrows",!0);N(C,G,X,"↾","\\upharpoonright",!0);N(C,G,X,"⇂","\\downharpoonright",!0);N(C,G,X,"⇝","\\rightsquigarrow",!0);N(C,G,X,"⇝","\\leadsto");N(C,G,X,"⇛","\\Rrightarrow",!0);N(C,G,X,"↾","\\restriction");N(C,L,le,"‘","`");N(C,L,le,"$","\\$");N(Ee,L,le,"$","\\$");N(Ee,L,le,"$","\\textdollar");N(C,L,le,"%","\\%");N(Ee,L,le,"%","\\%");N(C,L,le,"_","\\_");N(Ee,L,le,"_","\\_");N(Ee,L,le,"_","\\textunderscore");N(C,L,le,"∠","\\angle",!0);N(C,L,le,"∞","\\infty",!0);N(C,L,le,"′","\\prime");N(C,L,le,"△","\\triangle");N(C,L,le,"Γ","\\Gamma",!0);N(C,L,le,"Δ","\\Delta",!0);N(C,L,le,"Θ","\\Theta",!0);N(C,L,le,"Λ","\\Lambda",!0);N(C,L,le,"Ξ","\\Xi",!0);N(C,L,le,"Π","\\Pi",!0);N(C,L,le,"Σ","\\Sigma",!0);N(C,L,le,"Υ","\\Upsilon",!0);N(C,L,le,"Φ","\\Phi",!0);N(C,L,le,"Ψ","\\Psi",!0);N(C,L,le,"Ω","\\Omega",!0);N(C,L,le,"A","Α");N(C,L,le,"B","Β");N(C,L,le,"E","Ε");N(C,L,le,"Z","Ζ");N(C,L,le,"H","Η");N(C,L,le,"I","Ι");N(C,L,le,"K","Κ");N(C,L,le,"M","Μ");N(C,L,le,"N","Ν");N(C,L,le,"O","Ο");N(C,L,le,"P","Ρ");N(C,L,le,"T","Τ");N(C,L,le,"X","Χ");N(C,L,le,"¬","\\neg",!0);N(C,L,le,"¬","\\lnot");N(C,L,le,"⊤","\\top");N(C,L,le,"⊥","\\bot");N(C,L,le,"∅","\\emptyset");N(C,G,le,"∅","\\varnothing");N(C,L,st,"α","\\alpha",!0);N(C,L,st,"β","\\beta",!0);N(C,L,st,"γ","\\gamma",!0);N(C,L,st,"δ","\\delta",!0);N(C,L,st,"ϵ","\\epsilon",!0);N(C,L,st,"ζ","\\zeta",!0);N(C,L,st,"η","\\eta",!0);N(C,L,st,"θ","\\theta",!0);N(C,L,st,"ι","\\iota",!0);N(C,L,st,"κ","\\kappa",!0);N(C,L,st,"λ","\\lambda",!0);N(C,L,st,"μ","\\mu",!0);N(C,L,st,"ν","\\nu",!0);N(C,L,st,"ξ","\\xi",!0);N(C,L,st,"ο","\\omicron",!0);N(C,L,st,"π","\\pi",!0);N(C,L,st,"ρ","\\rho",!0);N(C,L,st,"σ","\\sigma",!0);N(C,L,st,"τ","\\tau",!0);N(C,L,st,"υ","\\upsilon",!0);N(C,L,st,"ϕ","\\phi",!0);N(C,L,st,"χ","\\chi",!0);N(C,L,st,"ψ","\\psi",!0);N(C,L,st,"ω","\\omega",!0);N(C,L,st,"ε","\\varepsilon",!0);N(C,L,st,"ϑ","\\vartheta",!0);N(C,L,st,"ϖ","\\varpi",!0);N(C,L,st,"ϱ","\\varrho",!0);N(C,L,st,"ς","\\varsigma",!0);N(C,L,st,"φ","\\varphi",!0);N(C,L,Ve,"∗","*",!0);N(C,L,Ve,"+","+");N(C,L,Ve,"−","-",!0);N(C,L,Ve,"⋅","\\cdot",!0);N(C,L,Ve,"∘","\\circ",!0);N(C,L,Ve,"÷","\\div",!0);N(C,L,Ve,"±","\\pm",!0);N(C,L,Ve,"×","\\times",!0);N(C,L,Ve,"∩","\\cap",!0);N(C,L,Ve,"∪","\\cup",!0);N(C,L,Ve,"∖","\\setminus",!0);N(C,L,Ve,"∧","\\land");N(C,L,Ve,"∨","\\lor");N(C,L,Ve,"∧","\\wedge",!0);N(C,L,Ve,"∨","\\vee",!0);N(C,L,le,"√","\\surd");N(C,L,ai,"⟨","\\langle",!0);N(C,L,ai,"∣","\\lvert");N(C,L,ai,"∥","\\lVert");N(C,L,xs,"?","?");N(C,L,xs,"!","!");N(C,L,xs,"⟩","\\rangle",!0);N(C,L,xs,"∣","\\rvert");N(C,L,xs,"∥","\\rVert");N(C,L,X,"=","=");N(C,L,X,":",":");N(C,L,X,"≈","\\approx",!0);N(C,L,X,"≅","\\cong",!0);N(C,L,X,"≥","\\ge");N(C,L,X,"≥","\\geq",!0);N(C,L,X,"←","\\gets");N(C,L,X,">","\\gt",!0);N(C,L,X,"∈","\\in",!0);N(C,L,X,"","\\@not");N(C,L,X,"⊂","\\subset",!0);N(C,L,X,"⊃","\\supset",!0);N(C,L,X,"⊆","\\subseteq",!0);N(C,L,X,"⊇","\\supseteq",!0);N(C,G,X,"⊈","\\nsubseteq",!0);N(C,G,X,"⊉","\\nsupseteq",!0);N(C,L,X,"⊨","\\models");N(C,L,X,"←","\\leftarrow",!0);N(C,L,X,"≤","\\le");N(C,L,X,"≤","\\leq",!0);N(C,L,X,"<","\\lt",!0);N(C,L,X,"→","\\rightarrow",!0);N(C,L,X,"→","\\to");N(C,G,X,"≱","\\ngeq",!0);N(C,G,X,"≰","\\nleq",!0);N(C,L,wl," ","\\ ");N(C,L,wl," ","\\space");N(C,L,wl," ","\\nobreakspace");N(Ee,L,wl," ","\\ ");N(Ee,L,wl," "," ");N(Ee,L,wl," ","\\space");N(Ee,L,wl," ","\\nobreakspace");N(C,L,wl,null,"\\nobreak");N(C,L,wl,null,"\\allowbreak");N(C,L,Hx,",",",");N(C,L,Hx,";",";");N(C,G,Ve,"⊼","\\barwedge",!0);N(C,G,Ve,"⊻","\\veebar",!0);N(C,L,Ve,"⊙","\\odot",!0);N(C,L,Ve,"⊕","\\oplus",!0);N(C,L,Ve,"⊗","\\otimes",!0);N(C,L,le,"∂","\\partial",!0);N(C,L,Ve,"⊘","\\oslash",!0);N(C,G,Ve,"⊚","\\circledcirc",!0);N(C,G,Ve,"⊡","\\boxdot",!0);N(C,L,Ve,"△","\\bigtriangleup");N(C,L,Ve,"▽","\\bigtriangledown");N(C,L,Ve,"†","\\dagger");N(C,L,Ve,"⋄","\\diamond");N(C,L,Ve,"⋆","\\star");N(C,L,Ve,"◃","\\triangleleft");N(C,L,Ve,"▹","\\triangleright");N(C,L,ai,"{","\\{");N(Ee,L,le,"{","\\{");N(Ee,L,le,"{","\\textbraceleft");N(C,L,xs,"}","\\}");N(Ee,L,le,"}","\\}");N(Ee,L,le,"}","\\textbraceright");N(C,L,ai,"{","\\lbrace");N(C,L,xs,"}","\\rbrace");N(C,L,ai,"[","\\lbrack",!0);N(Ee,L,le,"[","\\lbrack",!0);N(C,L,xs,"]","\\rbrack",!0);N(Ee,L,le,"]","\\rbrack",!0);N(C,L,ai,"(","\\lparen",!0);N(C,L,xs,")","\\rparen",!0);N(Ee,L,le,"<","\\textless",!0);N(Ee,L,le,">","\\textgreater",!0);N(C,L,ai,"⌊","\\lfloor",!0);N(C,L,xs,"⌋","\\rfloor",!0);N(C,L,ai,"⌈","\\lceil",!0);N(C,L,xs,"⌉","\\rceil",!0);N(C,L,le,"\\","\\backslash");N(C,L,le,"∣","|");N(C,L,le,"∣","\\vert");N(Ee,L,le,"|","\\textbar",!0);N(C,L,le,"∥","\\|");N(C,L,le,"∥","\\Vert");N(Ee,L,le,"∥","\\textbardbl");N(Ee,L,le,"~","\\textasciitilde");N(Ee,L,le,"\\","\\textbackslash");N(Ee,L,le,"^","\\textasciicircum");N(C,L,X,"↑","\\uparrow",!0);N(C,L,X,"⇑","\\Uparrow",!0);N(C,L,X,"↓","\\downarrow",!0);N(C,L,X,"⇓","\\Downarrow",!0);N(C,L,X,"↕","\\updownarrow",!0);N(C,L,X,"⇕","\\Updownarrow",!0);N(C,L,yr,"∐","\\coprod");N(C,L,yr,"⋁","\\bigvee");N(C,L,yr,"⋀","\\bigwedge");N(C,L,yr,"⨄","\\biguplus");N(C,L,yr,"⋂","\\bigcap");N(C,L,yr,"⋃","\\bigcup");N(C,L,yr,"∫","\\int");N(C,L,yr,"∫","\\intop");N(C,L,yr,"∬","\\iint");N(C,L,yr,"∭","\\iiint");N(C,L,yr,"∏","\\prod");N(C,L,yr,"∑","\\sum");N(C,L,yr,"⨂","\\bigotimes");N(C,L,yr,"⨁","\\bigoplus");N(C,L,yr,"⨀","\\bigodot");N(C,L,yr,"∮","\\oint");N(C,L,yr,"∯","\\oiint");N(C,L,yr,"∰","\\oiiint");N(C,L,yr,"⨆","\\bigsqcup");N(C,L,yr,"∫","\\smallint");N(Ee,L,zd,"…","\\textellipsis");N(C,L,zd,"…","\\mathellipsis");N(Ee,L,zd,"…","\\ldots",!0);N(C,L,zd,"…","\\ldots",!0);N(C,L,zd,"⋯","\\@cdots",!0);N(C,L,zd,"⋱","\\ddots",!0);N(C,L,le,"⋮","\\varvdots");N(Ee,L,le,"⋮","\\varvdots");N(C,L,Wn,"ˊ","\\acute");N(C,L,Wn,"ˋ","\\grave");N(C,L,Wn,"¨","\\ddot");N(C,L,Wn,"~","\\tilde");N(C,L,Wn,"ˉ","\\bar");N(C,L,Wn,"˘","\\breve");N(C,L,Wn,"ˇ","\\check");N(C,L,Wn,"^","\\hat");N(C,L,Wn,"⃗","\\vec");N(C,L,Wn,"˙","\\dot");N(C,L,Wn,"˚","\\mathring");N(C,L,st,"","\\@imath");N(C,L,st,"","\\@jmath");N(C,L,le,"ı","ı");N(C,L,le,"ȷ","ȷ");N(Ee,L,le,"ı","\\i",!0);N(Ee,L,le,"ȷ","\\j",!0);N(Ee,L,le,"ß","\\ss",!0);N(Ee,L,le,"æ","\\ae",!0);N(Ee,L,le,"œ","\\oe",!0);N(Ee,L,le,"ø","\\o",!0);N(Ee,L,le,"Æ","\\AE",!0);N(Ee,L,le,"Œ","\\OE",!0);N(Ee,L,le,"Ø","\\O",!0);N(Ee,L,Wn,"ˊ","\\'");N(Ee,L,Wn,"ˋ","\\`");N(Ee,L,Wn,"ˆ","\\^");N(Ee,L,Wn,"˜","\\~");N(Ee,L,Wn,"ˉ","\\=");N(Ee,L,Wn,"˘","\\u");N(Ee,L,Wn,"˙","\\.");N(Ee,L,Wn,"¸","\\c");N(Ee,L,Wn,"˚","\\r");N(Ee,L,Wn,"ˇ","\\v");N(Ee,L,Wn,"¨",'\\"');N(Ee,L,Wn,"˝","\\H");N(Ee,L,Wn,"◯","\\textcircled");var vR={"--":!0,"---":!0,"``":!0,"''":!0};N(Ee,L,le,"–","--",!0);N(Ee,L,le,"–","\\textendash");N(Ee,L,le,"—","---",!0);N(Ee,L,le,"—","\\textemdash");N(Ee,L,le,"‘","`",!0);N(Ee,L,le,"‘","\\textquoteleft");N(Ee,L,le,"’","'",!0);N(Ee,L,le,"’","\\textquoteright");N(Ee,L,le,"“","``",!0);N(Ee,L,le,"“","\\textquotedblleft");N(Ee,L,le,"”","''",!0);N(Ee,L,le,"”","\\textquotedblright");N(C,L,le,"°","\\degree",!0);N(Ee,L,le,"°","\\degree");N(Ee,L,le,"°","\\textdegree",!0);N(C,L,le,"£","\\pounds");N(C,L,le,"£","\\mathsterling",!0);N(Ee,L,le,"£","\\pounds");N(Ee,L,le,"£","\\textsterling",!0);N(C,G,le,"✠","\\maltese");N(Ee,G,le,"✠","\\maltese");var cN='0123456789/@."';for(var Eb=0;Eb<cN.length;Eb++){var uN=cN.charAt(Eb);N(C,L,le,uN,uN)}var dN='0123456789!@*()-=+";:?/.,';for(var _b=0;_b<dN.length;_b++){var hN=dN.charAt(_b);N(Ee,L,le,hN,hN)}var Yg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var Db=0;Db<Yg.length;Db++){var Ap=Yg.charAt(Db);N(C,L,st,Ap,Ap),N(Ee,L,le,Ap,Ap)}N(C,G,le,"C","ℂ");N(Ee,G,le,"C","ℂ");N(C,G,le,"H","ℍ");N(Ee,G,le,"H","ℍ");N(C,G,le,"N","ℕ");N(Ee,G,le,"N","ℕ");N(C,G,le,"P","ℙ");N(Ee,G,le,"P","ℙ");N(C,G,le,"Q","ℚ");N(Ee,G,le,"Q","ℚ");N(C,G,le,"R","ℝ");N(Ee,G,le,"R","ℝ");N(C,G,le,"Z","ℤ");N(Ee,G,le,"Z","ℤ");N(C,L,st,"h","ℎ");N(Ee,L,st,"h","ℎ");var ht="";for(var cs=0;cs<Yg.length;cs++){var nr=Yg.charAt(cs);ht=String.fromCharCode(55349,56320+cs),N(C,L,st,nr,ht),N(Ee,L,le,nr,ht),ht=String.fromCharCode(55349,56372+cs),N(C,L,st,nr,ht),N(Ee,L,le,nr,ht),ht=String.fromCharCode(55349,56424+cs),N(C,L,st,nr,ht),N(Ee,L,le,nr,ht),ht=String.fromCharCode(55349,56580+cs),N(C,L,st,nr,ht),N(Ee,L,le,nr,ht),ht=String.fromCharCode(55349,56684+cs),N(C,L,st,nr,ht),N(Ee,L,le,nr,ht),ht=String.fromCharCode(55349,56736+cs),N(C,L,st,nr,ht),N(Ee,L,le,nr,ht),ht=String.fromCharCode(55349,56788+cs),N(C,L,st,nr,ht),N(Ee,L,le,nr,ht),ht=String.fromCharCode(55349,56840+cs),N(C,L,st,nr,ht),N(Ee,L,le,nr,ht),ht=String.fromCharCode(55349,56944+cs),N(C,L,st,nr,ht),N(Ee,L,le,nr,ht),cs<26&&(ht=String.fromCharCode(55349,56632+cs),N(C,L,st,nr,ht),N(Ee,L,le,nr,ht),ht=String.fromCharCode(55349,56476+cs),N(C,L,st,nr,ht),N(Ee,L,le,nr,ht))}ht="𝕜";N(C,L,st,"k",ht);N(Ee,L,le,"k",ht);for(var Jo=0;Jo<10;Jo++){var Yl=Jo.toString();ht=String.fromCharCode(55349,57294+Jo),N(C,L,st,Yl,ht),N(Ee,L,le,Yl,ht),ht=String.fromCharCode(55349,57314+Jo),N(C,L,st,Yl,ht),N(Ee,L,le,Yl,ht),ht=String.fromCharCode(55349,57324+Jo),N(C,L,st,Yl,ht),N(Ee,L,le,Yl,ht),ht=String.fromCharCode(55349,57334+Jo),N(C,L,st,Yl,ht),N(Ee,L,le,Yl,ht)}var C4="ÐÞþ";for(var Rb=0;Rb<C4.length;Rb++){var Ep=C4.charAt(Rb);N(C,L,st,Ep,Ep),N(Ee,L,le,Ep,Ep)}var _p=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],fN=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],dce=function(e,t){var r=e.charCodeAt(0),s=e.charCodeAt(1),i=(r-55296)*1024+(s-56320)+65536,l=t==="math"?0:1;if(119808<=i&&i<120484){var c=Math.floor((i-119808)/26);return[_p[c][2],_p[c][l]]}else if(120782<=i&&i<=120831){var u=Math.floor((i-120782)/10);return[fN[u][2],fN[u][l]]}else{if(i===120485||i===120486)return[_p[0][2],_p[0][l]];if(120486<i&&i<120782)return["",""];throw new De("Unsupported character: "+e)}},Ux=function(e,t,r){return Ln[r][e]&&Ln[r][e].replace&&(e=Ln[r][e].replace),{value:e,metrics:E5(e,t,r)}},Li=function(e,t,r,s,i){var l=Ux(e,t,r),c=l.metrics;e=l.value;var u;if(c){var h=c.italic;(r==="text"||s&&s.font==="mathit")&&(h=0),u=new Ti(e,c.height,c.depth,h,c.skew,c.width,i)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+e+"' in style '"+t+"' and mode '"+r+"'")),u=new Ti(e,0,0,0,0,0,i);if(s){u.maxFontSize=s.sizeMultiplier,s.style.isTight()&&u.classes.push("mtight");var m=s.getColor();m&&(u.style.color=m)}return u},hce=function(e,t,r,s){return s===void 0&&(s=[]),r.font==="boldsymbol"&&Ux(e,"Main-Bold",t).metrics?Li(e,"Main-Bold",t,r,s.concat(["mathbf"])):e==="\\"||Ln[t][e].font==="main"?Li(e,"Main-Regular",t,r,s):Li(e,"AMS-Regular",t,r,s.concat(["amsrm"]))},fce=function(e,t,r,s,i){return i!=="textord"&&Ux(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},mce=function(e,t,r){var s=e.mode,i=e.text,l=["mord"],c=s==="math"||s==="text"&&t.font,u=c?t.font:t.fontFamily,h="",m="";if(i.charCodeAt(0)===55349&&([h,m]=dce(i,s)),h.length>0)return Li(i,h,s,t,l.concat(m));if(u){var p,x;if(u==="boldsymbol"){var v=fce(i,s,t,l,r);p=v.fontName,x=[v.fontClass]}else c?(p=wR[u].fontName,x=[u]):(p=Dp(u,t.fontWeight,t.fontShape),x=[u,t.fontWeight,t.fontShape]);if(Ux(i,p,s).metrics)return Li(i,p,s,t,l.concat(x));if(vR.hasOwnProperty(i)&&p.slice(0,10)==="Typewriter"){for(var b=[],O=0;O<i.length;O++)b.push(Li(i[O],p,s,t,l.concat(x)));return bR(b)}}if(r==="mathord")return Li(i,"Math-Italic",s,t,l.concat(["mathnormal"]));if(r==="textord"){var k=Ln[s][i]&&Ln[s][i].font;if(k==="ams"){var j=Dp("amsrm",t.fontWeight,t.fontShape);return Li(i,j,s,t,l.concat("amsrm",t.fontWeight,t.fontShape))}else if(k==="main"||!k){var T=Dp("textrm",t.fontWeight,t.fontShape);return Li(i,T,s,t,l.concat(t.fontWeight,t.fontShape))}else{var M=Dp(k,t.fontWeight,t.fontShape);return Li(i,M,s,t,l.concat(M,t.fontWeight,t.fontShape))}}else throw new Error("unexpected type: "+r+" in makeOrd")},pce=(n,e)=>{if(vo(n.classes)!==vo(e.classes)||n.skew!==e.skew||n.maxFontSize!==e.maxFontSize)return!1;if(n.classes.length===1){var t=n.classes[0];if(t==="mbin"||t==="mord")return!1}for(var r in n.style)if(n.style.hasOwnProperty(r)&&n.style[r]!==e.style[r])return!1;for(var s in e.style)if(e.style.hasOwnProperty(s)&&n.style[s]!==e.style[s])return!1;return!0},gce=n=>{for(var e=0;e<n.length-1;e++){var t=n[e],r=n[e+1];t instanceof Ti&&r instanceof Ti&&pce(t,r)&&(t.text+=r.text,t.height=Math.max(t.height,r.height),t.depth=Math.max(t.depth,r.depth),t.italic=r.italic,n.splice(e+1,1),e--)}return n},D5=function(e){for(var t=0,r=0,s=0,i=0;i<e.children.length;i++){var l=e.children[i];l.height>t&&(t=l.height),l.depth>r&&(r=l.depth),l.maxFontSize>s&&(s=l.maxFontSize)}e.height=t,e.depth=r,e.maxFontSize=s},Cs=function(e,t,r,s){var i=new O0(e,t,r,s);return D5(i),i},yR=(n,e,t,r)=>new O0(n,e,t,r),xce=function(e,t,r){var s=Cs([e],[],t);return s.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),s.style.borderBottomWidth=Be(s.height),s.maxFontSize=1,s},vce=function(e,t,r,s){var i=new _5(e,t,r,s);return D5(i),i},bR=function(e){var t=new S0(e);return D5(t),t},yce=function(e,t){return e instanceof S0?Cs([],[e],t):e},bce=function(e){if(e.positionType==="individualShift"){for(var t=e.children,r=[t[0]],s=-t[0].shift-t[0].elem.depth,i=s,l=1;l<t.length;l++){var c=-t[l].shift-i-t[l].elem.depth,u=c-(t[l-1].elem.height+t[l-1].elem.depth);i=i+c,r.push({type:"kern",size:u}),r.push(t[l])}return{children:r,depth:s}}var h;if(e.positionType==="top"){for(var m=e.positionData,p=0;p<e.children.length;p++){var x=e.children[p];m-=x.type==="kern"?x.size:x.elem.height+x.elem.depth}h=m}else if(e.positionType==="bottom")h=-e.positionData;else{var v=e.children[0];if(v.type!=="elem")throw new Error('First child must have type "elem".');if(e.positionType==="shift")h=-v.elem.depth-e.positionData;else if(e.positionType==="firstBaseline")h=-v.elem.depth;else throw new Error("Invalid positionType "+e.positionType+".")}return{children:e.children,depth:h}},wce=function(e,t){for(var{children:r,depth:s}=bce(e),i=0,l=0;l<r.length;l++){var c=r[l];if(c.type==="elem"){var u=c.elem;i=Math.max(i,u.maxFontSize,u.height)}}i+=2;var h=Cs(["pstrut"],[]);h.style.height=Be(i);for(var m=[],p=s,x=s,v=s,b=0;b<r.length;b++){var O=r[b];if(O.type==="kern")v+=O.size;else{var k=O.elem,j=O.wrapperClasses||[],T=O.wrapperStyle||{},M=Cs(j,[h,k],void 0,T);M.style.top=Be(-i-v-k.depth),O.marginLeft&&(M.style.marginLeft=O.marginLeft),O.marginRight&&(M.style.marginRight=O.marginRight),m.push(M),v+=k.height+k.depth}p=Math.min(p,v),x=Math.max(x,v)}var _=Cs(["vlist"],m);_.style.height=Be(x);var D;if(p<0){var E=Cs([],[]),z=Cs(["vlist"],[E]);z.style.height=Be(-p);var Q=Cs(["vlist-s"],[new Ti("")]);D=[Cs(["vlist-r"],[_,Q]),Cs(["vlist-r"],[z])]}else D=[Cs(["vlist-r"],[_])];var q=Cs(["vlist-t"],D);return D.length===2&&q.classes.push("vlist-t2"),q.height=x,q.depth=-p,q},Sce=(n,e)=>{var t=Cs(["mspace"],[],e),r=Kn(n,e);return t.style.marginRight=Be(r),t},Dp=function(e,t,r){var s="";switch(e){case"amsrm":s="AMS";break;case"textrm":s="Main";break;case"textsf":s="SansSerif";break;case"texttt":s="Typewriter";break;default:s=e}var i;return t==="textbf"&&r==="textit"?i="BoldItalic":t==="textbf"?i="Bold":t==="textit"?i="Italic":i="Regular",s+"-"+i},wR={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},SR={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Oce=function(e,t){var[r,s,i]=SR[e],l=new yo(r),c=new gl([l],{width:Be(s),height:Be(i),style:"width:"+Be(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),u=yR(["overlay"],[c],t);return u.height=i,u.style.height=Be(i),u.style.width=Be(s),u},ge={fontMap:wR,makeSymbol:Li,mathsym:hce,makeSpan:Cs,makeSvgSpan:yR,makeLineSpan:xce,makeAnchor:vce,makeFragment:bR,wrapFragment:yce,makeVList:wce,makeOrd:mce,makeGlue:Sce,staticSvg:Oce,svgData:SR,tryCombineChars:gce},Xn={number:3,unit:"mu"},ec={number:4,unit:"mu"},Ya={number:5,unit:"mu"},kce={mord:{mop:Xn,mbin:ec,mrel:Ya,minner:Xn},mop:{mord:Xn,mop:Xn,mrel:Ya,minner:Xn},mbin:{mord:ec,mop:ec,mopen:ec,minner:ec},mrel:{mord:Ya,mop:Ya,mopen:Ya,minner:Ya},mopen:{},mclose:{mop:Xn,mbin:ec,mrel:Ya,minner:Xn},mpunct:{mord:Xn,mop:Xn,mrel:Ya,mopen:Xn,mclose:Xn,mpunct:Xn,minner:Xn},minner:{mord:Xn,mop:Xn,mbin:ec,mrel:Ya,mopen:Xn,mpunct:Xn,minner:Xn}},jce={mord:{mop:Xn},mop:{mord:Xn,mop:Xn},mbin:{},mrel:{},mopen:{},mclose:{mop:Xn},mpunct:{},minner:{mop:Xn}},OR={},Kg={},Zg={};function Qe(n){for(var{type:e,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:l}=n,c={type:e,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:s},u=0;u<t.length;++u)OR[t[u]]=c;e&&(i&&(Kg[e]=i),l&&(Zg[e]=l))}function Rc(n){var{type:e,htmlBuilder:t,mathmlBuilder:r}=n;Qe({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:t,mathmlBuilder:r})}var Jg=function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},ar=function(e){return e.type==="ordgroup"?e.body:[e]},xl=ge.makeSpan,Nce=["leftmost","mbin","mopen","mrel","mop","mpunct"],Cce=["rightmost","mrel","mclose","mpunct"],Tce={display:at.DISPLAY,text:at.TEXT,script:at.SCRIPT,scriptscript:at.SCRIPTSCRIPT},Mce={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Mr=function(e,t,r,s){s===void 0&&(s=[null,null]);for(var i=[],l=0;l<e.length;l++){var c=Xt(e[l],t);if(c instanceof S0){var u=c.children;i.push(...u)}else i.push(c)}if(ge.tryCombineChars(i),!r)return i;var h=t;if(e.length===1){var m=e[0];m.type==="sizing"?h=t.havingSize(m.size):m.type==="styling"&&(h=t.havingStyle(Tce[m.style]))}var p=xl([s[0]||"leftmost"],[],t),x=xl([s[1]||"rightmost"],[],t),v=r==="root";return mN(i,(b,O)=>{var k=O.classes[0],j=b.classes[0];k==="mbin"&&Cce.includes(j)?O.classes[0]="mord":j==="mbin"&&Nce.includes(k)&&(b.classes[0]="mord")},{node:p},x,v),mN(i,(b,O)=>{var k=T4(O),j=T4(b),T=k&&j?b.hasClass("mtight")?jce[k][j]:kce[k][j]:null;if(T)return ge.makeGlue(T,h)},{node:p},x,v),i},mN=function n(e,t,r,s,i){s&&e.push(s);for(var l=0;l<e.length;l++){var c=e[l],u=kR(c);if(u){n(u.children,t,r,null,i);continue}var h=!c.hasClass("mspace");if(h){var m=t(c,r.node);m&&(r.insertAfter?r.insertAfter(m):(e.unshift(m),l++))}h?r.node=c:i&&c.hasClass("newline")&&(r.node=xl(["leftmost"])),r.insertAfter=(p=>x=>{e.splice(p+1,0,x),l++})(l)}s&&e.pop()},kR=function(e){return e instanceof S0||e instanceof _5||e instanceof O0&&e.hasClass("enclosing")?e:null},Ace=function n(e,t){var r=kR(e);if(r){var s=r.children;if(s.length){if(t==="right")return n(s[s.length-1],"right");if(t==="left")return n(s[0],"left")}}return e},T4=function(e,t){return e?(t&&(e=Ace(e,t)),Mce[e.classes[0]]||null):null},qf=function(e,t){var r=["nulldelimiter"].concat(e.baseSizingClasses());return xl(t.concat(r))},Xt=function(e,t,r){if(!e)return xl();if(Kg[e.type]){var s=Kg[e.type](e,t);if(r&&t.size!==r.size){s=xl(t.sizingClasses(r),[s],t);var i=t.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new De("Got group of unknown type: '"+e.type+"'")};function Rp(n,e){var t=xl(["base"],n,e),r=xl(["strut"]);return r.style.height=Be(t.height+t.depth),t.depth&&(r.style.verticalAlign=Be(-t.depth)),t.children.unshift(r),t}function M4(n,e){var t=null;n.length===1&&n[0].type==="tag"&&(t=n[0].tag,n=n[0].body);var r=Mr(n,e,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],l=[],c=0;c<r.length;c++)if(l.push(r[c]),r[c].hasClass("mbin")||r[c].hasClass("mrel")||r[c].hasClass("allowbreak")){for(var u=!1;c<r.length-1&&r[c+1].hasClass("mspace")&&!r[c+1].hasClass("newline");)c++,l.push(r[c]),r[c].hasClass("nobreak")&&(u=!0);u||(i.push(Rp(l,e)),l=[])}else r[c].hasClass("newline")&&(l.pop(),l.length>0&&(i.push(Rp(l,e)),l=[]),i.push(r[c]));l.length>0&&i.push(Rp(l,e));var h;t?(h=Rp(Mr(t,e,!0)),h.classes=["tag"],i.push(h)):s&&i.push(s);var m=xl(["katex-html"],i);if(m.setAttribute("aria-hidden","true"),h){var p=h.children[0];p.style.height=Be(m.height+m.depth),m.depth&&(p.style.verticalAlign=Be(-m.depth))}return m}function jR(n){return new S0(n)}class ti{constructor(e,t,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=r||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=vo(this.classes));for(var r=0;r<this.children.length;r++)if(this.children[r]instanceof pa&&this.children[r+1]instanceof pa){for(var s=this.children[r].toText()+this.children[++r].toText();this.children[r+1]instanceof pa;)s+=this.children[++r].toText();e.appendChild(new pa(s).toNode())}else e.appendChild(this.children[r].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=tn.escape(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+tn.escape(vo(this.classes))+'"'),e+=">";for(var r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e+="</"+this.type+">",e}toText(){return this.children.map(e=>e.toText()).join("")}}class pa{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return tn.escape(this.toText())}toText(){return this.text}}class Ece{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character=" ":e>=-.05556&&e<=-.05555?this.character=" ":e>=-.1667&&e<=-.1666?this.character=" ":e>=-.2223&&e<=-.2222?this.character=" ":e>=-.2778&&e<=-.2777?this.character=" ":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Be(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Be(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var _e={MathNode:ti,TextNode:pa,SpaceNode:Ece,newDocumentFragment:jR},Mi=function(e,t,r){return Ln[t][e]&&Ln[t][e].replace&&e.charCodeAt(0)!==55349&&!(vR.hasOwnProperty(e)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(e=Ln[t][e].replace),new _e.TextNode(e)},R5=function(e){return e.length===1?e[0]:new _e.MathNode("mrow",e)},z5=function(e,t){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold";var r=t.font;if(!r||r==="mathnormal")return null;var s=e.mode;if(r==="mathit")return"italic";if(r==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(r==="mathbf")return"bold";if(r==="mathbb")return"double-struck";if(r==="mathsfit")return"sans-serif-italic";if(r==="mathfrak")return"fraktur";if(r==="mathscr"||r==="mathcal")return"script";if(r==="mathsf")return"sans-serif";if(r==="mathtt")return"monospace";var i=e.text;if(["\\imath","\\jmath"].includes(i))return null;Ln[s][i]&&Ln[s][i].replace&&(i=Ln[s][i].replace);var l=ge.fontMap[r].fontName;return E5(i,l,s)?ge.fontMap[r].variant:null};function zb(n){if(!n)return!1;if(n.type==="mi"&&n.children.length===1){var e=n.children[0];return e instanceof pa&&e.text==="."}else if(n.type==="mo"&&n.children.length===1&&n.getAttribute("separator")==="true"&&n.getAttribute("lspace")==="0em"&&n.getAttribute("rspace")==="0em"){var t=n.children[0];return t instanceof pa&&t.text===","}else return!1}var Fs=function(e,t,r){if(e.length===1){var s=Rn(e[0],t);return r&&s instanceof ti&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],l,c=0;c<e.length;c++){var u=Rn(e[c],t);if(u instanceof ti&&l instanceof ti){if(u.type==="mtext"&&l.type==="mtext"&&u.getAttribute("mathvariant")===l.getAttribute("mathvariant")){l.children.push(...u.children);continue}else if(u.type==="mn"&&l.type==="mn"){l.children.push(...u.children);continue}else if(zb(u)&&l.type==="mn"){l.children.push(...u.children);continue}else if(u.type==="mn"&&zb(l))u.children=[...l.children,...u.children],i.pop();else if((u.type==="msup"||u.type==="msub")&&u.children.length>=1&&(l.type==="mn"||zb(l))){var h=u.children[0];h instanceof ti&&h.type==="mn"&&(h.children=[...l.children,...h.children],i.pop())}else if(l.type==="mi"&&l.children.length===1){var m=l.children[0];if(m instanceof pa&&m.text==="̸"&&(u.type==="mo"||u.type==="mi"||u.type==="mn")){var p=u.children[0];p instanceof pa&&p.text.length>0&&(p.text=p.text.slice(0,1)+"̸"+p.text.slice(1),i.pop())}}}i.push(u),l=u}return i},bo=function(e,t,r){return R5(Fs(e,t,r))},Rn=function(e,t){if(!e)return new _e.MathNode("mrow");if(Zg[e.type]){var r=Zg[e.type](e,t);return r}else throw new De("Got group of unknown type: '"+e.type+"'")};function pN(n,e,t,r,s){var i=Fs(n,t),l;i.length===1&&i[0]instanceof ti&&["mrow","mtable"].includes(i[0].type)?l=i[0]:l=new _e.MathNode("mrow",i);var c=new _e.MathNode("annotation",[new _e.TextNode(e)]);c.setAttribute("encoding","application/x-tex");var u=new _e.MathNode("semantics",[l,c]),h=new _e.MathNode("math",[u]);h.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&h.setAttribute("display","block");var m=s?"katex":"katex-mathml";return ge.makeSpan([m],[h])}var NR=function(e){return new rl({style:e.displayMode?at.DISPLAY:at.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},CR=function(e,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),e=ge.makeSpan(r,[e])}return e},_ce=function(e,t,r){var s=NR(r),i;if(r.output==="mathml")return pN(e,t,s,r.displayMode,!0);if(r.output==="html"){var l=M4(e,s);i=ge.makeSpan(["katex"],[l])}else{var c=pN(e,t,s,r.displayMode,!1),u=M4(e,s);i=ge.makeSpan(["katex"],[c,u])}return CR(i,r)},Dce=function(e,t,r){var s=NR(r),i=M4(e,s),l=ge.makeSpan(["katex"],[i]);return CR(l,r)},Rce={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},zce=function(e){var t=new _e.MathNode("mo",[new _e.TextNode(Rce[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Pce={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Lce=function(e){return e.type==="ordgroup"?e.body.length:1},Bce=function(e,t){function r(){var c=4e5,u=e.label.slice(1);if(["widehat","widecheck","widetilde","utilde"].includes(u)){var h=e,m=Lce(h.base),p,x,v;if(m>5)u==="widehat"||u==="widecheck"?(p=420,c=2364,v=.42,x=u+"4"):(p=312,c=2340,v=.34,x="tilde4");else{var b=[1,1,2,2,3,3][m];u==="widehat"||u==="widecheck"?(c=[0,1062,2364,2364,2364][b],p=[0,239,300,360,420][b],v=[0,.24,.3,.3,.36,.42][b],x=u+b):(c=[0,600,1033,2339,2340][b],p=[0,260,286,306,312][b],v=[0,.26,.286,.3,.306,.34][b],x="tilde"+b)}var O=new yo(x),k=new gl([O],{width:"100%",height:Be(v),viewBox:"0 0 "+c+" "+p,preserveAspectRatio:"none"});return{span:ge.makeSvgSpan([],[k],t),minWidth:0,height:v}}else{var j=[],T=Pce[u],[M,_,D]=T,E=D/1e3,z=M.length,Q,q;if(z===1){var B=T[3];Q=["hide-tail"],q=[B]}else if(z===2)Q=["halfarrow-left","halfarrow-right"],q=["xMinYMin","xMaxYMin"];else if(z===3)Q=["brace-left","brace-center","brace-right"],q=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
|
||
`+z+" children.");for(var U=0;U<z;U++){var V=new yo(M[U]),ce=new gl([V],{width:"400em",height:Be(E),viewBox:"0 0 "+c+" "+D,preserveAspectRatio:q[U]+" slice"}),W=ge.makeSvgSpan([Q[U]],[ce],t);if(z===1)return{span:W,minWidth:_,height:E};W.style.height=Be(E),j.push(W)}return{span:ge.makeSpan(["stretchy"],j,t),minWidth:_,height:E}}}var{span:s,minWidth:i,height:l}=r();return s.height=l,s.style.height=Be(l),i>0&&(s.style.minWidth=Be(i)),s},Ice=function(e,t,r,s,i){var l,c=e.height+e.depth+r+s;if(/fbox|color|angl/.test(t)){if(l=ge.makeSpan(["stretchy",t],[],i),t==="fbox"){var u=i.color&&i.getColor();u&&(l.style.borderColor=u)}}else{var h=[];/^[bx]cancel$/.test(t)&&h.push(new N4({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&h.push(new N4({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var m=new gl(h,{width:"100%",height:Be(c)});l=ge.makeSvgSpan([],[m],i)}return l.height=c,l.style.height=Be(c),l},vl={encloseSpan:Ice,mathMLnode:zce,svgSpan:Bce};function Nt(n,e){if(!n||n.type!==e)throw new Error("Expected node of type "+e+", but got "+(n?"node of type "+n.type:String(n)));return n}function P5(n){var e=Vx(n);if(!e)throw new Error("Expected node of symbol group type, but got "+(n?"node of type "+n.type:String(n)));return e}function Vx(n){return n&&(n.type==="atom"||uce.hasOwnProperty(n.type))?n:null}var L5=(n,e)=>{var t,r,s;n&&n.type==="supsub"?(r=Nt(n.base,"accent"),t=r.base,n.base=t,s=oce(Xt(n,e)),n.base=r):(r=Nt(n,"accent"),t=r.base);var i=Xt(t,e.havingCrampedStyle()),l=r.isShifty&&tn.isCharacterBox(t),c=0;if(l){var u=tn.getBaseElem(t),h=Xt(u,e.havingCrampedStyle());c=oN(h).skew}var m=r.label==="\\c",p=m?i.height+i.depth:Math.min(i.height,e.fontMetrics().xHeight),x;if(r.isStretchy)x=vl.svgSpan(r,e),x=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:x,wrapperClasses:["svg-align"],wrapperStyle:c>0?{width:"calc(100% - "+Be(2*c)+")",marginLeft:Be(2*c)}:void 0}]},e);else{var v,b;r.label==="\\vec"?(v=ge.staticSvg("vec",e),b=ge.svgData.vec[1]):(v=ge.makeOrd({mode:r.mode,text:r.label},e,"textord"),v=oN(v),v.italic=0,b=v.width,m&&(p+=v.depth)),x=ge.makeSpan(["accent-body"],[v]);var O=r.label==="\\textcircled";O&&(x.classes.push("accent-full"),p=i.height);var k=c;O||(k-=b/2),x.style.left=Be(k),r.label==="\\textcircled"&&(x.style.top=".2em"),x=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-p},{type:"elem",elem:x}]},e)}var j=ge.makeSpan(["mord","accent"],[x],e);return s?(s.children[0]=j,s.height=Math.max(j.height,s.height),s.classes[0]="mord",s):j},TR=(n,e)=>{var t=n.isStretchy?vl.mathMLnode(n.label):new _e.MathNode("mo",[Mi(n.label,n.mode)]),r=new _e.MathNode("mover",[Rn(n.base,e),t]);return r.setAttribute("accent","true"),r},Fce=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(n=>"\\"+n).join("|"));Qe({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(n,e)=>{var t=Jg(e[0]),r=!Fce.test(n.funcName),s=!r||n.funcName==="\\widehat"||n.funcName==="\\widetilde"||n.funcName==="\\widecheck";return{type:"accent",mode:n.parser.mode,label:n.funcName,isStretchy:r,isShifty:s,base:t}},htmlBuilder:L5,mathmlBuilder:TR});Qe({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(n,e)=>{var t=e[0],r=n.parser.mode;return r==="math"&&(n.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+n.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:n.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:L5,mathmlBuilder:TR});Qe({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(n,e)=>{var{parser:t,funcName:r}=n,s=e[0];return{type:"accentUnder",mode:t.mode,label:r,base:s}},htmlBuilder:(n,e)=>{var t=Xt(n.base,e),r=vl.svgSpan(n,e),s=n.label==="\\utilde"?.12:0,i=ge.makeVList({positionType:"top",positionData:t.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:t}]},e);return ge.makeSpan(["mord","accentunder"],[i],e)},mathmlBuilder:(n,e)=>{var t=vl.mathMLnode(n.label),r=new _e.MathNode("munder",[Rn(n.base,e),t]);return r.setAttribute("accentunder","true"),r}});var zp=n=>{var e=new _e.MathNode("mpadded",n?[n]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};Qe({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(n,e,t){var{parser:r,funcName:s}=n;return{type:"xArrow",mode:r.mode,label:s,body:e[0],below:t[0]}},htmlBuilder(n,e){var t=e.style,r=e.havingStyle(t.sup()),s=ge.wrapFragment(Xt(n.body,r,e),e),i=n.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var l;n.below&&(r=e.havingStyle(t.sub()),l=ge.wrapFragment(Xt(n.below,r,e),e),l.classes.push(i+"-arrow-pad"));var c=vl.svgSpan(n,e),u=-e.fontMetrics().axisHeight+.5*c.height,h=-e.fontMetrics().axisHeight-.5*c.height-.111;(s.depth>.25||n.label==="\\xleftequilibrium")&&(h-=s.depth);var m;if(l){var p=-e.fontMetrics().axisHeight+l.height+.5*c.height+.111;m=ge.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:h},{type:"elem",elem:c,shift:u},{type:"elem",elem:l,shift:p}]},e)}else m=ge.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:h},{type:"elem",elem:c,shift:u}]},e);return m.children[0].children[0].children[1].classes.push("svg-align"),ge.makeSpan(["mrel","x-arrow"],[m],e)},mathmlBuilder(n,e){var t=vl.mathMLnode(n.label);t.setAttribute("minsize",n.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(n.body){var s=zp(Rn(n.body,e));if(n.below){var i=zp(Rn(n.below,e));r=new _e.MathNode("munderover",[t,i,s])}else r=new _e.MathNode("mover",[t,s])}else if(n.below){var l=zp(Rn(n.below,e));r=new _e.MathNode("munder",[t,l])}else r=zp(),r=new _e.MathNode("mover",[t,r]);return r}});var qce=ge.makeSpan;function MR(n,e){var t=Mr(n.body,e,!0);return qce([n.mclass],t,e)}function AR(n,e){var t,r=Fs(n.body,e);return n.mclass==="minner"?t=new _e.MathNode("mpadded",r):n.mclass==="mord"?n.isCharacterBox?(t=r[0],t.type="mi"):t=new _e.MathNode("mi",r):(n.isCharacterBox?(t=r[0],t.type="mo"):t=new _e.MathNode("mo",r),n.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):n.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):n.mclass==="mopen"||n.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):n.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}Qe({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(n,e){var{parser:t,funcName:r}=n,s=e[0];return{type:"mclass",mode:t.mode,mclass:"m"+r.slice(5),body:ar(s),isCharacterBox:tn.isCharacterBox(s)}},htmlBuilder:MR,mathmlBuilder:AR});var Wx=n=>{var e=n.type==="ordgroup"&&n.body.length?n.body[0]:n;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};Qe({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(n,e){var{parser:t}=n;return{type:"mclass",mode:t.mode,mclass:Wx(e[0]),body:ar(e[1]),isCharacterBox:tn.isCharacterBox(e[1])}}});Qe({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(n,e){var{parser:t,funcName:r}=n,s=e[1],i=e[0],l;r!=="\\stackrel"?l=Wx(s):l="mrel";var c={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:ar(s)},u={type:"supsub",mode:i.mode,base:c,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:t.mode,mclass:l,body:[u],isCharacterBox:tn.isCharacterBox(u)}},htmlBuilder:MR,mathmlBuilder:AR});Qe({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(n,e){var{parser:t}=n;return{type:"pmb",mode:t.mode,mclass:Wx(e[0]),body:ar(e[0])}},htmlBuilder(n,e){var t=Mr(n.body,e,!0),r=ge.makeSpan([n.mclass],t,e);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(n,e){var t=Fs(n.body,e),r=new _e.MathNode("mstyle",t);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var Qce={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},gN=()=>({type:"styling",body:[],mode:"math",style:"display"}),xN=n=>n.type==="textord"&&n.text==="@",$ce=(n,e)=>(n.type==="mathord"||n.type==="atom")&&n.text===e;function Hce(n,e,t){var r=Qce[n];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(r,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var s=t.callFunction("\\\\cdleft",[e[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},l=t.callFunction("\\Big",[i],[]),c=t.callFunction("\\\\cdright",[e[1]],[]),u={type:"ordgroup",mode:"math",body:[s,l,c]};return t.callFunction("\\\\cdparent",[u],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var h={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[h],[])}default:return{type:"textord",text:" ",mode:"math"}}}function Uce(n){var e=[];for(n.gullet.beginGroup(),n.gullet.macros.set("\\cr","\\\\\\relax"),n.gullet.beginGroup();;){e.push(n.parseExpression(!1,"\\\\")),n.gullet.endGroup(),n.gullet.beginGroup();var t=n.fetch().text;if(t==="&"||t==="\\\\")n.consume();else if(t==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new De("Expected \\\\ or \\cr or \\end",n.nextToken)}for(var r=[],s=[r],i=0;i<e.length;i++){for(var l=e[i],c=gN(),u=0;u<l.length;u++)if(!xN(l[u]))c.body.push(l[u]);else{r.push(c),u+=1;var h=P5(l[u]).text,m=new Array(2);if(m[0]={type:"ordgroup",mode:"math",body:[]},m[1]={type:"ordgroup",mode:"math",body:[]},!("=|.".indexOf(h)>-1))if("<>AV".indexOf(h)>-1)for(var p=0;p<2;p++){for(var x=!0,v=u+1;v<l.length;v++){if($ce(l[v],h)){x=!1,u=v;break}if(xN(l[v]))throw new De("Missing a "+h+" character to complete a CD arrow.",l[v]);m[p].body.push(l[v])}if(x)throw new De("Missing a "+h+" character to complete a CD arrow.",l[u])}else throw new De('Expected one of "<>AV=|." after @',l[u]);var b=Hce(h,m,n),O={type:"styling",body:[b],mode:"math",style:"display"};r.push(O),c=gN()}i%2===0?r.push(c):r.shift(),r=[],s.push(r)}n.gullet.endGroup(),n.gullet.endGroup();var k=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:k,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}Qe({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(n,e){var{parser:t,funcName:r}=n;return{type:"cdlabel",mode:t.mode,side:r.slice(4),label:e[0]}},htmlBuilder(n,e){var t=e.havingStyle(e.style.sup()),r=ge.wrapFragment(Xt(n.label,t,e),e);return r.classes.push("cd-label-"+n.side),r.style.bottom=Be(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(n,e){var t=new _e.MathNode("mrow",[Rn(n.label,e)]);return t=new _e.MathNode("mpadded",[t]),t.setAttribute("width","0"),n.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new _e.MathNode("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});Qe({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(n,e){var{parser:t}=n;return{type:"cdlabelparent",mode:t.mode,fragment:e[0]}},htmlBuilder(n,e){var t=ge.wrapFragment(Xt(n.fragment,e),e);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(n,e){return new _e.MathNode("mrow",[Rn(n.fragment,e)])}});Qe({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(n,e){for(var{parser:t}=n,r=Nt(e[0],"ordgroup"),s=r.body,i="",l=0;l<s.length;l++){var c=Nt(s[l],"textord");i+=c.text}var u=parseInt(i),h;if(isNaN(u))throw new De("\\@char has non-numeric argument "+i);if(u<0||u>=1114111)throw new De("\\@char with invalid code point "+i);return u<=65535?h=String.fromCharCode(u):(u-=65536,h=String.fromCharCode((u>>10)+55296,(u&1023)+56320)),{type:"textord",mode:t.mode,text:h}}});var ER=(n,e)=>{var t=Mr(n.body,e.withColor(n.color),!1);return ge.makeFragment(t)},_R=(n,e)=>{var t=Fs(n.body,e.withColor(n.color)),r=new _e.MathNode("mstyle",t);return r.setAttribute("mathcolor",n.color),r};Qe({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(n,e){var{parser:t}=n,r=Nt(e[0],"color-token").color,s=e[1];return{type:"color",mode:t.mode,color:r,body:ar(s)}},htmlBuilder:ER,mathmlBuilder:_R});Qe({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(n,e){var{parser:t,breakOnTokenText:r}=n,s=Nt(e[0],"color-token").color;t.gullet.macros.set("\\current@color",s);var i=t.parseExpression(!0,r);return{type:"color",mode:t.mode,color:s,body:i}},htmlBuilder:ER,mathmlBuilder:_R});Qe({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(n,e,t){var{parser:r}=n,s=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:s&&Nt(s,"size").value}},htmlBuilder(n,e){var t=ge.makeSpan(["mspace"],[],e);return n.newLine&&(t.classes.push("newline"),n.size&&(t.style.marginTop=Be(Kn(n.size,e)))),t},mathmlBuilder(n,e){var t=new _e.MathNode("mspace");return n.newLine&&(t.setAttribute("linebreak","newline"),n.size&&t.setAttribute("height",Be(Kn(n.size,e)))),t}});var A4={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},DR=n=>{var e=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new De("Expected a control sequence",n);return e},Vce=n=>{var e=n.gullet.popToken();return e.text==="="&&(e=n.gullet.popToken(),e.text===" "&&(e=n.gullet.popToken())),e},RR=(n,e,t,r)=>{var s=n.gullet.macros.get(t.text);s==null&&(t.noexpand=!0,s={tokens:[t],numArgs:0,unexpandable:!n.gullet.isExpandable(t.text)}),n.gullet.macros.set(e,s,r)};Qe({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(n){var{parser:e,funcName:t}=n;e.consumeSpaces();var r=e.fetch();if(A4[r.text])return(t==="\\global"||t==="\\\\globallong")&&(r.text=A4[r.text]),Nt(e.parseFunction(),"internal");throw new De("Invalid token after macro prefix",r)}});Qe({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(n){var{parser:e,funcName:t}=n,r=e.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new De("Expected a control sequence",r);for(var i=0,l,c=[[]];e.gullet.future().text!=="{";)if(r=e.gullet.popToken(),r.text==="#"){if(e.gullet.future().text==="{"){l=e.gullet.future(),c[i].push("{");break}if(r=e.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new De('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new De('Argument number "'+r.text+'" out of order');i++,c.push([])}else{if(r.text==="EOF")throw new De("Expected a macro definition");c[i].push(r.text)}var{tokens:u}=e.gullet.consumeArg();return l&&u.unshift(l),(t==="\\edef"||t==="\\xdef")&&(u=e.gullet.expandTokens(u),u.reverse()),e.gullet.macros.set(s,{tokens:u,numArgs:i,delimiters:c},t===A4[t]),{type:"internal",mode:e.mode}}});Qe({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(n){var{parser:e,funcName:t}=n,r=DR(e.gullet.popToken());e.gullet.consumeSpaces();var s=Vce(e);return RR(e,r,s,t==="\\\\globallet"),{type:"internal",mode:e.mode}}});Qe({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(n){var{parser:e,funcName:t}=n,r=DR(e.gullet.popToken()),s=e.gullet.popToken(),i=e.gullet.popToken();return RR(e,r,i,t==="\\\\globalfuture"),e.gullet.pushToken(i),e.gullet.pushToken(s),{type:"internal",mode:e.mode}}});var Wh=function(e,t,r){var s=Ln.math[e]&&Ln.math[e].replace,i=E5(s||e,t,r);if(!i)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return i},B5=function(e,t,r,s){var i=r.havingBaseStyle(t),l=ge.makeSpan(s.concat(i.sizingClasses(r)),[e],r),c=i.sizeMultiplier/r.sizeMultiplier;return l.height*=c,l.depth*=c,l.maxFontSize=i.sizeMultiplier,l},zR=function(e,t,r){var s=t.havingBaseStyle(r),i=(1-t.sizeMultiplier/s.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Be(i),e.height-=i,e.depth+=i},Wce=function(e,t,r,s,i,l){var c=ge.makeSymbol(e,"Main-Regular",i,s),u=B5(c,t,s,l);return r&&zR(u,s,t),u},Gce=function(e,t,r,s){return ge.makeSymbol(e,"Size"+t+"-Regular",r,s)},PR=function(e,t,r,s,i,l){var c=Gce(e,t,i,s),u=B5(ge.makeSpan(["delimsizing","size"+t],[c],s),at.TEXT,s,l);return r&&zR(u,s,at.TEXT),u},Pb=function(e,t,r){var s;t==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=ge.makeSpan(["delimsizinginner",s],[ge.makeSpan([],[ge.makeSymbol(e,t,r)])]);return{type:"elem",elem:i}},Lb=function(e,t,r){var s=ma["Size4-Regular"][e.charCodeAt(0)]?ma["Size4-Regular"][e.charCodeAt(0)][4]:ma["Size1-Regular"][e.charCodeAt(0)][4],i=new yo("inner",Joe(e,Math.round(1e3*t))),l=new gl([i],{width:Be(s),height:Be(t),style:"width:"+Be(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),c=ge.makeSvgSpan([],[l],r);return c.height=t,c.style.height=Be(t),c.style.width=Be(s),{type:"elem",elem:c}},E4=.008,Pp={type:"kern",size:-1*E4},Xce=["|","\\lvert","\\rvert","\\vert"],Yce=["\\|","\\lVert","\\rVert","\\Vert"],LR=function(e,t,r,s,i,l){var c,u,h,m,p="",x=0;c=h=m=e,u=null;var v="Size1-Regular";e==="\\uparrow"?h=m="⏐":e==="\\Uparrow"?h=m="‖":e==="\\downarrow"?c=h="⏐":e==="\\Downarrow"?c=h="‖":e==="\\updownarrow"?(c="\\uparrow",h="⏐",m="\\downarrow"):e==="\\Updownarrow"?(c="\\Uparrow",h="‖",m="\\Downarrow"):Xce.includes(e)?(h="∣",p="vert",x=333):Yce.includes(e)?(h="∥",p="doublevert",x=556):e==="["||e==="\\lbrack"?(c="⎡",h="⎢",m="⎣",v="Size4-Regular",p="lbrack",x=667):e==="]"||e==="\\rbrack"?(c="⎤",h="⎥",m="⎦",v="Size4-Regular",p="rbrack",x=667):e==="\\lfloor"||e==="⌊"?(h=c="⎢",m="⎣",v="Size4-Regular",p="lfloor",x=667):e==="\\lceil"||e==="⌈"?(c="⎡",h=m="⎢",v="Size4-Regular",p="lceil",x=667):e==="\\rfloor"||e==="⌋"?(h=c="⎥",m="⎦",v="Size4-Regular",p="rfloor",x=667):e==="\\rceil"||e==="⌉"?(c="⎤",h=m="⎥",v="Size4-Regular",p="rceil",x=667):e==="("||e==="\\lparen"?(c="⎛",h="⎜",m="⎝",v="Size4-Regular",p="lparen",x=875):e===")"||e==="\\rparen"?(c="⎞",h="⎟",m="⎠",v="Size4-Regular",p="rparen",x=875):e==="\\{"||e==="\\lbrace"?(c="⎧",u="⎨",m="⎩",h="⎪",v="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(c="⎫",u="⎬",m="⎭",h="⎪",v="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(c="⎧",m="⎩",h="⎪",v="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(c="⎫",m="⎭",h="⎪",v="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(c="⎧",m="⎭",h="⎪",v="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(c="⎫",m="⎩",h="⎪",v="Size4-Regular");var b=Wh(c,v,i),O=b.height+b.depth,k=Wh(h,v,i),j=k.height+k.depth,T=Wh(m,v,i),M=T.height+T.depth,_=0,D=1;if(u!==null){var E=Wh(u,v,i);_=E.height+E.depth,D=2}var z=O+M+_,Q=Math.max(0,Math.ceil((t-z)/(D*j))),q=z+Q*D*j,B=s.fontMetrics().axisHeight;r&&(B*=s.sizeMultiplier);var U=q/2-B,V=[];if(p.length>0){var ce=q-O-M,W=Math.round(q*1e3),J=ece(p,Math.round(ce*1e3)),H=new yo(p,J),ae=(x/1e3).toFixed(3)+"em",ne=(W/1e3).toFixed(3)+"em",ue=new gl([H],{width:ae,height:ne,viewBox:"0 0 "+x+" "+W}),R=ge.makeSvgSpan([],[ue],s);R.height=W/1e3,R.style.width=ae,R.style.height=ne,V.push({type:"elem",elem:R})}else{if(V.push(Pb(m,v,i)),V.push(Pp),u===null){var me=q-O-M+2*E4;V.push(Lb(h,me,s))}else{var Y=(q-O-M-_)/2+2*E4;V.push(Lb(h,Y,s)),V.push(Pp),V.push(Pb(u,v,i)),V.push(Pp),V.push(Lb(h,Y,s))}V.push(Pp),V.push(Pb(c,v,i))}var P=s.havingBaseStyle(at.TEXT),K=ge.makeVList({positionType:"bottom",positionData:U,children:V},P);return B5(ge.makeSpan(["delimsizing","mult"],[K],P),at.TEXT,s,l)},Bb=80,Ib=.08,Fb=function(e,t,r,s,i){var l=Zoe(e,s,r),c=new yo(e,l),u=new gl([c],{width:"400em",height:Be(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return ge.makeSvgSpan(["hide-tail"],[u],i)},Kce=function(e,t){var r=t.havingBaseSizing(),s=qR("\\surd",e*r.sizeMultiplier,FR,r),i=r.sizeMultiplier,l=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),c,u=0,h=0,m=0,p;return s.type==="small"?(m=1e3+1e3*l+Bb,e<1?i=1:e<1.4&&(i=.7),u=(1+l+Ib)/i,h=(1+l)/i,c=Fb("sqrtMain",u,m,l,t),c.style.minWidth="0.853em",p=.833/i):s.type==="large"?(m=(1e3+Bb)*uf[s.size],h=(uf[s.size]+l)/i,u=(uf[s.size]+l+Ib)/i,c=Fb("sqrtSize"+s.size,u,m,l,t),c.style.minWidth="1.02em",p=1/i):(u=e+l+Ib,h=e+l,m=Math.floor(1e3*e+l)+Bb,c=Fb("sqrtTall",u,m,l,t),c.style.minWidth="0.742em",p=1.056),c.height=h,c.style.height=Be(u),{span:c,advanceWidth:p,ruleWidth:(t.fontMetrics().sqrtRuleThickness+l)*i}},BR=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],Zce=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],IR=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],uf=[0,1.2,1.8,2.4,3],Jce=function(e,t,r,s,i){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),BR.includes(e)||IR.includes(e))return PR(e,t,!1,r,s,i);if(Zce.includes(e))return LR(e,uf[t],!1,r,s,i);throw new De("Illegal delimiter: '"+e+"'")},eue=[{type:"small",style:at.SCRIPTSCRIPT},{type:"small",style:at.SCRIPT},{type:"small",style:at.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],tue=[{type:"small",style:at.SCRIPTSCRIPT},{type:"small",style:at.SCRIPT},{type:"small",style:at.TEXT},{type:"stack"}],FR=[{type:"small",style:at.SCRIPTSCRIPT},{type:"small",style:at.SCRIPT},{type:"small",style:at.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],nue=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},qR=function(e,t,r,s){for(var i=Math.min(2,3-s.style.size),l=i;l<r.length&&r[l].type!=="stack";l++){var c=Wh(e,nue(r[l]),"math"),u=c.height+c.depth;if(r[l].type==="small"){var h=s.havingBaseStyle(r[l].style);u*=h.sizeMultiplier}if(u>t)return r[l]}return r[r.length-1]},QR=function(e,t,r,s,i,l){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var c;IR.includes(e)?c=eue:BR.includes(e)?c=FR:c=tue;var u=qR(e,t,c,s);return u.type==="small"?Wce(e,u.style,r,s,i,l):u.type==="large"?PR(e,u.size,r,s,i,l):LR(e,t,r,s,i,l)},rue=function(e,t,r,s,i,l){var c=s.fontMetrics().axisHeight*s.sizeMultiplier,u=901,h=5/s.fontMetrics().ptPerEm,m=Math.max(t-c,r+c),p=Math.max(m/500*u,2*m-h);return QR(e,p,!0,s,i,l)},ul={sqrtImage:Kce,sizedDelim:Jce,sizeToMaxHeight:uf,customSizedDelim:QR,leftRightDelim:rue},vN={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},sue=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Gx(n,e){var t=Vx(n);if(t&&sue.includes(t.text))return t;throw t?new De("Invalid delimiter '"+t.text+"' after '"+e.funcName+"'",n):new De("Invalid delimiter type '"+n.type+"'",n)}Qe({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(n,e)=>{var t=Gx(e[0],n);return{type:"delimsizing",mode:n.parser.mode,size:vN[n.funcName].size,mclass:vN[n.funcName].mclass,delim:t.text}},htmlBuilder:(n,e)=>n.delim==="."?ge.makeSpan([n.mclass]):ul.sizedDelim(n.delim,n.size,e,n.mode,[n.mclass]),mathmlBuilder:n=>{var e=[];n.delim!=="."&&e.push(Mi(n.delim,n.mode));var t=new _e.MathNode("mo",e);n.mclass==="mopen"||n.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var r=Be(ul.sizeToMaxHeight[n.size]);return t.setAttribute("minsize",r),t.setAttribute("maxsize",r),t}});function yN(n){if(!n.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Qe({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(n,e)=>{var t=n.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new De("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:n.parser.mode,delim:Gx(e[0],n).text,color:t}}});Qe({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(n,e)=>{var t=Gx(e[0],n),r=n.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=Nt(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:t.text,right:i.delim,rightColor:i.color}},htmlBuilder:(n,e)=>{yN(n);for(var t=Mr(n.body,e,!0,["mopen","mclose"]),r=0,s=0,i=!1,l=0;l<t.length;l++)t[l].isMiddle?i=!0:(r=Math.max(t[l].height,r),s=Math.max(t[l].depth,s));r*=e.sizeMultiplier,s*=e.sizeMultiplier;var c;if(n.left==="."?c=qf(e,["mopen"]):c=ul.leftRightDelim(n.left,r,s,e,n.mode,["mopen"]),t.unshift(c),i)for(var u=1;u<t.length;u++){var h=t[u],m=h.isMiddle;m&&(t[u]=ul.leftRightDelim(m.delim,r,s,m.options,n.mode,[]))}var p;if(n.right===".")p=qf(e,["mclose"]);else{var x=n.rightColor?e.withColor(n.rightColor):e;p=ul.leftRightDelim(n.right,r,s,x,n.mode,["mclose"])}return t.push(p),ge.makeSpan(["minner"],t,e)},mathmlBuilder:(n,e)=>{yN(n);var t=Fs(n.body,e);if(n.left!=="."){var r=new _e.MathNode("mo",[Mi(n.left,n.mode)]);r.setAttribute("fence","true"),t.unshift(r)}if(n.right!=="."){var s=new _e.MathNode("mo",[Mi(n.right,n.mode)]);s.setAttribute("fence","true"),n.rightColor&&s.setAttribute("mathcolor",n.rightColor),t.push(s)}return R5(t)}});Qe({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(n,e)=>{var t=Gx(e[0],n);if(!n.parser.leftrightDepth)throw new De("\\middle without preceding \\left",t);return{type:"middle",mode:n.parser.mode,delim:t.text}},htmlBuilder:(n,e)=>{var t;if(n.delim===".")t=qf(e,[]);else{t=ul.sizedDelim(n.delim,1,e,n.mode,[]);var r={delim:n.delim,options:e};t.isMiddle=r}return t},mathmlBuilder:(n,e)=>{var t=n.delim==="\\vert"||n.delim==="|"?Mi("|","text"):Mi(n.delim,n.mode),r=new _e.MathNode("mo",[t]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var I5=(n,e)=>{var t=ge.wrapFragment(Xt(n.body,e),e),r=n.label.slice(1),s=e.sizeMultiplier,i,l=0,c=tn.isCharacterBox(n.body);if(r==="sout")i=ge.makeSpan(["stretchy","sout"]),i.height=e.fontMetrics().defaultRuleThickness/s,l=-.5*e.fontMetrics().xHeight;else if(r==="phase"){var u=Kn({number:.6,unit:"pt"},e),h=Kn({number:.35,unit:"ex"},e),m=e.havingBaseSizing();s=s/m.sizeMultiplier;var p=t.height+t.depth+u+h;t.style.paddingLeft=Be(p/2+u);var x=Math.floor(1e3*p*s),v=Yoe(x),b=new gl([new yo("phase",v)],{width:"400em",height:Be(x/1e3),viewBox:"0 0 400000 "+x,preserveAspectRatio:"xMinYMin slice"});i=ge.makeSvgSpan(["hide-tail"],[b],e),i.style.height=Be(p),l=t.depth+u+h}else{/cancel/.test(r)?c||t.classes.push("cancel-pad"):r==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var O=0,k=0,j=0;/box/.test(r)?(j=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),O=e.fontMetrics().fboxsep+(r==="colorbox"?0:j),k=O):r==="angl"?(j=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),O=4*j,k=Math.max(0,.25-t.depth)):(O=c?.2:0,k=O),i=vl.encloseSpan(t,r,O,k,e),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=Be(j)):r==="angl"&&j!==.049&&(i.style.borderTopWidth=Be(j),i.style.borderRightWidth=Be(j)),l=t.depth+k,n.backgroundColor&&(i.style.backgroundColor=n.backgroundColor,n.borderColor&&(i.style.borderColor=n.borderColor))}var T;if(n.backgroundColor)T=ge.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:l},{type:"elem",elem:t,shift:0}]},e);else{var M=/cancel|phase/.test(r)?["svg-align"]:[];T=ge.makeVList({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:i,shift:l,wrapperClasses:M}]},e)}return/cancel/.test(r)&&(T.height=t.height,T.depth=t.depth),/cancel/.test(r)&&!c?ge.makeSpan(["mord","cancel-lap"],[T],e):ge.makeSpan(["mord"],[T],e)},F5=(n,e)=>{var t=0,r=new _e.MathNode(n.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Rn(n.body,e)]);switch(n.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*t+"pt"),r.setAttribute("height","+"+2*t+"pt"),r.setAttribute("lspace",t+"pt"),r.setAttribute("voffset",t+"pt"),n.label==="\\fcolorbox"){var s=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);r.setAttribute("style","border: "+s+"em solid "+String(n.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return n.backgroundColor&&r.setAttribute("mathbackground",n.backgroundColor),r};Qe({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(n,e,t){var{parser:r,funcName:s}=n,i=Nt(e[0],"color-token").color,l=e[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:l}},htmlBuilder:I5,mathmlBuilder:F5});Qe({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(n,e,t){var{parser:r,funcName:s}=n,i=Nt(e[0],"color-token").color,l=Nt(e[1],"color-token").color,c=e[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:l,borderColor:i,body:c}},htmlBuilder:I5,mathmlBuilder:F5});Qe({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(n,e){var{parser:t}=n;return{type:"enclose",mode:t.mode,label:"\\fbox",body:e[0]}}});Qe({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(n,e){var{parser:t,funcName:r}=n,s=e[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:I5,mathmlBuilder:F5});Qe({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(n,e){var{parser:t}=n;return{type:"enclose",mode:t.mode,label:"\\angl",body:e[0]}}});var $R={};function Na(n){for(var{type:e,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:l}=n,c={type:e,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},u=0;u<t.length;++u)$R[t[u]]=c;i&&(Kg[e]=i),l&&(Zg[e]=l)}var HR={};function F(n,e){HR[n]=e}function bN(n){var e=[];n.consumeSpaces();var t=n.fetch().text;for(t==="\\relax"&&(n.consume(),n.consumeSpaces(),t=n.fetch().text);t==="\\hline"||t==="\\hdashline";)n.consume(),e.push(t==="\\hdashline"),n.consumeSpaces(),t=n.fetch().text;return e}var Xx=n=>{var e=n.parser.settings;if(!e.displayMode)throw new De("{"+n.envName+"} can be used only in display mode.")};function q5(n){if(n.indexOf("ed")===-1)return n.indexOf("*")===-1}function Mo(n,e,t){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:l,colSeparationType:c,autoTag:u,singleRow:h,emptySingleRow:m,maxNumCols:p,leqno:x}=e;if(n.gullet.beginGroup(),h||n.gullet.macros.set("\\cr","\\\\\\relax"),!l){var v=n.gullet.expandMacroAsText("\\arraystretch");if(v==null)l=1;else if(l=parseFloat(v),!l||l<0)throw new De("Invalid \\arraystretch: "+v)}n.gullet.beginGroup();var b=[],O=[b],k=[],j=[],T=u!=null?[]:void 0;function M(){u&&n.gullet.macros.set("\\@eqnsw","1",!0)}function _(){T&&(n.gullet.macros.get("\\df@tag")?(T.push(n.subparse([new si("\\df@tag")])),n.gullet.macros.set("\\df@tag",void 0,!0)):T.push(!!u&&n.gullet.macros.get("\\@eqnsw")==="1"))}for(M(),j.push(bN(n));;){var D=n.parseExpression(!1,h?"\\end":"\\\\");n.gullet.endGroup(),n.gullet.beginGroup(),D={type:"ordgroup",mode:n.mode,body:D},t&&(D={type:"styling",mode:n.mode,style:t,body:[D]}),b.push(D);var E=n.fetch().text;if(E==="&"){if(p&&b.length===p){if(h||c)throw new De("Too many tab characters: &",n.nextToken);n.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}n.consume()}else if(E==="\\end"){_(),b.length===1&&D.type==="styling"&&D.body[0].body.length===0&&(O.length>1||!m)&&O.pop(),j.length<O.length+1&&j.push([]);break}else if(E==="\\\\"){n.consume();var z=void 0;n.gullet.future().text!==" "&&(z=n.parseSizeGroup(!0)),k.push(z?z.value:null),_(),j.push(bN(n)),b=[],O.push(b),M()}else throw new De("Expected & or \\\\ or \\cr or \\end",n.nextToken)}return n.gullet.endGroup(),n.gullet.endGroup(),{type:"array",mode:n.mode,addJot:s,arraystretch:l,body:O,cols:i,rowGaps:k,hskipBeforeAndAfter:r,hLinesBeforeRow:j,colSeparationType:c,tags:T,leqno:x}}function Q5(n){return n.slice(0,1)==="d"?"display":"text"}var Ca=function(e,t){var r,s,i=e.body.length,l=e.hLinesBeforeRow,c=0,u=new Array(i),h=[],m=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),p=1/t.fontMetrics().ptPerEm,x=5*p;if(e.colSeparationType&&e.colSeparationType==="small"){var v=t.havingStyle(at.SCRIPT).sizeMultiplier;x=.2778*(v/t.sizeMultiplier)}var b=e.colSeparationType==="CD"?Kn({number:3,unit:"ex"},t):12*p,O=3*p,k=e.arraystretch*b,j=.7*k,T=.3*k,M=0;function _(Jn){for(var nn=0;nn<Jn.length;++nn)nn>0&&(M+=.25),h.push({pos:M,isDashed:Jn[nn]})}for(_(l[0]),r=0;r<e.body.length;++r){var D=e.body[r],E=j,z=T;c<D.length&&(c=D.length);var Q=new Array(D.length);for(s=0;s<D.length;++s){var q=Xt(D[s],t);z<q.depth&&(z=q.depth),E<q.height&&(E=q.height),Q[s]=q}var B=e.rowGaps[r],U=0;B&&(U=Kn(B,t),U>0&&(U+=T,z<U&&(z=U),U=0)),e.addJot&&(z+=O),Q.height=E,Q.depth=z,M+=E,Q.pos=M,M+=z+U,u[r]=Q,_(l[r+1])}var V=M/2+t.fontMetrics().axisHeight,ce=e.cols||[],W=[],J,H,ae=[];if(e.tags&&e.tags.some(Jn=>Jn))for(r=0;r<i;++r){var ne=u[r],ue=ne.pos-V,R=e.tags[r],me=void 0;R===!0?me=ge.makeSpan(["eqn-num"],[],t):R===!1?me=ge.makeSpan([],[],t):me=ge.makeSpan([],Mr(R,t,!0),t),me.depth=ne.depth,me.height=ne.height,ae.push({type:"elem",elem:me,shift:ue})}for(s=0,H=0;s<c||H<ce.length;++s,++H){for(var Y=ce[H]||{},P=!0;Y.type==="separator";){if(P||(J=ge.makeSpan(["arraycolsep"],[]),J.style.width=Be(t.fontMetrics().doubleRuleSep),W.push(J)),Y.separator==="|"||Y.separator===":"){var K=Y.separator==="|"?"solid":"dashed",$=ge.makeSpan(["vertical-separator"],[],t);$.style.height=Be(M),$.style.borderRightWidth=Be(m),$.style.borderRightStyle=K,$.style.margin="0 "+Be(-m/2);var fe=M-V;fe&&($.style.verticalAlign=Be(-fe)),W.push($)}else throw new De("Invalid separator type: "+Y.separator);H++,Y=ce[H]||{},P=!1}if(!(s>=c)){var ye=void 0;(s>0||e.hskipBeforeAndAfter)&&(ye=tn.deflt(Y.pregap,x),ye!==0&&(J=ge.makeSpan(["arraycolsep"],[]),J.style.width=Be(ye),W.push(J)));var Re=[];for(r=0;r<i;++r){var de=u[r],We=de[s];if(We){var ct=de.pos-V;We.depth=de.depth,We.height=de.height,Re.push({type:"elem",elem:We,shift:ct})}}Re=ge.makeVList({positionType:"individualShift",children:Re},t),Re=ge.makeSpan(["col-align-"+(Y.align||"c")],[Re]),W.push(Re),(s<c-1||e.hskipBeforeAndAfter)&&(ye=tn.deflt(Y.postgap,x),ye!==0&&(J=ge.makeSpan(["arraycolsep"],[]),J.style.width=Be(ye),W.push(J)))}}if(u=ge.makeSpan(["mtable"],W),h.length>0){for(var ke=ge.makeLineSpan("hline",t,m),nt=ge.makeLineSpan("hdashline",t,m),ut=[{type:"elem",elem:u,shift:0}];h.length>0;){var Ct=h.pop(),Bn=Ct.pos-V;Ct.isDashed?ut.push({type:"elem",elem:nt,shift:Bn}):ut.push({type:"elem",elem:ke,shift:Bn})}u=ge.makeVList({positionType:"individualShift",children:ut},t)}if(ae.length===0)return ge.makeSpan(["mord"],[u],t);var Tn=ge.makeVList({positionType:"individualShift",children:ae},t);return Tn=ge.makeSpan(["tag"],[Tn],t),ge.makeFragment([u,Tn])},iue={c:"center ",l:"left ",r:"right "},Ta=function(e,t){for(var r=[],s=new _e.MathNode("mtd",[],["mtr-glue"]),i=new _e.MathNode("mtd",[],["mml-eqn-num"]),l=0;l<e.body.length;l++){for(var c=e.body[l],u=[],h=0;h<c.length;h++)u.push(new _e.MathNode("mtd",[Rn(c[h],t)]));e.tags&&e.tags[l]&&(u.unshift(s),u.push(s),e.leqno?u.unshift(i):u.push(i)),r.push(new _e.MathNode("mtr",u))}var m=new _e.MathNode("mtable",r),p=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);m.setAttribute("rowspacing",Be(p));var x="",v="";if(e.cols&&e.cols.length>0){var b=e.cols,O="",k=!1,j=0,T=b.length;b[0].type==="separator"&&(x+="top ",j=1),b[b.length-1].type==="separator"&&(x+="bottom ",T-=1);for(var M=j;M<T;M++)b[M].type==="align"?(v+=iue[b[M].align],k&&(O+="none "),k=!0):b[M].type==="separator"&&k&&(O+=b[M].separator==="|"?"solid ":"dashed ",k=!1);m.setAttribute("columnalign",v.trim()),/[sd]/.test(O)&&m.setAttribute("columnlines",O.trim())}if(e.colSeparationType==="align"){for(var _=e.cols||[],D="",E=1;E<_.length;E++)D+=E%2?"0em ":"1em ";m.setAttribute("columnspacing",D.trim())}else e.colSeparationType==="alignat"||e.colSeparationType==="gather"?m.setAttribute("columnspacing","0em"):e.colSeparationType==="small"?m.setAttribute("columnspacing","0.2778em"):e.colSeparationType==="CD"?m.setAttribute("columnspacing","0.5em"):m.setAttribute("columnspacing","1em");var z="",Q=e.hLinesBeforeRow;x+=Q[0].length>0?"left ":"",x+=Q[Q.length-1].length>0?"right ":"";for(var q=1;q<Q.length-1;q++)z+=Q[q].length===0?"none ":Q[q][0]?"dashed ":"solid ";return/[sd]/.test(z)&&m.setAttribute("rowlines",z.trim()),x!==""&&(m=new _e.MathNode("menclose",[m]),m.setAttribute("notation",x.trim())),e.arraystretch&&e.arraystretch<1&&(m=new _e.MathNode("mstyle",[m]),m.setAttribute("scriptlevel","1")),m},UR=function(e,t){e.envName.indexOf("ed")===-1&&Xx(e);var r=[],s=e.envName.indexOf("at")>-1?"alignat":"align",i=e.envName==="split",l=Mo(e.parser,{cols:r,addJot:!0,autoTag:i?void 0:q5(e.envName),emptySingleRow:!0,colSeparationType:s,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},"display"),c,u=0,h={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&t[0].type==="ordgroup"){for(var m="",p=0;p<t[0].body.length;p++){var x=Nt(t[0].body[p],"textord");m+=x.text}c=Number(m),u=c*2}var v=!u;l.body.forEach(function(j){for(var T=1;T<j.length;T+=2){var M=Nt(j[T],"styling"),_=Nt(M.body[0],"ordgroup");_.body.unshift(h)}if(v)u<j.length&&(u=j.length);else{var D=j.length/2;if(c<D)throw new De("Too many math in a row: "+("expected "+c+", but got "+D),j[0])}});for(var b=0;b<u;++b){var O="r",k=0;b%2===1?O="l":b>0&&v&&(k=1),r[b]={type:"align",align:O,pregap:k,postgap:0}}return l.colSeparationType=v?"align":"alignat",l};Na({type:"array",names:["array","darray"],props:{numArgs:1},handler(n,e){var t=Vx(e[0]),r=t?[e[0]]:Nt(e[0],"ordgroup").body,s=r.map(function(l){var c=P5(l),u=c.text;if("lcr".indexOf(u)!==-1)return{type:"align",align:u};if(u==="|")return{type:"separator",separator:"|"};if(u===":")return{type:"separator",separator:":"};throw new De("Unknown column alignment: "+u,l)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return Mo(n.parser,i,Q5(n.envName))},htmlBuilder:Ca,mathmlBuilder:Ta});Na({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(n){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[n.envName.replace("*","")],t="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(n.envName.charAt(n.envName.length-1)==="*"){var s=n.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),t=s.fetch().text,"lcr".indexOf(t)===-1)throw new De("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:t}]}}var i=Mo(n.parser,r,Q5(n.envName)),l=Math.max(0,...i.body.map(c=>c.length));return i.cols=new Array(l).fill({type:"align",align:t}),e?{type:"leftright",mode:n.mode,body:[i],left:e[0],right:e[1],rightColor:void 0}:i},htmlBuilder:Ca,mathmlBuilder:Ta});Na({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(n){var e={arraystretch:.5},t=Mo(n.parser,e,"script");return t.colSeparationType="small",t},htmlBuilder:Ca,mathmlBuilder:Ta});Na({type:"array",names:["subarray"],props:{numArgs:1},handler(n,e){var t=Vx(e[0]),r=t?[e[0]]:Nt(e[0],"ordgroup").body,s=r.map(function(l){var c=P5(l),u=c.text;if("lc".indexOf(u)!==-1)return{type:"align",align:u};throw new De("Unknown column alignment: "+u,l)});if(s.length>1)throw new De("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5};if(i=Mo(n.parser,i,"script"),i.body.length>0&&i.body[0].length>1)throw new De("{subarray} can contain only one column");return i},htmlBuilder:Ca,mathmlBuilder:Ta});Na({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(n){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=Mo(n.parser,e,Q5(n.envName));return{type:"leftright",mode:n.mode,body:[t],left:n.envName.indexOf("r")>-1?".":"\\{",right:n.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Ca,mathmlBuilder:Ta});Na({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:UR,htmlBuilder:Ca,mathmlBuilder:Ta});Na({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(n){["gather","gather*"].includes(n.envName)&&Xx(n);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:q5(n.envName),emptySingleRow:!0,leqno:n.parser.settings.leqno};return Mo(n.parser,e,"display")},htmlBuilder:Ca,mathmlBuilder:Ta});Na({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:UR,htmlBuilder:Ca,mathmlBuilder:Ta});Na({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(n){Xx(n);var e={autoTag:q5(n.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:n.parser.settings.leqno};return Mo(n.parser,e,"display")},htmlBuilder:Ca,mathmlBuilder:Ta});Na({type:"array",names:["CD"],props:{numArgs:0},handler(n){return Xx(n),Uce(n.parser)},htmlBuilder:Ca,mathmlBuilder:Ta});F("\\nonumber","\\gdef\\@eqnsw{0}");F("\\notag","\\nonumber");Qe({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(n,e){throw new De(n.funcName+" valid only within array environment")}});var wN=$R;Qe({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(n,e){var{parser:t,funcName:r}=n,s=e[0];if(s.type!=="ordgroup")throw new De("Invalid environment name",s);for(var i="",l=0;l<s.body.length;++l)i+=Nt(s.body[l],"textord").text;if(r==="\\begin"){if(!wN.hasOwnProperty(i))throw new De("No such environment: "+i,s);var c=wN[i],{args:u,optArgs:h}=t.parseArguments("\\begin{"+i+"}",c),m={mode:t.mode,envName:i,parser:t},p=c.handler(m,u,h);t.expect("\\end",!1);var x=t.nextToken,v=Nt(t.parseFunction(),"environment");if(v.name!==i)throw new De("Mismatch: \\begin{"+i+"} matched by \\end{"+v.name+"}",x);return p}return{type:"environment",mode:t.mode,name:i,nameGroup:s}}});var VR=(n,e)=>{var t=n.font,r=e.withFont(t);return Xt(n.body,r)},WR=(n,e)=>{var t=n.font,r=e.withFont(t);return Rn(n.body,r)},SN={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Qe({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(n,e)=>{var{parser:t,funcName:r}=n,s=Jg(e[0]),i=r;return i in SN&&(i=SN[i]),{type:"font",mode:t.mode,font:i.slice(1),body:s}},htmlBuilder:VR,mathmlBuilder:WR});Qe({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(n,e)=>{var{parser:t}=n,r=e[0],s=tn.isCharacterBox(r);return{type:"mclass",mode:t.mode,mclass:Wx(r),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:r}],isCharacterBox:s}}});Qe({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(n,e)=>{var{parser:t,funcName:r,breakOnTokenText:s}=n,{mode:i}=t,l=t.parseExpression(!0,s),c="math"+r.slice(1);return{type:"font",mode:i,font:c,body:{type:"ordgroup",mode:t.mode,body:l}}},htmlBuilder:VR,mathmlBuilder:WR});var GR=(n,e)=>{var t=e;return n==="display"?t=t.id>=at.SCRIPT.id?t.text():at.DISPLAY:n==="text"&&t.size===at.DISPLAY.size?t=at.TEXT:n==="script"?t=at.SCRIPT:n==="scriptscript"&&(t=at.SCRIPTSCRIPT),t},$5=(n,e)=>{var t=GR(n.size,e.style),r=t.fracNum(),s=t.fracDen(),i;i=e.havingStyle(r);var l=Xt(n.numer,i,e);if(n.continued){var c=8.5/e.fontMetrics().ptPerEm,u=3.5/e.fontMetrics().ptPerEm;l.height=l.height<c?c:l.height,l.depth=l.depth<u?u:l.depth}i=e.havingStyle(s);var h=Xt(n.denom,i,e),m,p,x;n.hasBarLine?(n.barSize?(p=Kn(n.barSize,e),m=ge.makeLineSpan("frac-line",e,p)):m=ge.makeLineSpan("frac-line",e),p=m.height,x=m.height):(m=null,p=0,x=e.fontMetrics().defaultRuleThickness);var v,b,O;t.size===at.DISPLAY.size||n.size==="display"?(v=e.fontMetrics().num1,p>0?b=3*x:b=7*x,O=e.fontMetrics().denom1):(p>0?(v=e.fontMetrics().num2,b=x):(v=e.fontMetrics().num3,b=3*x),O=e.fontMetrics().denom2);var k;if(m){var T=e.fontMetrics().axisHeight;v-l.depth-(T+.5*p)<b&&(v+=b-(v-l.depth-(T+.5*p))),T-.5*p-(h.height-O)<b&&(O+=b-(T-.5*p-(h.height-O)));var M=-(T-.5*p);k=ge.makeVList({positionType:"individualShift",children:[{type:"elem",elem:h,shift:O},{type:"elem",elem:m,shift:M},{type:"elem",elem:l,shift:-v}]},e)}else{var j=v-l.depth-(h.height-O);j<b&&(v+=.5*(b-j),O+=.5*(b-j)),k=ge.makeVList({positionType:"individualShift",children:[{type:"elem",elem:h,shift:O},{type:"elem",elem:l,shift:-v}]},e)}i=e.havingStyle(t),k.height*=i.sizeMultiplier/e.sizeMultiplier,k.depth*=i.sizeMultiplier/e.sizeMultiplier;var _;t.size===at.DISPLAY.size?_=e.fontMetrics().delim1:t.size===at.SCRIPTSCRIPT.size?_=e.havingStyle(at.SCRIPT).fontMetrics().delim2:_=e.fontMetrics().delim2;var D,E;return n.leftDelim==null?D=qf(e,["mopen"]):D=ul.customSizedDelim(n.leftDelim,_,!0,e.havingStyle(t),n.mode,["mopen"]),n.continued?E=ge.makeSpan([]):n.rightDelim==null?E=qf(e,["mclose"]):E=ul.customSizedDelim(n.rightDelim,_,!0,e.havingStyle(t),n.mode,["mclose"]),ge.makeSpan(["mord"].concat(i.sizingClasses(e)),[D,ge.makeSpan(["mfrac"],[k]),E],e)},H5=(n,e)=>{var t=new _e.MathNode("mfrac",[Rn(n.numer,e),Rn(n.denom,e)]);if(!n.hasBarLine)t.setAttribute("linethickness","0px");else if(n.barSize){var r=Kn(n.barSize,e);t.setAttribute("linethickness",Be(r))}var s=GR(n.size,e.style);if(s.size!==e.style.size){t=new _e.MathNode("mstyle",[t]);var i=s.size===at.DISPLAY.size?"true":"false";t.setAttribute("displaystyle",i),t.setAttribute("scriptlevel","0")}if(n.leftDelim!=null||n.rightDelim!=null){var l=[];if(n.leftDelim!=null){var c=new _e.MathNode("mo",[new _e.TextNode(n.leftDelim.replace("\\",""))]);c.setAttribute("fence","true"),l.push(c)}if(l.push(t),n.rightDelim!=null){var u=new _e.MathNode("mo",[new _e.TextNode(n.rightDelim.replace("\\",""))]);u.setAttribute("fence","true"),l.push(u)}return R5(l)}return t};Qe({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(n,e)=>{var{parser:t,funcName:r}=n,s=e[0],i=e[1],l,c=null,u=null,h="auto";switch(r){case"\\dfrac":case"\\frac":case"\\tfrac":l=!0;break;case"\\\\atopfrac":l=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":l=!1,c="(",u=")";break;case"\\\\bracefrac":l=!1,c="\\{",u="\\}";break;case"\\\\brackfrac":l=!1,c="[",u="]";break;default:throw new Error("Unrecognized genfrac command")}switch(r){case"\\dfrac":case"\\dbinom":h="display";break;case"\\tfrac":case"\\tbinom":h="text";break}return{type:"genfrac",mode:t.mode,continued:!1,numer:s,denom:i,hasBarLine:l,leftDelim:c,rightDelim:u,size:h,barSize:null}},htmlBuilder:$5,mathmlBuilder:H5});Qe({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(n,e)=>{var{parser:t,funcName:r}=n,s=e[0],i=e[1];return{type:"genfrac",mode:t.mode,continued:!0,numer:s,denom:i,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});Qe({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(n){var{parser:e,funcName:t,token:r}=n,s;switch(t){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:s,token:r}}});var ON=["display","text","script","scriptscript"],kN=function(e){var t=null;return e.length>0&&(t=e,t=t==="."?null:t),t};Qe({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(n,e){var{parser:t}=n,r=e[4],s=e[5],i=Jg(e[0]),l=i.type==="atom"&&i.family==="open"?kN(i.text):null,c=Jg(e[1]),u=c.type==="atom"&&c.family==="close"?kN(c.text):null,h=Nt(e[2],"size"),m,p=null;h.isBlank?m=!0:(p=h.value,m=p.number>0);var x="auto",v=e[3];if(v.type==="ordgroup"){if(v.body.length>0){var b=Nt(v.body[0],"textord");x=ON[Number(b.text)]}}else v=Nt(v,"textord"),x=ON[Number(v.text)];return{type:"genfrac",mode:t.mode,numer:r,denom:s,continued:!1,hasBarLine:m,barSize:p,leftDelim:l,rightDelim:u,size:x}},htmlBuilder:$5,mathmlBuilder:H5});Qe({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(n,e){var{parser:t,funcName:r,token:s}=n;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:Nt(e[0],"size").value,token:s}}});Qe({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(n,e)=>{var{parser:t,funcName:r}=n,s=e[0],i=zoe(Nt(e[1],"infix").size),l=e[2],c=i.number>0;return{type:"genfrac",mode:t.mode,numer:s,denom:l,continued:!1,hasBarLine:c,barSize:i,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:$5,mathmlBuilder:H5});var XR=(n,e)=>{var t=e.style,r,s;n.type==="supsub"?(r=n.sup?Xt(n.sup,e.havingStyle(t.sup()),e):Xt(n.sub,e.havingStyle(t.sub()),e),s=Nt(n.base,"horizBrace")):s=Nt(n,"horizBrace");var i=Xt(s.base,e.havingBaseStyle(at.DISPLAY)),l=vl.svgSpan(s,e),c;if(s.isOver?(c=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:l}]},e),c.children[0].children[0].children[1].classes.push("svg-align")):(c=ge.makeVList({positionType:"bottom",positionData:i.depth+.1+l.height,children:[{type:"elem",elem:l},{type:"kern",size:.1},{type:"elem",elem:i}]},e),c.children[0].children[0].children[0].classes.push("svg-align")),r){var u=ge.makeSpan(["mord",s.isOver?"mover":"munder"],[c],e);s.isOver?c=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:u},{type:"kern",size:.2},{type:"elem",elem:r}]},e):c=ge.makeVList({positionType:"bottom",positionData:u.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:u}]},e)}return ge.makeSpan(["mord",s.isOver?"mover":"munder"],[c],e)},aue=(n,e)=>{var t=vl.mathMLnode(n.label);return new _e.MathNode(n.isOver?"mover":"munder",[Rn(n.base,e),t])};Qe({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(n,e){var{parser:t,funcName:r}=n;return{type:"horizBrace",mode:t.mode,label:r,isOver:/^\\over/.test(r),base:e[0]}},htmlBuilder:XR,mathmlBuilder:aue});Qe({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(n,e)=>{var{parser:t}=n,r=e[1],s=Nt(e[0],"url").url;return t.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:t.mode,href:s,body:ar(r)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(n,e)=>{var t=Mr(n.body,e,!1);return ge.makeAnchor(n.href,[],t,e)},mathmlBuilder:(n,e)=>{var t=bo(n.body,e);return t instanceof ti||(t=new ti("mrow",[t])),t.setAttribute("href",n.href),t}});Qe({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(n,e)=>{var{parser:t}=n,r=Nt(e[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:r}))return t.formatUnsupportedCmd("\\url");for(var s=[],i=0;i<r.length;i++){var l=r[i];l==="~"&&(l="\\textasciitilde"),s.push({type:"textord",mode:"text",text:l})}var c={type:"text",mode:t.mode,font:"\\texttt",body:s};return{type:"href",mode:t.mode,href:r,body:ar(c)}}});Qe({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(n,e){var{parser:t}=n;return{type:"hbox",mode:t.mode,body:ar(e[0])}},htmlBuilder(n,e){var t=Mr(n.body,e,!1);return ge.makeFragment(t)},mathmlBuilder(n,e){return new _e.MathNode("mrow",Fs(n.body,e))}});Qe({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(n,e)=>{var{parser:t,funcName:r,token:s}=n,i=Nt(e[0],"raw").string,l=e[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var c,u={};switch(r){case"\\htmlClass":u.class=i,c={command:"\\htmlClass",class:i};break;case"\\htmlId":u.id=i,c={command:"\\htmlId",id:i};break;case"\\htmlStyle":u.style=i,c={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var h=i.split(","),m=0;m<h.length;m++){var p=h[m].split("=");if(p.length!==2)throw new De("Error parsing key-value for \\htmlData");u["data-"+p[0].trim()]=p[1].trim()}c={command:"\\htmlData",attributes:u};break}default:throw new Error("Unrecognized html command")}return t.settings.isTrusted(c)?{type:"html",mode:t.mode,attributes:u,body:ar(l)}:t.formatUnsupportedCmd(r)},htmlBuilder:(n,e)=>{var t=Mr(n.body,e,!1),r=["enclosing"];n.attributes.class&&r.push(...n.attributes.class.trim().split(/\s+/));var s=ge.makeSpan(r,t,e);for(var i in n.attributes)i!=="class"&&n.attributes.hasOwnProperty(i)&&s.setAttribute(i,n.attributes[i]);return s},mathmlBuilder:(n,e)=>bo(n.body,e)});Qe({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(n,e)=>{var{parser:t}=n;return{type:"htmlmathml",mode:t.mode,html:ar(e[0]),mathml:ar(e[1])}},htmlBuilder:(n,e)=>{var t=Mr(n.html,e,!1);return ge.makeFragment(t)},mathmlBuilder:(n,e)=>bo(n.mathml,e)});var qb=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new De("Invalid size: '"+e+"' in \\includegraphics");var r={number:+(t[1]+t[2]),unit:t[3]};if(!mR(r))throw new De("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};Qe({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(n,e,t)=>{var{parser:r}=n,s={number:0,unit:"em"},i={number:.9,unit:"em"},l={number:0,unit:"em"},c="";if(t[0])for(var u=Nt(t[0],"raw").string,h=u.split(","),m=0;m<h.length;m++){var p=h[m].split("=");if(p.length===2){var x=p[1].trim();switch(p[0].trim()){case"alt":c=x;break;case"width":s=qb(x);break;case"height":i=qb(x);break;case"totalheight":l=qb(x);break;default:throw new De("Invalid key: '"+p[0]+"' in \\includegraphics.")}}}var v=Nt(e[0],"url").url;return c===""&&(c=v,c=c.replace(/^.*[\\/]/,""),c=c.substring(0,c.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:v})?{type:"includegraphics",mode:r.mode,alt:c,width:s,height:i,totalheight:l,src:v}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(n,e)=>{var t=Kn(n.height,e),r=0;n.totalheight.number>0&&(r=Kn(n.totalheight,e)-t);var s=0;n.width.number>0&&(s=Kn(n.width,e));var i={height:Be(t+r)};s>0&&(i.width=Be(s)),r>0&&(i.verticalAlign=Be(-r));var l=new ace(n.src,n.alt,i);return l.height=t,l.depth=r,l},mathmlBuilder:(n,e)=>{var t=new _e.MathNode("mglyph",[]);t.setAttribute("alt",n.alt);var r=Kn(n.height,e),s=0;if(n.totalheight.number>0&&(s=Kn(n.totalheight,e)-r,t.setAttribute("valign",Be(-s))),t.setAttribute("height",Be(r+s)),n.width.number>0){var i=Kn(n.width,e);t.setAttribute("width",Be(i))}return t.setAttribute("src",n.src),t}});Qe({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(n,e){var{parser:t,funcName:r}=n,s=Nt(e[0],"size");if(t.settings.strict){var i=r[1]==="m",l=s.value.unit==="mu";i?(l||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):l&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:s.value}},htmlBuilder(n,e){return ge.makeGlue(n.dimension,e)},mathmlBuilder(n,e){var t=Kn(n.dimension,e);return new _e.SpaceNode(t)}});Qe({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(n,e)=>{var{parser:t,funcName:r}=n,s=e[0];return{type:"lap",mode:t.mode,alignment:r.slice(5),body:s}},htmlBuilder:(n,e)=>{var t;n.alignment==="clap"?(t=ge.makeSpan([],[Xt(n.body,e)]),t=ge.makeSpan(["inner"],[t],e)):t=ge.makeSpan(["inner"],[Xt(n.body,e)]);var r=ge.makeSpan(["fix"],[]),s=ge.makeSpan([n.alignment],[t,r],e),i=ge.makeSpan(["strut"]);return i.style.height=Be(s.height+s.depth),s.depth&&(i.style.verticalAlign=Be(-s.depth)),s.children.unshift(i),s=ge.makeSpan(["thinbox"],[s],e),ge.makeSpan(["mord","vbox"],[s],e)},mathmlBuilder:(n,e)=>{var t=new _e.MathNode("mpadded",[Rn(n.body,e)]);if(n.alignment!=="rlap"){var r=n.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",r+"width")}return t.setAttribute("width","0px"),t}});Qe({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(n,e){var{funcName:t,parser:r}=n,s=r.mode;r.switchMode("math");var i=t==="\\("?"\\)":"$",l=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",body:l}}});Qe({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(n,e){throw new De("Mismatched "+n.funcName)}});var jN=(n,e)=>{switch(e.style.size){case at.DISPLAY.size:return n.display;case at.TEXT.size:return n.text;case at.SCRIPT.size:return n.script;case at.SCRIPTSCRIPT.size:return n.scriptscript;default:return n.text}};Qe({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(n,e)=>{var{parser:t}=n;return{type:"mathchoice",mode:t.mode,display:ar(e[0]),text:ar(e[1]),script:ar(e[2]),scriptscript:ar(e[3])}},htmlBuilder:(n,e)=>{var t=jN(n,e),r=Mr(t,e,!1);return ge.makeFragment(r)},mathmlBuilder:(n,e)=>{var t=jN(n,e);return bo(t,e)}});var YR=(n,e,t,r,s,i,l)=>{n=ge.makeSpan([],[n]);var c=t&&tn.isCharacterBox(t),u,h;if(e){var m=Xt(e,r.havingStyle(s.sup()),r);h={elem:m,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-m.depth)}}if(t){var p=Xt(t,r.havingStyle(s.sub()),r);u={elem:p,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-p.height)}}var x;if(h&&u){var v=r.fontMetrics().bigOpSpacing5+u.elem.height+u.elem.depth+u.kern+n.depth+l;x=ge.makeVList({positionType:"bottom",positionData:v,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:Be(-i)},{type:"kern",size:u.kern},{type:"elem",elem:n},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:Be(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(u){var b=n.height-l;x=ge.makeVList({positionType:"top",positionData:b,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:u.elem,marginLeft:Be(-i)},{type:"kern",size:u.kern},{type:"elem",elem:n}]},r)}else if(h){var O=n.depth+l;x=ge.makeVList({positionType:"bottom",positionData:O,children:[{type:"elem",elem:n},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:Be(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else return n;var k=[x];if(u&&i!==0&&!c){var j=ge.makeSpan(["mspace"],[],r);j.style.marginRight=Be(i),k.unshift(j)}return ge.makeSpan(["mop","op-limits"],k,r)},KR=["\\smallint"],Pd=(n,e)=>{var t,r,s=!1,i;n.type==="supsub"?(t=n.sup,r=n.sub,i=Nt(n.base,"op"),s=!0):i=Nt(n,"op");var l=e.style,c=!1;l.size===at.DISPLAY.size&&i.symbol&&!KR.includes(i.name)&&(c=!0);var u;if(i.symbol){var h=c?"Size2-Regular":"Size1-Regular",m="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(m=i.name.slice(1),i.name=m==="oiint"?"\\iint":"\\iiint"),u=ge.makeSymbol(i.name,h,"math",e,["mop","op-symbol",c?"large-op":"small-op"]),m.length>0){var p=u.italic,x=ge.staticSvg(m+"Size"+(c?"2":"1"),e);u=ge.makeVList({positionType:"individualShift",children:[{type:"elem",elem:u,shift:0},{type:"elem",elem:x,shift:c?.08:0}]},e),i.name="\\"+m,u.classes.unshift("mop"),u.italic=p}}else if(i.body){var v=Mr(i.body,e,!0);v.length===1&&v[0]instanceof Ti?(u=v[0],u.classes[0]="mop"):u=ge.makeSpan(["mop"],v,e)}else{for(var b=[],O=1;O<i.name.length;O++)b.push(ge.mathsym(i.name[O],i.mode,e));u=ge.makeSpan(["mop"],b,e)}var k=0,j=0;return(u instanceof Ti||i.name==="\\oiint"||i.name==="\\oiiint")&&!i.suppressBaseShift&&(k=(u.height-u.depth)/2-e.fontMetrics().axisHeight,j=u.italic),s?YR(u,t,r,e,l,j,k):(k&&(u.style.position="relative",u.style.top=Be(k)),u)},k0=(n,e)=>{var t;if(n.symbol)t=new ti("mo",[Mi(n.name,n.mode)]),KR.includes(n.name)&&t.setAttribute("largeop","false");else if(n.body)t=new ti("mo",Fs(n.body,e));else{t=new ti("mi",[new pa(n.name.slice(1))]);var r=new ti("mo",[Mi("","text")]);n.parentIsSupSub?t=new ti("mrow",[t,r]):t=jR([t,r])}return t},lue={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Qe({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(n,e)=>{var{parser:t,funcName:r}=n,s=r;return s.length===1&&(s=lue[s]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:Pd,mathmlBuilder:k0});Qe({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(n,e)=>{var{parser:t}=n,r=e[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:ar(r)}},htmlBuilder:Pd,mathmlBuilder:k0});var oue={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Qe({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(n){var{parser:e,funcName:t}=n;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Pd,mathmlBuilder:k0});Qe({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(n){var{parser:e,funcName:t}=n;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Pd,mathmlBuilder:k0});Qe({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(n){var{parser:e,funcName:t}=n,r=t;return r.length===1&&(r=oue[r]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Pd,mathmlBuilder:k0});var ZR=(n,e)=>{var t,r,s=!1,i;n.type==="supsub"?(t=n.sup,r=n.sub,i=Nt(n.base,"operatorname"),s=!0):i=Nt(n,"operatorname");var l;if(i.body.length>0){for(var c=i.body.map(p=>{var x=p.text;return typeof x=="string"?{type:"textord",mode:p.mode,text:x}:p}),u=Mr(c,e.withFont("mathrm"),!0),h=0;h<u.length;h++){var m=u[h];m instanceof Ti&&(m.text=m.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}l=ge.makeSpan(["mop"],u,e)}else l=ge.makeSpan(["mop"],[],e);return s?YR(l,t,r,e,e.style,0,0):l},cue=(n,e)=>{for(var t=Fs(n.body,e.withFont("mathrm")),r=!0,s=0;s<t.length;s++){var i=t[s];if(!(i instanceof _e.SpaceNode))if(i instanceof _e.MathNode)switch(i.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var l=i.children[0];i.children.length===1&&l instanceof _e.TextNode?l.text=l.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break}default:r=!1}else r=!1}if(r){var c=t.map(m=>m.toText()).join("");t=[new _e.TextNode(c)]}var u=new _e.MathNode("mi",t);u.setAttribute("mathvariant","normal");var h=new _e.MathNode("mo",[Mi("","text")]);return n.parentIsSupSub?new _e.MathNode("mrow",[u,h]):_e.newDocumentFragment([u,h])};Qe({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(n,e)=>{var{parser:t,funcName:r}=n,s=e[0];return{type:"operatorname",mode:t.mode,body:ar(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:ZR,mathmlBuilder:cue});F("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Rc({type:"ordgroup",htmlBuilder(n,e){return n.semisimple?ge.makeFragment(Mr(n.body,e,!1)):ge.makeSpan(["mord"],Mr(n.body,e,!0),e)},mathmlBuilder(n,e){return bo(n.body,e,!0)}});Qe({type:"overline",names:["\\overline"],props:{numArgs:1},handler(n,e){var{parser:t}=n,r=e[0];return{type:"overline",mode:t.mode,body:r}},htmlBuilder(n,e){var t=Xt(n.body,e.havingCrampedStyle()),r=ge.makeLineSpan("overline-line",e),s=e.fontMetrics().defaultRuleThickness,i=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]},e);return ge.makeSpan(["mord","overline"],[i],e)},mathmlBuilder(n,e){var t=new _e.MathNode("mo",[new _e.TextNode("‾")]);t.setAttribute("stretchy","true");var r=new _e.MathNode("mover",[Rn(n.body,e),t]);return r.setAttribute("accent","true"),r}});Qe({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(n,e)=>{var{parser:t}=n,r=e[0];return{type:"phantom",mode:t.mode,body:ar(r)}},htmlBuilder:(n,e)=>{var t=Mr(n.body,e.withPhantom(),!1);return ge.makeFragment(t)},mathmlBuilder:(n,e)=>{var t=Fs(n.body,e);return new _e.MathNode("mphantom",t)}});Qe({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(n,e)=>{var{parser:t}=n,r=e[0];return{type:"hphantom",mode:t.mode,body:r}},htmlBuilder:(n,e)=>{var t=ge.makeSpan([],[Xt(n.body,e.withPhantom())]);if(t.height=0,t.depth=0,t.children)for(var r=0;r<t.children.length;r++)t.children[r].height=0,t.children[r].depth=0;return t=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t}]},e),ge.makeSpan(["mord"],[t],e)},mathmlBuilder:(n,e)=>{var t=Fs(ar(n.body),e),r=new _e.MathNode("mphantom",t),s=new _e.MathNode("mpadded",[r]);return s.setAttribute("height","0px"),s.setAttribute("depth","0px"),s}});Qe({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(n,e)=>{var{parser:t}=n,r=e[0];return{type:"vphantom",mode:t.mode,body:r}},htmlBuilder:(n,e)=>{var t=ge.makeSpan(["inner"],[Xt(n.body,e.withPhantom())]),r=ge.makeSpan(["fix"],[]);return ge.makeSpan(["mord","rlap"],[t,r],e)},mathmlBuilder:(n,e)=>{var t=Fs(ar(n.body),e),r=new _e.MathNode("mphantom",t),s=new _e.MathNode("mpadded",[r]);return s.setAttribute("width","0px"),s}});Qe({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(n,e){var{parser:t}=n,r=Nt(e[0],"size").value,s=e[1];return{type:"raisebox",mode:t.mode,dy:r,body:s}},htmlBuilder(n,e){var t=Xt(n.body,e),r=Kn(n.dy,e);return ge.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(n,e){var t=new _e.MathNode("mpadded",[Rn(n.body,e)]),r=n.dy.number+n.dy.unit;return t.setAttribute("voffset",r),t}});Qe({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(n){var{parser:e}=n;return{type:"internal",mode:e.mode}}});Qe({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(n,e,t){var{parser:r}=n,s=t[0],i=Nt(e[0],"size"),l=Nt(e[1],"size");return{type:"rule",mode:r.mode,shift:s&&Nt(s,"size").value,width:i.value,height:l.value}},htmlBuilder(n,e){var t=ge.makeSpan(["mord","rule"],[],e),r=Kn(n.width,e),s=Kn(n.height,e),i=n.shift?Kn(n.shift,e):0;return t.style.borderRightWidth=Be(r),t.style.borderTopWidth=Be(s),t.style.bottom=Be(i),t.width=r,t.height=s+i,t.depth=-i,t.maxFontSize=s*1.125*e.sizeMultiplier,t},mathmlBuilder(n,e){var t=Kn(n.width,e),r=Kn(n.height,e),s=n.shift?Kn(n.shift,e):0,i=e.color&&e.getColor()||"black",l=new _e.MathNode("mspace");l.setAttribute("mathbackground",i),l.setAttribute("width",Be(t)),l.setAttribute("height",Be(r));var c=new _e.MathNode("mpadded",[l]);return s>=0?c.setAttribute("height",Be(s)):(c.setAttribute("height",Be(s)),c.setAttribute("depth",Be(-s))),c.setAttribute("voffset",Be(s)),c}});function JR(n,e,t){for(var r=Mr(n,e,!1),s=e.sizeMultiplier/t.sizeMultiplier,i=0;i<r.length;i++){var l=r[i].classes.indexOf("sizing");l<0?Array.prototype.push.apply(r[i].classes,e.sizingClasses(t)):r[i].classes[l+1]==="reset-size"+e.size&&(r[i].classes[l+1]="reset-size"+t.size),r[i].height*=s,r[i].depth*=s}return ge.makeFragment(r)}var NN=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],uue=(n,e)=>{var t=e.havingSize(n.size);return JR(n.body,t,e)};Qe({type:"sizing",names:NN,props:{numArgs:0,allowedInText:!0},handler:(n,e)=>{var{breakOnTokenText:t,funcName:r,parser:s}=n,i=s.parseExpression(!1,t);return{type:"sizing",mode:s.mode,size:NN.indexOf(r)+1,body:i}},htmlBuilder:uue,mathmlBuilder:(n,e)=>{var t=e.havingSize(n.size),r=Fs(n.body,t),s=new _e.MathNode("mstyle",r);return s.setAttribute("mathsize",Be(t.sizeMultiplier)),s}});Qe({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(n,e,t)=>{var{parser:r}=n,s=!1,i=!1,l=t[0]&&Nt(t[0],"ordgroup");if(l)for(var c="",u=0;u<l.body.length;++u){var h=l.body[u];if(c=h.text,c==="t")s=!0;else if(c==="b")i=!0;else{s=!1,i=!1;break}}else s=!0,i=!0;var m=e[0];return{type:"smash",mode:r.mode,body:m,smashHeight:s,smashDepth:i}},htmlBuilder:(n,e)=>{var t=ge.makeSpan([],[Xt(n.body,e)]);if(!n.smashHeight&&!n.smashDepth)return t;if(n.smashHeight&&(t.height=0,t.children))for(var r=0;r<t.children.length;r++)t.children[r].height=0;if(n.smashDepth&&(t.depth=0,t.children))for(var s=0;s<t.children.length;s++)t.children[s].depth=0;var i=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t}]},e);return ge.makeSpan(["mord"],[i],e)},mathmlBuilder:(n,e)=>{var t=new _e.MathNode("mpadded",[Rn(n.body,e)]);return n.smashHeight&&t.setAttribute("height","0px"),n.smashDepth&&t.setAttribute("depth","0px"),t}});Qe({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(n,e,t){var{parser:r}=n,s=t[0],i=e[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(n,e){var t=Xt(n.body,e.havingCrampedStyle());t.height===0&&(t.height=e.fontMetrics().xHeight),t=ge.wrapFragment(t,e);var r=e.fontMetrics(),s=r.defaultRuleThickness,i=s;e.style.id<at.TEXT.id&&(i=e.fontMetrics().xHeight);var l=s+i/4,c=t.height+t.depth+l+s,{span:u,ruleWidth:h,advanceWidth:m}=ul.sqrtImage(c,e),p=u.height-h;p>t.height+t.depth+l&&(l=(l+p-t.height-t.depth)/2);var x=u.height-t.height-l-h;t.style.paddingLeft=Be(m);var v=ge.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+x)},{type:"elem",elem:u},{type:"kern",size:h}]},e);if(n.index){var b=e.havingStyle(at.SCRIPTSCRIPT),O=Xt(n.index,b,e),k=.6*(v.height-v.depth),j=ge.makeVList({positionType:"shift",positionData:-k,children:[{type:"elem",elem:O}]},e),T=ge.makeSpan(["root"],[j]);return ge.makeSpan(["mord","sqrt"],[T,v],e)}else return ge.makeSpan(["mord","sqrt"],[v],e)},mathmlBuilder(n,e){var{body:t,index:r}=n;return r?new _e.MathNode("mroot",[Rn(t,e),Rn(r,e)]):new _e.MathNode("msqrt",[Rn(t,e)])}});var CN={display:at.DISPLAY,text:at.TEXT,script:at.SCRIPT,scriptscript:at.SCRIPTSCRIPT};Qe({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(n,e){var{breakOnTokenText:t,funcName:r,parser:s}=n,i=s.parseExpression(!0,t),l=r.slice(1,r.length-5);return{type:"styling",mode:s.mode,style:l,body:i}},htmlBuilder(n,e){var t=CN[n.style],r=e.havingStyle(t).withFont("");return JR(n.body,r,e)},mathmlBuilder(n,e){var t=CN[n.style],r=e.havingStyle(t),s=Fs(n.body,r),i=new _e.MathNode("mstyle",s),l={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},c=l[n.style];return i.setAttribute("scriptlevel",c[0]),i.setAttribute("displaystyle",c[1]),i}});var due=function(e,t){var r=e.base;if(r)if(r.type==="op"){var s=r.limits&&(t.style.size===at.DISPLAY.size||r.alwaysHandleSupSub);return s?Pd:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(t.style.size===at.DISPLAY.size||r.limits);return i?ZR:null}else{if(r.type==="accent")return tn.isCharacterBox(r.base)?L5:null;if(r.type==="horizBrace"){var l=!e.sub;return l===r.isOver?XR:null}else return null}else return null};Rc({type:"supsub",htmlBuilder(n,e){var t=due(n,e);if(t)return t(n,e);var{base:r,sup:s,sub:i}=n,l=Xt(r,e),c,u,h=e.fontMetrics(),m=0,p=0,x=r&&tn.isCharacterBox(r);if(s){var v=e.havingStyle(e.style.sup());c=Xt(s,v,e),x||(m=l.height-v.fontMetrics().supDrop*v.sizeMultiplier/e.sizeMultiplier)}if(i){var b=e.havingStyle(e.style.sub());u=Xt(i,b,e),x||(p=l.depth+b.fontMetrics().subDrop*b.sizeMultiplier/e.sizeMultiplier)}var O;e.style===at.DISPLAY?O=h.sup1:e.style.cramped?O=h.sup3:O=h.sup2;var k=e.sizeMultiplier,j=Be(.5/h.ptPerEm/k),T=null;if(u){var M=n.base&&n.base.type==="op"&&n.base.name&&(n.base.name==="\\oiint"||n.base.name==="\\oiiint");(l instanceof Ti||M)&&(T=Be(-l.italic))}var _;if(c&&u){m=Math.max(m,O,c.depth+.25*h.xHeight),p=Math.max(p,h.sub2);var D=h.defaultRuleThickness,E=4*D;if(m-c.depth-(u.height-p)<E){p=E-(m-c.depth)+u.height;var z=.8*h.xHeight-(m-c.depth);z>0&&(m+=z,p-=z)}var Q=[{type:"elem",elem:u,shift:p,marginRight:j,marginLeft:T},{type:"elem",elem:c,shift:-m,marginRight:j}];_=ge.makeVList({positionType:"individualShift",children:Q},e)}else if(u){p=Math.max(p,h.sub1,u.height-.8*h.xHeight);var q=[{type:"elem",elem:u,marginLeft:T,marginRight:j}];_=ge.makeVList({positionType:"shift",positionData:p,children:q},e)}else if(c)m=Math.max(m,O,c.depth+.25*h.xHeight),_=ge.makeVList({positionType:"shift",positionData:-m,children:[{type:"elem",elem:c,marginRight:j}]},e);else throw new Error("supsub must have either sup or sub.");var B=T4(l,"right")||"mord";return ge.makeSpan([B],[l,ge.makeSpan(["msupsub"],[_])],e)},mathmlBuilder(n,e){var t=!1,r,s;n.base&&n.base.type==="horizBrace"&&(s=!!n.sup,s===n.base.isOver&&(t=!0,r=n.base.isOver)),n.base&&(n.base.type==="op"||n.base.type==="operatorname")&&(n.base.parentIsSupSub=!0);var i=[Rn(n.base,e)];n.sub&&i.push(Rn(n.sub,e)),n.sup&&i.push(Rn(n.sup,e));var l;if(t)l=r?"mover":"munder";else if(n.sub)if(n.sup){var h=n.base;h&&h.type==="op"&&h.limits&&e.style===at.DISPLAY||h&&h.type==="operatorname"&&h.alwaysHandleSupSub&&(e.style===at.DISPLAY||h.limits)?l="munderover":l="msubsup"}else{var u=n.base;u&&u.type==="op"&&u.limits&&(e.style===at.DISPLAY||u.alwaysHandleSupSub)||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(u.limits||e.style===at.DISPLAY)?l="munder":l="msub"}else{var c=n.base;c&&c.type==="op"&&c.limits&&(e.style===at.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||e.style===at.DISPLAY)?l="mover":l="msup"}return new _e.MathNode(l,i)}});Rc({type:"atom",htmlBuilder(n,e){return ge.mathsym(n.text,n.mode,e,["m"+n.family])},mathmlBuilder(n,e){var t=new _e.MathNode("mo",[Mi(n.text,n.mode)]);if(n.family==="bin"){var r=z5(n,e);r==="bold-italic"&&t.setAttribute("mathvariant",r)}else n.family==="punct"?t.setAttribute("separator","true"):(n.family==="open"||n.family==="close")&&t.setAttribute("stretchy","false");return t}});var ez={mi:"italic",mn:"normal",mtext:"normal"};Rc({type:"mathord",htmlBuilder(n,e){return ge.makeOrd(n,e,"mathord")},mathmlBuilder(n,e){var t=new _e.MathNode("mi",[Mi(n.text,n.mode,e)]),r=z5(n,e)||"italic";return r!==ez[t.type]&&t.setAttribute("mathvariant",r),t}});Rc({type:"textord",htmlBuilder(n,e){return ge.makeOrd(n,e,"textord")},mathmlBuilder(n,e){var t=Mi(n.text,n.mode,e),r=z5(n,e)||"normal",s;return n.mode==="text"?s=new _e.MathNode("mtext",[t]):/[0-9]/.test(n.text)?s=new _e.MathNode("mn",[t]):n.text==="\\prime"?s=new _e.MathNode("mo",[t]):s=new _e.MathNode("mi",[t]),r!==ez[s.type]&&s.setAttribute("mathvariant",r),s}});var Qb={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},$b={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Rc({type:"spacing",htmlBuilder(n,e){if($b.hasOwnProperty(n.text)){var t=$b[n.text].className||"";if(n.mode==="text"){var r=ge.makeOrd(n,e,"textord");return r.classes.push(t),r}else return ge.makeSpan(["mspace",t],[ge.mathsym(n.text,n.mode,e)],e)}else{if(Qb.hasOwnProperty(n.text))return ge.makeSpan(["mspace",Qb[n.text]],[],e);throw new De('Unknown type of space "'+n.text+'"')}},mathmlBuilder(n,e){var t;if($b.hasOwnProperty(n.text))t=new _e.MathNode("mtext",[new _e.TextNode(" ")]);else{if(Qb.hasOwnProperty(n.text))return new _e.MathNode("mspace");throw new De('Unknown type of space "'+n.text+'"')}return t}});var TN=()=>{var n=new _e.MathNode("mtd",[]);return n.setAttribute("width","50%"),n};Rc({type:"tag",mathmlBuilder(n,e){var t=new _e.MathNode("mtable",[new _e.MathNode("mtr",[TN(),new _e.MathNode("mtd",[bo(n.body,e)]),TN(),new _e.MathNode("mtd",[bo(n.tag,e)])])]);return t.setAttribute("width","100%"),t}});var MN={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},AN={"\\textbf":"textbf","\\textmd":"textmd"},hue={"\\textit":"textit","\\textup":"textup"},EN=(n,e)=>{var t=n.font;if(t){if(MN[t])return e.withTextFontFamily(MN[t]);if(AN[t])return e.withTextFontWeight(AN[t]);if(t==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(hue[t])};Qe({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(n,e){var{parser:t,funcName:r}=n,s=e[0];return{type:"text",mode:t.mode,body:ar(s),font:r}},htmlBuilder(n,e){var t=EN(n,e),r=Mr(n.body,t,!0);return ge.makeSpan(["mord","text"],r,t)},mathmlBuilder(n,e){var t=EN(n,e);return bo(n.body,t)}});Qe({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(n,e){var{parser:t}=n;return{type:"underline",mode:t.mode,body:e[0]}},htmlBuilder(n,e){var t=Xt(n.body,e),r=ge.makeLineSpan("underline-line",e),s=e.fontMetrics().defaultRuleThickness,i=ge.makeVList({positionType:"top",positionData:t.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:t}]},e);return ge.makeSpan(["mord","underline"],[i],e)},mathmlBuilder(n,e){var t=new _e.MathNode("mo",[new _e.TextNode("‾")]);t.setAttribute("stretchy","true");var r=new _e.MathNode("munder",[Rn(n.body,e),t]);return r.setAttribute("accentunder","true"),r}});Qe({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(n,e){var{parser:t}=n;return{type:"vcenter",mode:t.mode,body:e[0]}},htmlBuilder(n,e){var t=Xt(n.body,e),r=e.fontMetrics().axisHeight,s=.5*(t.height-r-(t.depth+r));return ge.makeVList({positionType:"shift",positionData:s,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(n,e){return new _e.MathNode("mpadded",[Rn(n.body,e)],["vcenter"])}});Qe({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(n,e,t){throw new De("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(n,e){for(var t=_N(n),r=[],s=e.havingStyle(e.style.text()),i=0;i<t.length;i++){var l=t[i];l==="~"&&(l="\\textasciitilde"),r.push(ge.makeSymbol(l,"Typewriter-Regular",n.mode,s,["mord","texttt"]))}return ge.makeSpan(["mord","text"].concat(s.sizingClasses(e)),ge.tryCombineChars(r),s)},mathmlBuilder(n,e){var t=new _e.TextNode(_N(n)),r=new _e.MathNode("mtext",[t]);return r.setAttribute("mathvariant","monospace"),r}});var _N=n=>n.body.replace(/ /g,n.star?"␣":" "),so=OR,tz=`[ \r
|
||
]`,fue="\\\\[a-zA-Z@]+",mue="\\\\[^\uD800-\uDFFF]",pue="("+fue+")"+tz+"*",gue=`\\\\(
|
||
|[ \r ]+
|
||
?)[ \r ]*`,_4="[̀-ͯ]",xue=new RegExp(_4+"+$"),vue="("+tz+"+)|"+(gue+"|")+"([!-\\[\\]-‧-豈-]"+(_4+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(_4+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+pue)+("|"+mue+")");class DN{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(vue,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new si("EOF",new Ts(this,t,t));var r=this.tokenRegex.exec(e);if(r===null||r.index!==t)throw new De("Unexpected character: '"+e[t]+"'",new si(e[t],new Ts(this,t,t+1)));var s=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[s]===14){var i=e.indexOf(`
|
||
`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new si(s,new Ts(this,t,this.tokenRegex.lastIndex))}}class yue{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new De("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,r){if(r===void 0&&(r=!1),r){for(var s=0;s<this.undefStack.length;s++)delete this.undefStack[s][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}}var bue=HR;F("\\noexpand",function(n){var e=n.popToken();return n.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});F("\\expandafter",function(n){var e=n.popToken();return n.expandOnce(!0),{tokens:[e],numArgs:0}});F("\\@firstoftwo",function(n){var e=n.consumeArgs(2);return{tokens:e[0],numArgs:0}});F("\\@secondoftwo",function(n){var e=n.consumeArgs(2);return{tokens:e[1],numArgs:0}});F("\\@ifnextchar",function(n){var e=n.consumeArgs(3);n.consumeSpaces();var t=n.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});F("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");F("\\TextOrMath",function(n){var e=n.consumeArgs(2);return n.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var RN={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};F("\\char",function(n){var e=n.popToken(),t,r="";if(e.text==="'")t=8,e=n.popToken();else if(e.text==='"')t=16,e=n.popToken();else if(e.text==="`")if(e=n.popToken(),e.text[0]==="\\")r=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new De("\\char` missing argument");r=e.text.charCodeAt(0)}else t=10;if(t){if(r=RN[e.text],r==null||r>=t)throw new De("Invalid base-"+t+" digit "+e.text);for(var s;(s=RN[n.future().text])!=null&&s<t;)r*=t,r+=s,n.popToken()}return"\\@char{"+r+"}"});var U5=(n,e,t,r)=>{var s=n.consumeArg().tokens;if(s.length!==1)throw new De("\\newcommand's first argument must be a macro name");var i=s[0].text,l=n.isDefined(i);if(l&&!e)throw new De("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!l&&!t)throw new De("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var c=0;if(s=n.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var u="",h=n.expandNextToken();h.text!=="]"&&h.text!=="EOF";)u+=h.text,h=n.expandNextToken();if(!u.match(/^\s*[0-9]+\s*$/))throw new De("Invalid number of arguments: "+u);c=parseInt(u),s=n.consumeArg().tokens}return l&&r||n.macros.set(i,{tokens:s,numArgs:c}),""};F("\\newcommand",n=>U5(n,!1,!0,!1));F("\\renewcommand",n=>U5(n,!0,!1,!1));F("\\providecommand",n=>U5(n,!0,!0,!0));F("\\message",n=>{var e=n.consumeArgs(1)[0];return console.log(e.reverse().map(t=>t.text).join("")),""});F("\\errmessage",n=>{var e=n.consumeArgs(1)[0];return console.error(e.reverse().map(t=>t.text).join("")),""});F("\\show",n=>{var e=n.popToken(),t=e.text;return console.log(e,n.macros.get(t),so[t],Ln.math[t],Ln.text[t]),""});F("\\bgroup","{");F("\\egroup","}");F("~","\\nobreakspace");F("\\lq","`");F("\\rq","'");F("\\aa","\\r a");F("\\AA","\\r A");F("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");F("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");F("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");F("ℬ","\\mathscr{B}");F("ℰ","\\mathscr{E}");F("ℱ","\\mathscr{F}");F("ℋ","\\mathscr{H}");F("ℐ","\\mathscr{I}");F("ℒ","\\mathscr{L}");F("ℳ","\\mathscr{M}");F("ℛ","\\mathscr{R}");F("ℭ","\\mathfrak{C}");F("ℌ","\\mathfrak{H}");F("ℨ","\\mathfrak{Z}");F("\\Bbbk","\\Bbb{k}");F("·","\\cdotp");F("\\llap","\\mathllap{\\textrm{#1}}");F("\\rlap","\\mathrlap{\\textrm{#1}}");F("\\clap","\\mathclap{\\textrm{#1}}");F("\\mathstrut","\\vphantom{(}");F("\\underbar","\\underline{\\text{#1}}");F("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');F("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");F("\\ne","\\neq");F("≠","\\neq");F("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");F("∉","\\notin");F("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");F("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");F("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");F("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");F("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");F("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");F("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");F("⟂","\\perp");F("‼","\\mathclose{!\\mkern-0.8mu!}");F("∌","\\notni");F("⌜","\\ulcorner");F("⌝","\\urcorner");F("⌞","\\llcorner");F("⌟","\\lrcorner");F("©","\\copyright");F("®","\\textregistered");F("️","\\textregistered");F("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');F("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');F("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');F("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');F("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");F("⋮","\\vdots");F("\\varGamma","\\mathit{\\Gamma}");F("\\varDelta","\\mathit{\\Delta}");F("\\varTheta","\\mathit{\\Theta}");F("\\varLambda","\\mathit{\\Lambda}");F("\\varXi","\\mathit{\\Xi}");F("\\varPi","\\mathit{\\Pi}");F("\\varSigma","\\mathit{\\Sigma}");F("\\varUpsilon","\\mathit{\\Upsilon}");F("\\varPhi","\\mathit{\\Phi}");F("\\varPsi","\\mathit{\\Psi}");F("\\varOmega","\\mathit{\\Omega}");F("\\substack","\\begin{subarray}{c}#1\\end{subarray}");F("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");F("\\boxed","\\fbox{$\\displaystyle{#1}$}");F("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");F("\\implies","\\DOTSB\\;\\Longrightarrow\\;");F("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");F("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");F("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var zN={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};F("\\dots",function(n){var e="\\dotso",t=n.expandAfterFuture().text;return t in zN?e=zN[t]:(t.slice(0,4)==="\\not"||t in Ln.math&&["bin","rel"].includes(Ln.math[t].group))&&(e="\\dotsb"),e});var V5={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};F("\\dotso",function(n){var e=n.future().text;return e in V5?"\\ldots\\,":"\\ldots"});F("\\dotsc",function(n){var e=n.future().text;return e in V5&&e!==","?"\\ldots\\,":"\\ldots"});F("\\cdots",function(n){var e=n.future().text;return e in V5?"\\@cdots\\,":"\\@cdots"});F("\\dotsb","\\cdots");F("\\dotsm","\\cdots");F("\\dotsi","\\!\\cdots");F("\\dotsx","\\ldots\\,");F("\\DOTSI","\\relax");F("\\DOTSB","\\relax");F("\\DOTSX","\\relax");F("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");F("\\,","\\tmspace+{3mu}{.1667em}");F("\\thinspace","\\,");F("\\>","\\mskip{4mu}");F("\\:","\\tmspace+{4mu}{.2222em}");F("\\medspace","\\:");F("\\;","\\tmspace+{5mu}{.2777em}");F("\\thickspace","\\;");F("\\!","\\tmspace-{3mu}{.1667em}");F("\\negthinspace","\\!");F("\\negmedspace","\\tmspace-{4mu}{.2222em}");F("\\negthickspace","\\tmspace-{5mu}{.277em}");F("\\enspace","\\kern.5em ");F("\\enskip","\\hskip.5em\\relax");F("\\quad","\\hskip1em\\relax");F("\\qquad","\\hskip2em\\relax");F("\\tag","\\@ifstar\\tag@literal\\tag@paren");F("\\tag@paren","\\tag@literal{({#1})}");F("\\tag@literal",n=>{if(n.macros.get("\\df@tag"))throw new De("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});F("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");F("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");F("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");F("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");F("\\newline","\\\\\\relax");F("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var nz=Be(ma["Main-Regular"][84][1]-.7*ma["Main-Regular"][65][1]);F("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+nz+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");F("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+nz+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");F("\\hspace","\\@ifstar\\@hspacer\\@hspace");F("\\@hspace","\\hskip #1\\relax");F("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");F("\\ordinarycolon",":");F("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");F("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');F("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');F("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');F("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');F("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');F("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');F("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');F("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');F("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');F("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');F("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');F("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');F("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');F("∷","\\dblcolon");F("∹","\\eqcolon");F("≔","\\coloneqq");F("≕","\\eqqcolon");F("⩴","\\Coloneqq");F("\\ratio","\\vcentcolon");F("\\coloncolon","\\dblcolon");F("\\colonequals","\\coloneqq");F("\\coloncolonequals","\\Coloneqq");F("\\equalscolon","\\eqqcolon");F("\\equalscoloncolon","\\Eqqcolon");F("\\colonminus","\\coloneq");F("\\coloncolonminus","\\Coloneq");F("\\minuscolon","\\eqcolon");F("\\minuscoloncolon","\\Eqcolon");F("\\coloncolonapprox","\\Colonapprox");F("\\coloncolonsim","\\Colonsim");F("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");F("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");F("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");F("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");F("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");F("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");F("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");F("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");F("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");F("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");F("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");F("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");F("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");F("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");F("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");F("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");F("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");F("\\nleqq","\\html@mathml{\\@nleqq}{≰}");F("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");F("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");F("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");F("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");F("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");F("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");F("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");F("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");F("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");F("\\imath","\\html@mathml{\\@imath}{ı}");F("\\jmath","\\html@mathml{\\@jmath}{ȷ}");F("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");F("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");F("⟦","\\llbracket");F("⟧","\\rrbracket");F("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");F("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");F("⦃","\\lBrace");F("⦄","\\rBrace");F("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");F("⦵","\\minuso");F("\\darr","\\downarrow");F("\\dArr","\\Downarrow");F("\\Darr","\\Downarrow");F("\\lang","\\langle");F("\\rang","\\rangle");F("\\uarr","\\uparrow");F("\\uArr","\\Uparrow");F("\\Uarr","\\Uparrow");F("\\N","\\mathbb{N}");F("\\R","\\mathbb{R}");F("\\Z","\\mathbb{Z}");F("\\alef","\\aleph");F("\\alefsym","\\aleph");F("\\Alpha","\\mathrm{A}");F("\\Beta","\\mathrm{B}");F("\\bull","\\bullet");F("\\Chi","\\mathrm{X}");F("\\clubs","\\clubsuit");F("\\cnums","\\mathbb{C}");F("\\Complex","\\mathbb{C}");F("\\Dagger","\\ddagger");F("\\diamonds","\\diamondsuit");F("\\empty","\\emptyset");F("\\Epsilon","\\mathrm{E}");F("\\Eta","\\mathrm{H}");F("\\exist","\\exists");F("\\harr","\\leftrightarrow");F("\\hArr","\\Leftrightarrow");F("\\Harr","\\Leftrightarrow");F("\\hearts","\\heartsuit");F("\\image","\\Im");F("\\infin","\\infty");F("\\Iota","\\mathrm{I}");F("\\isin","\\in");F("\\Kappa","\\mathrm{K}");F("\\larr","\\leftarrow");F("\\lArr","\\Leftarrow");F("\\Larr","\\Leftarrow");F("\\lrarr","\\leftrightarrow");F("\\lrArr","\\Leftrightarrow");F("\\Lrarr","\\Leftrightarrow");F("\\Mu","\\mathrm{M}");F("\\natnums","\\mathbb{N}");F("\\Nu","\\mathrm{N}");F("\\Omicron","\\mathrm{O}");F("\\plusmn","\\pm");F("\\rarr","\\rightarrow");F("\\rArr","\\Rightarrow");F("\\Rarr","\\Rightarrow");F("\\real","\\Re");F("\\reals","\\mathbb{R}");F("\\Reals","\\mathbb{R}");F("\\Rho","\\mathrm{P}");F("\\sdot","\\cdot");F("\\sect","\\S");F("\\spades","\\spadesuit");F("\\sub","\\subset");F("\\sube","\\subseteq");F("\\supe","\\supseteq");F("\\Tau","\\mathrm{T}");F("\\thetasym","\\vartheta");F("\\weierp","\\wp");F("\\Zeta","\\mathrm{Z}");F("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");F("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");F("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");F("\\bra","\\mathinner{\\langle{#1}|}");F("\\ket","\\mathinner{|{#1}\\rangle}");F("\\braket","\\mathinner{\\langle{#1}\\rangle}");F("\\Bra","\\left\\langle#1\\right|");F("\\Ket","\\left|#1\\right\\rangle");var rz=n=>e=>{var t=e.consumeArg().tokens,r=e.consumeArg().tokens,s=e.consumeArg().tokens,i=e.consumeArg().tokens,l=e.macros.get("|"),c=e.macros.get("\\|");e.macros.beginGroup();var u=p=>x=>{n&&(x.macros.set("|",l),s.length&&x.macros.set("\\|",c));var v=p;if(!p&&s.length){var b=x.future();b.text==="|"&&(x.popToken(),v=!0)}return{tokens:v?s:r,numArgs:0}};e.macros.set("|",u(!1)),s.length&&e.macros.set("\\|",u(!0));var h=e.consumeArg().tokens,m=e.expandTokens([...i,...h,...t]);return e.macros.endGroup(),{tokens:m.reverse(),numArgs:0}};F("\\bra@ket",rz(!1));F("\\bra@set",rz(!0));F("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");F("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");F("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");F("\\angln","{\\angl n}");F("\\blue","\\textcolor{##6495ed}{#1}");F("\\orange","\\textcolor{##ffa500}{#1}");F("\\pink","\\textcolor{##ff00af}{#1}");F("\\red","\\textcolor{##df0030}{#1}");F("\\green","\\textcolor{##28ae7b}{#1}");F("\\gray","\\textcolor{gray}{#1}");F("\\purple","\\textcolor{##9d38bd}{#1}");F("\\blueA","\\textcolor{##ccfaff}{#1}");F("\\blueB","\\textcolor{##80f6ff}{#1}");F("\\blueC","\\textcolor{##63d9ea}{#1}");F("\\blueD","\\textcolor{##11accd}{#1}");F("\\blueE","\\textcolor{##0c7f99}{#1}");F("\\tealA","\\textcolor{##94fff5}{#1}");F("\\tealB","\\textcolor{##26edd5}{#1}");F("\\tealC","\\textcolor{##01d1c1}{#1}");F("\\tealD","\\textcolor{##01a995}{#1}");F("\\tealE","\\textcolor{##208170}{#1}");F("\\greenA","\\textcolor{##b6ffb0}{#1}");F("\\greenB","\\textcolor{##8af281}{#1}");F("\\greenC","\\textcolor{##74cf70}{#1}");F("\\greenD","\\textcolor{##1fab54}{#1}");F("\\greenE","\\textcolor{##0d923f}{#1}");F("\\goldA","\\textcolor{##ffd0a9}{#1}");F("\\goldB","\\textcolor{##ffbb71}{#1}");F("\\goldC","\\textcolor{##ff9c39}{#1}");F("\\goldD","\\textcolor{##e07d10}{#1}");F("\\goldE","\\textcolor{##a75a05}{#1}");F("\\redA","\\textcolor{##fca9a9}{#1}");F("\\redB","\\textcolor{##ff8482}{#1}");F("\\redC","\\textcolor{##f9685d}{#1}");F("\\redD","\\textcolor{##e84d39}{#1}");F("\\redE","\\textcolor{##bc2612}{#1}");F("\\maroonA","\\textcolor{##ffbde0}{#1}");F("\\maroonB","\\textcolor{##ff92c6}{#1}");F("\\maroonC","\\textcolor{##ed5fa6}{#1}");F("\\maroonD","\\textcolor{##ca337c}{#1}");F("\\maroonE","\\textcolor{##9e034e}{#1}");F("\\purpleA","\\textcolor{##ddd7ff}{#1}");F("\\purpleB","\\textcolor{##c6b9fc}{#1}");F("\\purpleC","\\textcolor{##aa87ff}{#1}");F("\\purpleD","\\textcolor{##7854ab}{#1}");F("\\purpleE","\\textcolor{##543b78}{#1}");F("\\mintA","\\textcolor{##f5f9e8}{#1}");F("\\mintB","\\textcolor{##edf2df}{#1}");F("\\mintC","\\textcolor{##e0e5cc}{#1}");F("\\grayA","\\textcolor{##f6f7f7}{#1}");F("\\grayB","\\textcolor{##f0f1f2}{#1}");F("\\grayC","\\textcolor{##e3e5e6}{#1}");F("\\grayD","\\textcolor{##d6d8da}{#1}");F("\\grayE","\\textcolor{##babec2}{#1}");F("\\grayF","\\textcolor{##888d93}{#1}");F("\\grayG","\\textcolor{##626569}{#1}");F("\\grayH","\\textcolor{##3b3e40}{#1}");F("\\grayI","\\textcolor{##21242c}{#1}");F("\\kaBlue","\\textcolor{##314453}{#1}");F("\\kaGreen","\\textcolor{##71B307}{#1}");var sz={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class wue{constructor(e,t,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new yue(bue,t.macros),this.mode=r,this.stack=[]}feed(e){this.lexer=new DN(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,r,s;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:t,end:r}=this.consumeArg());return this.pushToken(new si("EOF",r.loc)),this.pushTokens(s),new si("",Ts.range(t,r))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var t=[],r=e&&e.length>0;r||this.consumeSpaces();var s=this.future(),i,l=0,c=0;do{if(i=this.popToken(),t.push(i),i.text==="{")++l;else if(i.text==="}"){if(--l,l===-1)throw new De("Extra }",i)}else if(i.text==="EOF")throw new De("Unexpected end of input in a macro argument, expected '"+(e&&r?e[c]:"}")+"'",i);if(e&&r)if((l===0||l===1&&e[c]==="{")&&i.text===e[c]){if(++c,c===e.length){t.splice(-c,c);break}}else c=0}while(l!==0||r);return s.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:s,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new De("The length of delimiters doesn't match the number of args!");for(var r=t[0],s=0;s<r.length;s++){var i=this.popToken();if(r[s]!==i.text)throw new De("Use of the macro doesn't match its definition",i)}}for(var l=[],c=0;c<e;c++)l.push(this.consumeArg(t&&t[c+1]).tokens);return l}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new De("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),r=t.text,s=t.noexpand?null:this._getExpansion(r);if(s==null||e&&s.unexpandable){if(e&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new De("Undefined control sequence: "+r);return this.pushToken(t),!1}this.countExpansion(1);var i=s.tokens,l=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var c=i.length-1;c>=0;--c){var u=i[c];if(u.text==="#"){if(c===0)throw new De("Incomplete placeholder at end of macro body",u);if(u=i[--c],u.text==="#")i.splice(c+1,1);else if(/^[1-9]$/.test(u.text))i.splice(c,2,...l[+u.text-1]);else throw new De("Not a valid argument number",u)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new si(e)]):void 0}expandTokens(e){var t=[],r=this.stack.length;for(this.pushTokens(e);this.stack.length>r;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),t.push(s)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(r=>r.text).join("")}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var r=this.lexer.catcodes[e];if(r!=null&&r!==13)return}var s=typeof t=="function"?t(this):t;if(typeof s=="string"){var i=0;if(s.indexOf("#")!==-1)for(var l=s.replace(/##/g,"");l.indexOf("#"+(i+1))!==-1;)++i;for(var c=new DN(s,this.settings),u=[],h=c.lex();h.text!=="EOF";)u.push(h),h=c.lex();u.reverse();var m={tokens:u,numArgs:i};return m}return s}isDefined(e){return this.macros.has(e)||so.hasOwnProperty(e)||Ln.math.hasOwnProperty(e)||Ln.text.hasOwnProperty(e)||sz.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:so.hasOwnProperty(e)&&!so[e].primitive}}var PN=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Lp=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Hb={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},LN={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Yx{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new wue(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new De("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new si("}")),this.gullet.pushTokens(e);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r}parseExpression(e,t){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(Yx.endOfExpression.indexOf(s.text)!==-1||t&&s.text===t||e&&so[s.text]&&so[s.text].infix)break;var i=this.parseAtom(t);if(i){if(i.type==="internal")continue}else break;r.push(i)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t=-1,r,s=0;s<e.length;s++)if(e[s].type==="infix"){if(t!==-1)throw new De("only one infix operator per group",e[s].token);t=s,r=e[s].replaceWith}if(t!==-1&&r){var i,l,c=e.slice(0,t),u=e.slice(t+1);c.length===1&&c[0].type==="ordgroup"?i=c[0]:i={type:"ordgroup",mode:this.mode,body:c},u.length===1&&u[0].type==="ordgroup"?l=u[0]:l={type:"ordgroup",mode:this.mode,body:u};var h;return r==="\\\\abovefrac"?h=this.callFunction(r,[i,e[t],l],[]):h=this.callFunction(r,[i,l],[]),[h]}else return e}handleSupSubscript(e){var t=this.fetch(),r=t.text;this.consume(),this.consumeSpaces();var s;do{var i;s=this.parseGroup(e)}while(((i=s)==null?void 0:i.type)==="internal");if(!s)throw new De("Expected group after '"+r+"'",t);return s}formatUnsupportedCmd(e){for(var t=[],r=0;r<e.length;r++)t.push({type:"textord",mode:"text",text:e[r]});var s={type:"text",mode:this.mode,body:t},i={type:"color",mode:this.mode,color:this.settings.errorColor,body:[s]};return i}parseAtom(e){var t=this.parseGroup("atom",e);if(t?.type==="internal"||this.mode==="text")return t;for(var r,s;;){this.consumeSpaces();var i=this.fetch();if(i.text==="\\limits"||i.text==="\\nolimits"){if(t&&t.type==="op"){var l=i.text==="\\limits";t.limits=l,t.alwaysHandleSupSub=!0}else if(t&&t.type==="operatorname")t.alwaysHandleSupSub&&(t.limits=i.text==="\\limits");else throw new De("Limit controls must follow a math operator",i);this.consume()}else if(i.text==="^"){if(r)throw new De("Double superscript",i);r=this.handleSupSubscript("superscript")}else if(i.text==="_"){if(s)throw new De("Double subscript",i);s=this.handleSupSubscript("subscript")}else if(i.text==="'"){if(r)throw new De("Double superscript",i);var c={type:"textord",mode:this.mode,text:"\\prime"},u=[c];for(this.consume();this.fetch().text==="'";)u.push(c),this.consume();this.fetch().text==="^"&&u.push(this.handleSupSubscript("superscript")),r={type:"ordgroup",mode:this.mode,body:u}}else if(Lp[i.text]){var h=PN.test(i.text),m=[];for(m.push(new si(Lp[i.text])),this.consume();;){var p=this.fetch().text;if(!Lp[p]||PN.test(p)!==h)break;m.unshift(new si(Lp[p])),this.consume()}var x=this.subparse(m);h?s={type:"ordgroup",mode:"math",body:x}:r={type:"ordgroup",mode:"math",body:x}}else break}return r||s?{type:"supsub",mode:this.mode,base:t,sup:r,sub:s}:t}parseFunction(e,t){var r=this.fetch(),s=r.text,i=so[s];if(!i)return null;if(this.consume(),t&&t!=="atom"&&!i.allowedInArgument)throw new De("Got function '"+s+"' with no arguments"+(t?" as "+t:""),r);if(this.mode==="text"&&!i.allowedInText)throw new De("Can't use function '"+s+"' in text mode",r);if(this.mode==="math"&&i.allowedInMath===!1)throw new De("Can't use function '"+s+"' in math mode",r);var{args:l,optArgs:c}=this.parseArguments(s,i);return this.callFunction(s,l,c,r,e)}callFunction(e,t,r,s,i){var l={funcName:e,parser:this,token:s,breakOnTokenText:i},c=so[e];if(c&&c.handler)return c.handler(l,t,r);throw new De("No function handler for "+e)}parseArguments(e,t){var r=t.numArgs+t.numOptionalArgs;if(r===0)return{args:[],optArgs:[]};for(var s=[],i=[],l=0;l<r;l++){var c=t.argTypes&&t.argTypes[l],u=l<t.numOptionalArgs;(t.primitive&&c==null||t.type==="sqrt"&&l===1&&i[0]==null)&&(c="primitive");var h=this.parseGroupOfType("argument to '"+e+"'",c,u);if(u)i.push(h);else if(h!=null)s.push(h);else throw new De("Null argument, please report this as a bug")}return{args:s,optArgs:i}}parseGroupOfType(e,t,r){switch(t){case"color":return this.parseColorGroup(r);case"size":return this.parseSizeGroup(r);case"url":return this.parseUrlGroup(r);case"math":case"text":return this.parseArgumentGroup(r,t);case"hbox":{var s=this.parseArgumentGroup(r,"text");return s!=null?{type:"styling",mode:s.mode,body:[s],style:"text"}:null}case"raw":{var i=this.parseStringGroup("raw",r);return i!=null?{type:"raw",mode:"text",string:i.text}:null}case"primitive":{if(r)throw new De("A primitive argument cannot be optional");var l=this.parseGroup(e);if(l==null)throw new De("Expected group as "+e,this.fetch());return l}case"original":case null:case void 0:return this.parseArgumentGroup(r);default:throw new De("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(e,t){var r=this.gullet.scanArgument(t);if(r==null)return null;for(var s="",i;(i=this.fetch()).text!=="EOF";)s+=i.text,this.consume();return this.consume(),r.text=s,r}parseRegexGroup(e,t){for(var r=this.fetch(),s=r,i="",l;(l=this.fetch()).text!=="EOF"&&e.test(i+l.text);)s=l,i+=s.text,this.consume();if(i==="")throw new De("Invalid "+t+": '"+r.text+"'",r);return r.range(s,i)}parseColorGroup(e){var t=this.parseStringGroup("color",e);if(t==null)return null;var r=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!r)throw new De("Invalid color: '"+t.text+"'",t);var s=r[0];return/^[0-9a-f]{6}$/i.test(s)&&(s="#"+s),{type:"color-token",mode:this.mode,color:s}}parseSizeGroup(e){var t,r=!1;if(this.gullet.consumeSpaces(),!e&&this.gullet.future().text!=="{"?t=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):t=this.parseStringGroup("size",e),!t)return null;!e&&t.text.length===0&&(t.text="0pt",r=!0);var s=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!s)throw new De("Invalid size: '"+t.text+"'",t);var i={number:+(s[1]+s[2]),unit:s[3]};if(!mR(i))throw new De("Invalid unit: '"+i.unit+"'",t);return{type:"size",mode:this.mode,value:i,isBlank:r}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),t==null)return null;var r=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:r}}parseArgumentGroup(e,t){var r=this.gullet.scanArgument(e);if(r==null)return null;var s=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var l={type:"ordgroup",mode:this.mode,loc:r.loc,body:i};return t&&this.switchMode(s),l}parseGroup(e,t){var r=this.fetch(),s=r.text,i;if(s==="{"||s==="\\begingroup"){this.consume();var l=s==="{"?"}":"\\endgroup";this.gullet.beginGroup();var c=this.parseExpression(!1,l),u=this.fetch();this.expect(l),this.gullet.endGroup(),i={type:"ordgroup",mode:this.mode,loc:Ts.range(r,u),body:c,semisimple:s==="\\begingroup"||void 0}}else if(i=this.parseFunction(t,e)||this.parseSymbol(),i==null&&s[0]==="\\"&&!sz.hasOwnProperty(s)){if(this.settings.throwOnError)throw new De("Undefined control sequence: "+s,r);i=this.formatUnsupportedCmd(s),this.consume()}return i}formLigatures(e){for(var t=e.length-1,r=0;r<t;++r){var s=e[r],i=s.text;i==="-"&&e[r+1].text==="-"&&(r+1<t&&e[r+2].text==="-"?(e.splice(r,3,{type:"textord",mode:"text",loc:Ts.range(s,e[r+2]),text:"---"}),t-=2):(e.splice(r,2,{type:"textord",mode:"text",loc:Ts.range(s,e[r+1]),text:"--"}),t-=1)),(i==="'"||i==="`")&&e[r+1].text===i&&(e.splice(r,2,{type:"textord",mode:"text",loc:Ts.range(s,e[r+1]),text:i+i}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var r=t.slice(5),s=r.charAt(0)==="*";if(s&&(r=r.slice(1)),r.length<2||r.charAt(0)!==r.slice(-1))throw new De(`\\verb assertion failed --
|
||
please report what input caused this bug`);return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:s}}LN.hasOwnProperty(t[0])&&!Ln[this.mode][t[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=LN[t[0]]+t.slice(1));var i=xue.exec(t);i&&(t=t.substring(0,i.index),t==="i"?t="ı":t==="j"&&(t="ȷ"));var l;if(Ln[this.mode][t]){this.settings.strict&&this.mode==="math"&&C4.indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var c=Ln[this.mode][t].group,u=Ts.range(e),h;if(cce.hasOwnProperty(c)){var m=c;h={type:"atom",mode:this.mode,family:m,loc:u,text:t}}else h={type:c,mode:this.mode,loc:u,text:t};l=h}else if(t.charCodeAt(0)>=128)this.settings.strict&&(fR(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),e)),l={type:"textord",mode:"text",loc:Ts.range(e),text:t};else return null;if(this.consume(),i)for(var p=0;p<i[0].length;p++){var x=i[0][p];if(!Hb[x])throw new De("Unknown accent ' "+x+"'",e);var v=Hb[x][this.mode]||Hb[x].text;if(!v)throw new De("Accent "+x+" unsupported in "+this.mode+" mode",e);l={type:"accent",mode:this.mode,loc:Ts.range(e),label:v,isStretchy:!1,isShifty:!0,base:l}}return l}}Yx.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var W5=function(e,t){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var r=new Yx(e,t);delete r.gullet.macros.current["\\df@tag"];var s=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new De("\\tag works only in display equations");s=[{type:"tag",mode:"text",body:s,tag:r.subparse([new si("\\df@tag")])}]}return s},iz=function(e,t,r){t.textContent="";var s=G5(e,r).toNode();t.appendChild(s)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),iz=function(){throw new De("KaTeX doesn't work in quirks mode.")});var Sue=function(e,t){var r=G5(e,t).toMarkup();return r},Oue=function(e,t){var r=new M5(t);return W5(e,r)},az=function(e,t,r){if(r.throwOnError||!(e instanceof De))throw e;var s=ge.makeSpan(["katex-error"],[new Ti(t)]);return s.setAttribute("title",e.toString()),s.setAttribute("style","color:"+r.errorColor),s},G5=function(e,t){var r=new M5(t);try{var s=W5(e,r);return _ce(s,e,r)}catch(i){return az(i,e,r)}},kue=function(e,t){var r=new M5(t);try{var s=W5(e,r);return Dce(s,e,r)}catch(i){return az(i,e,r)}},jue="0.16.25",Nue={Span:O0,Anchor:_5,SymbolNode:Ti,SvgNode:gl,PathNode:yo,LineNode:N4},BN={version:jue,render:iz,renderToString:Sue,ParseError:De,SETTINGS_SCHEMA:ug,__parse:Oue,__renderToDomTree:G5,__renderToHTMLTree:kue,__setFontMetrics:tce,__defineSymbol:N,__defineFunction:Qe,__defineMacro:F,__domTree:Nue};const Cue={};function Tue(n){const e=this,t=n||Cue,r=e.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(Coe(t)),i.push(yoe()),l.push(boe(t))}const IN=/[#.]/g;function Mue(n,e){const t=n||"",r={};let s=0,i,l;for(;s<t.length;){IN.lastIndex=s;const c=IN.exec(t),u=t.slice(s,c?c.index:t.length);u&&(i?i==="#"?r.id=u:Array.isArray(r.className)?r.className.push(u):r.className=[u]:l=u,s+=u.length),c&&(i=c[0],s++)}return{type:"element",tagName:l||e||"div",properties:r,children:[]}}function lz(n,e,t){const r=t?Due(t):void 0;function s(i,l,...c){let u;if(i==null){u={type:"root",children:[]};const h=l;c.unshift(h)}else{u=Mue(i,e);const h=u.tagName.toLowerCase(),m=r?r.get(h):void 0;if(u.tagName=m||h,Aue(l))c.unshift(l);else for(const[p,x]of Object.entries(l))Eue(n,u.properties,p,x)}for(const h of c)D4(u.children,h);return u.type==="element"&&u.tagName==="template"&&(u.content={type:"root",children:u.children},u.children=[]),u}return s}function Aue(n){if(n===null||typeof n!="object"||Array.isArray(n))return!0;if(typeof n.type!="string")return!1;const e=n,t=Object.keys(n);for(const r of t){const s=e[r];if(s&&typeof s=="object"){if(!Array.isArray(s))return!0;const i=s;for(const l of i)if(typeof l!="number"&&typeof l!="string")return!0}}return!!("children"in n&&Array.isArray(n.children))}function Eue(n,e,t,r){const s=hD(n,t);let i;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;i=r}else typeof r=="boolean"?i=r:typeof r=="string"?s.spaceSeparated?i=x8(r):s.commaSeparated?i=h8(r):s.commaOrSpaceSeparated?i=x8(h8(r).join(" ")):i=FN(s,s.property,r):Array.isArray(r)?i=[...r]:i=s.property==="style"?_ue(r):String(r);if(Array.isArray(i)){const l=[];for(const c of i)l.push(FN(s,s.property,c));i=l}s.property==="className"&&Array.isArray(e.className)&&(i=e.className.concat(i)),e[s.property]=i}}function D4(n,e){if(e!=null)if(typeof e=="number"||typeof e=="string")n.push({type:"text",value:String(e)});else if(Array.isArray(e))for(const t of e)D4(n,t);else if(typeof e=="object"&&"type"in e)e.type==="root"?D4(n,e.children):n.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function FN(n,e,t){if(typeof t=="string"){if(n.number&&t&&!Number.isNaN(Number(t)))return Number(t);if((n.boolean||n.overloadedBoolean)&&(t===""||Lf(t)===Lf(e)))return!0}return t}function _ue(n){const e=[];for(const[t,r]of Object.entries(n))e.push([t,r].join(": "));return e.join("; ")}function Due(n){const e=new Map;for(const t of n)e.set(t.toLowerCase(),t);return e}const Rue=["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"],zue=lz(fD,"div"),Pue=lz(Ix,"g",Rue),Ub={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function Lue(n,e){return oz(n,{})||{type:"root",children:[]}}function oz(n,e){const t=Bue(n,e);return t&&e.afterTransform&&e.afterTransform(n,t),t}function Bue(n,e){switch(n.nodeType){case 1:return Que(n,e);case 3:return Fue(n);case 8:return que(n);case 9:return qN(n,e);case 10:return Iue();case 11:return qN(n,e);default:return}}function qN(n,e){return{type:"root",children:cz(n,e)}}function Iue(){return{type:"doctype"}}function Fue(n){return{type:"text",value:n.nodeValue||""}}function que(n){return{type:"comment",value:n.nodeValue||""}}function Que(n,e){const t=n.namespaceURI,r=t===Ub.svg?Pue:zue,s=t===Ub.html?n.tagName.toLowerCase():n.tagName,i=t===Ub.html&&s==="template"?n.content:n,l=n.getAttributeNames(),c={};let u=-1;for(;++u<l.length;)c[l[u]]=n.getAttribute(l[u])||"";return r(s,c,cz(i,e))}function cz(n,e){const t=n.childNodes,r=[];let s=-1;for(;++s<t.length;){const i=oz(t[s],e);i!==void 0&&r.push(i)}return r}new DOMParser;function $ue(n,e){const t=Hue(n);return Lue(t)}function Hue(n){const e=document.createElement("template");return e.innerHTML=n,e.content}const QN=(function(n,e,t){const r=b0(t);if(!n||!n.type||!n.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=n.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++e<n.children.length;)if(r(n.children[e],e,n))return n.children[e]}),zc=(function(n){if(n==null)return Wue;if(typeof n=="string")return Vue(n);if(typeof n=="object")return Uue(n);if(typeof n=="function")return X5(n);throw new Error("Expected function, string, or array as `test`")});function Uue(n){const e=[];let t=-1;for(;++t<n.length;)e[t]=zc(n[t]);return X5(r);function r(...s){let i=-1;for(;++i<e.length;)if(e[i].apply(this,s))return!0;return!1}}function Vue(n){return X5(e);function e(t){return t.tagName===n}}function X5(n){return e;function e(t,r,s){return!!(Gue(t)&&n.call(this,t,typeof r=="number"?r:void 0,s||void 0))}}function Wue(n){return!!(n&&typeof n=="object"&&"type"in n&&n.type==="element"&&"tagName"in n&&typeof n.tagName=="string")}function Gue(n){return n!==null&&typeof n=="object"&&"type"in n&&"tagName"in n}const $N=/\n/g,HN=/[\t ]+/g,R4=zc("br"),UN=zc(nde),Xue=zc("p"),VN=zc("tr"),Yue=zc(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",tde,rde]),uz=zc(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function Kue(n,e){const t=e||{},r="children"in n?n.children:[],s=uz(n),i=fz(n,{whitespace:t.whitespace||"normal"}),l=[];(n.type==="text"||n.type==="comment")&&l.push(...hz(n,{breakBefore:!0,breakAfter:!0}));let c=-1;for(;++c<r.length;)l.push(...dz(r[c],n,{whitespace:i,breakBefore:c?void 0:s,breakAfter:c<r.length-1?R4(r[c+1]):s}));const u=[];let h;for(c=-1;++c<l.length;){const m=l[c];typeof m=="number"?h!==void 0&&m>h&&(h=m):m&&(h!==void 0&&h>-1&&u.push(`
|
||
`.repeat(h)||" "),h=-1,u.push(m))}return u.join("")}function dz(n,e,t){return n.type==="element"?Zue(n,e,t):n.type==="text"?t.whitespace==="normal"?hz(n,t):Jue(n):[]}function Zue(n,e,t){const r=fz(n,t),s=n.children||[];let i=-1,l=[];if(Yue(n))return l;let c,u;for(R4(n)||VN(n)&&QN(e,n,VN)?u=`
|
||
`:Xue(n)?(c=2,u=2):uz(n)&&(c=1,u=1);++i<s.length;)l=l.concat(dz(s[i],n,{whitespace:r,breakBefore:i?void 0:c,breakAfter:i<s.length-1?R4(s[i+1]):u}));return UN(n)&&QN(e,n,UN)&&l.push(" "),c&&l.unshift(c),u&&l.push(u),l}function hz(n,e){const t=String(n.value),r=[],s=[];let i=0;for(;i<=t.length;){$N.lastIndex=i;const u=$N.exec(t),h=u&&"index"in u?u.index:t.length;r.push(ede(t.slice(i,h).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),i===0?e.breakBefore:!0,h===t.length?e.breakAfter:!0)),i=h+1}let l=-1,c;for(;++l<r.length;)r[l].charCodeAt(r[l].length-1)===8203||l<r.length-1&&r[l+1].charCodeAt(0)===8203?(s.push(r[l]),c=void 0):r[l]?(typeof c=="number"&&s.push(c),s.push(r[l]),c=0):(l===0||l===r.length-1)&&s.push(0);return s}function Jue(n){return[String(n.value)]}function ede(n,e,t){const r=[];let s=0,i;for(;s<n.length;){HN.lastIndex=s;const l=HN.exec(n);i=l?l.index:n.length,!s&&!i&&l&&!e&&r.push(""),s!==i&&r.push(n.slice(s,i)),s=l?i+l[0].length:i}return s!==i&&!t&&r.push(""),r.join(" ")}function fz(n,e){if(n.type==="element"){const t=n.properties||{};switch(n.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return t.wrap?"pre-wrap":"pre";case"td":case"th":return t.noWrap?"nowrap":e.whitespace;case"textarea":return"pre-wrap"}}return e.whitespace}function tde(n){return!!(n.properties||{}).hidden}function nde(n){return n.tagName==="td"||n.tagName==="th"}function rde(n){return n.tagName==="dialog"&&!(n.properties||{}).open}const sde={},ide=[];function ade(n){const e=n||sde;return function(t,r){O5(t,"element",function(s,i){const l=Array.isArray(s.properties.className)?s.properties.className:ide,c=l.includes("language-math"),u=l.includes("math-display"),h=l.includes("math-inline");let m=u;if(!c&&!u&&!h)return;let p=i[i.length-1],x=s;if(s.tagName==="code"&&c&&p&&p.type==="element"&&p.tagName==="pre"&&(x=p,p=i[i.length-2],m=!0),!p)return;const v=Kue(x,{whitespace:"pre"});let b;try{b=BN.renderToString(v,{...e,displayMode:m,throwOnError:!0})}catch(k){const j=k,T=j.name.toLowerCase();r.message("Could not render math with KaTeX",{ancestors:[...i,s],cause:j,place:s.position,ruleId:T,source:"rehype-katex"});try{b=BN.renderToString(v,{...e,displayMode:m,strict:"ignore",throwOnError:!1})}catch{b=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(e.errorColor||"#cc0000"),title:String(k)},children:[{type:"text",value:v}]}]}}typeof b=="string"&&(b=$ue(b).children);const O=p.children.indexOf(x);return p.children.splice(O,1,...b),FD})}}function lde({content:n,className:e=""}){return a.jsx("div",{className:`prose prose-sm dark:prose-invert max-w-none ${e}`,children:a.jsx(aae,{remarkPlugins:[voe,Tue],rehypePlugins:[ade],components:{code({inline:t,className:r,children:s,...i}){return t?a.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",...i,children:s}):a.jsx("code",{className:`${r} block bg-muted p-4 rounded-lg overflow-x-auto`,...i,children:s})},table({children:t,...r}){return a.jsx("div",{className:"overflow-x-auto",children:a.jsx("table",{className:"border-collapse border border-border",...r,children:t})})},th({children:t,...r}){return a.jsx("th",{className:"border border-border bg-muted px-4 py-2 text-left font-semibold",...r,children:t})},td({children:t,...r}){return a.jsx("td",{className:"border border-border px-4 py-2",...r,children:t})},a({children:t,...r}){return a.jsx("a",{className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",...r,children:t})},blockquote({children:t,...r}){return a.jsx("blockquote",{className:"border-l-4 border-primary pl-4 italic text-muted-foreground",...r,children:t})},h1({children:t,...r}){return a.jsx("h1",{className:"text-3xl font-bold mt-6 mb-4",...r,children:t})},h2({children:t,...r}){return a.jsx("h2",{className:"text-2xl font-bold mt-5 mb-3",...r,children:t})},h3({children:t,...r}){return a.jsx("h3",{className:"text-xl font-bold mt-4 mb-2",...r,children:t})},h4({children:t,...r}){return a.jsx("h4",{className:"text-lg font-semibold mt-3 mb-2",...r,children:t})},ul({children:t,...r}){return a.jsx("ul",{className:"list-disc list-inside space-y-1 my-2",...r,children:t})},ol({children:t,...r}){return a.jsx("ol",{className:"list-decimal list-inside space-y-1 my-2",...r,children:t})},p({children:t,...r}){return a.jsx("p",{className:"my-2 leading-relaxed",...r,children:t})},hr({...t}){return a.jsx("hr",{className:"my-4 border-border",...t})}},children:n})})}function ode({children:n,className:e}){return a.jsx(lde,{content:n,className:e})}const Sl="/api/webui/emoji";async function cde(n){const e=new URLSearchParams;n.page&&e.append("page",n.page.toString()),n.page_size&&e.append("page_size",n.page_size.toString()),n.search&&e.append("search",n.search),n.is_registered!==void 0&&e.append("is_registered",n.is_registered.toString()),n.is_banned!==void 0&&e.append("is_banned",n.is_banned.toString()),n.format&&e.append("format",n.format),n.sort_by&&e.append("sort_by",n.sort_by),n.sort_order&&e.append("sort_order",n.sort_order);const t=await ot(`${Sl}/list?${e}`,{headers:bt()});if(!t.ok)throw new Error(`获取表情包列表失败: ${t.statusText}`);return t.json()}async function ude(n){const e=await ot(`${Sl}/${n}`,{headers:bt()});if(!e.ok)throw new Error(`获取表情包详情失败: ${e.statusText}`);return e.json()}async function dde(n,e){const t=await ot(`${Sl}/${n}`,{method:"PATCH",headers:bt(),body:JSON.stringify(e)});if(!t.ok)throw new Error(`更新表情包失败: ${t.statusText}`);return t.json()}async function hde(n){const e=await ot(`${Sl}/${n}`,{method:"DELETE",headers:bt()});if(!e.ok)throw new Error(`删除表情包失败: ${e.statusText}`);return e.json()}async function fde(){const n=await ot(`${Sl}/stats/summary`,{headers:bt()});if(!n.ok)throw new Error(`获取统计数据失败: ${n.statusText}`);return n.json()}async function mde(n){const e=await ot(`${Sl}/${n}/register`,{method:"POST",headers:bt()});if(!e.ok)throw new Error(`注册表情包失败: ${e.statusText}`);return e.json()}async function pde(n){const e=await ot(`${Sl}/${n}/ban`,{method:"POST",headers:bt()});if(!e.ok)throw new Error(`封禁表情包失败: ${e.statusText}`);return e.json()}function z4(n){const e=localStorage.getItem("access-token");return`${Sl}/${n}/thumbnail?token=${encodeURIComponent(e||"")}`}async function gde(n){const e=await ot(`${Sl}/batch/delete`,{method:"POST",headers:bt(),body:JSON.stringify({emoji_ids:n})});if(!e.ok){const t=await e.json();throw new Error(t.detail||"批量删除失败")}return e.json()}function xde(){const[n,e]=S.useState([]),[t,r]=S.useState(null),[s,i]=S.useState(!1),[l,c]=S.useState(1),[u,h]=S.useState(0),[m,p]=S.useState(20),[x,v]=S.useState(""),[b,O]=S.useState("all"),[k,j]=S.useState("all"),[T,M]=S.useState("all"),[_,D]=S.useState(null),[E,z]=S.useState(!1),[Q,q]=S.useState(!1),[B,U]=S.useState(!1),[V,ce]=S.useState(new Set),[W,J]=S.useState(!1),[H,ae]=S.useState(""),{toast:ne}=Pr(),ue=S.useCallback(async()=>{try{i(!0);const ke=await cde({page:l,page_size:m,search:x||void 0,is_registered:b==="all"?void 0:b==="registered",is_banned:k==="all"?void 0:k==="banned",format:T==="all"?void 0:T,sort_by:"usage_count",sort_order:"desc"});e(ke.data),h(ke.total)}catch(ke){const nt=ke instanceof Error?ke.message:"加载表情包列表失败";ne({title:"错误",description:nt,variant:"destructive"})}finally{i(!1)}},[l,m,x,b,k,T,ne]),R=async()=>{try{const ke=await fde();r(ke.data)}catch(ke){console.error("加载统计数据失败:",ke)}};S.useEffect(()=>{ue()},[ue]),S.useEffect(()=>{R()},[]);const me=async ke=>{try{const nt=await ude(ke.id);D(nt.data),z(!0)}catch(nt){const ut=nt instanceof Error?nt.message:"加载详情失败";ne({title:"错误",description:ut,variant:"destructive"})}},Y=ke=>{D(ke),q(!0)},P=ke=>{D(ke),U(!0)},K=async()=>{if(_)try{await hde(_.id),ne({title:"成功",description:"表情包已删除"}),U(!1),D(null),ue(),R()}catch(ke){const nt=ke instanceof Error?ke.message:"删除失败";ne({title:"错误",description:nt,variant:"destructive"})}},$=async ke=>{try{await mde(ke.id),ne({title:"成功",description:"表情包已注册"}),ue(),R()}catch(nt){const ut=nt instanceof Error?nt.message:"注册失败";ne({title:"错误",description:ut,variant:"destructive"})}},fe=async ke=>{try{await pde(ke.id),ne({title:"成功",description:"表情包已封禁"}),ue(),R()}catch(nt){const ut=nt instanceof Error?nt.message:"封禁失败";ne({title:"错误",description:ut,variant:"destructive"})}},ye=ke=>{const nt=new Set(V);nt.has(ke)?nt.delete(ke):nt.add(ke),ce(nt)},Re=()=>{V.size===n.length&&n.length>0?ce(new Set):ce(new Set(n.map(ke=>ke.id)))},de=async()=>{try{const ke=await gde(Array.from(V));ne({title:"批量删除完成",description:ke.message}),ce(new Set),J(!1),ue(),R()}catch(ke){ne({title:"批量删除失败",description:ke instanceof Error?ke.message:"批量删除失败",variant:"destructive"})}},We=()=>{const ke=parseInt(H),nt=Math.ceil(u/m);ke>=1&&ke<=nt?(c(ke),ae("")):ne({title:"无效的页码",description:`请输入1-${nt}之间的页码`,variant:"destructive"})},ct=t?.formats?Object.keys(t.formats):[];return a.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[a.jsxs("div",{className:"mb-4 sm:mb-6",children:[a.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"表情包管理"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理麦麦的表情包资源"})]}),a.jsx(fn,{className:"flex-1",children:a.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[t&&a.jsxs("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:[a.jsx(yt,{children:a.jsxs(Jt,{className:"pb-2",children:[a.jsx(Sr,{children:"总数"}),a.jsx(en,{className:"text-2xl",children:t.total})]})}),a.jsx(yt,{children:a.jsxs(Jt,{className:"pb-2",children:[a.jsx(Sr,{children:"已注册"}),a.jsx(en,{className:"text-2xl text-green-600",children:t.registered})]})}),a.jsx(yt,{children:a.jsxs(Jt,{className:"pb-2",children:[a.jsx(Sr,{children:"已封禁"}),a.jsx(en,{className:"text-2xl text-red-600",children:t.banned})]})}),a.jsx(yt,{children:a.jsxs(Jt,{className:"pb-2",children:[a.jsx(Sr,{children:"未注册"}),a.jsx(en,{className:"text-2xl text-gray-600",children:t.unregistered})]})})]}),a.jsxs(yt,{children:[a.jsx(Jt,{children:a.jsxs(en,{className:"flex items-center gap-2",children:[a.jsx(n2,{className:"h-5 w-5"}),"搜索和筛选"]})}),a.jsxs(vn,{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{children:"搜索"}),a.jsxs("div",{className:"relative",children:[a.jsx(Ps,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),a.jsx(Ae,{placeholder:"描述或哈希值...",value:x,onChange:ke=>{v(ke.target.value),c(1)},className:"pl-8"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{children:"注册状态"}),a.jsxs(Bt,{value:b,onValueChange:ke=>{O(ke),c(1)},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"all",children:"全部"}),a.jsx(Pe,{value:"registered",children:"已注册"}),a.jsx(Pe,{value:"unregistered",children:"未注册"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{children:"封禁状态"}),a.jsxs(Bt,{value:k,onValueChange:ke=>{j(ke),c(1)},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"all",children:"全部"}),a.jsx(Pe,{value:"banned",children:"已封禁"}),a.jsx(Pe,{value:"unbanned",children:"未封禁"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{children:"格式"}),a.jsxs(Bt,{value:T,onValueChange:ke=>{M(ke),c(1)},children:[a.jsx(Dt,{children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"all",children:"全部"}),ct.map(ke=>a.jsxs(Pe,{value:ke,children:[ke.toUpperCase()," (",t?.formats[ke],")"]},ke))]})]})]})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 pt-4 border-t",children:[a.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:V.size>0&&a.jsxs("span",{children:["已选择 ",V.size," 个表情包"]})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(te,{htmlFor:"emoji-page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),a.jsxs(Bt,{value:m.toString(),onValueChange:ke=>{p(parseInt(ke)),c(1),ce(new Set)},children:[a.jsx(Dt,{id:"emoji-page-size",className:"w-20",children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"10",children:"10"}),a.jsx(Pe,{value:"20",children:"20"}),a.jsx(Pe,{value:"50",children:"50"}),a.jsx(Pe,{value:"100",children:"100"})]})]}),V.size>0&&a.jsxs(a.Fragment,{children:[a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>ce(new Set),children:"取消选择"}),a.jsxs(ie,{variant:"destructive",size:"sm",onClick:()=>J(!0),children:[a.jsx(Ht,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]}),a.jsx("div",{className:"flex justify-end pt-4 border-t",children:a.jsxs(ie,{variant:"outline",size:"sm",onClick:ue,disabled:s,children:[a.jsx(Ii,{className:`h-4 w-4 mr-2 ${s?"animate-spin":""}`}),"刷新"]})})]})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{children:[a.jsx(en,{children:"表情包列表"}),a.jsxs(Sr,{children:["共 ",u," 个表情包,当前第 ",l," 页"]})]}),a.jsxs(vn,{children:[a.jsx("div",{className:"hidden md:block rounded-md border overflow-hidden",children:a.jsxs(Ac,{children:[a.jsx(Ec,{children:a.jsxs(xr,{children:[a.jsx(gt,{className:"w-12",children:a.jsx(ss,{checked:n.length>0&&V.size===n.length,onCheckedChange:Re,"aria-label":"全选"})}),a.jsx(gt,{className:"w-16",children:"预览"}),a.jsx(gt,{children:"描述"}),a.jsx(gt,{children:"格式"}),a.jsx(gt,{children:"情绪"}),a.jsx(gt,{className:"text-center",children:"状态"}),a.jsx(gt,{className:"text-right",children:"使用次数"}),a.jsx(gt,{className:"text-right",children:"操作"})]})}),a.jsx(_c,{children:n.length===0?a.jsx(xr,{children:a.jsx(it,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):n.map(ke=>a.jsxs(xr,{children:[a.jsx(it,{children:a.jsx(ss,{checked:V.has(ke.id),onCheckedChange:()=>ye(ke.id),"aria-label":`选择 ${ke.description}`})}),a.jsx(it,{children:a.jsx("div",{className:"w-20 h-20 bg-muted rounded flex items-center justify-center overflow-hidden",children:a.jsx("img",{src:z4(ke.id),alt:ke.description||"表情包",className:"w-full h-full object-cover",onError:nt=>{const ut=nt.target;ut.style.display="none";const Ct=ut.parentElement;Ct&&(Ct.innerHTML='<svg class="h-6 w-6 text-muted-foreground" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" /></svg>')}})})}),a.jsx(it,{children:a.jsxs("div",{className:"space-y-1 max-w-xs",children:[a.jsx("div",{className:"font-medium truncate",title:ke.description||"无描述",children:ke.description||"无描述"}),a.jsxs("div",{className:"text-xs text-muted-foreground font-mono",children:[ke.emoji_hash.slice(0,16),"..."]})]})}),a.jsx(it,{children:a.jsx($n,{variant:"outline",children:ke.format.toUpperCase()})}),a.jsx(it,{children:a.jsx(WN,{emotions:ke.emotion})}),a.jsx(it,{className:"align-middle",children:a.jsxs("div",{className:"flex gap-2 justify-center",children:[ke.is_registered&&a.jsxs($n,{variant:"default",className:"bg-green-600",children:[a.jsx(ua,{className:"h-3 w-3 mr-1"}),"已注册"]}),ke.is_banned&&a.jsxs($n,{variant:"destructive",children:[a.jsx(Zb,{className:"h-3 w-3 mr-1"}),"已封禁"]})]})}),a.jsx(it,{className:"text-right font-mono",children:ke.usage_count}),a.jsx(it,{children:a.jsxs("div",{className:"flex items-center justify-end gap-1 flex-wrap",children:[a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>me(ke),children:[a.jsx(oo,{className:"h-4 w-4 mr-1"}),"详情"]}),a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>Y(ke),children:[a.jsx(sd,{className:"h-4 w-4 mr-1"}),"编辑"]}),!ke.is_registered&&a.jsxs(ie,{size:"sm",onClick:()=>$(ke),className:"bg-green-600 hover:bg-green-700 text-white",children:[a.jsx(ua,{className:"h-4 w-4 mr-1"}),"注册"]}),!ke.is_banned&&a.jsxs(ie,{size:"sm",onClick:()=>fe(ke),className:"bg-orange-600 hover:bg-orange-700 text-white",children:[a.jsx(dk,{className:"h-4 w-4 mr-1"}),"封禁"]}),a.jsxs(ie,{size:"sm",onClick:()=>P(ke),className:"bg-red-600 hover:bg-red-700 text-white",children:[a.jsx(Ht,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},ke.id))})]})}),a.jsx("div",{className:"md:hidden space-y-3",children:n.length===0?a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):n.map(ke=>a.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[a.jsxs("div",{className:"flex gap-3",children:[a.jsx("div",{className:"flex-shrink-0",children:a.jsx("div",{className:"w-16 h-16 bg-muted rounded flex items-center justify-center overflow-hidden",children:a.jsx("img",{src:z4(ke.id),alt:ke.description||"表情包",className:"w-full h-full object-cover",onError:nt=>{const ut=nt.target;ut.style.display="none";const Ct=ut.parentElement;Ct&&(Ct.innerHTML='<svg class="h-6 w-6 text-muted-foreground" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" /></svg>')}})})}),a.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[a.jsxs("div",{className:"min-w-0 w-full overflow-hidden",children:[a.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",title:ke.description||"无描述",children:ke.description||"无描述"}),a.jsxs("p",{className:"text-xs text-muted-foreground font-mono line-clamp-1 w-full break-all",children:[ke.emoji_hash.slice(0,16),"..."]})]}),a.jsxs("div",{className:"flex flex-wrap gap-1 items-center min-w-0",children:[a.jsx($n,{variant:"outline",className:"text-xs flex-shrink-0",children:ke.format.toUpperCase()}),ke.is_registered&&a.jsxs($n,{variant:"default",className:"bg-green-600 text-xs flex-shrink-0",children:[a.jsx(ua,{className:"h-3 w-3 mr-1"}),"已注册"]}),ke.is_banned&&a.jsxs($n,{variant:"destructive",className:"text-xs flex-shrink-0",children:[a.jsx(Zb,{className:"h-3 w-3 mr-1"}),"已封禁"]}),a.jsxs("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:["使用: ",ke.usage_count]})]}),ke.emotion&&ke.emotion.trim()&&a.jsx("div",{className:"min-w-0 overflow-hidden",children:a.jsx(WN,{emotions:ke.emotion})})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>me(ke),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[a.jsx(oo,{className:"h-3 w-3 mr-1"}),"详情"]}),a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>Y(ke),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[a.jsx(sd,{className:"h-3 w-3 mr-1"}),"编辑"]}),!ke.is_registered&&a.jsxs(ie,{size:"sm",onClick:()=>$(ke),className:"text-xs px-2 py-1 h-auto flex-shrink-0 bg-green-600 hover:bg-green-700 text-white",children:[a.jsx(ua,{className:"h-3 w-3 mr-1"}),"注册"]}),!ke.is_banned&&a.jsxs(ie,{size:"sm",onClick:()=>fe(ke),className:"text-xs px-2 py-1 h-auto flex-shrink-0 bg-orange-600 hover:bg-orange-700 text-white",children:[a.jsx(dk,{className:"h-3 w-3 mr-1"}),"封禁"]}),a.jsxs(ie,{size:"sm",onClick:()=>P(ke),className:"text-xs px-2 py-1 h-auto flex-shrink-0 bg-red-600 hover:bg-red-700 text-white",children:[a.jsx(Ht,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},ke.id))}),u>0&&a.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[a.jsxs("div",{className:"text-sm text-muted-foreground",children:["显示 ",(l-1)*m+1," 到"," ",Math.min(l*m,u)," 条,共 ",u," 条"]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>c(1),disabled:l===1,className:"hidden sm:flex",children:a.jsx(Yf,{className:"h-4 w-4"})}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>c(ke=>Math.max(1,ke-1)),disabled:l===1,children:[a.jsx(Tc,{className:"h-4 w-4 sm:mr-1"}),a.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ae,{type:"number",value:H,onChange:ke=>ae(ke.target.value),onKeyDown:ke=>ke.key==="Enter"&&We(),placeholder:l.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(u/m)}),a.jsx(ie,{variant:"outline",size:"sm",onClick:We,disabled:!H,className:"h-8",children:"跳转"})]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>c(ke=>ke+1),disabled:l>=Math.ceil(u/m),children:[a.jsx("span",{className:"hidden sm:inline",children:"下一页"}),a.jsx(Mc,{className:"h-4 w-4 sm:ml-1"})]}),a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>c(Math.ceil(u/m)),disabled:l>=Math.ceil(u/m),className:"hidden sm:flex",children:a.jsx(Kf,{className:"h-4 w-4"})})]})]})]})]}),a.jsx(vde,{emoji:_,open:E,onOpenChange:z}),a.jsx(yde,{emoji:_,open:Q,onOpenChange:q,onSuccess:()=>{ue(),R()}})]})}),a.jsx(mn,{open:W,onOpenChange:J,children:a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认批量删除"}),a.jsxs(un,{children:["你确定要删除选中的 ",V.size," 个表情包吗?此操作不可撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:de,children:"确认删除"})]})]})}),a.jsx(Rr,{open:B,onOpenChange:U,children:a.jsxs(Nr,{children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:"确认删除"}),a.jsx(Gr,{children:"确定要删除这个表情包吗?此操作无法撤销。"})]}),a.jsxs(ps,{children:[a.jsx(ie,{variant:"outline",onClick:()=>U(!1),children:"取消"}),a.jsx(ie,{variant:"destructive",onClick:K,children:"删除"})]})]})})]})}function vde({emoji:n,open:e,onOpenChange:t}){if(!n)return null;const r=s=>s?new Date(s*1e3).toLocaleString("zh-CN"):"-";return a.jsx(Rr,{open:e,onOpenChange:t,children:a.jsxs(Nr,{className:"max-w-2xl max-h-[90vh]",children:[a.jsx(Cr,{children:a.jsx(Tr,{children:"表情包详情"})}),a.jsx(fn,{className:"max-h-[calc(90vh-8rem)] pr-4",children:a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex justify-center",children:a.jsx("div",{className:"w-32 h-32 bg-muted rounded-lg flex items-center justify-center overflow-hidden",children:a.jsx("img",{src:z4(n.id),alt:n.description||"表情包",className:"w-full h-full object-cover",onError:s=>{const i=s.target;i.style.display="none";const l=i.parentElement;l&&(l.innerHTML='<svg class="h-16 w-16 text-muted-foreground" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" /></svg>')}})})}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{children:[a.jsx(te,{className:"text-muted-foreground",children:"ID"}),a.jsx("div",{className:"mt-1 font-mono",children:n.id})]}),a.jsxs("div",{children:[a.jsx(te,{className:"text-muted-foreground",children:"格式"}),a.jsx("div",{className:"mt-1",children:a.jsx($n,{variant:"outline",children:n.format.toUpperCase()})})]})]}),a.jsxs("div",{children:[a.jsx(te,{className:"text-muted-foreground",children:"文件路径"}),a.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:n.full_path})]}),a.jsxs("div",{children:[a.jsx(te,{className:"text-muted-foreground",children:"哈希值"}),a.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:n.emoji_hash})]}),a.jsxs("div",{children:[a.jsx(te,{className:"text-muted-foreground",children:"描述"}),n.description?a.jsx("div",{className:"mt-1 rounded-lg border bg-muted/50 p-3",children:a.jsx(ode,{className:"prose-sm",children:n.description})}):a.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:"-"})]}),a.jsxs("div",{children:[a.jsx(te,{className:"text-muted-foreground",children:"情绪"}),a.jsx("div",{className:"mt-1",children:n.emotion?a.jsx("span",{className:"text-sm",children:n.emotion}):a.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{children:[a.jsx(te,{className:"text-muted-foreground",children:"状态"}),a.jsxs("div",{className:"mt-2 flex gap-2",children:[n.is_registered&&a.jsx($n,{variant:"default",className:"bg-green-600",children:"已注册"}),n.is_banned&&a.jsx($n,{variant:"destructive",children:"已封禁"}),!n.is_registered&&!n.is_banned&&a.jsx($n,{variant:"outline",children:"未注册"})]})]}),a.jsxs("div",{children:[a.jsx(te,{className:"text-muted-foreground",children:"使用次数"}),a.jsx("div",{className:"mt-1 font-mono text-lg",children:n.usage_count})]})]}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{children:[a.jsx(te,{className:"text-muted-foreground",children:"记录时间"}),a.jsx("div",{className:"mt-1 text-sm",children:r(n.record_time)})]}),a.jsxs("div",{children:[a.jsx(te,{className:"text-muted-foreground",children:"注册时间"}),a.jsx("div",{className:"mt-1 text-sm",children:r(n.register_time)})]})]}),a.jsxs("div",{children:[a.jsx(te,{className:"text-muted-foreground",children:"最后使用"}),a.jsx("div",{className:"mt-1 text-sm",children:r(n.last_used_time)})]})]})})]})})}function yde({emoji:n,open:e,onOpenChange:t,onSuccess:r}){const[s,i]=S.useState(""),[l,c]=S.useState(""),[u,h]=S.useState(!1),[m,p]=S.useState(!1),[x,v]=S.useState(!1),{toast:b}=Pr();S.useEffect(()=>{n&&(i(n.description||""),c(n.emotion||""),h(n.is_registered),p(n.is_banned))},[n]);const O=async()=>{if(n)try{v(!0);const k=l.split(/[,,]/).map(j=>j.trim()).filter(Boolean).join(",");await dde(n.id,{description:s||void 0,emotion:k||void 0,is_registered:u,is_banned:m}),b({title:"成功",description:"表情包信息已更新"}),t(!1),r()}catch(k){const j=k instanceof Error?k.message:"保存失败";b({title:"错误",description:j,variant:"destructive"})}finally{v(!1)}};return n?a.jsx(Rr,{open:e,onOpenChange:t,children:a.jsxs(Nr,{className:"max-w-2xl",children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:"编辑表情包"}),a.jsx(Gr,{children:"修改表情包的描述和标签信息"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(te,{children:"描述"}),a.jsx(kn,{value:s,onChange:k=>i(k.target.value),placeholder:"输入表情包描述...",rows:3,className:"mt-1"})]}),a.jsxs("div",{children:[a.jsx(te,{children:"情绪"}),a.jsx(kn,{value:l,onChange:k=>c(k.target.value),placeholder:"输入情绪描述...",rows:2,className:"mt-1"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"输入情绪相关的文本描述"})]}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ss,{id:"is_registered",checked:u,onCheckedChange:k=>h(k===!0)}),a.jsx(te,{htmlFor:"is_registered",className:"cursor-pointer",children:"已注册"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ss,{id:"is_banned",checked:m,onCheckedChange:k=>p(k===!0)}),a.jsx(te,{htmlFor:"is_banned",className:"cursor-pointer",children:"已封禁"})]})]})]}),a.jsxs(ps,{children:[a.jsx(ie,{variant:"outline",onClick:()=>t(!1),children:"取消"}),a.jsx(ie,{onClick:O,disabled:x,children:x?"保存中...":"保存"})]})]})}):null}function WN({emotions:n}){if(!n||n.trim()==="")return a.jsx("span",{className:"text-xs text-muted-foreground",children:"-"});const e=20,t=n.length>e?n.slice(0,e)+"...":n;return a.jsx("div",{className:"text-sm break-words max-w-xs",title:n,children:t})}const Pc="/api/webui/expression";async function bde(n){const e=new URLSearchParams;n.page&&e.append("page",n.page.toString()),n.page_size&&e.append("page_size",n.page_size.toString()),n.search&&e.append("search",n.search),n.chat_id&&e.append("chat_id",n.chat_id);const t=await ot(`${Pc}/list?${e}`,{headers:bt()});if(!t.ok){const r=await t.json();throw new Error(r.detail||"获取表达方式列表失败")}return t.json()}async function wde(n){const e=await ot(`${Pc}/${n}`,{headers:bt()});if(!e.ok){const t=await e.json();throw new Error(t.detail||"获取表达方式详情失败")}return e.json()}async function Sde(n){const e=await ot(`${Pc}/`,{method:"POST",headers:bt(),body:JSON.stringify(n)});if(!e.ok){const t=await e.json();throw new Error(t.detail||"创建表达方式失败")}return e.json()}async function Ode(n,e){const t=await ot(`${Pc}/${n}`,{method:"PATCH",headers:bt(),body:JSON.stringify(e)});if(!t.ok){const r=await t.json();throw new Error(r.detail||"更新表达方式失败")}return t.json()}async function kde(n){const e=await ot(`${Pc}/${n}`,{method:"DELETE",headers:bt()});if(!e.ok){const t=await e.json();throw new Error(t.detail||"删除表达方式失败")}return e.json()}async function jde(n){const e=await ot(`${Pc}/batch/delete`,{method:"POST",headers:bt(),body:JSON.stringify({ids:n})});if(!e.ok){const t=await e.json();throw new Error(t.detail||"批量删除表达方式失败")}return e.json()}async function Nde(){const n=await ot(`${Pc}/stats/summary`,{headers:bt()});if(!n.ok){const e=await n.json();throw new Error(e.detail||"获取统计数据失败")}return n.json()}function Cde(){const[n,e]=S.useState([]),[t,r]=S.useState(!0),[s,i]=S.useState(0),[l,c]=S.useState(1),[u,h]=S.useState(20),[m,p]=S.useState(""),[x,v]=S.useState(null),[b,O]=S.useState(!1),[k,j]=S.useState(!1),[T,M]=S.useState(!1),[_,D]=S.useState(null),[E,z]=S.useState(new Set),[Q,q]=S.useState(!1),[B,U]=S.useState(""),[V,ce]=S.useState({total:0,recent_7days:0,chat_count:0,top_chats:{}}),{toast:W}=Pr(),J=async()=>{try{r(!0);const $=await bde({page:l,page_size:u,search:m||void 0});e($.data),i($.total)}catch($){W({title:"加载失败",description:$ instanceof Error?$.message:"无法加载表达方式",variant:"destructive"})}finally{r(!1)}},H=async()=>{try{const $=await Nde();$?.data&&ce($.data)}catch($){console.error("加载统计数据失败:",$)}};S.useEffect(()=>{J(),H()},[l,u,m]);const ae=async $=>{try{const fe=await wde($.id);v(fe.data),O(!0)}catch(fe){W({title:"加载详情失败",description:fe instanceof Error?fe.message:"无法加载表达方式详情",variant:"destructive"})}},ne=$=>{v($),j(!0)},ue=async $=>{try{await kde($.id),W({title:"删除成功",description:`已删除表达方式: ${$.situation}`}),D(null),J(),H()}catch(fe){W({title:"删除失败",description:fe instanceof Error?fe.message:"无法删除表达方式",variant:"destructive"})}},R=$=>{const fe=new Set(E);fe.has($)?fe.delete($):fe.add($),z(fe)},me=()=>{E.size===n.length&&n.length>0?z(new Set):z(new Set(n.map($=>$.id)))},Y=async()=>{try{await jde(Array.from(E)),W({title:"批量删除成功",description:`已删除 ${E.size} 个表达方式`}),z(new Set),q(!1),J(),H()}catch($){W({title:"批量删除失败",description:$ instanceof Error?$.message:"无法批量删除表达方式",variant:"destructive"})}},P=()=>{const $=parseInt(B),fe=Math.ceil(s/u);$>=1&&$<=fe?(c($),U("")):W({title:"无效的页码",description:`请输入1-${fe}之间的页码`,variant:"destructive"})},K=$=>$?new Date($*1e3).toLocaleString("zh-CN"):"-";return a.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[a.jsx("div",{className:"mb-4 sm:mb-6",children:a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[a.jsx(Gf,{className:"h-8 w-8",strokeWidth:2}),"表达方式管理"]}),a.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦的表达方式和话术模板"})]}),a.jsxs(ie,{onClick:()=>M(!0),className:"gap-2",children:[a.jsx(Wr,{className:"h-4 w-4"}),"新增表达方式"]})]})}),a.jsx(fn,{className:"flex-1",children:a.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[a.jsx("div",{className:"text-sm text-muted-foreground",children:"总数量"}),a.jsx("div",{className:"text-2xl font-bold mt-1",children:V.total})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[a.jsx("div",{className:"text-sm text-muted-foreground",children:"近7天新增"}),a.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:V.recent_7days})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[a.jsx("div",{className:"text-sm text-muted-foreground",children:"关联聊天数"}),a.jsx("div",{className:"text-2xl font-bold mt-1 text-blue-600",children:V.chat_count})]})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[a.jsx(te,{htmlFor:"search",children:"搜索"}),a.jsx("div",{className:"flex flex-col sm:flex-row gap-2 mt-1.5",children:a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(Ps,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),a.jsx(Ae,{id:"search",placeholder:"搜索情境、风格或上下文...",value:m,onChange:$=>p($.target.value),className:"pl-9"})]})}),a.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 mt-4 pt-4 border-t",children:[a.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:E.size>0&&a.jsxs("span",{children:["已选择 ",E.size," 个表达方式"]})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(te,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),a.jsxs(Bt,{value:u.toString(),onValueChange:$=>{h(parseInt($)),c(1),z(new Set)},children:[a.jsx(Dt,{id:"page-size",className:"w-20",children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"10",children:"10"}),a.jsx(Pe,{value:"20",children:"20"}),a.jsx(Pe,{value:"50",children:"50"}),a.jsx(Pe,{value:"100",children:"100"})]})]}),E.size>0&&a.jsxs(a.Fragment,{children:[a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>z(new Set),children:"取消选择"}),a.jsxs(ie,{variant:"destructive",size:"sm",onClick:()=>q(!0),children:[a.jsx(Ht,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),a.jsxs("div",{className:"rounded-lg border bg-card",children:[a.jsx("div",{className:"hidden md:block",children:a.jsxs(Ac,{children:[a.jsx(Ec,{children:a.jsxs(xr,{children:[a.jsx(gt,{className:"w-12",children:a.jsx(ss,{checked:E.size===n.length&&n.length>0,onCheckedChange:me})}),a.jsx(gt,{children:"情境"}),a.jsx(gt,{children:"风格"}),a.jsx(gt,{children:"聊天ID"}),a.jsx(gt,{children:"最后活跃"}),a.jsx(gt,{className:"text-right",children:"操作"})]})}),a.jsx(_c,{children:t?a.jsx(xr,{children:a.jsx(it,{colSpan:6,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):n.length===0?a.jsx(xr,{children:a.jsx(it,{colSpan:6,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):n.map($=>a.jsxs(xr,{children:[a.jsx(it,{children:a.jsx(ss,{checked:E.has($.id),onCheckedChange:()=>R($.id)})}),a.jsx(it,{className:"font-medium max-w-xs truncate",children:$.situation}),a.jsx(it,{className:"max-w-xs truncate",children:$.style}),a.jsx(it,{className:"font-mono text-sm",children:$.chat_id}),a.jsx(it,{className:"text-sm text-muted-foreground",children:K($.last_active_time)}),a.jsx(it,{className:"text-right",children:a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>ae($),children:[a.jsx(qi,{className:"h-4 w-4 mr-1"}),"详情"]}),a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>ne($),children:[a.jsx(sd,{className:"h-4 w-4 mr-1"}),"编辑"]}),a.jsxs(ie,{size:"sm",onClick:()=>D($),className:"bg-red-600 hover:bg-red-700 text-white",children:[a.jsx(Ht,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},$.id))})]})}),a.jsx("div",{className:"md:hidden space-y-3 p-4",children:t?a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):n.length===0?a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):n.map($=>a.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(ss,{checked:E.has($.id),onCheckedChange:()=>R($.id),className:"mt-1"}),a.jsxs("div",{className:"min-w-0 flex-1 overflow-hidden space-y-2",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"情境"}),a.jsx("h3",{className:"font-semibold text-sm line-clamp-2 w-full break-all",title:$.situation,children:$.situation})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"风格"}),a.jsx("p",{className:"text-sm line-clamp-2 w-full break-all",title:$.style,children:$.style})]})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"聊天ID"}),a.jsx("p",{className:"font-mono text-xs truncate",children:$.chat_id})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"最后活跃"}),a.jsx("p",{className:"text-xs",children:K($.last_active_time)})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>ae($),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[a.jsx(qi,{className:"h-3 w-3 mr-1"}),"查看"]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>ne($),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[a.jsx(sd,{className:"h-3 w-3 mr-1"}),"编辑"]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>D($),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[a.jsx(Ht,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},$.id))}),s>0&&a.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[a.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",s," 条记录,第 ",l," / ",Math.ceil(s/u)," 页"]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>c(1),disabled:l===1,className:"hidden sm:flex",children:a.jsx(Yf,{className:"h-4 w-4"})}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>c(l-1),disabled:l===1,children:[a.jsx(Tc,{className:"h-4 w-4 sm:mr-1"}),a.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ae,{type:"number",value:B,onChange:$=>U($.target.value),onKeyDown:$=>$.key==="Enter"&&P(),placeholder:l.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(s/u)}),a.jsx(ie,{variant:"outline",size:"sm",onClick:P,disabled:!B,className:"h-8",children:"跳转"})]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>c(l+1),disabled:l>=Math.ceil(s/u),children:[a.jsx("span",{className:"hidden sm:inline",children:"下一页"}),a.jsx(Mc,{className:"h-4 w-4 sm:ml-1"})]}),a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>c(Math.ceil(s/u)),disabled:l>=Math.ceil(s/u),className:"hidden sm:flex",children:a.jsx(Kf,{className:"h-4 w-4"})})]})]})]})]})}),a.jsx(Tde,{expression:x,open:b,onOpenChange:O}),a.jsx(Mde,{open:T,onOpenChange:M,onSuccess:()=>{J(),H(),M(!1)}}),a.jsx(Ade,{expression:x,open:k,onOpenChange:j,onSuccess:()=>{J(),H(),j(!1)}}),a.jsx(mn,{open:!!_,onOpenChange:()=>D(null),children:a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:['确定要删除表达方式 "',_?.situation,'" 吗? 此操作不可撤销。']})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>_&&ue(_),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),a.jsx(Ede,{open:Q,onOpenChange:q,onConfirm:Y,count:E.size})]})}function Tde({expression:n,open:e,onOpenChange:t}){if(!n)return null;const r=s=>s?new Date(s*1e3).toLocaleString("zh-CN"):"-";return a.jsx(Rr,{open:e,onOpenChange:t,children:a.jsxs(Nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:"表达方式详情"}),a.jsx(Gr,{children:"查看表达方式的完整信息"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsx(Mu,{label:"情境",value:n.situation}),a.jsx(Mu,{label:"风格",value:n.style}),a.jsx(Mu,{icon:pg,label:"聊天ID",value:n.chat_id,mono:!0}),a.jsx(Mu,{icon:pg,label:"记录ID",value:n.id.toString(),mono:!0})]}),n.context&&a.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[a.jsx(te,{className:"text-xs text-muted-foreground",children:"上下文"}),a.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:n.context})]}),n.up_content&&a.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[a.jsx(te,{className:"text-xs text-muted-foreground",children:"上文内容"}),a.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:n.up_content})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsx(Mu,{icon:uc,label:"最后活跃",value:r(n.last_active_time)}),a.jsx(Mu,{icon:uc,label:"创建时间",value:r(n.create_date)})]})]}),a.jsx(ps,{children:a.jsx(ie,{onClick:()=>t(!1),children:"关闭"})})]})})}function Mu({icon:n,label:e,value:t,mono:r=!1}){return a.jsxs("div",{className:"space-y-1",children:[a.jsxs(te,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[n&&a.jsx(n,{className:"h-3 w-3"}),e]}),a.jsx("div",{className:ve("text-sm",r&&"font-mono",!t&&"text-muted-foreground"),children:t||"-"})]})}function Mde({open:n,onOpenChange:e,onSuccess:t}){const[r,s]=S.useState({situation:"",style:"",context:"",up_content:"",chat_id:""}),[i,l]=S.useState(!1),{toast:c}=Pr(),u=async()=>{if(!r.situation||!r.style||!r.chat_id){c({title:"验证失败",description:"请填写必填字段:情境、风格和聊天ID",variant:"destructive"});return}try{l(!0),await Sde(r),c({title:"创建成功",description:"表达方式已创建"}),s({situation:"",style:"",context:"",up_content:"",chat_id:""}),t()}catch(h){c({title:"创建失败",description:h instanceof Error?h.message:"无法创建表达方式",variant:"destructive"})}finally{l(!1)}};return a.jsx(Rr,{open:n,onOpenChange:e,children:a.jsxs(Nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:"新增表达方式"}),a.jsx(Gr,{children:"创建新的表达方式记录"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs(te,{htmlFor:"situation",children:["情境 ",a.jsx("span",{className:"text-destructive",children:"*"})]}),a.jsx(Ae,{id:"situation",value:r.situation,onChange:h=>s({...r,situation:h.target.value}),placeholder:"描述使用场景"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(te,{htmlFor:"style",children:["风格 ",a.jsx("span",{className:"text-destructive",children:"*"})]}),a.jsx(Ae,{id:"style",value:r.style,onChange:h=>s({...r,style:h.target.value}),placeholder:"描述表达风格"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(te,{htmlFor:"chat_id",children:["聊天ID ",a.jsx("span",{className:"text-destructive",children:"*"})]}),a.jsx(Ae,{id:"chat_id",value:r.chat_id,onChange:h=>s({...r,chat_id:h.target.value}),placeholder:"关联的聊天ID"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"context",children:"上下文"}),a.jsx(kn,{id:"context",value:r.context,onChange:h=>s({...r,context:h.target.value}),placeholder:"上下文信息(可选)",rows:3})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"up_content",children:"上文内容"}),a.jsx(kn,{id:"up_content",value:r.up_content,onChange:h=>s({...r,up_content:h.target.value}),placeholder:"上文内容(可选)",rows:3})]})]}),a.jsxs(ps,{children:[a.jsx(ie,{variant:"outline",onClick:()=>e(!1),children:"取消"}),a.jsx(ie,{onClick:u,disabled:i,children:i?"创建中...":"创建"})]})]})})}function Ade({expression:n,open:e,onOpenChange:t,onSuccess:r}){const[s,i]=S.useState({}),[l,c]=S.useState(!1),{toast:u}=Pr();S.useEffect(()=>{n&&i({situation:n.situation,style:n.style,context:n.context||"",up_content:n.up_content||"",chat_id:n.chat_id})},[n]);const h=async()=>{if(n)try{c(!0),await Ode(n.id,s),u({title:"保存成功",description:"表达方式已更新"}),r()}catch(m){u({title:"保存失败",description:m instanceof Error?m.message:"无法更新表达方式",variant:"destructive"})}finally{c(!1)}};return n?a.jsx(Rr,{open:e,onOpenChange:t,children:a.jsxs(Nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:"编辑表达方式"}),a.jsx(Gr,{children:"修改表达方式的信息"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"edit_situation",children:"情境"}),a.jsx(Ae,{id:"edit_situation",value:s.situation||"",onChange:m=>i({...s,situation:m.target.value}),placeholder:"描述使用场景"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"edit_style",children:"风格"}),a.jsx(Ae,{id:"edit_style",value:s.style||"",onChange:m=>i({...s,style:m.target.value}),placeholder:"描述表达风格"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"edit_chat_id",children:"聊天ID"}),a.jsx(Ae,{id:"edit_chat_id",value:s.chat_id||"",onChange:m=>i({...s,chat_id:m.target.value}),placeholder:"关联的聊天ID"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"edit_context",children:"上下文"}),a.jsx(kn,{id:"edit_context",value:s.context||"",onChange:m=>i({...s,context:m.target.value}),placeholder:"上下文信息",rows:3})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"edit_up_content",children:"上文内容"}),a.jsx(kn,{id:"edit_up_content",value:s.up_content||"",onChange:m=>i({...s,up_content:m.target.value}),placeholder:"上文内容",rows:3})]})]}),a.jsxs(ps,{children:[a.jsx(ie,{variant:"outline",onClick:()=>t(!1),children:"取消"}),a.jsx(ie,{onClick:h,disabled:l,children:l?"保存中...":"保存"})]})]})}):null}function Ede({open:n,onOpenChange:e,onConfirm:t,count:r}){return a.jsx(mn,{open:n,onOpenChange:e,children:a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认批量删除"}),a.jsxs(un,{children:["您即将删除 ",r," 个表达方式,此操作无法撤销。确定要继续吗?"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:t,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"确认删除"})]})]})})}const Ld="/api/webui/person";async function _de(n){const e=new URLSearchParams;n.page&&e.append("page",n.page.toString()),n.page_size&&e.append("page_size",n.page_size.toString()),n.search&&e.append("search",n.search),n.is_known!==void 0&&e.append("is_known",n.is_known.toString()),n.platform&&e.append("platform",n.platform);const t=await ot(`${Ld}/list?${e}`,{headers:bt()});if(!t.ok){const r=await t.json();throw new Error(r.detail||"获取人物列表失败")}return t.json()}async function Dde(n){const e=await ot(`${Ld}/${n}`,{headers:bt()});if(!e.ok){const t=await e.json();throw new Error(t.detail||"获取人物详情失败")}return e.json()}async function Rde(n,e){const t=await ot(`${Ld}/${n}`,{method:"PATCH",headers:bt(),body:JSON.stringify(e)});if(!t.ok){const r=await t.json();throw new Error(r.detail||"更新人物信息失败")}return t.json()}async function zde(n){const e=await ot(`${Ld}/${n}`,{method:"DELETE",headers:bt()});if(!e.ok){const t=await e.json();throw new Error(t.detail||"删除人物信息失败")}return e.json()}async function Pde(){const n=await ot(`${Ld}/stats/summary`,{headers:bt()});if(!n.ok){const e=await n.json();throw new Error(e.detail||"获取统计数据失败")}return n.json()}async function Lde(n){const e=await ot(`${Ld}/batch/delete`,{method:"POST",headers:bt(),body:JSON.stringify({person_ids:n})});if(!e.ok){const t=await e.json();throw new Error(t.detail||"批量删除失败")}return e.json()}function Bde(){const[n,e]=S.useState([]),[t,r]=S.useState(!0),[s,i]=S.useState(0),[l,c]=S.useState(1),[u,h]=S.useState(20),[m,p]=S.useState(""),[x,v]=S.useState(void 0),[b,O]=S.useState(void 0),[k,j]=S.useState(null),[T,M]=S.useState(!1),[_,D]=S.useState(!1),[E,z]=S.useState(null),[Q,q]=S.useState({total:0,known:0,unknown:0,platforms:{}}),[B,U]=S.useState(new Set),[V,ce]=S.useState(!1),[W,J]=S.useState(""),{toast:H}=Pr(),ae=async()=>{try{r(!0);const de=await _de({page:l,page_size:u,search:m||void 0,is_known:x,platform:b});e(de.data),i(de.total)}catch(de){H({title:"加载失败",description:de instanceof Error?de.message:"无法加载人物信息",variant:"destructive"})}finally{r(!1)}},ne=async()=>{try{const de=await Pde();de?.data&&q(de.data)}catch(de){console.error("加载统计数据失败:",de)}};S.useEffect(()=>{ae(),ne()},[l,u,m,x,b]);const ue=async de=>{try{const We=await Dde(de.person_id);j(We.data),M(!0)}catch(We){H({title:"加载详情失败",description:We instanceof Error?We.message:"无法加载人物详情",variant:"destructive"})}},R=de=>{j(de),D(!0)},me=async de=>{try{await zde(de.person_id),H({title:"删除成功",description:`已删除人物信息: ${de.person_name||de.nickname||de.user_id}`}),z(null),ae(),ne()}catch(We){H({title:"删除失败",description:We instanceof Error?We.message:"无法删除人物信息",variant:"destructive"})}},Y=S.useMemo(()=>Object.keys(Q.platforms),[Q.platforms]),P=de=>{const We=new Set(B);We.has(de)?We.delete(de):We.add(de),U(We)},K=()=>{B.size===n.length&&n.length>0?U(new Set):U(new Set(n.map(de=>de.person_id)))},$=()=>{if(B.size===0){H({title:"未选择任何人物",description:"请先选择要删除的人物",variant:"destructive"});return}ce(!0)},fe=async()=>{try{const de=await Lde(Array.from(B));H({title:"批量删除完成",description:de.message}),U(new Set),ce(!1),ae(),ne()}catch(de){H({title:"批量删除失败",description:de instanceof Error?de.message:"批量删除失败",variant:"destructive"})}},ye=()=>{const de=parseInt(W),We=Math.ceil(s/u);de>=1&&de<=We?(c(de),J("")):H({title:"无效的页码",description:`请输入1-${We}之间的页码`,variant:"destructive"})},Re=de=>de?new Date(de*1e3).toLocaleString("zh-CN"):"-";return a.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[a.jsx("div",{className:"mb-4 sm:mb-6",children:a.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[a.jsx(EF,{className:"h-8 w-8",strokeWidth:2}),"人物信息管理"]}),a.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦认识的所有人物信息"})]})})}),a.jsx(fn,{className:"flex-1",children:a.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[a.jsx("div",{className:"text-sm text-muted-foreground",children:"总人数"}),a.jsx("div",{className:"text-2xl font-bold mt-1",children:Q.total})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[a.jsx("div",{className:"text-sm text-muted-foreground",children:"已认识"}),a.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:Q.known})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[a.jsx("div",{className:"text-sm text-muted-foreground",children:"未认识"}),a.jsx("div",{className:"text-2xl font-bold mt-1 text-muted-foreground",children:Q.unknown})]})]}),a.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"sm:col-span-2",children:[a.jsx(te,{htmlFor:"search",children:"搜索"}),a.jsxs("div",{className:"relative mt-1.5",children:[a.jsx(Ps,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),a.jsx(Ae,{id:"search",placeholder:"搜索名称、昵称或用户ID...",value:m,onChange:de=>p(de.target.value),className:"pl-9"})]})]}),a.jsxs("div",{children:[a.jsx(te,{htmlFor:"filter-known",children:"认识状态"}),a.jsxs(Bt,{value:x===void 0?"all":x.toString(),onValueChange:de=>{v(de==="all"?void 0:de==="true"),c(1)},children:[a.jsx(Dt,{id:"filter-known",className:"mt-1.5",children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"all",children:"全部"}),a.jsx(Pe,{value:"true",children:"已认识"}),a.jsx(Pe,{value:"false",children:"未认识"})]})]})]}),a.jsxs("div",{children:[a.jsx(te,{htmlFor:"filter-platform",children:"平台"}),a.jsxs(Bt,{value:b||"all",onValueChange:de=>{O(de==="all"?void 0:de),c(1)},children:[a.jsx(Dt,{id:"filter-platform",className:"mt-1.5",children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"all",children:"全部平台"}),Y.map(de=>a.jsxs(Pe,{value:de,children:[de," (",Q.platforms[de],")"]},de))]})]})]})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 mt-4 pt-4 border-t",children:[a.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:B.size>0&&a.jsxs("span",{children:["已选择 ",B.size," 个人物"]})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(te,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),a.jsxs(Bt,{value:u.toString(),onValueChange:de=>{h(parseInt(de)),c(1),U(new Set)},children:[a.jsx(Dt,{id:"page-size",className:"w-20",children:a.jsx(It,{})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"10",children:"10"}),a.jsx(Pe,{value:"20",children:"20"}),a.jsx(Pe,{value:"50",children:"50"}),a.jsx(Pe,{value:"100",children:"100"})]})]}),B.size>0&&a.jsxs(a.Fragment,{children:[a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>U(new Set),children:"取消选择"}),a.jsxs(ie,{variant:"destructive",size:"sm",onClick:$,children:[a.jsx(Ht,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),a.jsxs("div",{className:"rounded-lg border bg-card",children:[a.jsx("div",{className:"hidden md:block",children:a.jsxs(Ac,{children:[a.jsx(Ec,{children:a.jsxs(xr,{children:[a.jsx(gt,{className:"w-12",children:a.jsx(ss,{checked:n.length>0&&B.size===n.length,onCheckedChange:K,"aria-label":"全选"})}),a.jsx(gt,{children:"状态"}),a.jsx(gt,{children:"名称"}),a.jsx(gt,{children:"昵称"}),a.jsx(gt,{children:"平台"}),a.jsx(gt,{children:"用户ID"}),a.jsx(gt,{children:"最后更新"}),a.jsx(gt,{className:"text-right",children:"操作"})]})}),a.jsx(_c,{children:t?a.jsx(xr,{children:a.jsx(it,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):n.length===0?a.jsx(xr,{children:a.jsx(it,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):n.map(de=>a.jsxs(xr,{children:[a.jsx(it,{children:a.jsx(ss,{checked:B.has(de.person_id),onCheckedChange:()=>P(de.person_id),"aria-label":`选择 ${de.person_name||de.nickname||de.user_id}`})}),a.jsx(it,{children:a.jsx("div",{className:ve("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",de.is_known?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"),children:de.is_known?"已认识":"未认识"})}),a.jsx(it,{className:"font-medium",children:de.person_name||a.jsx("span",{className:"text-muted-foreground",children:"-"})}),a.jsx(it,{children:de.nickname||"-"}),a.jsx(it,{children:de.platform}),a.jsx(it,{className:"font-mono text-sm",children:de.user_id}),a.jsx(it,{className:"text-sm text-muted-foreground",children:Re(de.last_know)}),a.jsx(it,{className:"text-right",children:a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>ue(de),children:[a.jsx(qi,{className:"h-4 w-4 mr-1"}),"详情"]}),a.jsxs(ie,{variant:"default",size:"sm",onClick:()=>R(de),children:[a.jsx(sd,{className:"h-4 w-4 mr-1"}),"编辑"]}),a.jsxs(ie,{size:"sm",onClick:()=>z(de),className:"bg-red-600 hover:bg-red-700 text-white",children:[a.jsx(Ht,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},de.id))})]})}),a.jsx("div",{className:"md:hidden space-y-3 p-4",children:t?a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):n.length===0?a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):n.map(de=>a.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(ss,{checked:B.has(de.person_id),onCheckedChange:()=>P(de.person_id),className:"mt-1"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:ve("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium mb-2",de.is_known?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"),children:de.is_known?"已认识":"未认识"}),a.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",children:de.person_name||a.jsx("span",{className:"text-muted-foreground",children:"未命名"})}),de.nickname&&a.jsxs("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-1 w-full break-all",children:["昵称: ",de.nickname]})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"平台"}),a.jsx("p",{className:"font-medium text-xs",children:de.platform})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"用户ID"}),a.jsx("p",{className:"font-mono text-xs truncate",title:de.user_id,children:de.user_id})]}),a.jsxs("div",{className:"col-span-2",children:[a.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"最后更新"}),a.jsx("p",{className:"text-xs",children:Re(de.last_know)})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>ue(de),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[a.jsx(qi,{className:"h-3 w-3 mr-1"}),"查看"]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>R(de),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[a.jsx(sd,{className:"h-3 w-3 mr-1"}),"编辑"]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>z(de),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[a.jsx(Ht,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},de.id))}),s>0&&a.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[a.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",s," 条记录,第 ",l," / ",Math.ceil(s/u)," 页"]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>c(1),disabled:l===1,className:"hidden sm:flex",children:a.jsx(Yf,{className:"h-4 w-4"})}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>c(l-1),disabled:l===1,children:[a.jsx(Tc,{className:"h-4 w-4 sm:mr-1"}),a.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ae,{type:"number",value:W,onChange:de=>J(de.target.value),onKeyDown:de=>de.key==="Enter"&&ye(),placeholder:l.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(s/u)}),a.jsx(ie,{variant:"outline",size:"sm",onClick:ye,disabled:!W,className:"h-8",children:"跳转"})]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>c(l+1),disabled:l>=Math.ceil(s/u),children:[a.jsx("span",{className:"hidden sm:inline",children:"下一页"}),a.jsx(Mc,{className:"h-4 w-4 sm:ml-1"})]}),a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>c(Math.ceil(s/u)),disabled:l>=Math.ceil(s/u),className:"hidden sm:flex",children:a.jsx(Kf,{className:"h-4 w-4"})})]})]})]})]})}),a.jsx(Ide,{person:k,open:T,onOpenChange:M}),a.jsx(Fde,{person:k,open:_,onOpenChange:D,onSuccess:()=>{ae(),ne(),D(!1)}}),a.jsx(mn,{open:!!E,onOpenChange:()=>z(null),children:a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认删除"}),a.jsxs(un,{children:['确定要删除人物信息 "',E?.person_name||E?.nickname||E?.user_id,'" 吗? 此操作不可撤销。']})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:()=>E&&me(E),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),a.jsx(mn,{open:V,onOpenChange:ce,children:a.jsxs(an,{children:[a.jsxs(ln,{children:[a.jsx(cn,{children:"确认批量删除"}),a.jsxs(un,{children:["确定要删除选中的 ",B.size," 个人物信息吗? 此操作不可撤销。"]})]}),a.jsxs(on,{children:[a.jsx(hn,{children:"取消"}),a.jsx(dn,{onClick:fe,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})})]})}function Ide({person:n,open:e,onOpenChange:t}){if(!n)return null;const r=s=>s?new Date(s*1e3).toLocaleString("zh-CN"):"-";return a.jsx(Rr,{open:e,onOpenChange:t,children:a.jsxs(Nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:"人物详情"}),a.jsxs(Gr,{children:["查看 ",n.person_name||n.nickname||n.user_id," 的完整信息"]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsx(Ka,{icon:q9,label:"人物名称",value:n.person_name}),a.jsx(Ka,{icon:Gf,label:"昵称",value:n.nickname}),a.jsx(Ka,{icon:pg,label:"用户ID",value:n.user_id,mono:!0}),a.jsx(Ka,{icon:pg,label:"人物ID",value:n.person_id,mono:!0}),a.jsx(Ka,{label:"平台",value:n.platform}),a.jsx(Ka,{label:"状态",value:n.is_known?"已认识":"未认识"})]}),n.name_reason&&a.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[a.jsx(te,{className:"text-xs text-muted-foreground",children:"名称设定原因"}),a.jsx("p",{className:"mt-1 text-sm",children:n.name_reason})]}),n.memory_points&&a.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[a.jsx(te,{className:"text-xs text-muted-foreground",children:"个人印象"}),a.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:n.memory_points})]}),n.group_nick_name&&n.group_nick_name.length>0&&a.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[a.jsx(te,{className:"text-xs text-muted-foreground",children:"群昵称"}),a.jsx("div",{className:"mt-2 space-y-1",children:n.group_nick_name.map((s,i)=>a.jsxs("div",{className:"text-sm flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:s.group_id}),a.jsx("span",{children:"→"}),a.jsx("span",{children:s.group_nick_name})]},i))})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[a.jsx(Ka,{icon:uc,label:"认识时间",value:r(n.know_times)}),a.jsx(Ka,{icon:uc,label:"首次记录",value:r(n.know_since)}),a.jsx(Ka,{icon:uc,label:"最后更新",value:r(n.last_know)})]})]}),a.jsx(ps,{children:a.jsx(ie,{onClick:()=>t(!1),children:"关闭"})})]})})}function Ka({icon:n,label:e,value:t,mono:r=!1}){return a.jsxs("div",{className:"space-y-1",children:[a.jsxs(te,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[n&&a.jsx(n,{className:"h-3 w-3"}),e]}),a.jsx("div",{className:ve("text-sm",r&&"font-mono",!t&&"text-muted-foreground"),children:t||"-"})]})}function Fde({person:n,open:e,onOpenChange:t,onSuccess:r}){const[s,i]=S.useState({}),[l,c]=S.useState(!1),{toast:u}=Pr();S.useEffect(()=>{n&&i({person_name:n.person_name||"",name_reason:n.name_reason||"",nickname:n.nickname||"",memory_points:n.memory_points||"",is_known:n.is_known})},[n]);const h=async()=>{if(n)try{c(!0),await Rde(n.person_id,s),u({title:"保存成功",description:"人物信息已更新"}),r()}catch(m){u({title:"保存失败",description:m instanceof Error?m.message:"无法更新人物信息",variant:"destructive"})}finally{c(!1)}};return n?a.jsx(Rr,{open:e,onOpenChange:t,children:a.jsxs(Nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:"编辑人物信息"}),a.jsxs(Gr,{children:["修改 ",n.person_name||n.nickname||n.user_id," 的信息"]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"person_name",children:"人物名称"}),a.jsx(Ae,{id:"person_name",value:s.person_name||"",onChange:m=>i({...s,person_name:m.target.value}),placeholder:"为这个人设置一个名称"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"nickname",children:"昵称"}),a.jsx(Ae,{id:"nickname",value:s.nickname||"",onChange:m=>i({...s,nickname:m.target.value}),placeholder:"昵称"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"name_reason",children:"名称设定原因"}),a.jsx(kn,{id:"name_reason",value:s.name_reason||"",onChange:m=>i({...s,name_reason:m.target.value}),placeholder:"为什么这样称呼这个人?",rows:2})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"memory_points",children:"个人印象"}),a.jsx(kn,{id:"memory_points",value:s.memory_points||"",onChange:m=>i({...s,memory_points:m.target.value}),placeholder:"对这个人的印象和记忆点...",rows:4})]}),a.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[a.jsxs("div",{children:[a.jsx(te,{htmlFor:"is_known",className:"text-base font-medium",children:"已认识"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"标记是否已经认识这个人"})]}),a.jsx(jt,{id:"is_known",checked:s.is_known,onCheckedChange:m=>i({...s,is_known:m})})]})]}),a.jsxs(ps,{children:[a.jsx(ie,{variant:"outline",onClick:()=>t(!1),children:"取消"}),a.jsx(ie,{onClick:h,disabled:l,children:l?"保存中...":"保存"})]})]})}):null}function Au(n,e,t){let r=t.initialDeps??[],s;function i(){var l,c,u,h;let m;t.key&&((l=t.debug)!=null&&l.call(t))&&(m=Date.now());const p=n();if(!(p.length!==r.length||p.some((b,O)=>r[O]!==b)))return s;r=p;let v;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(v=Date.now()),s=e(...p),t.key&&((u=t.debug)!=null&&u.call(t))){const b=Math.round((Date.now()-m)*100)/100,O=Math.round((Date.now()-v)*100)/100,k=O/16,j=(T,M)=>{for(T=String(T);T.length<M;)T=" "+T;return T};console.info(`%c⏱ ${j(O,5)} /${j(b,5)} ms`,`
|
||
font-size: .6rem;
|
||
font-weight: bold;
|
||
color: hsl(${Math.max(0,Math.min(120-120*k,120))}deg 100% 31%);`,t?.key)}return(h=t?.onChange)==null||h.call(t,s),s}return i.updateDeps=l=>{r=l},i}function GN(n,e){if(n===void 0)throw new Error("Unexpected undefined");return n}const qde=(n,e)=>Math.abs(n-e)<1.01,Qde=(n,e,t)=>{let r;return function(...s){n.clearTimeout(r),r=n.setTimeout(()=>e.apply(this,s),t)}},XN=n=>{const{offsetWidth:e,offsetHeight:t}=n;return{width:e,height:t}},$de=n=>n,Hde=n=>{const e=Math.max(n.startIndex-n.overscan,0),t=Math.min(n.endIndex+n.overscan,n.count-1),r=[];for(let s=e;s<=t;s++)r.push(s);return r},Ude=(n,e)=>{const t=n.scrollElement;if(!t)return;const r=n.targetWindow;if(!r)return;const s=l=>{const{width:c,height:u}=l;e({width:Math.round(c),height:Math.round(u)})};if(s(XN(t)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(l=>{const c=()=>{const u=l[0];if(u?.borderBoxSize){const h=u.borderBoxSize[0];if(h){s({width:h.inlineSize,height:h.blockSize});return}}s(XN(t))};n.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},YN={passive:!0},KN=typeof window>"u"?!0:"onscrollend"in window,Vde=(n,e)=>{const t=n.scrollElement;if(!t)return;const r=n.targetWindow;if(!r)return;let s=0;const i=n.options.useScrollendEvent&&KN?()=>{}:Qde(r,()=>{e(s,!1)},n.options.isScrollingResetDelay),l=m=>()=>{const{horizontal:p,isRtl:x}=n.options;s=p?t.scrollLeft*(x&&-1||1):t.scrollTop,i(),e(s,m)},c=l(!0),u=l(!1);u(),t.addEventListener("scroll",c,YN);const h=n.options.useScrollendEvent&&KN;return h&&t.addEventListener("scrollend",u,YN),()=>{t.removeEventListener("scroll",c),h&&t.removeEventListener("scrollend",u)}},Wde=(n,e,t)=>{if(e?.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}return n[t.options.horizontal?"offsetWidth":"offsetHeight"]},Gde=(n,{adjustments:e=0,behavior:t},r)=>{var s,i;const l=n+e;(i=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[r.options.horizontal?"left":"top"]:l,behavior:t})};class Xde{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const l=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var i;return(i=r())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=r())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([r,s])=>{typeof s>"u"&&delete t[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:$de,rangeExtractor:Hde,onChange:()=>{},measureElement:Wde,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=Au(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{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(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=i,this.maybeNotify()}))}},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.getFurthestMeasurement=(t,r)=>{const s=new Map,i=new Map;for(let l=r-1;l>=0;l--){const c=t[l];if(s.has(c.lane))continue;const u=i.get(c.lane);if(u==null||c.end>u.end?i.set(c.lane,c):c.end<u.end&&s.set(c.lane,!0),s.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((l,c)=>l.end===c.end?l.index-c.index:l.end-c.end)[0]:void 0},this.getMeasurementOptions=Au(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,r,s,i,l)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:l}),{key:!1}),this.getMeasurements=Au(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:l},c)=>{if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(m=>{this.itemSizeCache.set(m.key,m.size)}));const u=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const h=this.measurementsCache.slice(0,u);for(let m=u;m<t;m++){const p=i(m),x=this.options.lanes===1?h[m-1]:this.getFurthestMeasurement(h,m),v=x?x.end+this.options.gap:r+s,b=c.get(p),O=typeof b=="number"?b:this.options.estimateSize(m),k=v+O,j=x?x.lane:m%this.options.lanes;h[m]={index:m,start:v,size:O,end:k,key:p,lane:j}}return this.measurementsCache=h,h},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Au(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,i)=>this.range=t.length>0&&r>0?Yde({measurements:t,outerSize:r,scrollOffset:s,lanes:i}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Au(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,i,l)=>i===null||l===null?[]:t({startIndex:i,endIndex:l,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,s=t.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(t,r)=>{const s=this.indexFromElement(t),i=this.measurementsCache[s];if(!i)return;const l=i.key,c=this.elementsCache.get(l);c!==t&&(c&&this.observer.unobserve(c),this.observer.observe(t),this.elementsCache.set(l,t)),t.isConnected&&this.resizeItem(s,this.options.measureElement(t,r,this))},this.resizeItem=(t,r)=>{const s=this.measurementsCache[t];if(!s)return;const i=this.itemSizeCache.get(s.key)??s.size,l=r-i;l!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,l,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=l,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,r)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,s)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(s))});return}this._measureElement(t,void 0)},this.getVirtualItems=Au(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let i=0,l=t.length;i<l;i++){const c=t[i],u=r[c];s.push(u)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length!==0)return GN(r[mz(0,r.length-1,s=>GN(r[s]).start,t)])},this.getOffsetForAlignment=(t,r,s=0)=>{const i=this.getSize(),l=this.getScrollOffset();r==="auto"&&(r=t>=l+i?"end":"start"),r==="center"?t+=(s-i)/2:r==="end"&&(t-=i);const c=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(c,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.measurementsCache[t];if(!s)return;const i=this.getSize(),l=this.getScrollOffset();if(r==="auto")if(s.end>=l+i-this.options.scrollPaddingEnd)r="end";else if(s.start<=l+this.options.scrollPaddingStart)r="start";else return[l,r];const c=r==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,r,s.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(t,{align:r="start",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,r),{adjustments:void 0,behavior:s})},this.scrollToIndex=(t,{align:r="auto",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),t=Math.max(0,Math.min(t,this.options.count-1));let i=0;const l=10,c=h=>{if(!this.targetWindow)return;const m=this.getOffsetForIndex(t,h);if(!m){console.warn("Failed to get offset for index:",t);return}const[p,x]=m;this._scrollToOffset(p,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const v=this.getScrollOffset(),b=this.getOffsetForIndex(t,x);if(!b){console.warn("Failed to get offset for index:",t);return}qde(b[0],v)||u(x)})},u=h=>{this.targetWindow&&(i++,i<l?this.targetWindow.requestAnimationFrame(()=>c(h)):console.warn(`Failed to scroll to index ${t} after ${l} attempts.`))};c(r)},this.scrollBy=(t,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((t=r[r.length-1])==null?void 0:t.end)??0;else{const i=Array(this.options.lanes).fill(null);let l=r.length-1;for(;l>=0&&i.some(c=>c===null);){const c=r[l];i[c.lane]===null&&(i[c.lane]=c.end),l--}s=Math.max(...i.filter(c=>c!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:r,behavior:s})=>{this.options.scrollToFn(t,{behavior:s,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const mz=(n,e,t,r)=>{for(;n<=e;){const s=(n+e)/2|0,i=t(s);if(i<r)n=s+1;else if(i>r)e=s-1;else return s}return n>0?n-1:0};function Yde({measurements:n,outerSize:e,scrollOffset:t,lanes:r}){const s=n.length-1,i=u=>n[u].start;if(n.length<=r)return{startIndex:0,endIndex:s};let l=mz(0,s,i,t),c=l;if(r===1)for(;c<s&&n[c].end<t+e;)c++;else if(r>1){const u=Array(r).fill(0);for(;c<s&&u.some(m=>m<t+e);){const m=n[c];u[m.lane]=m.end,c++}const h=Array(r).fill(t+e);for(;l>=0&&h.some(m=>m>=t);){const m=n[l];h[m.lane]=m.start,l--}l=Math.max(0,l-l%r),c=Math.min(s,c+(r-1-c%r))}return{startIndex:l,endIndex:c}}const ZN=typeof document<"u"?S.useLayoutEffect:S.useEffect;function Kde(n){const e=S.useReducer(()=>({}),{})[1],t={...n,onChange:(s,i)=>{var l;i?g9.flushSync(e):e(),(l=n.onChange)==null||l.call(n,s,i)}},[r]=S.useState(()=>new Xde(t));return r.setOptions(t),ZN(()=>r._didMount(),[]),ZN(()=>r._willUpdate()),r}function Zde(n){return Kde({observeElementRect:Ude,observeElementOffset:Vde,scrollToFn:Gde,...n})}function Jde(n,e,t="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:n,timeZoneName:t}).format(e).split(/\s/g).slice(2).join(" ")}const ehe={},Gh={};function cc(n,e){try{const r=(ehe[n]||=new Intl.DateTimeFormat("en-US",{timeZone:n,timeZoneName:"longOffset"}).format)(e).split("GMT")[1];return r in Gh?Gh[r]:JN(r,r.split(":"))}catch{if(n in Gh)return Gh[n];const t=n?.match(the);return t?JN(n,t.slice(1)):NaN}}const the=/([+-]\d\d):?(\d\d)?/;function JN(n,e){const t=+(e[0]||0),r=+(e[1]||0),s=+(e[2]||0)/60;return Gh[n]=t*60+r>0?t*60+r+s:t*60-r-s}class ga extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(cc(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),pz(this),P4(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new ga(...t,e):new ga(Date.now(),e)}withTimeZone(e){return new ga(+this,e)}getTimezoneOffset(){const e=-cc(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),P4(this),+this}[Symbol.for("constructDateFrom")](e){return new ga(+new Date(e),this.timeZone)}}const e9=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(n=>{if(!e9.test(n))return;const e=n.replace(e9,"$1UTC");ga.prototype[e]&&(n.startsWith("get")?ga.prototype[n]=function(){return this.internal[e]()}:(ga.prototype[n]=function(){return Date.prototype[e].apply(this.internal,arguments),nhe(this),+this},ga.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),P4(this),+this}))});function P4(n){n.internal.setTime(+n),n.internal.setUTCSeconds(n.internal.getUTCSeconds()-Math.round(-cc(n.timeZone,n)*60))}function nhe(n){Date.prototype.setFullYear.call(n,n.internal.getUTCFullYear(),n.internal.getUTCMonth(),n.internal.getUTCDate()),Date.prototype.setHours.call(n,n.internal.getUTCHours(),n.internal.getUTCMinutes(),n.internal.getUTCSeconds(),n.internal.getUTCMilliseconds()),pz(n)}function pz(n){const e=cc(n.timeZone,n),t=e>0?Math.floor(e):Math.ceil(e),r=new Date(+n);r.setUTCHours(r.getUTCHours()-1);const s=-new Date(+n).getTimezoneOffset(),i=-new Date(+r).getTimezoneOffset(),l=s-i,c=Date.prototype.getHours.apply(n)!==n.internal.getUTCHours();l&&c&&n.internal.setUTCMinutes(n.internal.getUTCMinutes()+l);const u=s-t;u&&Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+u);const h=new Date(+n);h.setUTCSeconds(0);const m=s>0?h.getSeconds():(h.getSeconds()-60)%60,p=Math.round(-(cc(n.timeZone,n)*60))%60;(p||m)&&(n.internal.setUTCSeconds(n.internal.getUTCSeconds()+p),Date.prototype.setUTCSeconds.call(n,Date.prototype.getUTCSeconds.call(n)+p+m));const x=cc(n.timeZone,n),v=x>0?Math.floor(x):Math.ceil(x),O=-new Date(+n).getTimezoneOffset()-v,k=v!==t,j=O-u;if(k&&j){Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+j);const T=cc(n.timeZone,n),M=T>0?Math.floor(T):Math.ceil(T),_=v-M;_&&(n.internal.setUTCMinutes(n.internal.getUTCMinutes()+_),Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+_))}}class Zr extends ga{static tz(e,...t){return t.length?new Zr(...t,e):new Zr(Date.now(),e)}toISOString(){const[e,t,r]=this.tzComponents(),s=`${e}${t}:${r}`;return this.internal.toISOString().slice(0,-1)+s}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,r,s]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${r} ${t} ${s}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,r,s]=this.tzComponents();return`${e} GMT${t}${r}${s} (${Jde(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),t=e>0?"-":"+",r=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),s=String(Math.abs(e)%60).padStart(2,"0");return[t,r,s]}withTimeZone(e){return new Zr(+this,e)}[Symbol.for("constructDateFrom")](e){return new Zr(+new Date(e),this.timeZone)}}const gz=6048e5,rhe=864e5,t9=Symbol.for("constructDateFrom");function vr(n,e){return typeof n=="function"?n(e):n&&typeof n=="object"&&t9 in n?n[t9](e):n instanceof Date?new n.constructor(e):new Date(e)}function Nn(n,e){return vr(e||n,n)}function xz(n,e,t){const r=Nn(n,t?.in);return isNaN(e)?vr(n,NaN):(e&&r.setDate(r.getDate()+e),r)}function vz(n,e,t){const r=Nn(n,t?.in);if(isNaN(e))return vr(n,NaN);if(!e)return r;const s=r.getDate(),i=vr(n,r.getTime());i.setMonth(r.getMonth()+e+1,0);const l=i.getDate();return s>=l?i:(r.setFullYear(i.getFullYear(),i.getMonth(),s),r)}let she={};function j0(){return she}function wo(n,e){const t=j0(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??t.weekStartsOn??t.locale?.options?.weekStartsOn??0,s=Nn(n,e?.in),i=s.getDay(),l=(i<r?7:0)+i-r;return s.setDate(s.getDate()-l),s.setHours(0,0,0,0),s}function Qf(n,e){return wo(n,{...e,weekStartsOn:1})}function yz(n,e){const t=Nn(n,e?.in),r=t.getFullYear(),s=vr(t,0);s.setFullYear(r+1,0,4),s.setHours(0,0,0,0);const i=Qf(s),l=vr(t,0);l.setFullYear(r,0,4),l.setHours(0,0,0,0);const c=Qf(l);return t.getTime()>=i.getTime()?r+1:t.getTime()>=c.getTime()?r:r-1}function n9(n){const e=Nn(n),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+n-+t}function Lc(n,...e){const t=vr.bind(null,n||e.find(r=>typeof r=="object"));return e.map(t)}function $f(n,e){const t=Nn(n,e?.in);return t.setHours(0,0,0,0),t}function bz(n,e,t){const[r,s]=Lc(t?.in,n,e),i=$f(r),l=$f(s),c=+i-n9(i),u=+l-n9(l);return Math.round((c-u)/rhe)}function ihe(n,e){const t=yz(n,e),r=vr(n,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),Qf(r)}function ahe(n,e,t){return xz(n,e*7,t)}function lhe(n,e,t){return vz(n,e*12,t)}function ohe(n,e){let t,r=e?.in;return n.forEach(s=>{!r&&typeof s=="object"&&(r=vr.bind(null,s));const i=Nn(s,r);(!t||t<i||isNaN(+i))&&(t=i)}),vr(r,t||NaN)}function che(n,e){let t,r=e?.in;return n.forEach(s=>{!r&&typeof s=="object"&&(r=vr.bind(null,s));const i=Nn(s,r);(!t||t>i||isNaN(+i))&&(t=i)}),vr(r,t||NaN)}function uhe(n,e,t){const[r,s]=Lc(t?.in,n,e);return+$f(r)==+$f(s)}function wz(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function dhe(n){return!(!wz(n)&&typeof n!="number"||isNaN(+Nn(n)))}function hhe(n,e,t){const[r,s]=Lc(t?.in,n,e),i=r.getFullYear()-s.getFullYear(),l=r.getMonth()-s.getMonth();return i*12+l}function fhe(n,e){const t=Nn(n,e?.in),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}function Sz(n,e){const[t,r]=Lc(n,e.start,e.end);return{start:t,end:r}}function mhe(n,e){const{start:t,end:r}=Sz(e?.in,n);let s=+t>+r;const i=s?+t:+r,l=s?r:t;l.setHours(0,0,0,0),l.setDate(1);let c=1;const u=[];for(;+l<=i;)u.push(vr(t,l)),l.setMonth(l.getMonth()+c);return s?u.reverse():u}function phe(n,e){const t=Nn(n,e?.in);return t.setDate(1),t.setHours(0,0,0,0),t}function ghe(n,e){const t=Nn(n,e?.in),r=t.getFullYear();return t.setFullYear(r+1,0,0),t.setHours(23,59,59,999),t}function Oz(n,e){const t=Nn(n,e?.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}function xhe(n,e){const{start:t,end:r}=Sz(e?.in,n);let s=+t>+r;const i=s?+t:+r,l=s?r:t;l.setHours(0,0,0,0),l.setMonth(0,1);let c=1;const u=[];for(;+l<=i;)u.push(vr(t,l)),l.setFullYear(l.getFullYear()+c);return s?u.reverse():u}function kz(n,e){const t=j0(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??t.weekStartsOn??t.locale?.options?.weekStartsOn??0,s=Nn(n,e?.in),i=s.getDay(),l=(i<r?-7:0)+6-(i-r);return s.setDate(s.getDate()+l),s.setHours(23,59,59,999),s}function vhe(n,e){return kz(n,{...e,weekStartsOn:1})}const yhe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},bhe=(n,e,t)=>{let r;const s=yhe[n];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),t?.addSuffix?t.comparison&&t.comparison>0?"in "+r:r+" ago":r};function nd(n){return(e={})=>{const t=e.width?String(e.width):n.defaultWidth;return n.formats[t]||n.formats[n.defaultWidth]}}const whe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},She={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ohe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},khe={date:nd({formats:whe,defaultWidth:"full"}),time:nd({formats:She,defaultWidth:"full"}),dateTime:nd({formats:Ohe,defaultWidth:"full"})},jhe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Nhe=(n,e,t,r)=>jhe[n];function oa(n){return(e,t)=>{const r=t?.context?String(t.context):"standalone";let s;if(r==="formatting"&&n.formattingValues){const l=n.defaultFormattingWidth||n.defaultWidth,c=t?.width?String(t.width):l;s=n.formattingValues[c]||n.formattingValues[l]}else{const l=n.defaultWidth,c=t?.width?String(t.width):n.defaultWidth;s=n.values[c]||n.values[l]}const i=n.argumentCallback?n.argumentCallback(e):e;return s[i]}}const Che={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},The={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Mhe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ahe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Ehe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},_he={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Dhe=(n,e)=>{const t=Number(n),r=t%100;if(r>20||r<10)switch(r%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},Rhe={ordinalNumber:Dhe,era:oa({values:Che,defaultWidth:"wide"}),quarter:oa({values:The,defaultWidth:"wide",argumentCallback:n=>n-1}),month:oa({values:Mhe,defaultWidth:"wide"}),day:oa({values:Ahe,defaultWidth:"wide"}),dayPeriod:oa({values:Ehe,defaultWidth:"wide",formattingValues:_he,defaultFormattingWidth:"wide"})};function ca(n){return(e,t={})=>{const r=t.width,s=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],i=e.match(s);if(!i)return null;const l=i[0],c=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],u=Array.isArray(c)?Phe(c,p=>p.test(l)):zhe(c,p=>p.test(l));let h;h=n.valueCallback?n.valueCallback(u):u,h=t.valueCallback?t.valueCallback(h):h;const m=e.slice(l.length);return{value:h,rest:m}}}function zhe(n,e){for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&e(n[t]))return t}function Phe(n,e){for(let t=0;t<n.length;t++)if(e(n[t]))return t}function jz(n){return(e,t={})=>{const r=e.match(n.matchPattern);if(!r)return null;const s=r[0],i=e.match(n.parsePattern);if(!i)return null;let l=n.valueCallback?n.valueCallback(i[0]):i[0];l=t.valueCallback?t.valueCallback(l):l;const c=e.slice(s.length);return{value:l,rest:c}}}const Lhe=/^(\d+)(th|st|nd|rd)?/i,Bhe=/\d+/i,Ihe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Fhe={any:[/^b/i,/^(a|c)/i]},qhe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Qhe={any:[/1/i,/2/i,/3/i,/4/i]},$he={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Hhe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Uhe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Vhe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Whe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ghe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Xhe={ordinalNumber:jz({matchPattern:Lhe,parsePattern:Bhe,valueCallback:n=>parseInt(n,10)}),era:ca({matchPatterns:Ihe,defaultMatchWidth:"wide",parsePatterns:Fhe,defaultParseWidth:"any"}),quarter:ca({matchPatterns:qhe,defaultMatchWidth:"wide",parsePatterns:Qhe,defaultParseWidth:"any",valueCallback:n=>n+1}),month:ca({matchPatterns:$he,defaultMatchWidth:"wide",parsePatterns:Hhe,defaultParseWidth:"any"}),day:ca({matchPatterns:Uhe,defaultMatchWidth:"wide",parsePatterns:Vhe,defaultParseWidth:"any"}),dayPeriod:ca({matchPatterns:Whe,defaultMatchWidth:"any",parsePatterns:Ghe,defaultParseWidth:"any"})},Y5={code:"en-US",formatDistance:bhe,formatLong:khe,formatRelative:Nhe,localize:Rhe,match:Xhe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Yhe(n,e){const t=Nn(n,e?.in);return bz(t,Oz(t))+1}function Nz(n,e){const t=Nn(n,e?.in),r=+Qf(t)-+ihe(t);return Math.round(r/gz)+1}function Cz(n,e){const t=Nn(n,e?.in),r=t.getFullYear(),s=j0(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,l=vr(e?.in||n,0);l.setFullYear(r+1,0,i),l.setHours(0,0,0,0);const c=wo(l,e),u=vr(e?.in||n,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const h=wo(u,e);return+t>=+c?r+1:+t>=+h?r:r-1}function Khe(n,e){const t=j0(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??t.firstWeekContainsDate??t.locale?.options?.firstWeekContainsDate??1,s=Cz(n,e),i=vr(e?.in||n,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),wo(i,e)}function Tz(n,e){const t=Nn(n,e?.in),r=+wo(t,e)-+Khe(t,e);return Math.round(r/gz)+1}function xn(n,e){const t=n<0?"-":"",r=Math.abs(n).toString().padStart(e,"0");return t+r}const Kl={y(n,e){const t=n.getFullYear(),r=t>0?t:1-t;return xn(e==="yy"?r%100:r,e.length)},M(n,e){const t=n.getMonth();return e==="M"?String(t+1):xn(t+1,2)},d(n,e){return xn(n.getDate(),e.length)},a(n,e){const t=n.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(n,e){return xn(n.getHours()%12||12,e.length)},H(n,e){return xn(n.getHours(),e.length)},m(n,e){return xn(n.getMinutes(),e.length)},s(n,e){return xn(n.getSeconds(),e.length)},S(n,e){const t=e.length,r=n.getMilliseconds(),s=Math.trunc(r*Math.pow(10,t-3));return xn(s,e.length)}},Eu={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},r9={G:function(n,e,t){const r=n.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(r,{width:"abbreviated"});case"GGGGG":return t.era(r,{width:"narrow"});case"GGGG":default:return t.era(r,{width:"wide"})}},y:function(n,e,t){if(e==="yo"){const r=n.getFullYear(),s=r>0?r:1-r;return t.ordinalNumber(s,{unit:"year"})}return Kl.y(n,e)},Y:function(n,e,t,r){const s=Cz(n,r),i=s>0?s:1-s;if(e==="YY"){const l=i%100;return xn(l,2)}return e==="Yo"?t.ordinalNumber(i,{unit:"year"}):xn(i,e.length)},R:function(n,e){const t=yz(n);return xn(t,e.length)},u:function(n,e){const t=n.getFullYear();return xn(t,e.length)},Q:function(n,e,t){const r=Math.ceil((n.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return xn(r,2);case"Qo":return t.ordinalNumber(r,{unit:"quarter"});case"QQQ":return t.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(r,{width:"wide",context:"formatting"})}},q:function(n,e,t){const r=Math.ceil((n.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return xn(r,2);case"qo":return t.ordinalNumber(r,{unit:"quarter"});case"qqq":return t.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(r,{width:"wide",context:"standalone"})}},M:function(n,e,t){const r=n.getMonth();switch(e){case"M":case"MM":return Kl.M(n,e);case"Mo":return t.ordinalNumber(r+1,{unit:"month"});case"MMM":return t.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(r,{width:"wide",context:"formatting"})}},L:function(n,e,t){const r=n.getMonth();switch(e){case"L":return String(r+1);case"LL":return xn(r+1,2);case"Lo":return t.ordinalNumber(r+1,{unit:"month"});case"LLL":return t.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(r,{width:"wide",context:"standalone"})}},w:function(n,e,t,r){const s=Tz(n,r);return e==="wo"?t.ordinalNumber(s,{unit:"week"}):xn(s,e.length)},I:function(n,e,t){const r=Nz(n);return e==="Io"?t.ordinalNumber(r,{unit:"week"}):xn(r,e.length)},d:function(n,e,t){return e==="do"?t.ordinalNumber(n.getDate(),{unit:"date"}):Kl.d(n,e)},D:function(n,e,t){const r=Yhe(n);return e==="Do"?t.ordinalNumber(r,{unit:"dayOfYear"}):xn(r,e.length)},E:function(n,e,t){const r=n.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(r,{width:"short",context:"formatting"});case"EEEE":default:return t.day(r,{width:"wide",context:"formatting"})}},e:function(n,e,t,r){const s=n.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return xn(i,2);case"eo":return t.ordinalNumber(i,{unit:"day"});case"eee":return t.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(s,{width:"short",context:"formatting"});case"eeee":default:return t.day(s,{width:"wide",context:"formatting"})}},c:function(n,e,t,r){const s=n.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return xn(i,e.length);case"co":return t.ordinalNumber(i,{unit:"day"});case"ccc":return t.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(s,{width:"narrow",context:"standalone"});case"cccccc":return t.day(s,{width:"short",context:"standalone"});case"cccc":default:return t.day(s,{width:"wide",context:"standalone"})}},i:function(n,e,t){const r=n.getDay(),s=r===0?7:r;switch(e){case"i":return String(s);case"ii":return xn(s,e.length);case"io":return t.ordinalNumber(s,{unit:"day"});case"iii":return t.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(r,{width:"short",context:"formatting"});case"iiii":default:return t.day(r,{width:"wide",context:"formatting"})}},a:function(n,e,t){const s=n.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,e,t){const r=n.getHours();let s;switch(r===12?s=Eu.noon:r===0?s=Eu.midnight:s=r/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,e,t){const r=n.getHours();let s;switch(r>=17?s=Eu.evening:r>=12?s=Eu.afternoon:r>=4?s=Eu.morning:s=Eu.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,e,t){if(e==="ho"){let r=n.getHours()%12;return r===0&&(r=12),t.ordinalNumber(r,{unit:"hour"})}return Kl.h(n,e)},H:function(n,e,t){return e==="Ho"?t.ordinalNumber(n.getHours(),{unit:"hour"}):Kl.H(n,e)},K:function(n,e,t){const r=n.getHours()%12;return e==="Ko"?t.ordinalNumber(r,{unit:"hour"}):xn(r,e.length)},k:function(n,e,t){let r=n.getHours();return r===0&&(r=24),e==="ko"?t.ordinalNumber(r,{unit:"hour"}):xn(r,e.length)},m:function(n,e,t){return e==="mo"?t.ordinalNumber(n.getMinutes(),{unit:"minute"}):Kl.m(n,e)},s:function(n,e,t){return e==="so"?t.ordinalNumber(n.getSeconds(),{unit:"second"}):Kl.s(n,e)},S:function(n,e){return Kl.S(n,e)},X:function(n,e,t){const r=n.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return i9(r);case"XXXX":case"XX":return nc(r);case"XXXXX":case"XXX":default:return nc(r,":")}},x:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"x":return i9(r);case"xxxx":case"xx":return nc(r);case"xxxxx":case"xxx":default:return nc(r,":")}},O:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+s9(r,":");case"OOOO":default:return"GMT"+nc(r,":")}},z:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+s9(r,":");case"zzzz":default:return"GMT"+nc(r,":")}},t:function(n,e,t){const r=Math.trunc(+n/1e3);return xn(r,e.length)},T:function(n,e,t){return xn(+n,e.length)}};function s9(n,e=""){const t=n>0?"-":"+",r=Math.abs(n),s=Math.trunc(r/60),i=r%60;return i===0?t+String(s):t+String(s)+e+xn(i,2)}function i9(n,e){return n%60===0?(n>0?"-":"+")+xn(Math.abs(n)/60,2):nc(n,e)}function nc(n,e=""){const t=n>0?"-":"+",r=Math.abs(n),s=xn(Math.trunc(r/60),2),i=xn(r%60,2);return t+s+e+i}const a9=(n,e)=>{switch(n){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Mz=(n,e)=>{switch(n){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Zhe=(n,e)=>{const t=n.match(/(P+)(p+)?/)||[],r=t[1],s=t[2];if(!s)return a9(n,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",a9(r,e)).replace("{{time}}",Mz(s,e))},Jhe={p:Mz,P:Zhe},efe=/^D+$/,tfe=/^Y+$/,nfe=["D","DD","YY","YYYY"];function rfe(n){return efe.test(n)}function sfe(n){return tfe.test(n)}function ife(n,e,t){const r=afe(n,e,t);if(console.warn(r),nfe.includes(n))throw new RangeError(r)}function afe(n,e,t){const r=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${e}\`) for formatting ${r} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const lfe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ofe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cfe=/^'([^]*?)'?$/,ufe=/''/g,dfe=/[a-zA-Z]/;function hg(n,e,t){const r=j0(),s=t?.locale??r.locale??Y5,i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,l=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,c=Nn(n,t?.in);if(!dhe(c))throw new RangeError("Invalid time value");let u=e.match(ofe).map(m=>{const p=m[0];if(p==="p"||p==="P"){const x=Jhe[p];return x(m,s.formatLong)}return m}).join("").match(lfe).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const p=m[0];if(p==="'")return{isToken:!1,value:hfe(m)};if(r9[p])return{isToken:!0,value:m};if(p.match(dfe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:m}});s.localize.preprocessor&&(u=s.localize.preprocessor(c,u));const h={firstWeekContainsDate:i,weekStartsOn:l,locale:s};return u.map(m=>{if(!m.isToken)return m.value;const p=m.value;(!t?.useAdditionalWeekYearTokens&&sfe(p)||!t?.useAdditionalDayOfYearTokens&&rfe(p))&&ife(p,e,String(n));const x=r9[p[0]];return x(c,p,s.localize,h)}).join("")}function hfe(n){const e=n.match(cfe);return e?e[1].replace(ufe,"'"):n}function ffe(n,e){const t=Nn(n,e?.in),r=t.getFullYear(),s=t.getMonth(),i=vr(t,0);return i.setFullYear(r,s+1,0),i.setHours(0,0,0,0),i.getDate()}function mfe(n,e){return Nn(n,e?.in).getMonth()}function pfe(n,e){return Nn(n,e?.in).getFullYear()}function gfe(n,e){return+Nn(n)>+Nn(e)}function xfe(n,e){return+Nn(n)<+Nn(e)}function vfe(n,e,t){const[r,s]=Lc(t?.in,n,e);return+wo(r,t)==+wo(s,t)}function yfe(n,e,t){const[r,s]=Lc(t?.in,n,e);return r.getFullYear()===s.getFullYear()&&r.getMonth()===s.getMonth()}function bfe(n,e,t){const[r,s]=Lc(t?.in,n,e);return r.getFullYear()===s.getFullYear()}function wfe(n,e,t){const r=Nn(n,t?.in),s=r.getFullYear(),i=r.getDate(),l=vr(n,0);l.setFullYear(s,e,15),l.setHours(0,0,0,0);const c=ffe(l);return r.setMonth(e,Math.min(i,c)),r}function Sfe(n,e,t){const r=Nn(n,t?.in);return isNaN(+r)?vr(n,NaN):(r.setFullYear(e),r)}const l9=5,Ofe=4;function kfe(n,e){const t=e.startOfMonth(n),r=t.getDay()>0?t.getDay():7,s=e.addDays(n,-r+1),i=e.addDays(s,l9*7-1);return e.getMonth(n)===e.getMonth(i)?l9:Ofe}function Az(n,e){const t=e.startOfMonth(n),r=t.getDay();return r===1?t:r===0?e.addDays(t,-6):e.addDays(t,-1*(r-1))}function jfe(n,e){const t=Az(n,e),r=kfe(n,e);return e.addDays(t,r*7-1)}class ii{constructor(e,t){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?Zr.tz(this.options.timeZone):new this.Date,this.newDate=(r,s,i)=>this.overrides?.newDate?this.overrides.newDate(r,s,i):this.options.timeZone?new Zr(r,s,i,this.options.timeZone):new Date(r,s,i),this.addDays=(r,s)=>this.overrides?.addDays?this.overrides.addDays(r,s):xz(r,s),this.addMonths=(r,s)=>this.overrides?.addMonths?this.overrides.addMonths(r,s):vz(r,s),this.addWeeks=(r,s)=>this.overrides?.addWeeks?this.overrides.addWeeks(r,s):ahe(r,s),this.addYears=(r,s)=>this.overrides?.addYears?this.overrides.addYears(r,s):lhe(r,s),this.differenceInCalendarDays=(r,s)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,s):bz(r,s),this.differenceInCalendarMonths=(r,s)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,s):hhe(r,s),this.eachMonthOfInterval=r=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):mhe(r),this.eachYearOfInterval=r=>{const s=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(r):xhe(r),i=new Set(s.map(c=>this.getYear(c)));if(i.size===s.length)return s;const l=[];return i.forEach(c=>{l.push(new Date(c,0,1))}),l},this.endOfBroadcastWeek=r=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):jfe(r,this),this.endOfISOWeek=r=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(r):vhe(r),this.endOfMonth=r=>this.overrides?.endOfMonth?this.overrides.endOfMonth(r):fhe(r),this.endOfWeek=(r,s)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(r,s):kz(r,this.options),this.endOfYear=r=>this.overrides?.endOfYear?this.overrides.endOfYear(r):ghe(r),this.format=(r,s,i)=>{const l=this.overrides?.format?this.overrides.format(r,s,this.options):hg(r,s,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(l):l},this.getISOWeek=r=>this.overrides?.getISOWeek?this.overrides.getISOWeek(r):Nz(r),this.getMonth=(r,s)=>this.overrides?.getMonth?this.overrides.getMonth(r,this.options):mfe(r,this.options),this.getYear=(r,s)=>this.overrides?.getYear?this.overrides.getYear(r,this.options):pfe(r,this.options),this.getWeek=(r,s)=>this.overrides?.getWeek?this.overrides.getWeek(r,this.options):Tz(r,this.options),this.isAfter=(r,s)=>this.overrides?.isAfter?this.overrides.isAfter(r,s):gfe(r,s),this.isBefore=(r,s)=>this.overrides?.isBefore?this.overrides.isBefore(r,s):xfe(r,s),this.isDate=r=>this.overrides?.isDate?this.overrides.isDate(r):wz(r),this.isSameDay=(r,s)=>this.overrides?.isSameDay?this.overrides.isSameDay(r,s):uhe(r,s),this.isSameMonth=(r,s)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(r,s):yfe(r,s),this.isSameYear=(r,s)=>this.overrides?.isSameYear?this.overrides.isSameYear(r,s):bfe(r,s),this.max=r=>this.overrides?.max?this.overrides.max(r):ohe(r),this.min=r=>this.overrides?.min?this.overrides.min(r):che(r),this.setMonth=(r,s)=>this.overrides?.setMonth?this.overrides.setMonth(r,s):wfe(r,s),this.setYear=(r,s)=>this.overrides?.setYear?this.overrides.setYear(r,s):Sfe(r,s),this.startOfBroadcastWeek=(r,s)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):Az(r,this),this.startOfDay=r=>this.overrides?.startOfDay?this.overrides.startOfDay(r):$f(r),this.startOfISOWeek=r=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(r):Qf(r),this.startOfMonth=r=>this.overrides?.startOfMonth?this.overrides.startOfMonth(r):phe(r),this.startOfWeek=(r,s)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(r,this.options):wo(r,this.options),this.startOfYear=r=>this.overrides?.startOfYear?this.overrides.startOfYear(r):Oz(r),this.options={locale:Y5,...e},this.overrides=t}getDigitMap(){const{numerals:e="latn"}=this.options,t=new Intl.NumberFormat("en-US",{numberingSystem:e}),r={};for(let s=0;s<10;s++)r[s.toString()]=t.format(s);return r}replaceDigits(e){const t=this.getDigitMap();return e.replace(/\d/g,r=>t[r]||r)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){const e=this.options.locale?.code;return e&&ii.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:t,timeZone:r,numerals:s}=this.options,i=t?.code;if(i&&ii.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:r,numberingSystem:s}).format(e)}catch{}const l=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(e,l)}}ii.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Ma=new ii;class Ez{constructor(e,t,r=Ma){this.date=e,this.displayMonth=t,this.outside=!!(t&&!r.isSameMonth(e,t)),this.dateLib=r}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class Nfe{constructor(e,t){this.date=e,this.weeks=t}}class Cfe{constructor(e,t){this.days=t,this.weekNumber=e}}function Tfe(n){return Ue.createElement("button",{...n})}function Mfe(n){return Ue.createElement("span",{...n})}function Afe(n){const{size:e=24,orientation:t="left",className:r}=n;return Ue.createElement("svg",{className:r,width:e,height:e,viewBox:"0 0 24 24"},t==="up"&&Ue.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),t==="down"&&Ue.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),t==="left"&&Ue.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),t==="right"&&Ue.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function Efe(n){const{day:e,modifiers:t,...r}=n;return Ue.createElement("td",{...r})}function _fe(n){const{day:e,modifiers:t,...r}=n,s=Ue.useRef(null);return Ue.useEffect(()=>{t.focused&&s.current?.focus()},[t.focused]),Ue.createElement("button",{ref:s,...r})}var et;(function(n){n.Root="root",n.Chevron="chevron",n.Day="day",n.DayButton="day_button",n.CaptionLabel="caption_label",n.Dropdowns="dropdowns",n.Dropdown="dropdown",n.DropdownRoot="dropdown_root",n.Footer="footer",n.MonthGrid="month_grid",n.MonthCaption="month_caption",n.MonthsDropdown="months_dropdown",n.Month="month",n.Months="months",n.Nav="nav",n.NextMonthButton="button_next",n.PreviousMonthButton="button_previous",n.Week="week",n.Weeks="weeks",n.Weekday="weekday",n.Weekdays="weekdays",n.WeekNumber="week_number",n.WeekNumberHeader="week_number_header",n.YearsDropdown="years_dropdown"})(et||(et={}));var Yn;(function(n){n.disabled="disabled",n.hidden="hidden",n.outside="outside",n.focused="focused",n.today="today"})(Yn||(Yn={}));var Bi;(function(n){n.range_end="range_end",n.range_middle="range_middle",n.range_start="range_start",n.selected="selected"})(Bi||(Bi={}));var ei;(function(n){n.weeks_before_enter="weeks_before_enter",n.weeks_before_exit="weeks_before_exit",n.weeks_after_enter="weeks_after_enter",n.weeks_after_exit="weeks_after_exit",n.caption_after_enter="caption_after_enter",n.caption_after_exit="caption_after_exit",n.caption_before_enter="caption_before_enter",n.caption_before_exit="caption_before_exit"})(ei||(ei={}));function Dfe(n){const{options:e,className:t,components:r,classNames:s,...i}=n,l=[s[et.Dropdown],t].join(" "),c=e?.find(({value:u})=>u===i.value);return Ue.createElement("span",{"data-disabled":i.disabled,className:s[et.DropdownRoot]},Ue.createElement(r.Select,{className:l,...i},e?.map(({value:u,label:h,disabled:m})=>Ue.createElement(r.Option,{key:u,value:u,disabled:m},h))),Ue.createElement("span",{className:s[et.CaptionLabel],"aria-hidden":!0},c?.label,Ue.createElement(r.Chevron,{orientation:"down",size:18,className:s[et.Chevron]})))}function Rfe(n){return Ue.createElement("div",{...n})}function zfe(n){return Ue.createElement("div",{...n})}function Pfe(n){const{calendarMonth:e,displayIndex:t,...r}=n;return Ue.createElement("div",{...r},n.children)}function Lfe(n){const{calendarMonth:e,displayIndex:t,...r}=n;return Ue.createElement("div",{...r})}function Bfe(n){return Ue.createElement("table",{...n})}function Ife(n){return Ue.createElement("div",{...n})}const _z=S.createContext(void 0);function N0(){const n=S.useContext(_z);if(n===void 0)throw new Error("useDayPicker() must be used within a custom component.");return n}function Ffe(n){const{components:e}=N0();return Ue.createElement(e.Dropdown,{...n})}function qfe(n){const{onPreviousClick:e,onNextClick:t,previousMonth:r,nextMonth:s,...i}=n,{components:l,classNames:c,labels:{labelPrevious:u,labelNext:h}}=N0(),m=S.useCallback(x=>{s&&t?.(x)},[s,t]),p=S.useCallback(x=>{r&&e?.(x)},[r,e]);return Ue.createElement("nav",{...i},Ue.createElement(l.PreviousMonthButton,{type:"button",className:c[et.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":u(r),onClick:p},Ue.createElement(l.Chevron,{disabled:r?void 0:!0,className:c[et.Chevron],orientation:"left"})),Ue.createElement(l.NextMonthButton,{type:"button",className:c[et.NextMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":h(s),onClick:m},Ue.createElement(l.Chevron,{disabled:s?void 0:!0,orientation:"right",className:c[et.Chevron]})))}function Qfe(n){const{components:e}=N0();return Ue.createElement(e.Button,{...n})}function $fe(n){return Ue.createElement("option",{...n})}function Hfe(n){const{components:e}=N0();return Ue.createElement(e.Button,{...n})}function Ufe(n){const{rootRef:e,...t}=n;return Ue.createElement("div",{...t,ref:e})}function Vfe(n){return Ue.createElement("select",{...n})}function Wfe(n){const{week:e,...t}=n;return Ue.createElement("tr",{...t})}function Gfe(n){return Ue.createElement("th",{...n})}function Xfe(n){return Ue.createElement("thead",{"aria-hidden":!0},Ue.createElement("tr",{...n}))}function Yfe(n){const{week:e,...t}=n;return Ue.createElement("th",{...t})}function Kfe(n){return Ue.createElement("th",{...n})}function Zfe(n){return Ue.createElement("tbody",{...n})}function Jfe(n){const{components:e}=N0();return Ue.createElement(e.Dropdown,{...n})}const e0e=Object.freeze(Object.defineProperty({__proto__:null,Button:Tfe,CaptionLabel:Mfe,Chevron:Afe,Day:Efe,DayButton:_fe,Dropdown:Dfe,DropdownNav:Rfe,Footer:zfe,Month:Pfe,MonthCaption:Lfe,MonthGrid:Bfe,Months:Ife,MonthsDropdown:Ffe,Nav:qfe,NextMonthButton:Qfe,Option:$fe,PreviousMonthButton:Hfe,Root:Ufe,Select:Vfe,Week:Wfe,WeekNumber:Yfe,WeekNumberHeader:Kfe,Weekday:Gfe,Weekdays:Xfe,Weeks:Zfe,YearsDropdown:Jfe},Symbol.toStringTag,{value:"Module"}));function al(n,e,t=!1,r=Ma){let{from:s,to:i}=n;const{differenceInCalendarDays:l,isSameDay:c}=r;return s&&i?(l(i,s)<0&&([s,i]=[i,s]),l(e,s)>=(t?1:0)&&l(i,e)>=(t?1:0)):!t&&i?c(i,e):!t&&s?c(s,e):!1}function Dz(n){return!!(n&&typeof n=="object"&&"before"in n&&"after"in n)}function K5(n){return!!(n&&typeof n=="object"&&"from"in n)}function Rz(n){return!!(n&&typeof n=="object"&&"after"in n)}function zz(n){return!!(n&&typeof n=="object"&&"before"in n)}function Pz(n){return!!(n&&typeof n=="object"&&"dayOfWeek"in n)}function Lz(n,e){return Array.isArray(n)&&n.every(e.isDate)}function ll(n,e,t=Ma){const r=Array.isArray(e)?e:[e],{isSameDay:s,differenceInCalendarDays:i,isAfter:l}=t;return r.some(c=>{if(typeof c=="boolean")return c;if(t.isDate(c))return s(n,c);if(Lz(c,t))return c.includes(n);if(K5(c))return al(c,n,!1,t);if(Pz(c))return Array.isArray(c.dayOfWeek)?c.dayOfWeek.includes(n.getDay()):c.dayOfWeek===n.getDay();if(Dz(c)){const u=i(c.before,n),h=i(c.after,n),m=u>0,p=h<0;return l(c.before,c.after)?p&&m:m||p}return Rz(c)?i(n,c.after)>0:zz(c)?i(c.before,n)>0:typeof c=="function"?c(n):!1})}function t0e(n,e,t,r,s){const{disabled:i,hidden:l,modifiers:c,showOutsideDays:u,broadcastCalendar:h,today:m}=e,{isSameDay:p,isSameMonth:x,startOfMonth:v,isBefore:b,endOfMonth:O,isAfter:k}=s,j=t&&v(t),T=r&&O(r),M={[Yn.focused]:[],[Yn.outside]:[],[Yn.disabled]:[],[Yn.hidden]:[],[Yn.today]:[]},_={};for(const D of n){const{date:E,displayMonth:z}=D,Q=!!(z&&!x(E,z)),q=!!(j&&b(E,j)),B=!!(T&&k(E,T)),U=!!(i&&ll(E,i,s)),V=!!(l&&ll(E,l,s))||q||B||!h&&!u&&Q||h&&u===!1&&Q,ce=p(E,m??s.today());Q&&M.outside.push(D),U&&M.disabled.push(D),V&&M.hidden.push(D),ce&&M.today.push(D),c&&Object.keys(c).forEach(W=>{const J=c?.[W];J&&ll(E,J,s)&&(_[W]?_[W].push(D):_[W]=[D])})}return D=>{const E={[Yn.focused]:!1,[Yn.disabled]:!1,[Yn.hidden]:!1,[Yn.outside]:!1,[Yn.today]:!1},z={};for(const Q in M){const q=M[Q];E[Q]=q.some(B=>B===D)}for(const Q in _)z[Q]=_[Q].some(q=>q===D);return{...E,...z}}}function n0e(n,e,t={}){return Object.entries(n).filter(([,s])=>s===!0).reduce((s,[i])=>(t[i]?s.push(t[i]):e[Yn[i]]?s.push(e[Yn[i]]):e[Bi[i]]&&s.push(e[Bi[i]]),s),[e[et.Day]])}function r0e(n){return{...e0e,...n}}function s0e(n){const e={"data-mode":n.mode??void 0,"data-required":"required"in n?n.required:void 0,"data-multiple-months":n.numberOfMonths&&n.numberOfMonths>1||void 0,"data-week-numbers":n.showWeekNumber||void 0,"data-broadcast-calendar":n.broadcastCalendar||void 0,"data-nav-layout":n.navLayout||void 0};return Object.entries(n).forEach(([t,r])=>{t.startsWith("data-")&&(e[t]=r)}),e}function Z5(){const n={};for(const e in et)n[et[e]]=`rdp-${et[e]}`;for(const e in Yn)n[Yn[e]]=`rdp-${Yn[e]}`;for(const e in Bi)n[Bi[e]]=`rdp-${Bi[e]}`;for(const e in ei)n[ei[e]]=`rdp-${ei[e]}`;return n}function Bz(n,e,t){return(t??new ii(e)).formatMonthYear(n)}const i0e=Bz;function a0e(n,e,t){return(t??new ii(e)).format(n,"d")}function l0e(n,e=Ma){return e.format(n,"LLLL")}function o0e(n,e,t){return(t??new ii(e)).format(n,"cccccc")}function c0e(n,e=Ma){return n<10?e.formatNumber(`0${n.toLocaleString()}`):e.formatNumber(`${n.toLocaleString()}`)}function u0e(){return""}function Iz(n,e=Ma){return e.format(n,"yyyy")}const d0e=Iz,h0e=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:Bz,formatDay:a0e,formatMonthCaption:i0e,formatMonthDropdown:l0e,formatWeekNumber:c0e,formatWeekNumberHeader:u0e,formatWeekdayName:o0e,formatYearCaption:d0e,formatYearDropdown:Iz},Symbol.toStringTag,{value:"Module"}));function f0e(n){return n?.formatMonthCaption&&!n.formatCaption&&(n.formatCaption=n.formatMonthCaption),n?.formatYearCaption&&!n.formatYearDropdown&&(n.formatYearDropdown=n.formatYearCaption),{...h0e,...n}}function m0e(n,e,t,r,s){const{startOfMonth:i,startOfYear:l,endOfYear:c,eachMonthOfInterval:u,getMonth:h}=s;return u({start:l(n),end:c(n)}).map(x=>{const v=r.formatMonthDropdown(x,s),b=h(x),O=e&&x<i(e)||t&&x>i(t)||!1;return{value:b,label:v,disabled:O}})}function p0e(n,e={},t={}){let r={...e?.[et.Day]};return Object.entries(n).filter(([,s])=>s===!0).forEach(([s])=>{r={...r,...t?.[s]}}),r}function g0e(n,e,t){const r=n.today(),s=e?n.startOfISOWeek(r):n.startOfWeek(r),i=[];for(let l=0;l<7;l++){const c=n.addDays(s,l);i.push(c)}return i}function x0e(n,e,t,r,s=!1){if(!n||!e)return;const{startOfYear:i,endOfYear:l,eachYearOfInterval:c,getYear:u}=r,h=i(n),m=l(e),p=c({start:h,end:m});return s&&p.reverse(),p.map(x=>{const v=t.formatYearDropdown(x,r);return{value:u(x),label:v,disabled:!1}})}function Fz(n,e,t,r){let s=(r??new ii(t)).format(n,"PPPP");return e.today&&(s=`Today, ${s}`),e.selected&&(s=`${s}, selected`),s}const v0e=Fz;function qz(n,e,t){return(t??new ii(e)).formatMonthYear(n)}const y0e=qz;function b0e(n,e,t,r){let s=(r??new ii(t)).format(n,"PPPP");return e?.today&&(s=`Today, ${s}`),s}function w0e(n){return"Choose the Month"}function S0e(){return""}function O0e(n){return"Go to the Next Month"}function k0e(n){return"Go to the Previous Month"}function j0e(n,e,t){return(t??new ii(e)).format(n,"cccc")}function N0e(n,e){return`Week ${n}`}function C0e(n){return"Week Number"}function T0e(n){return"Choose the Year"}const M0e=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:y0e,labelDay:v0e,labelDayButton:Fz,labelGrid:qz,labelGridcell:b0e,labelMonthDropdown:w0e,labelNav:S0e,labelNext:O0e,labelPrevious:k0e,labelWeekNumber:N0e,labelWeekNumberHeader:C0e,labelWeekday:j0e,labelYearDropdown:T0e},Symbol.toStringTag,{value:"Module"})),C0=n=>n instanceof HTMLElement?n:null,Vb=n=>[...n.querySelectorAll("[data-animated-month]")??[]],A0e=n=>C0(n.querySelector("[data-animated-month]")),Wb=n=>C0(n.querySelector("[data-animated-caption]")),Gb=n=>C0(n.querySelector("[data-animated-weeks]")),E0e=n=>C0(n.querySelector("[data-animated-nav]")),_0e=n=>C0(n.querySelector("[data-animated-weekdays]"));function D0e(n,e,{classNames:t,months:r,focused:s,dateLib:i}){const l=S.useRef(null),c=S.useRef(r),u=S.useRef(!1);S.useLayoutEffect(()=>{const h=c.current;if(c.current=r,!e||!n.current||!(n.current instanceof HTMLElement)||r.length===0||h.length===0||r.length!==h.length)return;const m=i.isSameMonth(r[0].date,h[0].date),p=i.isAfter(r[0].date,h[0].date),x=p?t[ei.caption_after_enter]:t[ei.caption_before_enter],v=p?t[ei.weeks_after_enter]:t[ei.weeks_before_enter],b=l.current,O=n.current.cloneNode(!0);if(O instanceof HTMLElement?(Vb(O).forEach(M=>{if(!(M instanceof HTMLElement))return;const _=A0e(M);_&&M.contains(_)&&M.removeChild(_);const D=Wb(M);D&&D.classList.remove(x);const E=Gb(M);E&&E.classList.remove(v)}),l.current=O):l.current=null,u.current||m||s)return;const k=b instanceof HTMLElement?Vb(b):[],j=Vb(n.current);if(j?.every(T=>T instanceof HTMLElement)&&k&&k.every(T=>T instanceof HTMLElement)){u.current=!0,n.current.style.isolation="isolate";const T=E0e(n.current);T&&(T.style.zIndex="1"),j.forEach((M,_)=>{const D=k[_];if(!D)return;M.style.position="relative",M.style.overflow="hidden";const E=Wb(M);E&&E.classList.add(x);const z=Gb(M);z&&z.classList.add(v);const Q=()=>{u.current=!1,n.current&&(n.current.style.isolation=""),T&&(T.style.zIndex=""),E&&E.classList.remove(x),z&&z.classList.remove(v),M.style.position="",M.style.overflow="",M.contains(D)&&M.removeChild(D)};D.style.pointerEvents="none",D.style.position="absolute",D.style.overflow="hidden",D.setAttribute("aria-hidden","true");const q=_0e(D);q&&(q.style.opacity="0");const B=Wb(D);B&&(B.classList.add(p?t[ei.caption_before_exit]:t[ei.caption_after_exit]),B.addEventListener("animationend",Q));const U=Gb(D);U&&U.classList.add(p?t[ei.weeks_before_exit]:t[ei.weeks_after_exit]),M.insertBefore(D,M.firstChild)})}})}function R0e(n,e,t,r){const s=n[0],i=n[n.length-1],{ISOWeek:l,fixedWeeks:c,broadcastCalendar:u}=t??{},{addDays:h,differenceInCalendarDays:m,differenceInCalendarMonths:p,endOfBroadcastWeek:x,endOfISOWeek:v,endOfMonth:b,endOfWeek:O,isAfter:k,startOfBroadcastWeek:j,startOfISOWeek:T,startOfWeek:M}=r,_=u?j(s,r):l?T(s):M(s),D=u?x(i):l?v(b(i)):O(b(i)),E=m(D,_),z=p(i,s)+1,Q=[];for(let U=0;U<=E;U++){const V=h(_,U);if(e&&k(V,e))break;Q.push(V)}const B=(u?35:42)*z;if(c&&Q.length<B){const U=B-Q.length;for(let V=0;V<U;V++){const ce=h(Q[Q.length-1],1);Q.push(ce)}}return Q}function z0e(n){const e=[];return n.reduce((t,r)=>{const s=r.weeks.reduce((i,l)=>i.concat(l.days.slice()),e.slice());return t.concat(s.slice())},e.slice())}function P0e(n,e,t,r){const{numberOfMonths:s=1}=t,i=[];for(let l=0;l<s;l++){const c=r.addMonths(n,l);if(e&&c>e)break;i.push(c)}return i}function o9(n,e,t,r){const{month:s,defaultMonth:i,today:l=r.today(),numberOfMonths:c=1}=n;let u=s||i||l;const{differenceInCalendarMonths:h,addMonths:m,startOfMonth:p}=r;if(t&&h(t,u)<c-1){const x=-1*(c-1);u=m(t,x)}return e&&h(u,e)<0&&(u=e),p(u)}function L0e(n,e,t,r){const{addDays:s,endOfBroadcastWeek:i,endOfISOWeek:l,endOfMonth:c,endOfWeek:u,getISOWeek:h,getWeek:m,startOfBroadcastWeek:p,startOfISOWeek:x,startOfWeek:v}=r,b=n.reduce((O,k)=>{const j=t.broadcastCalendar?p(k,r):t.ISOWeek?x(k):v(k),T=t.broadcastCalendar?i(k):t.ISOWeek?l(c(k)):u(c(k)),M=e.filter(z=>z>=j&&z<=T),_=t.broadcastCalendar?35:42;if(t.fixedWeeks&&M.length<_){const z=e.filter(Q=>{const q=_-M.length;return Q>T&&Q<=s(T,q)});M.push(...z)}const D=M.reduce((z,Q)=>{const q=t.ISOWeek?h(Q):m(Q),B=z.find(V=>V.weekNumber===q),U=new Ez(Q,k,r);return B?B.days.push(U):z.push(new Cfe(q,[U])),z},[]),E=new Nfe(k,D);return O.push(E),O},[]);return t.reverseMonths?b.reverse():b}function B0e(n,e){let{startMonth:t,endMonth:r}=n;const{startOfYear:s,startOfDay:i,startOfMonth:l,endOfMonth:c,addYears:u,endOfYear:h,newDate:m,today:p}=e,{fromYear:x,toYear:v,fromMonth:b,toMonth:O}=n;!t&&b&&(t=b),!t&&x&&(t=e.newDate(x,0,1)),!r&&O&&(r=O),!r&&v&&(r=m(v,11,31));const k=n.captionLayout==="dropdown"||n.captionLayout==="dropdown-years";return t?t=l(t):x?t=m(x,0,1):!t&&k&&(t=s(u(n.today??p(),-100))),r?r=c(r):v?r=m(v,11,31):!r&&k&&(r=h(n.today??p())),[t&&i(t),r&&i(r)]}function I0e(n,e,t,r){if(t.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i=1}=t,{startOfMonth:l,addMonths:c,differenceInCalendarMonths:u}=r,h=s?i:1,m=l(n);if(!e)return c(m,h);if(!(u(e,n)<i))return c(m,h)}function F0e(n,e,t,r){if(t.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i}=t,{startOfMonth:l,addMonths:c,differenceInCalendarMonths:u}=r,h=s?i??1:1,m=l(n);if(!e)return c(m,-h);if(!(u(m,e)<=0))return c(m,-h)}function q0e(n){const e=[];return n.reduce((t,r)=>t.concat(r.weeks.slice()),e.slice())}function Kx(n,e){const[t,r]=S.useState(n);return[e===void 0?t:e,r]}function Q0e(n,e){const[t,r]=B0e(n,e),{startOfMonth:s,endOfMonth:i}=e,l=o9(n,t,r,e),[c,u]=Kx(l,n.month?l:void 0);S.useEffect(()=>{const E=o9(n,t,r,e);u(E)},[n.timeZone]);const h=P0e(c,r,n,e),m=R0e(h,n.endMonth?i(n.endMonth):void 0,n,e),p=L0e(h,m,n,e),x=q0e(p),v=z0e(p),b=F0e(c,t,n,e),O=I0e(c,r,n,e),{disableNavigation:k,onMonthChange:j}=n,T=E=>x.some(z=>z.days.some(Q=>Q.isEqualTo(E))),M=E=>{if(k)return;let z=s(E);t&&z<s(t)&&(z=s(t)),r&&z>s(r)&&(z=s(r)),u(z),j?.(z)};return{months:p,weeks:x,days:v,navStart:t,navEnd:r,previousMonth:b,nextMonth:O,goToMonth:M,goToDay:E=>{T(E)||M(E.date)}}}var sa;(function(n){n[n.Today=0]="Today",n[n.Selected=1]="Selected",n[n.LastFocused=2]="LastFocused",n[n.FocusedModifier=3]="FocusedModifier"})(sa||(sa={}));function c9(n){return!n[Yn.disabled]&&!n[Yn.hidden]&&!n[Yn.outside]}function $0e(n,e,t,r){let s,i=-1;for(const l of n){const c=e(l);c9(c)&&(c[Yn.focused]&&i<sa.FocusedModifier?(s=l,i=sa.FocusedModifier):r?.isEqualTo(l)&&i<sa.LastFocused?(s=l,i=sa.LastFocused):t(l.date)&&i<sa.Selected?(s=l,i=sa.Selected):c[Yn.today]&&i<sa.Today&&(s=l,i=sa.Today))}return s||(s=n.find(l=>c9(e(l)))),s}function H0e(n,e,t,r,s,i,l){const{ISOWeek:c,broadcastCalendar:u}=i,{addDays:h,addMonths:m,addWeeks:p,addYears:x,endOfBroadcastWeek:v,endOfISOWeek:b,endOfWeek:O,max:k,min:j,startOfBroadcastWeek:T,startOfISOWeek:M,startOfWeek:_}=l;let E={day:h,week:p,month:m,year:x,startOfWeek:z=>u?T(z,l):c?M(z):_(z),endOfWeek:z=>u?v(z):c?b(z):O(z)}[n](t,e==="after"?1:-1);return e==="before"&&r?E=k([r,E]):e==="after"&&s&&(E=j([s,E])),E}function Qz(n,e,t,r,s,i,l,c=0){if(c>365)return;const u=H0e(n,e,t.date,r,s,i,l),h=!!(i.disabled&&ll(u,i.disabled,l)),m=!!(i.hidden&&ll(u,i.hidden,l)),p=u,x=new Ez(u,p,l);return!h&&!m?x:Qz(n,e,x,r,s,i,l,c+1)}function U0e(n,e,t,r,s){const{autoFocus:i}=n,[l,c]=S.useState(),u=$0e(e.days,t,r||(()=>!1),l),[h,m]=S.useState(i?u:void 0);return{isFocusTarget:O=>!!u?.isEqualTo(O),setFocused:m,focused:h,blur:()=>{c(h),m(void 0)},moveFocus:(O,k)=>{if(!h)return;const j=Qz(O,k,h,e.navStart,e.navEnd,n,s);j&&(n.disableNavigation&&!e.days.some(M=>M.isEqualTo(j))||(e.goToDay(j),m(j)))}}}function V0e(n,e){const{selected:t,required:r,onSelect:s}=n,[i,l]=Kx(t,s?t:void 0),c=s?t:i,{isSameDay:u}=e,h=v=>c?.some(b=>u(b,v))??!1,{min:m,max:p}=n;return{selected:c,select:(v,b,O)=>{let k=[...c??[]];if(h(v)){if(c?.length===m||r&&c?.length===1)return;k=c?.filter(j=>!u(j,v))}else c?.length===p?k=[v]:k=[...k,v];return s||l(k),s?.(k,v,b,O),k},isSelected:h}}function W0e(n,e,t=0,r=0,s=!1,i=Ma){const{from:l,to:c}=e||{},{isSameDay:u,isAfter:h,isBefore:m}=i;let p;if(!l&&!c)p={from:n,to:t>0?void 0:n};else if(l&&!c)u(l,n)?t===0?p={from:l,to:n}:s?p={from:l,to:void 0}:p=void 0:m(n,l)?p={from:n,to:l}:p={from:l,to:n};else if(l&&c)if(u(l,n)&&u(c,n))s?p={from:l,to:c}:p=void 0;else if(u(l,n))p={from:l,to:t>0?void 0:n};else if(u(c,n))p={from:n,to:t>0?void 0:n};else if(m(n,l))p={from:n,to:c};else if(h(n,l))p={from:l,to:n};else if(h(n,c))p={from:l,to:n};else throw new Error("Invalid range");if(p?.from&&p?.to){const x=i.differenceInCalendarDays(p.to,p.from);r>0&&x>r?p={from:n,to:void 0}:t>1&&x<t&&(p={from:n,to:void 0})}return p}function G0e(n,e,t=Ma){const r=Array.isArray(e)?e:[e];let s=n.from;const i=t.differenceInCalendarDays(n.to,n.from),l=Math.min(i,6);for(let c=0;c<=l;c++){if(r.includes(s.getDay()))return!0;s=t.addDays(s,1)}return!1}function u9(n,e,t=Ma){return al(n,e.from,!1,t)||al(n,e.to,!1,t)||al(e,n.from,!1,t)||al(e,n.to,!1,t)}function X0e(n,e,t=Ma){const r=Array.isArray(e)?e:[e];if(r.filter(c=>typeof c!="function").some(c=>typeof c=="boolean"?c:t.isDate(c)?al(n,c,!1,t):Lz(c,t)?c.some(u=>al(n,u,!1,t)):K5(c)?c.from&&c.to?u9(n,{from:c.from,to:c.to},t):!1:Pz(c)?G0e(n,c.dayOfWeek,t):Dz(c)?t.isAfter(c.before,c.after)?u9(n,{from:t.addDays(c.after,1),to:t.addDays(c.before,-1)},t):ll(n.from,c,t)||ll(n.to,c,t):Rz(c)||zz(c)?ll(n.from,c,t)||ll(n.to,c,t):!1))return!0;const l=r.filter(c=>typeof c=="function");if(l.length){let c=n.from;const u=t.differenceInCalendarDays(n.to,n.from);for(let h=0;h<=u;h++){if(l.some(m=>m(c)))return!0;c=t.addDays(c,1)}}return!1}function Y0e(n,e){const{disabled:t,excludeDisabled:r,selected:s,required:i,onSelect:l}=n,[c,u]=Kx(s,l?s:void 0),h=l?s:c;return{selected:h,select:(x,v,b)=>{const{min:O,max:k}=n,j=x?W0e(x,h,O,k,i,e):void 0;return r&&t&&j?.from&&j.to&&X0e({from:j.from,to:j.to},t,e)&&(j.from=x,j.to=void 0),l||u(j),l?.(j,x,v,b),j},isSelected:x=>h&&al(h,x,!1,e)}}function K0e(n,e){const{selected:t,required:r,onSelect:s}=n,[i,l]=Kx(t,s?t:void 0),c=s?t:i,{isSameDay:u}=e;return{selected:c,select:(p,x,v)=>{let b=p;return!r&&c&&c&&u(p,c)&&(b=void 0),s||l(b),s?.(b,p,x,v),b},isSelected:p=>c?u(c,p):!1}}function Z0e(n,e){const t=K0e(n,e),r=V0e(n,e),s=Y0e(n,e);switch(n.mode){case"single":return t;case"multiple":return r;case"range":return s;default:return}}function J0e(n){let e=n;e.timeZone&&(e={...n},e.today&&(e.today=new Zr(e.today,e.timeZone)),e.month&&(e.month=new Zr(e.month,e.timeZone)),e.defaultMonth&&(e.defaultMonth=new Zr(e.defaultMonth,e.timeZone)),e.startMonth&&(e.startMonth=new Zr(e.startMonth,e.timeZone)),e.endMonth&&(e.endMonth=new Zr(e.endMonth,e.timeZone)),e.mode==="single"&&e.selected?e.selected=new Zr(e.selected,e.timeZone):e.mode==="multiple"&&e.selected?e.selected=e.selected?.map(dt=>new Zr(dt,e.timeZone)):e.mode==="range"&&e.selected&&(e.selected={from:e.selected.from?new Zr(e.selected.from,e.timeZone):void 0,to:e.selected.to?new Zr(e.selected.to,e.timeZone):void 0}));const{components:t,formatters:r,labels:s,dateLib:i,locale:l,classNames:c}=S.useMemo(()=>{const dt={...Y5,...e.locale};return{dateLib:new ii({locale:dt,weekStartsOn:e.broadcastCalendar?1:e.weekStartsOn,firstWeekContainsDate:e.firstWeekContainsDate,useAdditionalWeekYearTokens:e.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:e.useAdditionalDayOfYearTokens,timeZone:e.timeZone,numerals:e.numerals},e.dateLib),components:r0e(e.components),formatters:f0e(e.formatters),labels:{...M0e,...e.labels},locale:dt,classNames:{...Z5(),...e.classNames}}},[e.locale,e.broadcastCalendar,e.weekStartsOn,e.firstWeekContainsDate,e.useAdditionalWeekYearTokens,e.useAdditionalDayOfYearTokens,e.timeZone,e.numerals,e.dateLib,e.components,e.formatters,e.labels,e.classNames]),{captionLayout:u,mode:h,navLayout:m,numberOfMonths:p=1,onDayBlur:x,onDayClick:v,onDayFocus:b,onDayKeyDown:O,onDayMouseEnter:k,onDayMouseLeave:j,onNextClick:T,onPrevClick:M,showWeekNumber:_,styles:D}=e,{formatCaption:E,formatDay:z,formatMonthDropdown:Q,formatWeekNumber:q,formatWeekNumberHeader:B,formatWeekdayName:U,formatYearDropdown:V}=r,ce=Q0e(e,i),{days:W,months:J,navStart:H,navEnd:ae,previousMonth:ne,nextMonth:ue,goToMonth:R}=ce,me=t0e(W,e,H,ae,i),{isSelected:Y,select:P,selected:K}=Z0e(e,i)??{},{blur:$,focused:fe,isFocusTarget:ye,moveFocus:Re,setFocused:de}=U0e(e,ce,me,Y??(()=>!1),i),{labelDayButton:We,labelGridcell:ct,labelGrid:ke,labelMonthDropdown:nt,labelNav:ut,labelPrevious:Ct,labelNext:Bn,labelWeekday:Tn,labelWeekNumber:Jn,labelWeekNumberHeader:nn,labelYearDropdown:_t}=s,Yr=S.useMemo(()=>g0e(i,e.ISOWeek),[i,e.ISOWeek]),In=h!==void 0||v!==void 0,or=S.useCallback(()=>{ne&&(R(ne),M?.(ne))},[ne,R,M]),yn=S.useCallback(()=>{ue&&(R(ue),T?.(ue))},[R,ue,T]),ft=S.useCallback((dt,zn)=>mt=>{mt.preventDefault(),mt.stopPropagation(),de(dt),P?.(dt.date,zn,mt),v?.(dt.date,zn,mt)},[P,v,de]),ee=S.useCallback((dt,zn)=>mt=>{de(dt),b?.(dt.date,zn,mt)},[b,de]),Se=S.useCallback((dt,zn)=>mt=>{$(),x?.(dt.date,zn,mt)},[$,x]),Le=S.useCallback((dt,zn)=>mt=>{const rn={ArrowLeft:[mt.shiftKey?"month":"day",e.dir==="rtl"?"after":"before"],ArrowRight:[mt.shiftKey?"month":"day",e.dir==="rtl"?"before":"after"],ArrowDown:[mt.shiftKey?"year":"week","after"],ArrowUp:[mt.shiftKey?"year":"week","before"],PageUp:[mt.shiftKey?"year":"month","before"],PageDown:[mt.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(rn[mt.key]){mt.preventDefault(),mt.stopPropagation();const[Ar,Mt]=rn[mt.key];Re(Ar,Mt)}O?.(dt.date,zn,mt)},[Re,O,e.dir]),rt=S.useCallback((dt,zn)=>mt=>{k?.(dt.date,zn,mt)},[k]),Tt=S.useCallback((dt,zn)=>mt=>{j?.(dt.date,zn,mt)},[j]),cr=S.useCallback(dt=>zn=>{const mt=Number(zn.target.value),rn=i.setMonth(i.startOfMonth(dt),mt);R(rn)},[i,R]),Kr=S.useCallback(dt=>zn=>{const mt=Number(zn.target.value),rn=i.setYear(i.startOfMonth(dt),mt);R(rn)},[i,R]),{className:re,style:Me}=S.useMemo(()=>({className:[c[et.Root],e.className].filter(Boolean).join(" "),style:{...D?.[et.Root],...e.style}}),[c,e.className,e.style,D]),pt=s0e(e),vt=S.useRef(null);D0e(vt,!!e.animate,{classNames:c,months:J,focused:fe,dateLib:i});const vs={dayPickerProps:e,selected:K,select:P,isSelected:Y,months:J,nextMonth:ue,previousMonth:ne,goToMonth:R,getModifiers:me,components:t,classNames:c,styles:D,labels:s,formatters:r};return Ue.createElement(_z.Provider,{value:vs},Ue.createElement(t.Root,{rootRef:e.animate?vt:void 0,className:re,style:Me,dir:e.dir,id:e.id,lang:e.lang,nonce:e.nonce,title:e.title,role:e.role,"aria-label":e["aria-label"],"aria-labelledby":e["aria-labelledby"],...pt},Ue.createElement(t.Months,{className:c[et.Months],style:D?.[et.Months]},!e.hideNavigation&&!m&&Ue.createElement(t.Nav,{"data-animated-nav":e.animate?"true":void 0,className:c[et.Nav],style:D?.[et.Nav],"aria-label":ut(),onPreviousClick:or,onNextClick:yn,previousMonth:ne,nextMonth:ue}),J.map((dt,zn)=>Ue.createElement(t.Month,{"data-animated-month":e.animate?"true":void 0,className:c[et.Month],style:D?.[et.Month],key:zn,displayIndex:zn,calendarMonth:dt},m==="around"&&!e.hideNavigation&&zn===0&&Ue.createElement(t.PreviousMonthButton,{type:"button",className:c[et.PreviousMonthButton],tabIndex:ne?void 0:-1,"aria-disabled":ne?void 0:!0,"aria-label":Ct(ne),onClick:or,"data-animated-button":e.animate?"true":void 0},Ue.createElement(t.Chevron,{disabled:ne?void 0:!0,className:c[et.Chevron],orientation:e.dir==="rtl"?"right":"left"})),Ue.createElement(t.MonthCaption,{"data-animated-caption":e.animate?"true":void 0,className:c[et.MonthCaption],style:D?.[et.MonthCaption],calendarMonth:dt,displayIndex:zn},u?.startsWith("dropdown")?Ue.createElement(t.DropdownNav,{className:c[et.Dropdowns],style:D?.[et.Dropdowns]},(()=>{const mt=u==="dropdown"||u==="dropdown-months"?Ue.createElement(t.MonthsDropdown,{key:"month",className:c[et.MonthsDropdown],"aria-label":nt(),classNames:c,components:t,disabled:!!e.disableNavigation,onChange:cr(dt.date),options:m0e(dt.date,H,ae,r,i),style:D?.[et.Dropdown],value:i.getMonth(dt.date)}):Ue.createElement("span",{key:"month"},Q(dt.date,i)),rn=u==="dropdown"||u==="dropdown-years"?Ue.createElement(t.YearsDropdown,{key:"year",className:c[et.YearsDropdown],"aria-label":_t(i.options),classNames:c,components:t,disabled:!!e.disableNavigation,onChange:Kr(dt.date),options:x0e(H,ae,r,i,!!e.reverseYears),style:D?.[et.Dropdown],value:i.getYear(dt.date)}):Ue.createElement("span",{key:"year"},V(dt.date,i));return i.getMonthYearOrder()==="year-first"?[rn,mt]:[mt,rn]})(),Ue.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},E(dt.date,i.options,i))):Ue.createElement(t.CaptionLabel,{className:c[et.CaptionLabel],role:"status","aria-live":"polite"},E(dt.date,i.options,i))),m==="around"&&!e.hideNavigation&&zn===p-1&&Ue.createElement(t.NextMonthButton,{type:"button",className:c[et.NextMonthButton],tabIndex:ue?void 0:-1,"aria-disabled":ue?void 0:!0,"aria-label":Bn(ue),onClick:yn,"data-animated-button":e.animate?"true":void 0},Ue.createElement(t.Chevron,{disabled:ue?void 0:!0,className:c[et.Chevron],orientation:e.dir==="rtl"?"left":"right"})),zn===p-1&&m==="after"&&!e.hideNavigation&&Ue.createElement(t.Nav,{"data-animated-nav":e.animate?"true":void 0,className:c[et.Nav],style:D?.[et.Nav],"aria-label":ut(),onPreviousClick:or,onNextClick:yn,previousMonth:ne,nextMonth:ue}),Ue.createElement(t.MonthGrid,{role:"grid","aria-multiselectable":h==="multiple"||h==="range","aria-label":ke(dt.date,i.options,i)||void 0,className:c[et.MonthGrid],style:D?.[et.MonthGrid]},!e.hideWeekdays&&Ue.createElement(t.Weekdays,{"data-animated-weekdays":e.animate?"true":void 0,className:c[et.Weekdays],style:D?.[et.Weekdays]},_&&Ue.createElement(t.WeekNumberHeader,{"aria-label":nn(i.options),className:c[et.WeekNumberHeader],style:D?.[et.WeekNumberHeader],scope:"col"},B()),Yr.map(mt=>Ue.createElement(t.Weekday,{"aria-label":Tn(mt,i.options,i),className:c[et.Weekday],key:String(mt),style:D?.[et.Weekday],scope:"col"},U(mt,i.options,i)))),Ue.createElement(t.Weeks,{"data-animated-weeks":e.animate?"true":void 0,className:c[et.Weeks],style:D?.[et.Weeks]},dt.weeks.map(mt=>Ue.createElement(t.Week,{className:c[et.Week],key:mt.weekNumber,style:D?.[et.Week],week:mt},_&&Ue.createElement(t.WeekNumber,{week:mt,style:D?.[et.WeekNumber],"aria-label":Jn(mt.weekNumber,{locale:l}),className:c[et.WeekNumber],scope:"row",role:"rowheader"},q(mt.weekNumber,i)),mt.days.map(rn=>{const{date:Ar}=rn,Mt=me(rn);if(Mt[Yn.focused]=!Mt.hidden&&!!fe?.isEqualTo(rn),Mt[Bi.selected]=Y?.(Ar)||Mt.selected,K5(K)){const{from:Fc,to:_o}=K;Mt[Bi.range_start]=!!(Fc&&_o&&i.isSameDay(Ar,Fc)),Mt[Bi.range_end]=!!(Fc&&_o&&i.isSameDay(Ar,_o)),Mt[Bi.range_middle]=al(K,Ar,!0,i)}const Ic=p0e(Mt,D,e.modifiersStyles),Eo=n0e(Mt,c,e.modifiersClassNames),n1=!In&&!Mt.hidden?ct(Ar,Mt,i.options,i):void 0;return Ue.createElement(t.Day,{key:`${i.format(Ar,"yyyy-MM-dd")}_${i.format(rn.displayMonth,"yyyy-MM")}`,day:rn,modifiers:Mt,className:Eo.join(" "),style:Ic,role:"gridcell","aria-selected":Mt.selected||void 0,"aria-label":n1,"data-day":i.format(Ar,"yyyy-MM-dd"),"data-month":rn.outside?i.format(Ar,"yyyy-MM"):void 0,"data-selected":Mt.selected||void 0,"data-disabled":Mt.disabled||void 0,"data-hidden":Mt.hidden||void 0,"data-outside":rn.outside||void 0,"data-focused":Mt.focused||void 0,"data-today":Mt.today||void 0},!Mt.hidden&&In?Ue.createElement(t.DayButton,{className:c[et.DayButton],style:D?.[et.DayButton],type:"button",day:rn,modifiers:Mt,disabled:Mt.disabled||void 0,tabIndex:ye(rn)?0:-1,"aria-label":We(Ar,Mt,i.options,i),onClick:ft(rn,Mt),onBlur:Se(rn,Mt),onFocus:ee(rn,Mt),onKeyDown:Le(rn,Mt),onMouseEnter:rt(rn,Mt),onMouseLeave:Tt(rn,Mt)},z(Ar,i.options,i)):!Mt.hidden&&z(rn.date,i.options,i))})))))))),e.footer&&Ue.createElement(t.Footer,{className:c[et.Footer],style:D?.[et.Footer],role:"status","aria-live":"polite"},e.footer)))}function d9({className:n,classNames:e,showOutsideDays:t=!0,captionLayout:r="label",buttonVariant:s="ghost",formatters:i,components:l,...c}){const u=Z5();return a.jsx(J0e,{showOutsideDays:t,className:ve("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,n),captionLayout:r,formatters:{formatMonthDropdown:h=>h.toLocaleString("default",{month:"short"}),...i},classNames:{root:ve("w-fit",u.root),months:ve("relative flex flex-col gap-4 md:flex-row",u.months),month:ve("flex w-full flex-col gap-4",u.month),nav:ve("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",u.nav),button_previous:ve(mf({variant:s}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",u.button_previous),button_next:ve(mf({variant:s}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",u.button_next),month_caption:ve("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",u.month_caption),dropdowns:ve("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",u.dropdowns),dropdown_root:ve("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",u.dropdown_root),dropdown:ve("bg-popover absolute inset-0 opacity-0",u.dropdown),caption_label:ve("select-none font-medium",r==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",u.caption_label),table:"w-full border-collapse",weekdays:ve("flex",u.weekdays),weekday:ve("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",u.weekday),week:ve("mt-2 flex w-full",u.week),week_number_header:ve("w-[--cell-size] select-none",u.week_number_header),week_number:ve("text-muted-foreground select-none text-[0.8rem]",u.week_number),day:ve("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",u.day),range_start:ve("bg-accent rounded-l-md",u.range_start),range_middle:ve("rounded-none",u.range_middle),range_end:ve("bg-accent rounded-r-md",u.range_end),today:ve("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",u.today),outside:ve("text-muted-foreground aria-selected:text-muted-foreground",u.outside),disabled:ve("text-muted-foreground opacity-50",u.disabled),hidden:ve("invisible",u.hidden),...e},components:{Root:({className:h,rootRef:m,...p})=>a.jsx("div",{"data-slot":"calendar",ref:m,className:ve(h),...p}),Chevron:({className:h,orientation:m,...p})=>m==="left"?a.jsx(Tc,{className:ve("size-4",h),...p}):m==="right"?a.jsx(Mc,{className:ve("size-4",h),...p}):a.jsx(hf,{className:ve("size-4",h),...p}),DayButton:eme,WeekNumber:({children:h,...m})=>a.jsx("td",{...m,children:a.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:h})}),...l},...c})}function eme({className:n,day:e,modifiers:t,...r}){const s=Z5(),i=S.useRef(null);return S.useEffect(()=>{t.focused&&i.current?.focus()},[t.focused]),a.jsx(ie,{ref:i,variant:"ghost",size:"icon","data-day":e.date.toLocaleDateString(),"data-selected-single":t.selected&&!t.range_start&&!t.range_end&&!t.range_middle,"data-range-start":t.range_start,"data-range-end":t.range_end,"data-range-middle":t.range_middle,className:ve("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",s.day,n),...r})}class tme{ws=null;reconnectTimeout=null;reconnectAttempts=0;maxReconnectAttempts=10;heartbeatInterval=null;logCallbacks=new Set;connectionCallbacks=new Set;isConnected=!1;logCache=[];maxCacheSize=1e3;getWebSocketUrl(){{const e=window.location.protocol==="https:"?"wss:":"ws:",t=window.location.host;return`${e}//${t}/ws/logs`}}connect(){if(this.ws?.readyState===WebSocket.OPEN||this.ws?.readyState===WebSocket.CONNECTING)return;const e=this.getWebSocketUrl();try{this.ws=new WebSocket(e),this.ws.onopen=()=>{this.isConnected=!0,this.reconnectAttempts=0,this.notifyConnection(!0),this.startHeartbeat()},this.ws.onmessage=t=>{try{if(t.data==="pong")return;const r=JSON.parse(t.data);this.notifyLog(r)}catch(r){console.error("解析日志消息失败:",r)}},this.ws.onerror=t=>{console.error("❌ WebSocket 错误:",t),this.isConnected=!1,this.notifyConnection(!1)},this.ws.onclose=()=>{this.isConnected=!1,this.notifyConnection(!1),this.stopHeartbeat(),this.attemptReconnect()}}catch(t){console.error("创建 WebSocket 连接失败:",t),this.attemptReconnect()}}attemptReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts)return;this.reconnectAttempts+=1;const e=Math.min(1e3*this.reconnectAttempts,1e4);this.reconnectTimeout=window.setTimeout(()=>{this.connect()},e)}startHeartbeat(){this.heartbeatInterval=window.setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send("ping")},3e4)}stopHeartbeat(){this.heartbeatInterval!==null&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null)}disconnect(){this.reconnectTimeout!==null&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.stopHeartbeat(),this.ws&&(this.ws.close(),this.ws=null),this.isConnected=!1,this.reconnectAttempts=0}onLog(e){return this.logCallbacks.add(e),()=>this.logCallbacks.delete(e)}onConnectionChange(e){return this.connectionCallbacks.add(e),e(this.isConnected),()=>this.connectionCallbacks.delete(e)}notifyLog(e){this.logCache.some(r=>r.id===e.id)||(this.logCache.push(e),this.logCache.length>this.maxCacheSize&&(this.logCache=this.logCache.slice(-this.maxCacheSize)),this.logCallbacks.forEach(r=>{try{r(e)}catch(s){console.error("日志回调执行失败:",s)}}))}notifyConnection(e){this.connectionCallbacks.forEach(t=>{try{t(e)}catch(r){console.error("连接状态回调执行失败:",r)}})}getAllLogs(){return[...this.logCache]}clearLogs(){this.logCache=[]}getConnectionStatus(){return this.isConnected}}const Fu=new tme;typeof window<"u"&&Fu.connect();const nme={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},rme=(n,e,t)=>{let r;const s=nme[n];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",String(e)),t?.addSuffix?t.comparison&&t.comparison>0?r+"内":r+"前":r},sme={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},ime={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},ame={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},lme={date:nd({formats:sme,defaultWidth:"full"}),time:nd({formats:ime,defaultWidth:"full"}),dateTime:nd({formats:ame,defaultWidth:"full"})};function h9(n,e,t){const r="eeee p";return vfe(n,e,t)?r:n.getTime()>e.getTime()?"'下个'"+r:"'上个'"+r}const ome={lastWeek:h9,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:h9,other:"PP p"},cme=(n,e,t,r)=>{const s=ome[n];return typeof s=="function"?s(e,t,r):s},ume={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},dme={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},hme={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},fme={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},mme={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},pme={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},gme=(n,e)=>{const t=Number(n);switch(e?.unit){case"date":return t.toString()+"日";case"hour":return t.toString()+"时";case"minute":return t.toString()+"分";case"second":return t.toString()+"秒";default:return"第 "+t.toString()}},xme={ordinalNumber:gme,era:oa({values:ume,defaultWidth:"wide"}),quarter:oa({values:dme,defaultWidth:"wide",argumentCallback:n=>n-1}),month:oa({values:hme,defaultWidth:"wide"}),day:oa({values:fme,defaultWidth:"wide"}),dayPeriod:oa({values:mme,defaultWidth:"wide",formattingValues:pme,defaultFormattingWidth:"wide"})},vme=/^(第\s*)?\d+(日|时|分|秒)?/i,yme=/\d+/i,bme={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},wme={any:[/^(前)/i,/^(公元)/i]},Sme={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},Ome={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},kme={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},jme={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},Nme={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},Cme={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},Tme={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},Mme={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},Ame={ordinalNumber:jz({matchPattern:vme,parsePattern:yme,valueCallback:n=>parseInt(n,10)}),era:ca({matchPatterns:bme,defaultMatchWidth:"wide",parsePatterns:wme,defaultParseWidth:"any"}),quarter:ca({matchPatterns:Sme,defaultMatchWidth:"wide",parsePatterns:Ome,defaultParseWidth:"any",valueCallback:n=>n+1}),month:ca({matchPatterns:kme,defaultMatchWidth:"wide",parsePatterns:jme,defaultParseWidth:"any"}),day:ca({matchPatterns:Nme,defaultMatchWidth:"wide",parsePatterns:Cme,defaultParseWidth:"any"}),dayPeriod:ca({matchPatterns:Tme,defaultMatchWidth:"any",parsePatterns:Mme,defaultParseWidth:"any"})},Bp={code:"zh-CN",formatDistance:rme,formatLong:lme,formatRelative:cme,localize:xme,match:Ame,options:{weekStartsOn:1,firstWeekContainsDate:4}};function Eme(){const[n,e]=S.useState([]),[t,r]=S.useState(""),[s,i]=S.useState("all"),[l,c]=S.useState("all"),[u,h]=S.useState(void 0),[m,p]=S.useState(void 0),[x,v]=S.useState(!0),[b,O]=S.useState(!1),k=S.useRef(null);S.useEffect(()=>{const U=Fu.getAllLogs();e(U);const V=Fu.onLog(()=>{e(Fu.getAllLogs())}),ce=Fu.onConnectionChange(W=>{O(W)});return()=>{V(),ce()}},[]);const j=S.useMemo(()=>{const U=new Set(n.map(V=>V.module));return Array.from(U).sort()},[n]),T=U=>{switch(U){case"DEBUG":return"text-muted-foreground";case"INFO":return"text-blue-500 dark:text-blue-400";case"WARNING":return"text-yellow-600 dark:text-yellow-500";case"ERROR":return"text-red-600 dark:text-red-500";case"CRITICAL":return"text-red-700 dark:text-red-400 font-bold";default:return"text-foreground"}},M=U=>{switch(U){case"DEBUG":return"bg-gray-800/30 dark:bg-gray-800/50";case"INFO":return"bg-blue-900/20 dark:bg-blue-500/20";case"WARNING":return"bg-yellow-900/20 dark:bg-yellow-500/20";case"ERROR":return"bg-red-900/20 dark:bg-red-500/20";case"CRITICAL":return"bg-red-900/30 dark:bg-red-600/30";default:return"bg-gray-800/20 dark:bg-gray-800/30"}},_=()=>{window.location.reload()},D=()=>{Fu.clearLogs(),e([])},E=()=>{const U=q.map(J=>`${J.timestamp} [${J.level.padEnd(8)}] [${J.module}] ${J.message}`).join(`
|
||
`),V=new Blob([U],{type:"text/plain;charset=utf-8"}),ce=URL.createObjectURL(V),W=document.createElement("a");W.href=ce,W.download=`logs-${hg(new Date,"yyyy-MM-dd-HHmmss")}.txt`,W.click(),URL.revokeObjectURL(ce)},z=()=>{v(!x)},Q=()=>{h(void 0),p(void 0)},q=S.useMemo(()=>n.filter(U=>{const V=t===""||U.message.toLowerCase().includes(t.toLowerCase())||U.module.toLowerCase().includes(t.toLowerCase()),ce=s==="all"||U.level===s,W=l==="all"||U.module===l;let J=!0;if(u||m){const H=new Date(U.timestamp);if(u){const ae=new Date(u);ae.setHours(0,0,0,0),J=J&&H>=ae}if(m){const ae=new Date(m);ae.setHours(23,59,59,999),J=J&&H<=ae}}return V&&ce&&W&&J}),[n,t,s,l,u,m]),B=Zde({count:q.length,getScrollElement:()=>k.current,estimateSize:()=>80,overscan:10});return S.useEffect(()=>{x&&q.length>0&&B.scrollToIndex(q.length-1,{align:"end",behavior:"auto"})},[q.length,x,B]),a.jsx(fn,{className:"h-full",children:a.jsxs("div",{className:"space-y-4 p-3 sm:p-4 lg:p-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl sm:text-2xl lg:text-3xl font-bold",children:"日志查看器"}),a.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:"实时查看和分析麦麦运行日志"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:ve("h-2.5 w-2.5 sm:h-3 sm:w-3 rounded-full",b?"bg-green-500 animate-pulse":"bg-red-500")}),a.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground",children:b?"已连接":"未连接"})]})]}),a.jsx(yt,{className:"p-3 sm:p-4",children:a.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[a.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:gap-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(Ps,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),a.jsx(Ae,{placeholder:"搜索日志...",value:t,onChange:U=>r(U.target.value),className:"pl-9 h-9 text-sm"})]}),a.jsxs(Bt,{value:s,onValueChange:i,children:[a.jsxs(Dt,{className:"w-full sm:w-[140px] lg:w-[180px] h-9 text-sm",children:[a.jsx(n2,{className:"h-4 w-4 mr-2"}),a.jsx(It,{placeholder:"级别"})]}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"all",children:"全部级别"}),a.jsx(Pe,{value:"DEBUG",children:"DEBUG"}),a.jsx(Pe,{value:"INFO",children:"INFO"}),a.jsx(Pe,{value:"WARNING",children:"WARNING"}),a.jsx(Pe,{value:"ERROR",children:"ERROR"}),a.jsx(Pe,{value:"CRITICAL",children:"CRITICAL"})]})]}),a.jsxs(Bt,{value:l,onValueChange:c,children:[a.jsxs(Dt,{className:"w-full sm:w-[160px] lg:w-[200px] h-9 text-sm",children:[a.jsx(n2,{className:"h-4 w-4 mr-2"}),a.jsx(It,{placeholder:"模块"})]}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"all",children:"全部模块"}),j.map(U=>a.jsx(Pe,{value:U,children:U},U))]})]})]}),a.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-4",children:[a.jsxs(co,{children:[a.jsx(uo,{asChild:!0,children:a.jsxs(ie,{variant:"outline",size:"sm",className:ve("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!u&&"text-muted-foreground"),children:[a.jsx(hk,{className:"mr-2 h-4 w-4"}),a.jsx("span",{className:"text-xs sm:text-sm",children:u?hg(u,"PPP",{locale:Bp}):"开始日期"})]})}),a.jsx(hl,{className:"w-auto p-0",align:"start",children:a.jsx(d9,{mode:"single",selected:u,onSelect:h,initialFocus:!0,locale:Bp})})]}),a.jsxs(co,{children:[a.jsx(uo,{asChild:!0,children:a.jsxs(ie,{variant:"outline",size:"sm",className:ve("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!m&&"text-muted-foreground"),children:[a.jsx(hk,{className:"mr-2 h-4 w-4"}),a.jsx("span",{className:"text-xs sm:text-sm",children:m?hg(m,"PPP",{locale:Bp}):"结束日期"})]})}),a.jsx(hl,{className:"w-auto p-0",align:"start",children:a.jsx(d9,{mode:"single",selected:m,onSelect:p,initialFocus:!0,locale:Bp})})]}),(u||m)&&a.jsxs(ie,{variant:"outline",size:"sm",onClick:Q,className:"w-full sm:w-auto h-9",children:[a.jsx(Xf,{className:"h-4 w-4 sm:mr-2"}),a.jsx("span",{className:"hidden sm:inline text-sm",children:"清除时间筛选"}),a.jsx("span",{className:"sm:hidden text-sm",children:"清除"})]})]}),a.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center",children:[a.jsxs("div",{className:"flex gap-2 flex-wrap",children:[a.jsxs(ie,{variant:x?"default":"outline",size:"sm",onClick:z,className:"flex-1 sm:flex-none h-9",children:[x?a.jsx(_F,{className:"h-4 w-4"}):a.jsx(DF,{className:"h-4 w-4"}),a.jsx("span",{className:"ml-2 text-sm",children:x?"自动滚动":"已暂停"})]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:_,className:"flex-1 sm:flex-none h-9",children:[a.jsx(Ii,{className:"h-4 w-4"}),a.jsx("span",{className:"ml-2 text-sm",children:"刷新"})]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:D,className:"flex-1 sm:flex-none h-9",children:[a.jsx(Ht,{className:"h-4 w-4"}),a.jsx("span",{className:"ml-2 text-sm",children:"清空"})]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:E,className:"flex-1 sm:flex-none h-9",children:[a.jsx(fc,{className:"h-4 w-4"}),a.jsx("span",{className:"ml-2 text-sm",children:"导出"})]})]}),a.jsx("div",{className:"flex-1 hidden sm:block"}),a.jsxs("div",{className:"text-xs sm:text-sm text-muted-foreground flex items-center justify-center sm:justify-end",children:[a.jsxs("span",{className:"font-mono",children:[q.length," / ",n.length]}),a.jsx("span",{className:"ml-1",children:"条日志"})]})]})]})}),a.jsx(yt,{className:"bg-black dark:bg-gray-950 border-gray-800 dark:border-gray-900",children:a.jsx(fn,{viewportRef:k,className:"h-[calc(100vh-280px)] sm:h-[calc(100vh-320px)] lg:h-[calc(100vh-400px)]",children:a.jsx("div",{className:"p-2 sm:p-3 lg:p-4 font-mono text-xs sm:text-sm relative",style:{height:`${B.getTotalSize()}px`},children:q.length===0?a.jsx("div",{className:"text-gray-500 dark:text-gray-600 text-center py-8 text-sm",children:"暂无日志数据"}):B.getVirtualItems().map(U=>{const V=q[U.index];return a.jsxs("div",{"data-index":U.index,ref:B.measureElement,className:ve("absolute top-0 left-0 w-full py-2 px-2 sm:px-3 rounded hover:bg-white/5 transition-colors group",M(V.level)),style:{transform:`translateY(${U.start}px)`},children:[a.jsxs("div",{className:"flex flex-col gap-1 sm:hidden",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-500 dark:text-gray-600 text-xs",children:V.timestamp}),a.jsxs("span",{className:ve("text-xs font-semibold",T(V.level)),children:["[",V.level,"]"]})]}),a.jsx("div",{className:"text-cyan-400 dark:text-cyan-500 text-xs truncate",children:V.module}),a.jsx("div",{className:"text-gray-300 dark:text-gray-400 text-xs whitespace-pre-wrap break-words",children:V.message})]}),a.jsxs("div",{className:"hidden sm:flex gap-3 items-start",children:[a.jsx("span",{className:"text-gray-500 dark:text-gray-600 flex-shrink-0 w-[140px] lg:w-[180px] text-xs lg:text-sm",children:V.timestamp}),a.jsxs("span",{className:ve("flex-shrink-0 w-[70px] lg:w-[80px] font-semibold text-xs lg:text-sm",T(V.level)),children:["[",V.level,"]"]}),a.jsx("span",{className:"text-cyan-400 dark:text-cyan-500 flex-shrink-0 w-[120px] lg:w-[150px] truncate text-xs lg:text-sm",children:V.module}),a.jsx("span",{className:"text-gray-300 dark:text-gray-400 flex-1 whitespace-pre-wrap break-words text-xs lg:text-sm",children:V.message})]})]},U.key)})})})})]})})}const _me="Mai-with-u",Dme="plugin-repo",Rme="main",zme="plugin_details.json";async function Pme(){try{const n=await ot("/api/webui/plugins/fetch-raw",{method:"POST",headers:bt(),body:JSON.stringify({owner:_me,repo:Dme,branch:Rme,file_path:zme})});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const e=await n.json();if(!e.success||!e.data)throw new Error(e.error||"获取插件列表失败");return JSON.parse(e.data).filter(s=>!s?.id||!s?.manifest?(console.warn("跳过无效插件数据:",s),!1):!s.manifest.name||!s.manifest.version?(console.warn("跳过缺少必需字段的插件:",s.id),!1):!0).map(s=>({id:s.id,manifest:{manifest_version:s.manifest.manifest_version||1,name:s.manifest.name,version:s.manifest.version,description:s.manifest.description||"",author:s.manifest.author||{name:"Unknown"},license:s.manifest.license||"Unknown",host_application:s.manifest.host_application||{min_version:"0.0.0"},homepage_url:s.manifest.homepage_url,repository_url:s.manifest.repository_url,keywords:s.manifest.keywords||[],categories:s.manifest.categories||[],default_locale:s.manifest.default_locale||"zh-CN",locales_path:s.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!1,published_at:new Date().toISOString(),updated_at:new Date().toISOString()}))}catch(n){throw console.error("Failed to fetch plugin list:",n),n}}async function Lme(){try{const n=await ot("/api/webui/plugins/git-status");if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return await n.json()}catch(n){return console.error("Failed to check Git status:",n),{installed:!1,error:"无法检测 Git 安装状态"}}}async function Bme(){try{const n=await ot("/api/webui/plugins/version");if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return await n.json()}catch(n){return console.error("Failed to get Maimai version:",n),{version:"0.0.0",version_major:0,version_minor:0,version_patch:0}}}function Ime(n,e,t){const r=n.split(".").map(c=>parseInt(c)||0),s=r[0]||0,i=r[1]||0,l=r[2]||0;if(t.version_major<s||t.version_major===s&&t.version_minor<i||t.version_major===s&&t.version_minor===i&&t.version_patch<l)return!1;if(e){const c=e.split(".").map(p=>parseInt(p)||0),u=c[0]||0,h=c[1]||0,m=c[2]||0;if(t.version_major>u||t.version_major===u&&t.version_minor>h||t.version_major===u&&t.version_minor===h&&t.version_patch>m)return!1}return!0}function Fme(n,e){const t=window.location.protocol==="https:"?"wss:":"ws:",r=window.location.host,s=new WebSocket(`${t}//${r}/api/webui/ws/plugin-progress`);return s.onopen=()=>{console.log("Plugin progress WebSocket connected");const i=setInterval(()=>{s.readyState===WebSocket.OPEN?s.send("ping"):clearInterval(i)},3e4)},s.onmessage=i=>{try{if(i.data==="pong")return;const l=JSON.parse(i.data);n(l)}catch(l){console.error("Failed to parse progress data:",l)}},s.onerror=i=>{console.error("Plugin progress WebSocket error:",i),e?.(i)},s.onclose=()=>{console.log("Plugin progress WebSocket disconnected")},s}async function Ip(){try{const n=await ot("/api/webui/plugins/installed",{headers:bt()});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const e=await n.json();if(!e.success)throw new Error(e.message||"获取已安装插件列表失败");return e.plugins||[]}catch(n){return console.error("Failed to get installed plugins:",n),[]}}function Fp(n,e){return e.some(t=>t.id===n)}function qp(n,e){const t=e.find(r=>r.id===n);if(t)return t.manifest?.version||t.version}async function qme(n,e,t="main"){const r=await ot("/api/webui/plugins/install",{method:"POST",headers:bt(),body:JSON.stringify({plugin_id:n,repository_url:e,branch:t})});if(!r.ok){const s=await r.json();throw new Error(s.detail||"安装失败")}return await r.json()}async function Qme(n){const e=await ot("/api/webui/plugins/uninstall",{method:"POST",headers:bt(),body:JSON.stringify({plugin_id:n})});if(!e.ok){const t=await e.json();throw new Error(t.detail||"卸载失败")}return await e.json()}async function $me(n,e,t="main"){const r=await ot("/api/webui/plugins/update",{method:"POST",headers:bt(),body:JSON.stringify({plugin_id:n,repository_url:e,branch:t})});if(!r.ok){const s=await r.json();throw new Error(s.detail||"更新失败")}return await r.json()}const T0="https://maibot-plugin-stats.maibot-webui.workers.dev";async function $z(n){try{const e=await fetch(`${T0}/stats/${n}`);return e.ok?await e.json():(console.error("Failed to fetch plugin stats:",e.statusText),null)}catch(e){return console.error("Error fetching plugin stats:",e),null}}async function Hme(n,e){try{const t=e||J5(),r=await fetch(`${T0}/stats/like`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:n,user_id:t})}),s=await r.json();return r.status===429?{success:!1,error:"操作过于频繁,请稍后再试"}:r.ok?{success:!0,...s}:{success:!1,error:s.error||"点赞失败"}}catch(t){return console.error("Error liking plugin:",t),{success:!1,error:"网络错误"}}}async function Ume(n,e){try{const t=e||J5(),r=await fetch(`${T0}/stats/dislike`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:n,user_id:t})}),s=await r.json();return r.status===429?{success:!1,error:"操作过于频繁,请稍后再试"}:r.ok?{success:!0,...s}:{success:!1,error:s.error||"点踩失败"}}catch(t){return console.error("Error disliking plugin:",t),{success:!1,error:"网络错误"}}}async function Vme(n,e,t,r){if(e<1||e>5)return{success:!1,error:"评分必须在 1-5 之间"};try{const s=r||J5(),i=await fetch(`${T0}/stats/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:n,rating:e,comment:t,user_id:s})}),l=await i.json();return i.status===429?{success:!1,error:"每天最多评分 3 次"}:i.ok?{success:!0,...l}:{success:!1,error:l.error||"评分失败"}}catch(s){return console.error("Error rating plugin:",s),{success:!1,error:"网络错误"}}}async function Wme(n){try{const e=await fetch(`${T0}/stats/download`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:n})}),t=await e.json();return e.status===429?(console.warn("Download recording rate limited"),{success:!0}):e.ok?{success:!0,...t}:(console.error("Failed to record download:",t.error),{success:!1,error:t.error})}catch(e){return console.error("Error recording download:",e),{success:!1,error:"网络错误"}}}function Gme(){const n=navigator,e=[navigator.userAgent,navigator.language,navigator.languages?.join(",")||"",navigator.platform,navigator.hardwareConcurrency||0,screen.width,screen.height,screen.colorDepth,screen.pixelDepth,new Date().getTimezoneOffset(),Intl.DateTimeFormat().resolvedOptions().timeZone,navigator.maxTouchPoints||0,n.deviceMemory||0].join("|");let t=0;for(let r=0;r<e.length;r++){const s=e.charCodeAt(r);t=(t<<5)-t+s,t=t&t}return`fp_${Math.abs(t).toString(36)}`}function J5(){const n="maibot_user_id";let e=localStorage.getItem(n);if(!e){const t=Gme(),r=Date.now().toString(36),s=Math.random().toString(36).substring(2,15);e=`${t}_${r}_${s}`,localStorage.setItem(n,e)}return e}function Xme({pluginId:n,compact:e=!1}){const[t,r]=S.useState(null),[s,i]=S.useState(!0),[l,c]=S.useState(0),[u,h]=S.useState(""),[m,p]=S.useState(!1),{toast:x}=Pr(),v=async()=>{i(!0);const j=await $z(n);j&&r(j),i(!1)};S.useEffect(()=>{v()},[n]);const b=async()=>{const j=await Hme(n);j.success?(x({title:"已点赞",description:"感谢你的支持!"}),v()):x({title:"点赞失败",description:j.error||"未知错误",variant:"destructive"})},O=async()=>{const j=await Ume(n);j.success?(x({title:"已反馈",description:"感谢你的反馈!"}),v()):x({title:"操作失败",description:j.error||"未知错误",variant:"destructive"})},k=async()=>{if(l===0){x({title:"请选择评分",description:"至少选择 1 颗星",variant:"destructive"});return}const j=await Vme(n,l,u||void 0);j.success?(x({title:"评分成功",description:"感谢你的评价!"}),p(!1),c(0),h(""),v()):x({title:"评分失败",description:j.error||"未知错误",variant:"destructive"})};return s?a.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(fc,{className:"h-4 w-4"}),a.jsx("span",{children:"-"})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Zl,{className:"h-4 w-4"}),a.jsx("span",{children:"-"})]})]}):t?e?a.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[a.jsxs("div",{className:"flex items-center gap-1",title:`下载量: ${t.downloads.toLocaleString()}`,children:[a.jsx(fc,{className:"h-4 w-4"}),a.jsx("span",{children:t.downloads.toLocaleString()})]}),a.jsxs("div",{className:"flex items-center gap-1",title:`评分: ${t.rating.toFixed(1)} (${t.rating_count} 条评价)`,children:[a.jsx(Zl,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),a.jsx("span",{children:t.rating.toFixed(1)})]}),a.jsxs("div",{className:"flex items-center gap-1",title:`点赞数: ${t.likes}`,children:[a.jsx(py,{className:"h-4 w-4"}),a.jsx("span",{children:t.likes})]})]}):a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[a.jsx(fc,{className:"h-5 w-5 text-muted-foreground mb-1"}),a.jsx("span",{className:"text-2xl font-bold",children:t.downloads.toLocaleString()}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"下载量"})]}),a.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[a.jsx(Zl,{className:"h-5 w-5 text-yellow-400 mb-1 fill-yellow-400"}),a.jsx("span",{className:"text-2xl font-bold",children:t.rating.toFixed(1)}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.rating_count," 条评价"]})]}),a.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[a.jsx(py,{className:"h-5 w-5 text-green-500 mb-1"}),a.jsx("span",{className:"text-2xl font-bold",children:t.likes}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"点赞"})]}),a.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[a.jsx(fk,{className:"h-5 w-5 text-red-500 mb-1"}),a.jsx("span",{className:"text-2xl font-bold",children:t.dislikes}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"点踩"})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(ie,{variant:"outline",size:"sm",onClick:b,children:[a.jsx(py,{className:"h-4 w-4 mr-1"}),"点赞"]}),a.jsxs(ie,{variant:"outline",size:"sm",onClick:O,children:[a.jsx(fk,{className:"h-4 w-4 mr-1"}),"点踩"]}),a.jsxs(Rr,{open:m,onOpenChange:p,children:[a.jsx(gw,{asChild:!0,children:a.jsxs(ie,{variant:"default",size:"sm",children:[a.jsx(Zl,{className:"h-4 w-4 mr-1"}),"评分"]})}),a.jsxs(Nr,{children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:"为插件评分"}),a.jsx(Gr,{children:"分享你的使用体验,帮助其他用户"})]}),a.jsxs("div",{className:"space-y-4 py-4",children:[a.jsxs("div",{className:"flex flex-col items-center gap-2",children:[a.jsx("div",{className:"flex gap-2",children:[1,2,3,4,5].map(j=>a.jsx("button",{onClick:()=>c(j),className:"focus:outline-none",children:a.jsx(Zl,{className:`h-8 w-8 transition-colors ${j<=l?"fill-yellow-400 text-yellow-400":"text-muted-foreground hover:text-yellow-300"}`})},j))}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:[l===0&&"点击星星进行评分",l===1&&"很差",l===2&&"一般",l===3&&"还行",l===4&&"不错",l===5&&"非常好"]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium mb-2 block",children:"评论(可选)"}),a.jsx(kn,{value:u,onChange:j=>h(j.target.value),placeholder:"分享你的使用体验...",rows:4,maxLength:500}),a.jsxs("div",{className:"text-xs text-muted-foreground mt-1 text-right",children:[u.length," / 500"]})]})]}),a.jsxs(ps,{children:[a.jsx(ie,{variant:"outline",onClick:()=>p(!1),children:"取消"}),a.jsx(ie,{onClick:k,disabled:l===0,children:"提交评分"})]})]})]})]}),t.recent_ratings&&t.recent_ratings.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsx("h4",{className:"text-sm font-semibold",children:"最近评价"}),a.jsx("div",{className:"space-y-3",children:t.recent_ratings.map((j,T)=>a.jsxs("div",{className:"p-3 rounded-lg border bg-muted/50",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("div",{className:"flex gap-1",children:[1,2,3,4,5].map(M=>a.jsx(Zl,{className:`h-3 w-3 ${M<=j.rating?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},M))}),a.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(j.created_at).toLocaleDateString()})]}),j.comment&&a.jsx("p",{className:"text-sm text-muted-foreground",children:j.comment})]},T))})]})]}):null}const f9={"Group Management":"群组管理","Entertainment & Interaction":"娱乐互动","Utility Tools":"实用工具","Content Generation":"内容生成",Multimedia:"多媒体","External Integration":"外部集成","Data Analysis & Insights":"数据分析与洞察",Other:"其他"};function Yme(){const n=ba(),[e,t]=S.useState(null),[r,s]=S.useState(""),[i,l]=S.useState("all"),[c,u]=S.useState("all"),[h,m]=S.useState(!0),[p,x]=S.useState([]),[v,b]=S.useState(!0),[O,k]=S.useState(null),[j,T]=S.useState(null),[M,_]=S.useState(null),[D,E]=S.useState(null),[,z]=S.useState([]),[Q,q]=S.useState({}),{toast:B}=Pr(),U=async R=>{const me=R.map(async K=>{try{const $=await $z(K.id);return{id:K.id,stats:$}}catch($){return console.warn(`Failed to load stats for ${K.id}:`,$),{id:K.id,stats:null}}}),Y=await Promise.all(me),P={};Y.forEach(({id:K,stats:$})=>{$&&(P[K]=$)}),q(P)};S.useEffect(()=>{let R=null,me=!1;return(async()=>{if(R=Fme(P=>{me||(_(P),P.stage==="success"?setTimeout(()=>{me||_(null)},2e3):P.stage==="error"&&(b(!1),k(P.error||"加载失败")))},P=>{console.error("WebSocket error:",P),me||B({title:"WebSocket 连接失败",description:"无法实时显示加载进度",variant:"destructive"})}),await new Promise(P=>{if(!R){P();return}const K=()=>{R&&R.readyState===WebSocket.OPEN?(console.log("WebSocket connected, starting to load plugins"),P()):R&&R.readyState===WebSocket.CLOSED?(console.warn("WebSocket closed before loading plugins"),P()):setTimeout(K,100)};K()}),!me){const P=await Lme();T(P),P.installed||B({title:"Git 未安装",description:P.error||"请先安装 Git 才能使用插件安装功能",variant:"destructive"})}if(!me){const P=await Bme();E(P)}if(!me)try{b(!0),k(null);const P=await Pme();if(!me){const K=await Ip();z(K);const $=P.map(fe=>{const ye=Fp(fe.id,K),Re=qp(fe.id,K);return{...fe,installed:ye,installed_version:Re}});for(const fe of K)!$.some(Re=>Re.id===fe.id)&&fe.manifest&&$.push({id:fe.id,manifest:{manifest_version:fe.manifest.manifest_version||1,name:fe.manifest.name,version:fe.manifest.version,description:fe.manifest.description||"",author:fe.manifest.author,license:fe.manifest.license||"Unknown",host_application:fe.manifest.host_application,homepage_url:fe.manifest.homepage_url,repository_url:fe.manifest.repository_url,keywords:fe.manifest.keywords||[],categories:fe.manifest.categories||[],default_locale:fe.manifest.default_locale||"zh-CN",locales_path:fe.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!0,installed_version:fe.manifest.version,published_at:new Date().toISOString(),updated_at:new Date().toISOString()});x($),U($)}}catch(P){if(!me){const K=P instanceof Error?P.message:"加载插件列表失败";k(K),B({title:"加载失败",description:K,variant:"destructive"})}}finally{me||b(!1)}})(),()=>{me=!0,R&&R.close()}},[B]);const V=R=>{if(!R.installed&&D&&!ce(R))return a.jsxs($n,{variant:"destructive",className:"gap-1",children:[a.jsx(xc,{className:"h-3 w-3"}),"不兼容"]});if(R.installed){const me=R.installed_version?.trim(),Y=R.manifest.version?.trim();if(me!==Y){const P=me?.split(".").map(Number)||[0,0,0],K=Y?.split(".").map(Number)||[0,0,0];for(let $=0;$<3;$++){if((K[$]||0)>(P[$]||0))return a.jsxs($n,{variant:"outline",className:"gap-1 text-orange-600 border-orange-600",children:[a.jsx(xc,{className:"h-3 w-3"}),"可更新"]});if((K[$]||0)<(P[$]||0))break}}return a.jsxs($n,{variant:"default",className:"gap-1",children:[a.jsx(ua,{className:"h-3 w-3"}),"已安装"]})}return null},ce=R=>!D||!R.manifest?.host_application?!0:Ime(R.manifest.host_application.min_version,R.manifest.host_application.max_version,D),W=R=>{if(!R.installed||!R.installed_version||!R.manifest?.version)return!1;const me=R.installed_version.trim(),Y=R.manifest.version.trim();if(me===Y)return!1;const P=me.split(".").map(Number),K=Y.split(".").map(Number);for(let $=0;$<3;$++){if((K[$]||0)>(P[$]||0))return!0;if((K[$]||0)<(P[$]||0))return!1}return!1},J=p.filter(R=>{if(!R.manifest)return console.warn("[过滤] 跳过无 manifest 的插件:",R.id),!1;const me=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some($=>$.toLowerCase().includes(r.toLowerCase())),Y=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i);let P=!0;c==="installed"?P=R.installed===!0:c==="updates"&&(P=R.installed===!0&&W(R));const K=!h||!D||ce(R);return me&&Y&&P&&K}),H=()=>{t(null)},ae=async R=>{if(!j?.installed){B({title:"无法安装",description:"Git 未安装",variant:"destructive"});return}if(D&&!ce(R)){B({title:"无法安装",description:"插件与当前麦麦版本不兼容",variant:"destructive"});return}try{await qme(R.id,R.manifest.repository_url||"","main"),Wme(R.id).catch(Y=>{console.warn("Failed to record download:",Y)}),B({title:"安装成功",description:`${R.manifest.name} 已成功安装`});const me=await Ip();z(me),x(Y=>Y.map(P=>{if(P.id===R.id){const K=Fp(P.id,me),$=qp(P.id,me);return{...P,installed:K,installed_version:$}}return P}))}catch(me){B({title:"安装失败",description:me instanceof Error?me.message:"未知错误",variant:"destructive"})}},ne=async R=>{try{await Qme(R.id),B({title:"卸载成功",description:`${R.manifest.name} 已成功卸载`});const me=await Ip();z(me),x(Y=>Y.map(P=>{if(P.id===R.id){const K=Fp(P.id,me),$=qp(P.id,me);return{...P,installed:K,installed_version:$}}return P}))}catch(me){B({title:"卸载失败",description:me instanceof Error?me.message:"未知错误",variant:"destructive"})}},ue=async R=>{if(!j?.installed){B({title:"无法更新",description:"Git 未安装",variant:"destructive"});return}try{const me=await $me(R.id,R.manifest.repository_url||"","main");B({title:"更新成功",description:`${R.manifest.name} 已从 ${me.old_version} 更新到 ${me.new_version}`});const Y=await Ip();z(Y),x(P=>P.map(K=>{if(K.id===R.id){const $=Fp(K.id,Y),fe=qp(K.id,Y);return{...K,installed:$,installed_version:fe}}return K}))}catch(me){B({title:"更新失败",description:me instanceof Error?me.message:"未知错误",variant:"destructive"})}};return a.jsx(fn,{className:"h-full",children:a.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件市场"}),a.jsx("p",{className:"text-muted-foreground mt-2",children:"浏览和管理麦麦的插件"})]}),a.jsxs(ie,{onClick:()=>n({to:"/plugin-mirrors"}),children:[a.jsx(RF,{className:"h-4 w-4 mr-2"}),"配置镜像源"]})]}),j&&!j.installed&&a.jsxs(yt,{className:"border-orange-600 bg-orange-50 dark:bg-orange-950/20",children:[a.jsx(Jt,{children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Uu,{className:"h-5 w-5 text-orange-600"}),a.jsxs("div",{children:[a.jsx(en,{className:"text-lg text-orange-900 dark:text-orange-100",children:"Git 未安装"}),a.jsx(Sr,{className:"text-orange-800 dark:text-orange-200",children:j.error||"请先安装 Git 才能使用插件安装功能"})]})]})}),a.jsx(vn,{children:a.jsxs("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:["您可以从 ",a.jsx("a",{href:"https://git-scm.com/downloads",target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"git-scm.com"})," 下载并安装 Git。 安装完成后,请重启麦麦应用。"]})})]}),a.jsx(yt,{className:"p-4",children:a.jsxs("div",{className:"flex flex-col gap-4",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(Ps,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),a.jsx(Ae,{placeholder:"搜索插件...",value:r,onChange:R=>s(R.target.value),className:"pl-9"})]}),a.jsxs(Bt,{value:i,onValueChange:l,children:[a.jsx(Dt,{className:"w-full sm:w-[200px]",children:a.jsx(It,{placeholder:"选择分类"})}),a.jsxs(Rt,{children:[a.jsx(Pe,{value:"all",children:"全部分类"}),a.jsx(Pe,{value:"Group Management",children:"群组管理"}),a.jsx(Pe,{value:"Entertainment & Interaction",children:"娱乐互动"}),a.jsx(Pe,{value:"Utility Tools",children:"实用工具"}),a.jsx(Pe,{value:"Content Generation",children:"内容生成"}),a.jsx(Pe,{value:"Multimedia",children:"多媒体"}),a.jsx(Pe,{value:"External Integration",children:"外部集成"}),a.jsx(Pe,{value:"Data Analysis & Insights",children:"数据分析与洞察"}),a.jsx(Pe,{value:"Other",children:"其他"})]})]})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ss,{id:"compatible-only",checked:h,onCheckedChange:R=>m(R===!0)}),a.jsx("label",{htmlFor:"compatible-only",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:"只显示兼容当前版本的插件"})]})]})}),a.jsx(dl,{value:c,onValueChange:u,className:"w-full",children:a.jsxs(va,{className:"grid w-full grid-cols-3",children:[a.jsxs($t,{value:"all",children:["全部插件 (",p.filter(R=>{if(!R.manifest)return!1;const me=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(K=>K.toLowerCase().includes(r.toLowerCase())),Y=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i),P=!h||!D||ce(R);return me&&Y&&P}).length,")"]}),a.jsxs($t,{value:"installed",children:["已安装 (",p.filter(R=>{if(!R.manifest)return!1;const me=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(K=>K.toLowerCase().includes(r.toLowerCase())),Y=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i),P=!h||!D||ce(R);return R.installed&&me&&Y&&P}).length,")"]}),a.jsxs($t,{value:"updates",children:["可更新 (",p.filter(R=>{if(!R.manifest)return!1;const me=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(K=>K.toLowerCase().includes(r.toLowerCase())),Y=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i),P=!h||!D||ce(R);return R.installed&&W(R)&&me&&Y&&P}).length,")"]})]})}),M&&M.stage==="loading"&&a.jsx(yt,{className:"p-4",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ff,{className:"h-4 w-4 animate-spin"}),a.jsxs("span",{className:"text-sm font-medium",children:[M.operation==="fetch"&&"加载插件列表",M.operation==="install"&&`安装插件${M.plugin_id?`: ${M.plugin_id}`:""}`,M.operation==="uninstall"&&`卸载插件${M.plugin_id?`: ${M.plugin_id}`:""}`,M.operation==="update"&&`更新插件${M.plugin_id?`: ${M.plugin_id}`:""}`]})]}),a.jsxs("span",{className:"text-sm font-medium",children:[M.progress,"%"]})]}),a.jsx(r0,{value:M.progress,className:"h-2"}),a.jsx("div",{className:"text-xs text-muted-foreground",children:M.message}),M.operation==="fetch"&&M.total_plugins>0&&a.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["已加载 ",M.loaded_plugins," / ",M.total_plugins," 个插件"]})]})}),M&&M.stage==="error"&&M.error&&a.jsx(yt,{className:"border-destructive bg-destructive/10",children:a.jsx(Jt,{children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Uu,{className:"h-5 w-5 text-destructive"}),a.jsxs("div",{children:[a.jsx(en,{className:"text-lg text-destructive",children:"加载失败"}),a.jsx(Sr,{className:"text-destructive/80",children:M.error})]})]})})}),v?a.jsxs("div",{className:"flex items-center justify-center py-12",children:[a.jsx(ff,{className:"h-8 w-8 animate-spin text-muted-foreground"}),a.jsx("span",{className:"ml-3 text-muted-foreground",children:"加载插件列表中..."})]}):O?a.jsx(yt,{className:"p-6",children:a.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[a.jsx(Uu,{className:"h-12 w-12 text-destructive mb-4"}),a.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:O}),a.jsx(ie,{onClick:()=>window.location.reload(),children:"重新加载"})]})}):J.length===0?a.jsx(yt,{className:"p-6",children:a.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[a.jsx(Ps,{className:"h-12 w-12 text-muted-foreground mb-4"}),a.jsx("h3",{className:"text-lg font-semibold mb-2",children:"未找到插件"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:r||i!=="all"?"尝试调整搜索条件或筛选器":"暂无可用插件"})]})}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:J.map(R=>a.jsxs(yt,{className:"flex flex-col hover:shadow-lg transition-shadow h-full",children:[a.jsxs(Jt,{children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsx(en,{className:"text-xl",children:R.manifest?.name||R.id}),a.jsxs("div",{className:"flex flex-col gap-1",children:[R.manifest?.categories&&R.manifest.categories[0]&&a.jsx($n,{variant:"secondary",className:"text-xs whitespace-nowrap",children:f9[R.manifest.categories[0]]||R.manifest.categories[0]}),V(R)]})]}),a.jsx(Sr,{className:"line-clamp-2",children:R.manifest?.description||"无描述"})]}),a.jsx(vn,{className:"flex-1",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(fc,{className:"h-4 w-4"}),a.jsx("span",{children:(Q[R.id]?.downloads??R.downloads??0).toLocaleString()})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Zl,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),a.jsx("span",{children:(Q[R.id]?.rating??R.rating??0).toFixed(1)})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[R.manifest?.keywords&&R.manifest.keywords.slice(0,3).map(me=>a.jsx($n,{variant:"outline",className:"text-xs",children:me},me)),R.manifest?.keywords&&R.manifest.keywords.length>3&&a.jsxs($n,{variant:"outline",className:"text-xs",children:["+",R.manifest.keywords.length-3]})]}),a.jsxs("div",{className:"text-xs text-muted-foreground pt-2 border-t space-y-1",children:[a.jsxs("div",{children:["v",R.manifest?.version||"unknown"," · ",R.manifest?.author?.name||"Unknown"]}),R.manifest?.host_application&&a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("span",{children:"支持:"}),a.jsxs("span",{className:"font-medium",children:[R.manifest.host_application.min_version,R.manifest.host_application.max_version?` - ${R.manifest.host_application.max_version}`:" - 最新版本"]})]})]})]})}),a.jsx(TC,{className:"pt-4",children:a.jsxs("div",{className:"flex items-center justify-end gap-2 w-full",children:[a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>t(R),children:"查看详情"}),R.installed?W(R)?a.jsxs(ie,{size:"sm",disabled:!j?.installed,title:j?.installed?void 0:"Git 未安装",onClick:()=>ue(R),children:[a.jsx(Ii,{className:"h-4 w-4 mr-1"}),"更新"]}):a.jsxs(ie,{variant:"destructive",size:"sm",disabled:!j?.installed,title:j?.installed?void 0:"Git 未安装",onClick:()=>ne(R),children:[a.jsx(Ht,{className:"h-4 w-4 mr-1"}),"卸载"]}):a.jsxs(ie,{size:"sm",disabled:!j?.installed||M?.operation==="install"||D!==null&&!ce(R),title:j?.installed?D!==null&&!ce(R)?`不兼容当前版本 (需要 ${R.manifest?.host_application?.min_version||"未知"}${R.manifest?.host_application?.max_version?` - ${R.manifest.host_application.max_version}`:"+"},当前 ${D?.version})`:void 0:"Git 未安装",onClick:()=>ae(R),children:[a.jsx(fc,{className:"h-4 w-4 mr-1"}),M?.operation==="install"&&M?.plugin_id===R.id?"安装中...":"安装"]})]})})]},R.id))}),a.jsx(Rr,{open:e!==null,onOpenChange:H,children:e&&e.manifest&&a.jsxs(Nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[a.jsx(Cr,{children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"space-y-2 flex-1",children:[a.jsx(Tr,{className:"text-2xl",children:e.manifest.name}),a.jsxs(Gr,{children:["作者: ",e.manifest.author?.name||"Unknown",e.manifest.author?.url&&a.jsx("a",{href:e.manifest.author.url,target:"_blank",rel:"noopener noreferrer",className:"ml-2 text-primary hover:underline",children:a.jsx(Kh,{className:"h-3 w-3 inline"})})]})]}),a.jsxs("div",{className:"flex flex-col gap-2",children:[e.manifest.categories&&e.manifest.categories[0]&&a.jsx($n,{variant:"secondary",children:f9[e.manifest.categories[0]]||e.manifest.categories[0]}),V(e)]})]})}),a.jsxs("div",{className:"space-y-6",children:[a.jsx(Xme,{pluginId:e.id}),a.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:"版本"}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:["v",e.manifest?.version||"unknown"]}),e.installed&&e.installed_version&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["已安装: v",e.installed_version]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:"下载量"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:(Q[e.id]?.downloads??e.downloads??0).toLocaleString()})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:"评分"}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Zl,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:[(Q[e.id]?.rating??e.rating??0).toFixed(1)," (",Q[e.id]?.rating_count??e.review_count??0,")"]})]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:"许可证"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:e.manifest.license||"Unknown"})]}),a.jsxs("div",{className:"col-span-2",children:[a.jsx("p",{className:"text-sm font-medium",children:"支持版本"}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.manifest.host_application?.min_version||"未知",e.manifest.host_application?.max_version?` - ${e.manifest.host_application.max_version}`:" - 最新版本"]})]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium mb-2",children:"关键词"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:e.manifest.keywords&&e.manifest.keywords.map(R=>a.jsx($n,{variant:"outline",children:R},R))})]}),e.detailed_description&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium mb-2",children:"详细说明"}),a.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:e.detailed_description})]}),!e.detailed_description&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium mb-2",children:"说明"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:e.manifest.description||"无描述"})]}),a.jsxs("div",{className:"space-y-2",children:[e.manifest.homepage_url&&a.jsxs("div",{className:"text-sm",children:[a.jsx("span",{className:"font-medium",children:"主页: "}),a.jsx("a",{href:e.manifest.homepage_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:e.manifest.homepage_url})]}),e.manifest.repository_url&&a.jsxs("div",{className:"text-sm",children:[a.jsx("span",{className:"font-medium",children:"仓库: "}),a.jsx("a",{href:e.manifest.repository_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:e.manifest.repository_url})]})]})]}),a.jsxs(ps,{children:[e.manifest.homepage_url&&a.jsxs(ie,{onClick:()=>window.open(e.manifest.homepage_url,"_blank"),children:[a.jsx(Kh,{className:"h-4 w-4 mr-2"}),"访问主页"]}),e.manifest.repository_url&&a.jsxs(ie,{variant:"outline",onClick:()=>window.open(e.manifest.repository_url,"_blank"),children:[a.jsx(Kh,{className:"h-4 w-4 mr-2"}),"查看仓库"]})]})]})})]})})}function Kme(){return a.jsx(fn,{className:"h-full",children:a.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件配置"}),a.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理和配置已安装的插件"})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(ie,{variant:"outline",size:"sm",children:[a.jsx(Ii,{className:"h-4 w-4 mr-2"}),"刷新"]}),a.jsxs(ie,{size:"sm",children:[a.jsx(dc,{className:"h-4 w-4 mr-2"}),"全局设置"]})]})]}),a.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[a.jsxs(yt,{children:[a.jsxs(Jt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(en,{className:"text-sm font-medium",children:"已安装插件"}),a.jsx(gg,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs(vn,{children:[a.jsx("div",{className:"text-2xl font-bold",children:"0"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"正在加载..."})]})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(en,{className:"text-sm font-medium",children:"已启用"}),a.jsx(ua,{className:"h-4 w-4 text-green-600"})]}),a.jsxs(vn,{children:[a.jsx("div",{className:"text-2xl font-bold",children:"0"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"运行中的插件"})]})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(en,{className:"text-sm font-medium",children:"已禁用"}),a.jsx(xc,{className:"h-4 w-4 text-orange-600"})]}),a.jsxs(vn,{children:[a.jsx("div",{className:"text-2xl font-bold",children:"0"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"未激活的插件"})]})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(en,{className:"text-sm font-medium",children:"可更新"}),a.jsx(Ii,{className:"h-4 w-4 text-blue-600"})]}),a.jsxs(vn,{children:[a.jsx("div",{className:"text-2xl font-bold",children:"0"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"有新版本可用"})]})]})]}),a.jsxs(yt,{children:[a.jsxs(Jt,{children:[a.jsx(en,{children:"已安装的插件"}),a.jsx(Sr,{children:"查看和管理已安装插件的配置"})]}),a.jsx(vn,{children:a.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[a.jsx(gg,{className:"h-16 w-16 text-muted-foreground/50"}),a.jsxs("div",{className:"text-center space-y-2",children:[a.jsx("p",{className:"text-lg font-medium text-muted-foreground",children:"插件配置功能开发中"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"即将支持插件的启用/禁用、参数配置等功能"})]}),a.jsx("div",{className:"flex gap-2",children:a.jsx(ie,{variant:"outline",asChild:!0,children:a.jsxs("a",{href:"/plugins",children:[a.jsx(Kh,{className:"h-4 w-4 mr-2"}),"前往插件市场"]})})})]})})]}),a.jsx(yt,{className:"border-blue-200 bg-blue-50 dark:bg-blue-950/20 dark:border-blue-900",children:a.jsx(vn,{className:"pt-6",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(xc,{className:"h-5 w-5 text-blue-600 mt-0.5 flex-shrink-0"}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-blue-900 dark:text-blue-100",children:"开发进行中"}),a.jsxs("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:["插件配置功能正在积极开发中。目前您可以通过",a.jsx("strong",{children:"插件市场"}),"安装和卸载插件,完整的配置管理功能即将推出。"]})]})]})})})]})})}function Zme(){const n=ba(),{toast:e}=Pr(),[t,r]=S.useState([]),[s,i]=S.useState(!0),[l,c]=S.useState(null),[u,h]=S.useState(null),[m,p]=S.useState(!1),[x,v]=S.useState(!1),[b,O]=S.useState({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),k=S.useCallback(async()=>{try{i(!0),c(null);const z=localStorage.getItem("access-token"),Q=await fetch("/api/webui/plugins/mirrors",{headers:{Authorization:`Bearer ${z}`}});if(!Q.ok)throw new Error("获取镜像源列表失败");const q=await Q.json();r(q.mirrors||[])}catch(z){const Q=z instanceof Error?z.message:"加载镜像源失败";c(Q),e({title:"加载失败",description:Q,variant:"destructive"})}finally{i(!1)}},[e]);S.useEffect(()=>{k()},[k]);const j=async()=>{try{const z=localStorage.getItem("access-token"),Q=await fetch("/api/webui/plugins/mirrors",{method:"POST",headers:{Authorization:`Bearer ${z}`,"Content-Type":"application/json"},body:JSON.stringify(b)});if(!Q.ok){const q=await Q.json();throw new Error(q.detail||"添加镜像源失败")}e({title:"添加成功",description:"镜像源已添加"}),p(!1),O({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),k()}catch(z){e({title:"添加失败",description:z instanceof Error?z.message:"未知错误",variant:"destructive"})}},T=async()=>{if(u)try{const z=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${u.id}`,{method:"PUT",headers:{Authorization:`Bearer ${z}`,"Content-Type":"application/json"},body:JSON.stringify({name:b.name,raw_prefix:b.raw_prefix,clone_prefix:b.clone_prefix,enabled:b.enabled,priority:b.priority})})).ok)throw new Error("更新镜像源失败");e({title:"更新成功",description:"镜像源已更新"}),v(!1),h(null),k()}catch(z){e({title:"更新失败",description:z instanceof Error?z.message:"未知错误",variant:"destructive"})}},M=async z=>{if(confirm("确定要删除这个镜像源吗?"))try{const Q=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${z}`,{method:"DELETE",headers:{Authorization:`Bearer ${Q}`}})).ok)throw new Error("删除镜像源失败");e({title:"删除成功",description:"镜像源已删除"}),k()}catch(Q){e({title:"删除失败",description:Q instanceof Error?Q.message:"未知错误",variant:"destructive"})}},_=async z=>{try{const Q=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${z.id}`,{method:"PUT",headers:{Authorization:`Bearer ${Q}`,"Content-Type":"application/json"},body:JSON.stringify({enabled:!z.enabled})})).ok)throw new Error("更新状态失败");k()}catch(Q){e({title:"更新失败",description:Q instanceof Error?Q.message:"未知错误",variant:"destructive"})}},D=z=>{h(z),O({id:z.id,name:z.name,raw_prefix:z.raw_prefix,clone_prefix:z.clone_prefix,enabled:z.enabled,priority:z.priority}),v(!0)},E=async(z,Q)=>{const q=Q==="up"?z.priority-1:z.priority+1;if(!(q<1))try{const B=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${z.id}`,{method:"PUT",headers:{Authorization:`Bearer ${B}`,"Content-Type":"application/json"},body:JSON.stringify({priority:q})})).ok)throw new Error("更新优先级失败");k()}catch(B){e({title:"更新失败",description:B instanceof Error?B.message:"未知错误",variant:"destructive"})}};return a.jsx(fn,{className:"h-full",children:a.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>n({to:"/plugins"}),children:a.jsx(Q9,{className:"h-5 w-5"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"镜像源配置"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理 Git 克隆和文件下载的镜像源"})]})]}),a.jsxs(ie,{onClick:()=>p(!0),children:[a.jsx(Wr,{className:"h-4 w-4 mr-2"}),"添加镜像源"]})]}),s?a.jsx(yt,{className:"p-6",children:a.jsx("div",{className:"flex items-center justify-center py-8",children:a.jsx(ff,{className:"h-8 w-8 animate-spin text-primary"})})}):l?a.jsx(yt,{className:"p-6",children:a.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[a.jsx(Uu,{className:"h-12 w-12 text-destructive mb-4"}),a.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:l}),a.jsx(ie,{onClick:k,children:"重新加载"})]})}):a.jsxs(yt,{children:[a.jsx("div",{className:"hidden md:block",children:a.jsxs(Ac,{children:[a.jsx(Ec,{children:a.jsxs(xr,{children:[a.jsx(gt,{children:"状态"}),a.jsx(gt,{children:"名称"}),a.jsx(gt,{children:"ID"}),a.jsx(gt,{children:"优先级"}),a.jsx(gt,{className:"text-right",children:"操作"})]})}),a.jsx(_c,{children:t.map(z=>a.jsxs(xr,{children:[a.jsx(it,{children:a.jsx(jt,{checked:z.enabled,onCheckedChange:()=>_(z)})}),a.jsx(it,{children:a.jsxs("div",{children:[a.jsx("div",{className:"font-medium",children:z.name}),a.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Raw: ",z.raw_prefix]})]})}),a.jsx(it,{children:a.jsx($n,{variant:"outline",children:z.id})}),a.jsx(it,{children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono",children:z.priority}),a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx(ie,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>E(z,"up"),disabled:z.priority===1,children:a.jsx(t2,{className:"h-3 w-3"})}),a.jsx(ie,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>E(z,"down"),children:a.jsx(hf,{className:"h-3 w-3"})})]})]})}),a.jsx(it,{className:"text-right",children:a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>D(z),children:a.jsx(rd,{className:"h-4 w-4"})}),a.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>M(z.id),children:a.jsx(Ht,{className:"h-4 w-4 text-destructive"})})]})})]},z.id))})]})}),a.jsx("div",{className:"md:hidden p-4 space-y-4",children:t.map(z=>a.jsx(yt,{className:"p-4",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h3",{className:"font-semibold",children:z.name}),z.enabled&&a.jsx($n,{variant:"default",className:"text-xs",children:"启用"})]}),a.jsx($n,{variant:"outline",className:"mt-1 text-xs",children:z.id})]}),a.jsx(jt,{checked:z.enabled,onCheckedChange:()=>_(z)})]}),a.jsxs("div",{className:"text-sm space-y-1",children:[a.jsxs("div",{className:"text-muted-foreground",children:[a.jsx("span",{className:"font-medium",children:"Raw: "}),a.jsx("span",{className:"break-all",children:z.raw_prefix})]}),a.jsxs("div",{className:"text-muted-foreground",children:[a.jsx("span",{className:"font-medium",children:"优先级: "}),a.jsx("span",{className:"font-mono",children:z.priority})]})]}),a.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t",children:[a.jsxs(ie,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>D(z),children:[a.jsx(rd,{className:"h-4 w-4 mr-1"}),"编辑"]}),a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>E(z,"up"),disabled:z.priority===1,children:a.jsx(t2,{className:"h-4 w-4"})}),a.jsx(ie,{variant:"outline",size:"sm",onClick:()=>E(z,"down"),children:a.jsx(hf,{className:"h-4 w-4"})}),a.jsx(ie,{variant:"destructive",size:"sm",onClick:()=>M(z.id),children:a.jsx(Ht,{className:"h-4 w-4"})})]})]})},z.id))})]}),a.jsx(Rr,{open:m,onOpenChange:p,children:a.jsxs(Nr,{className:"max-w-lg",children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:"添加镜像源"}),a.jsx(Gr,{children:"添加新的 Git 镜像源配置"})]}),a.jsxs("div",{className:"space-y-4 py-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"add-id",children:"镜像源 ID *"}),a.jsx(Ae,{id:"add-id",placeholder:"例如: my-mirror",value:b.id,onChange:z=>O({...b,id:z.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"add-name",children:"名称 *"}),a.jsx(Ae,{id:"add-name",placeholder:"例如: 我的镜像源",value:b.name,onChange:z=>O({...b,name:z.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"add-raw",children:"Raw 文件前缀 *"}),a.jsx(Ae,{id:"add-raw",placeholder:"https://example.com/raw",value:b.raw_prefix,onChange:z=>O({...b,raw_prefix:z.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"add-clone",children:"克隆前缀 *"}),a.jsx(Ae,{id:"add-clone",placeholder:"https://example.com/clone",value:b.clone_prefix,onChange:z=>O({...b,clone_prefix:z.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"add-priority",children:"优先级"}),a.jsx(Ae,{id:"add-priority",type:"number",min:"1",value:b.priority,onChange:z=>O({...b,priority:parseInt(z.target.value)||1})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"add-enabled",checked:b.enabled,onCheckedChange:z=>O({...b,enabled:z})}),a.jsx(te,{htmlFor:"add-enabled",children:"启用此镜像源"})]})]}),a.jsxs(ps,{children:[a.jsx(ie,{variant:"outline",onClick:()=>p(!1),children:"取消"}),a.jsx(ie,{onClick:j,children:"添加"})]})]})}),a.jsx(Rr,{open:x,onOpenChange:v,children:a.jsxs(Nr,{className:"max-w-lg",children:[a.jsxs(Cr,{children:[a.jsx(Tr,{children:"编辑镜像源"}),a.jsx(Gr,{children:"修改镜像源配置"})]}),a.jsxs("div",{className:"space-y-4 py-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{children:"镜像源 ID"}),a.jsx(Ae,{value:b.id,disabled:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"edit-name",children:"名称 *"}),a.jsx(Ae,{id:"edit-name",value:b.name,onChange:z=>O({...b,name:z.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"edit-raw",children:"Raw 文件前缀 *"}),a.jsx(Ae,{id:"edit-raw",value:b.raw_prefix,onChange:z=>O({...b,raw_prefix:z.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"edit-clone",children:"克隆前缀 *"}),a.jsx(Ae,{id:"edit-clone",value:b.clone_prefix,onChange:z=>O({...b,clone_prefix:z.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(te,{htmlFor:"edit-priority",children:"优先级"}),a.jsx(Ae,{id:"edit-priority",type:"number",min:"1",value:b.priority,onChange:z=>O({...b,priority:parseInt(z.target.value)||1})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jt,{id:"edit-enabled",checked:b.enabled,onCheckedChange:z=>O({...b,enabled:z})}),a.jsx(te,{htmlFor:"edit-enabled",children:"启用此镜像源"})]})]}),a.jsxs(ps,{children:[a.jsx(ie,{variant:"outline",onClick:()=>v(!1),children:"取消"}),a.jsx(ie,{onClick:T,children:"保存"})]})]})})]})})}const Jme=Cd("pointer-events-none inline-flex select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono font-medium opacity-100",{variants:{size:{sm:"h-5 text-[10px]",default:"h-6 text-xs",lg:"h-7 text-sm"}},defaultVariants:{size:"default"}}),Hz=S.forwardRef(({className:n,size:e,abbrTitle:t,children:r,...s},i)=>a.jsx("kbd",{className:ve(Jme({size:e,className:n})),ref:i,...s,children:t?a.jsx("abbr",{title:t,children:r}):r}));Hz.displayName="Kbd";const epe=[{icon:fg,title:"首页",description:"查看仪表板概览",path:"/",category:"概览"},{icon:io,title:"麦麦主程序配置",description:"配置麦麦的核心设置",path:"/config/bot",category:"配置"},{icon:$9,title:"麦麦模型提供商配置",description:"配置模型提供商",path:"/config/modelProvider",category:"配置"},{icon:H9,title:"麦麦模型配置",description:"配置模型参数",path:"/config/model",category:"配置"},{icon:J4,title:"表情包管理",description:"管理麦麦的表情包",path:"/resource/emoji",category:"资源"},{icon:Gf,title:"表达方式管理",description:"管理麦麦的表达方式",path:"/resource/expression",category:"资源"},{icon:U9,title:"人物信息管理",description:"管理人物信息",path:"/resource/person",category:"资源"},{icon:zF,title:"统计信息",description:"查看使用统计",path:"/statistics",category:"监控"},{icon:gg,title:"插件市场",description:"浏览和安装插件",path:"/plugins",category:"扩展"},{icon:mg,title:"日志查看器",description:"查看系统日志",path:"/logs",category:"监控"},{icon:dc,title:"系统设置",description:"配置系统参数",path:"/settings",category:"系统"}];function tpe({open:n,onOpenChange:e}){const[t,r]=S.useState(""),[s,i]=S.useState(0),l=ba(),c=epe.filter(m=>m.title.toLowerCase().includes(t.toLowerCase())||m.description.toLowerCase().includes(t.toLowerCase())||m.category.toLowerCase().includes(t.toLowerCase()));S.useEffect(()=>{n&&(r(""),i(0))},[n]);const u=S.useCallback(m=>{l({to:m}),e(!1)},[l,e]),h=S.useCallback(m=>{m.key==="ArrowDown"?(m.preventDefault(),i(p=>(p+1)%c.length)):m.key==="ArrowUp"?(m.preventDefault(),i(p=>(p-1+c.length)%c.length)):m.key==="Enter"&&c[s]&&(m.preventDefault(),u(c[s].path))},[c,s,u]);return a.jsx(Rr,{open:n,onOpenChange:e,children:a.jsxs(Nr,{className:"max-w-2xl p-0 gap-0",children:[a.jsxs(Cr,{className:"px-4 pt-4 pb-0",children:[a.jsx(Tr,{className:"sr-only",children:"搜索"}),a.jsxs("div",{className:"relative",children:[a.jsx(Ps,{className:"absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground"}),a.jsx(Ae,{value:t,onChange:m=>{r(m.target.value),i(0)},onKeyDown:h,placeholder:"搜索页面...",className:"h-12 pl-11 text-base border-0 focus-visible:ring-0 shadow-none",autoFocus:!0})]})]}),a.jsx("div",{className:"border-t",children:a.jsx(fn,{className:"h-[400px]",children:c.length>0?a.jsx("div",{className:"p-2",children:c.map((m,p)=>{const x=m.icon;return a.jsxs("button",{onClick:()=>u(m.path),onMouseEnter:()=>i(p),className:ve("w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-left transition-colors",p===s?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:[a.jsx(x,{className:"h-5 w-5 flex-shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"font-medium text-sm",children:m.title}),a.jsx("div",{className:"text-xs text-muted-foreground truncate",children:m.description})]}),a.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1 bg-muted rounded",children:m.category})]},m.path)})}):a.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[a.jsx(Ps,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:t?"未找到匹配的页面":"输入关键词开始搜索"})]})})}),a.jsx("div",{className:"border-t px-4 py-3 flex items-center justify-between text-xs text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↑"}),a.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↓"}),"导航"]}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Enter"}),"选择"]}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Esc"}),"关闭"]})]})})]})})}function npe(n){const e=rpe(n),t=S.forwardRef((r,s)=>{const{children:i,...l}=r,c=S.Children.toArray(i),u=c.find(ipe);if(u){const h=u.props.children,m=c.map(p=>p===u?S.Children.count(h)>1?S.Children.only(null):S.isValidElement(h)?h.props.children:null:p);return a.jsx(e,{...l,ref:s,children:S.isValidElement(h)?S.cloneElement(h,void 0,m):null})}return a.jsx(e,{...l,ref:s,children:i})});return t.displayName=`${n}.Slot`,t}function rpe(n){const e=S.forwardRef((t,r)=>{const{children:s,...i}=t;if(S.isValidElement(s)){const l=lpe(s),c=ape(i,s.props);return s.type!==S.Fragment&&(c.ref=r?lo(r,l):l),S.cloneElement(s,c)}return S.Children.count(s)>1?S.Children.only(null):null});return e.displayName=`${n}.SlotClone`,e}var spe=Symbol("radix.slottable");function ipe(n){return S.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===spe}function ape(n,e){const t={...e};for(const r in e){const s=n[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?t[r]=(...c)=>{const u=i(...c);return s(...c),u}:s&&(t[r]=s):r==="style"?t[r]={...s,...i}:r==="className"&&(t[r]=[s,i].filter(Boolean).join(" "))}return{...n,...t}}function lpe(n){let e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}var L4=["Enter"," "],ope=["ArrowDown","PageUp","Home"],Uz=["ArrowUp","PageDown","End"],cpe=[...ope,...Uz],upe={ltr:[...L4,"ArrowRight"],rtl:[...L4,"ArrowLeft"]},dpe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},M0="Menu",[Hf,hpe,fpe]=nx(M0),[Bc,Vz]=Hi(M0,[fpe,Sd,mx]),A0=Sd(),Wz=mx(),[Gz,Ao]=Bc(M0),[mpe,E0]=Bc(M0),Xz=n=>{const{__scopeMenu:e,open:t=!1,children:r,dir:s,onOpenChange:i,modal:l=!0}=n,c=A0(e),[u,h]=S.useState(null),m=S.useRef(!1),p=es(i),x=Wf(s);return S.useEffect(()=>{const v=()=>{m.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>m.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),a.jsx(ax,{...c,children:a.jsx(Gz,{scope:e,open:t,onOpenChange:p,content:u,onContentChange:h,children:a.jsx(mpe,{scope:e,onClose:S.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:m,dir:x,modal:l,children:r})})})};Xz.displayName=M0;var ppe="MenuAnchor",e3=S.forwardRef((n,e)=>{const{__scopeMenu:t,...r}=n,s=A0(t);return a.jsx(lx,{...s,...r,ref:e})});e3.displayName=ppe;var t3="MenuPortal",[gpe,Yz]=Bc(t3,{forceMount:void 0}),Kz=n=>{const{__scopeMenu:e,forceMount:t,children:r,container:s}=n,i=Ao(t3,e);return a.jsx(gpe,{scope:e,forceMount:t,children:a.jsx(Ls,{present:t||i.open,children:a.jsx(ix,{asChild:!0,container:s,children:r})})})};Kz.displayName=t3;var Ni="MenuContent",[xpe,n3]=Bc(Ni),Zz=S.forwardRef((n,e)=>{const t=Yz(Ni,n.__scopeMenu),{forceMount:r=t.forceMount,...s}=n,i=Ao(Ni,n.__scopeMenu),l=E0(Ni,n.__scopeMenu);return a.jsx(Hf.Provider,{scope:n.__scopeMenu,children:a.jsx(Ls,{present:r||i.open,children:a.jsx(Hf.Slot,{scope:n.__scopeMenu,children:l.modal?a.jsx(vpe,{...s,ref:e}):a.jsx(ype,{...s,ref:e})})})})}),vpe=S.forwardRef((n,e)=>{const t=Ao(Ni,n.__scopeMenu),r=S.useRef(null),s=Cn(e,r);return S.useEffect(()=>{const i=r.current;if(i)return D9(i)},[]),a.jsx(r3,{...n,ref:s,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:$e(n.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),ype=S.forwardRef((n,e)=>{const t=Ao(Ni,n.__scopeMenu);return a.jsx(r3,{...n,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),bpe=npe("MenuContent.ScrollLock"),r3=S.forwardRef((n,e)=>{const{__scopeMenu:t,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:h,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:x,onDismiss:v,disableOutsideScroll:b,...O}=n,k=Ao(Ni,t),j=E0(Ni,t),T=A0(t),M=Wz(t),_=hpe(t),[D,E]=S.useState(null),z=S.useRef(null),Q=Cn(e,z,k.onContentChange),q=S.useRef(0),B=S.useRef(""),U=S.useRef(0),V=S.useRef(null),ce=S.useRef("right"),W=S.useRef(0),J=b?R9:S.Fragment,H=b?{as:bpe,allowPinchZoom:!0}:void 0,ae=ue=>{const R=B.current+ue,me=_().filter(ye=>!ye.disabled),Y=document.activeElement,P=me.find(ye=>ye.ref.current===Y)?.textValue,K=me.map(ye=>ye.textValue),$=_pe(K,R,P),fe=me.find(ye=>ye.textValue===$)?.ref.current;(function ye(Re){B.current=Re,window.clearTimeout(q.current),Re!==""&&(q.current=window.setTimeout(()=>ye(""),1e3))})(R),fe&&setTimeout(()=>fe.focus())};S.useEffect(()=>()=>window.clearTimeout(q.current),[]),z9();const ne=S.useCallback(ue=>ce.current===V.current?.side&&Rpe(ue,V.current?.area),[]);return a.jsx(xpe,{scope:t,searchRef:B,onItemEnter:S.useCallback(ue=>{ne(ue)&&ue.preventDefault()},[ne]),onItemLeave:S.useCallback(ue=>{ne(ue)||(z.current?.focus(),E(null))},[ne]),onTriggerLeave:S.useCallback(ue=>{ne(ue)&&ue.preventDefault()},[ne]),pointerGraceTimerRef:U,onPointerGraceIntentChange:S.useCallback(ue=>{V.current=ue},[]),children:a.jsx(J,{...H,children:a.jsx(P9,{asChild:!0,trapped:s,onMountAutoFocus:$e(i,ue=>{ue.preventDefault(),z.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:a.jsx(Y4,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:h,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:x,onDismiss:v,children:a.jsx(RC,{asChild:!0,...M,dir:j.dir,orientation:"vertical",loop:r,currentTabStopId:D,onCurrentTabStopIdChange:E,onEntryFocus:$e(u,ue=>{j.isUsingKeyboardRef.current||ue.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(K4,{role:"menu","aria-orientation":"vertical","data-state":pP(k.open),"data-radix-menu-content":"",dir:j.dir,...T,...O,ref:Q,style:{outline:"none",...O.style},onKeyDown:$e(O.onKeyDown,ue=>{const me=ue.target.closest("[data-radix-menu-content]")===ue.currentTarget,Y=ue.ctrlKey||ue.altKey||ue.metaKey,P=ue.key.length===1;me&&(ue.key==="Tab"&&ue.preventDefault(),!Y&&P&&ae(ue.key));const K=z.current;if(ue.target!==K||!cpe.includes(ue.key))return;ue.preventDefault();const fe=_().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);Uz.includes(ue.key)&&fe.reverse(),Ape(fe)}),onBlur:$e(n.onBlur,ue=>{ue.currentTarget.contains(ue.target)||(window.clearTimeout(q.current),B.current="")}),onPointerMove:$e(n.onPointerMove,Uf(ue=>{const R=ue.target,me=W.current!==ue.clientX;if(ue.currentTarget.contains(R)&&me){const Y=ue.clientX>W.current?"right":"left";ce.current=Y,W.current=ue.clientX}}))})})})})})})});Zz.displayName=Ni;var wpe="MenuGroup",s3=S.forwardRef((n,e)=>{const{__scopeMenu:t,...r}=n;return a.jsx(Yt.div,{role:"group",...r,ref:e})});s3.displayName=wpe;var Spe="MenuLabel",Jz=S.forwardRef((n,e)=>{const{__scopeMenu:t,...r}=n;return a.jsx(Yt.div,{...r,ref:e})});Jz.displayName=Spe;var ex="MenuItem",m9="menu.itemSelect",Zx=S.forwardRef((n,e)=>{const{disabled:t=!1,onSelect:r,...s}=n,i=S.useRef(null),l=E0(ex,n.__scopeMenu),c=n3(ex,n.__scopeMenu),u=Cn(e,i),h=S.useRef(!1),m=()=>{const p=i.current;if(!t&&p){const x=new CustomEvent(m9,{bubbles:!0,cancelable:!0});p.addEventListener(m9,v=>r?.(v),{once:!0}),B9(p,x),x.defaultPrevented?h.current=!1:l.onClose()}};return a.jsx(eP,{...s,ref:u,disabled:t,onClick:$e(n.onClick,m),onPointerDown:p=>{n.onPointerDown?.(p),h.current=!0},onPointerUp:$e(n.onPointerUp,p=>{h.current||p.currentTarget?.click()}),onKeyDown:$e(n.onKeyDown,p=>{const x=c.searchRef.current!=="";t||x&&p.key===" "||L4.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Zx.displayName=ex;var eP=S.forwardRef((n,e)=>{const{__scopeMenu:t,disabled:r=!1,textValue:s,...i}=n,l=n3(ex,t),c=Wz(t),u=S.useRef(null),h=Cn(e,u),[m,p]=S.useState(!1),[x,v]=S.useState("");return S.useEffect(()=>{const b=u.current;b&&v((b.textContent??"").trim())},[i.children]),a.jsx(Hf.ItemSlot,{scope:t,disabled:r,textValue:s??x,children:a.jsx(zC,{asChild:!0,...c,focusable:!r,children:a.jsx(Yt.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:h,onPointerMove:$e(n.onPointerMove,Uf(b=>{r?l.onItemLeave(b):(l.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:$e(n.onPointerLeave,Uf(b=>l.onItemLeave(b))),onFocus:$e(n.onFocus,()=>p(!0)),onBlur:$e(n.onBlur,()=>p(!1))})})})}),Ope="MenuCheckboxItem",tP=S.forwardRef((n,e)=>{const{checked:t=!1,onCheckedChange:r,...s}=n;return a.jsx(aP,{scope:n.__scopeMenu,checked:t,children:a.jsx(Zx,{role:"menuitemcheckbox","aria-checked":tx(t)?"mixed":t,...s,ref:e,"data-state":l3(t),onSelect:$e(s.onSelect,()=>r?.(tx(t)?!0:!t),{checkForDefaultPrevented:!1})})})});tP.displayName=Ope;var nP="MenuRadioGroup",[kpe,jpe]=Bc(nP,{value:void 0,onValueChange:()=>{}}),rP=S.forwardRef((n,e)=>{const{value:t,onValueChange:r,...s}=n,i=es(r);return a.jsx(kpe,{scope:n.__scopeMenu,value:t,onValueChange:i,children:a.jsx(s3,{...s,ref:e})})});rP.displayName=nP;var sP="MenuRadioItem",iP=S.forwardRef((n,e)=>{const{value:t,...r}=n,s=jpe(sP,n.__scopeMenu),i=t===s.value;return a.jsx(aP,{scope:n.__scopeMenu,checked:i,children:a.jsx(Zx,{role:"menuitemradio","aria-checked":i,...r,ref:e,"data-state":l3(i),onSelect:$e(r.onSelect,()=>s.onValueChange?.(t),{checkForDefaultPrevented:!1})})})});iP.displayName=sP;var i3="MenuItemIndicator",[aP,Npe]=Bc(i3,{checked:!1}),lP=S.forwardRef((n,e)=>{const{__scopeMenu:t,forceMount:r,...s}=n,i=Npe(i3,t);return a.jsx(Ls,{present:r||tx(i.checked)||i.checked===!0,children:a.jsx(Yt.span,{...s,ref:e,"data-state":l3(i.checked)})})});lP.displayName=i3;var Cpe="MenuSeparator",oP=S.forwardRef((n,e)=>{const{__scopeMenu:t,...r}=n;return a.jsx(Yt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});oP.displayName=Cpe;var Tpe="MenuArrow",cP=S.forwardRef((n,e)=>{const{__scopeMenu:t,...r}=n,s=A0(t);return a.jsx(Z4,{...s,...r,ref:e})});cP.displayName=Tpe;var a3="MenuSub",[Mpe,uP]=Bc(a3),dP=n=>{const{__scopeMenu:e,children:t,open:r=!1,onOpenChange:s}=n,i=Ao(a3,e),l=A0(e),[c,u]=S.useState(null),[h,m]=S.useState(null),p=es(s);return S.useEffect(()=>(i.open===!1&&p(!1),()=>p(!1)),[i.open,p]),a.jsx(ax,{...l,children:a.jsx(Gz,{scope:e,open:r,onOpenChange:p,content:h,onContentChange:m,children:a.jsx(Mpe,{scope:e,contentId:ki(),triggerId:ki(),trigger:c,onTriggerChange:u,children:t})})})};dP.displayName=a3;var Xh="MenuSubTrigger",hP=S.forwardRef((n,e)=>{const t=Ao(Xh,n.__scopeMenu),r=E0(Xh,n.__scopeMenu),s=uP(Xh,n.__scopeMenu),i=n3(Xh,n.__scopeMenu),l=S.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=i,h={__scopeMenu:n.__scopeMenu},m=S.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return S.useEffect(()=>m,[m]),S.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),u(null)}},[c,u]),a.jsx(e3,{asChild:!0,...h,children:a.jsx(eP,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":s.contentId,"data-state":pP(t.open),...n,ref:lo(e,s.onTriggerChange),onClick:p=>{n.onClick?.(p),!(n.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:$e(n.onPointerMove,Uf(p=>{i.onItemEnter(p),!p.defaultPrevented&&!n.disabled&&!t.open&&!l.current&&(i.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{t.onOpenChange(!0),m()},100))})),onPointerLeave:$e(n.onPointerLeave,Uf(p=>{m();const x=t.content?.getBoundingClientRect();if(x){const v=t.content?.dataset.side,b=v==="right",O=b?-5:5,k=x[b?"left":"right"],j=x[b?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+O,y:p.clientY},{x:k,y:x.top},{x:j,y:x.top},{x:j,y:x.bottom},{x:k,y:x.bottom}],side:v}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:$e(n.onKeyDown,p=>{const x=i.searchRef.current!=="";n.disabled||x&&p.key===" "||upe[r.dir].includes(p.key)&&(t.onOpenChange(!0),t.content?.focus(),p.preventDefault())})})})});hP.displayName=Xh;var fP="MenuSubContent",mP=S.forwardRef((n,e)=>{const t=Yz(Ni,n.__scopeMenu),{forceMount:r=t.forceMount,...s}=n,i=Ao(Ni,n.__scopeMenu),l=E0(Ni,n.__scopeMenu),c=uP(fP,n.__scopeMenu),u=S.useRef(null),h=Cn(e,u);return a.jsx(Hf.Provider,{scope:n.__scopeMenu,children:a.jsx(Ls,{present:r||i.open,children:a.jsx(Hf.Slot,{scope:n.__scopeMenu,children:a.jsx(r3,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:h,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{l.isUsingKeyboardRef.current&&u.current?.focus(),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:$e(n.onFocusOutside,m=>{m.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:$e(n.onEscapeKeyDown,m=>{l.onClose(),m.preventDefault()}),onKeyDown:$e(n.onKeyDown,m=>{const p=m.currentTarget.contains(m.target),x=dpe[l.dir].includes(m.key);p&&x&&(i.onOpenChange(!1),c.trigger?.focus(),m.preventDefault())})})})})})});mP.displayName=fP;function pP(n){return n?"open":"closed"}function tx(n){return n==="indeterminate"}function l3(n){return tx(n)?"indeterminate":n?"checked":"unchecked"}function Ape(n){const e=document.activeElement;for(const t of n)if(t===e||(t.focus(),document.activeElement!==e))return}function Epe(n,e){return n.map((t,r)=>n[(e+r)%n.length])}function _pe(n,e,t){const s=e.length>1&&Array.from(e).every(h=>h===e[0])?e[0]:e,i=t?n.indexOf(t):-1;let l=Epe(n,Math.max(i,0));s.length===1&&(l=l.filter(h=>h!==t));const u=l.find(h=>h.toLowerCase().startsWith(s.toLowerCase()));return u!==t?u:void 0}function Dpe(n,e){const{x:t,y:r}=n;let s=!1;for(let i=0,l=e.length-1;i<e.length;l=i++){const c=e[i],u=e[l],h=c.x,m=c.y,p=u.x,x=u.y;m>r!=x>r&&t<(p-h)*(r-m)/(x-m)+h&&(s=!s)}return s}function Rpe(n,e){if(!e)return!1;const t={x:n.clientX,y:n.clientY};return Dpe(t,e)}function Uf(n){return e=>e.pointerType==="mouse"?n(e):void 0}var zpe=Xz,Ppe=e3,Lpe=Kz,Bpe=Zz,Ipe=s3,Fpe=Jz,qpe=Zx,Qpe=tP,$pe=rP,Hpe=iP,Upe=lP,Vpe=oP,Wpe=cP,Gpe=dP,Xpe=hP,Ype=mP,o3="ContextMenu",[Kpe]=Hi(o3,[Vz]),ls=Vz(),[Zpe,gP]=Kpe(o3),xP=n=>{const{__scopeContextMenu:e,children:t,onOpenChange:r,dir:s,modal:i=!0}=n,[l,c]=S.useState(!1),u=ls(e),h=es(r),m=S.useCallback(p=>{c(p),h(p)},[h]);return a.jsx(Zpe,{scope:e,open:l,onOpenChange:m,modal:i,children:a.jsx(zpe,{...u,dir:s,open:l,onOpenChange:m,modal:i,children:t})})};xP.displayName=o3;var vP="ContextMenuTrigger",yP=S.forwardRef((n,e)=>{const{__scopeContextMenu:t,disabled:r=!1,...s}=n,i=gP(vP,t),l=ls(t),c=S.useRef({x:0,y:0}),u=S.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),h=S.useRef(0),m=S.useCallback(()=>window.clearTimeout(h.current),[]),p=x=>{c.current={x:x.clientX,y:x.clientY},i.onOpenChange(!0)};return S.useEffect(()=>m,[m]),S.useEffect(()=>void(r&&m()),[r,m]),a.jsxs(a.Fragment,{children:[a.jsx(Ppe,{...l,virtualRef:u}),a.jsx(Yt.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:e,style:{WebkitTouchCallout:"none",...n.style},onContextMenu:r?n.onContextMenu:$e(n.onContextMenu,x=>{m(),p(x),x.preventDefault()}),onPointerDown:r?n.onPointerDown:$e(n.onPointerDown,Qp(x=>{m(),h.current=window.setTimeout(()=>p(x),700)})),onPointerMove:r?n.onPointerMove:$e(n.onPointerMove,Qp(m)),onPointerCancel:r?n.onPointerCancel:$e(n.onPointerCancel,Qp(m)),onPointerUp:r?n.onPointerUp:$e(n.onPointerUp,Qp(m))})]})});yP.displayName=vP;var Jpe="ContextMenuPortal",bP=n=>{const{__scopeContextMenu:e,...t}=n,r=ls(e);return a.jsx(Lpe,{...r,...t})};bP.displayName=Jpe;var wP="ContextMenuContent",SP=S.forwardRef((n,e)=>{const{__scopeContextMenu:t,...r}=n,s=gP(wP,t),i=ls(t),l=S.useRef(!1);return a.jsx(Bpe,{...i,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{n.onCloseAutoFocus?.(c),!c.defaultPrevented&&l.current&&c.preventDefault(),l.current=!1},onInteractOutside:c=>{n.onInteractOutside?.(c),!c.defaultPrevented&&!s.modal&&(l.current=!0)},style:{...n.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});SP.displayName=wP;var ege="ContextMenuGroup",tge=S.forwardRef((n,e)=>{const{__scopeContextMenu:t,...r}=n,s=ls(t);return a.jsx(Ipe,{...s,...r,ref:e})});tge.displayName=ege;var nge="ContextMenuLabel",OP=S.forwardRef((n,e)=>{const{__scopeContextMenu:t,...r}=n,s=ls(t);return a.jsx(Fpe,{...s,...r,ref:e})});OP.displayName=nge;var rge="ContextMenuItem",kP=S.forwardRef((n,e)=>{const{__scopeContextMenu:t,...r}=n,s=ls(t);return a.jsx(qpe,{...s,...r,ref:e})});kP.displayName=rge;var sge="ContextMenuCheckboxItem",jP=S.forwardRef((n,e)=>{const{__scopeContextMenu:t,...r}=n,s=ls(t);return a.jsx(Qpe,{...s,...r,ref:e})});jP.displayName=sge;var ige="ContextMenuRadioGroup",age=S.forwardRef((n,e)=>{const{__scopeContextMenu:t,...r}=n,s=ls(t);return a.jsx($pe,{...s,...r,ref:e})});age.displayName=ige;var lge="ContextMenuRadioItem",NP=S.forwardRef((n,e)=>{const{__scopeContextMenu:t,...r}=n,s=ls(t);return a.jsx(Hpe,{...s,...r,ref:e})});NP.displayName=lge;var oge="ContextMenuItemIndicator",CP=S.forwardRef((n,e)=>{const{__scopeContextMenu:t,...r}=n,s=ls(t);return a.jsx(Upe,{...s,...r,ref:e})});CP.displayName=oge;var cge="ContextMenuSeparator",TP=S.forwardRef((n,e)=>{const{__scopeContextMenu:t,...r}=n,s=ls(t);return a.jsx(Vpe,{...s,...r,ref:e})});TP.displayName=cge;var uge="ContextMenuArrow",dge=S.forwardRef((n,e)=>{const{__scopeContextMenu:t,...r}=n,s=ls(t);return a.jsx(Wpe,{...s,...r,ref:e})});dge.displayName=uge;var MP="ContextMenuSub",AP=n=>{const{__scopeContextMenu:e,children:t,onOpenChange:r,open:s,defaultOpen:i}=n,l=ls(e),[c,u]=So({prop:s,defaultProp:i??!1,onChange:r,caller:MP});return a.jsx(Gpe,{...l,open:c,onOpenChange:u,children:t})};AP.displayName=MP;var hge="ContextMenuSubTrigger",EP=S.forwardRef((n,e)=>{const{__scopeContextMenu:t,...r}=n,s=ls(t);return a.jsx(Xpe,{...s,...r,ref:e})});EP.displayName=hge;var fge="ContextMenuSubContent",_P=S.forwardRef((n,e)=>{const{__scopeContextMenu:t,...r}=n,s=ls(t);return a.jsx(Ype,{...s,...r,ref:e,style:{...n.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});_P.displayName=fge;function Qp(n){return e=>e.pointerType!=="mouse"?n(e):void 0}var mge=xP,pge=yP,gge=bP,DP=SP,RP=OP,zP=kP,PP=jP,LP=NP,BP=CP,IP=TP,xge=AP,FP=EP,qP=_P;const vge=mge,yge=pge,bge=xge,QP=S.forwardRef(({className:n,inset:e,children:t,...r},s)=>a.jsxs(FP,{ref:s,className:ve("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e&&"pl-8",n),...r,children:[t,a.jsx(Mc,{className:"ml-auto h-4 w-4"})]}));QP.displayName=FP.displayName;const $P=S.forwardRef(({className:n,...e},t)=>a.jsx(qP,{ref:t,className:ve("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",n),...e}));$P.displayName=qP.displayName;const HP=S.forwardRef(({className:n,...e},t)=>a.jsx(gge,{children:a.jsx(DP,{ref:t,className:ve("z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",n),...e})}));HP.displayName=DP.displayName;const Pi=S.forwardRef(({className:n,inset:e,...t},r)=>a.jsx(zP,{ref:r,className:ve("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",n),...t}));Pi.displayName=zP.displayName;const wge=S.forwardRef(({className:n,children:e,checked:t,...r},s)=>a.jsxs(PP,{ref:s,className:ve("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),checked:t,...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(BP,{children:a.jsx(hc,{className:"h-4 w-4"})})}),e]}));wge.displayName=PP.displayName;const Sge=S.forwardRef(({className:n,children:e,...t},r)=>a.jsxs(LP,{ref:r,className:ve("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),...t,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(BP,{children:a.jsx(PF,{className:"h-2 w-2 fill-current"})})}),e]}));Sge.displayName=LP.displayName;const Oge=S.forwardRef(({className:n,inset:e,...t},r)=>a.jsx(RP,{ref:r,className:ve("px-2 py-1.5 text-sm font-semibold text-foreground",e&&"pl-8",n),...t}));Oge.displayName=RP.displayName;const Yh=S.forwardRef(({className:n,...e},t)=>a.jsx(IP,{ref:t,className:ve("-mx-1 my-1 h-px bg-border",n),...e}));Yh.displayName=IP.displayName;const qu=({className:n,...e})=>a.jsx("span",{className:ve("ml-auto text-xs tracking-widest text-muted-foreground",n),...e});qu.displayName="ContextMenuShortcut";var kge=Symbol("radix.slottable");function jge(n){const e=({children:t})=>a.jsx(a.Fragment,{children:t});return e.displayName=`${n}.Slottable`,e.__radixId=kge,e}var[Jx]=Hi("Tooltip",[Sd]),e1=Sd(),UP="TooltipProvider",Nge=700,B4="tooltip.open",[Cge,c3]=Jx(UP),VP=n=>{const{__scopeTooltip:e,delayDuration:t=Nge,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=n,l=S.useRef(!0),c=S.useRef(!1),u=S.useRef(0);return S.useEffect(()=>{const h=u.current;return()=>window.clearTimeout(h)},[]),a.jsx(Cge,{scope:e,isOpenDelayedRef:l,delayDuration:t,onOpen:S.useCallback(()=>{window.clearTimeout(u.current),l.current=!1},[]),onClose:S.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:S.useCallback(h=>{c.current=h},[]),disableHoverableContent:s,children:i})};VP.displayName=UP;var Vf="Tooltip",[Tge,_0]=Jx(Vf),WP=n=>{const{__scopeTooltip:e,children:t,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:l,delayDuration:c}=n,u=c3(Vf,n.__scopeTooltip),h=e1(e),[m,p]=S.useState(null),x=ki(),v=S.useRef(0),b=l??u.disableHoverableContent,O=c??u.delayDuration,k=S.useRef(!1),[j,T]=So({prop:r,defaultProp:s??!1,onChange:z=>{z?(u.onOpen(),document.dispatchEvent(new CustomEvent(B4))):u.onClose(),i?.(z)},caller:Vf}),M=S.useMemo(()=>j?k.current?"delayed-open":"instant-open":"closed",[j]),_=S.useCallback(()=>{window.clearTimeout(v.current),v.current=0,k.current=!1,T(!0)},[T]),D=S.useCallback(()=>{window.clearTimeout(v.current),v.current=0,T(!1)},[T]),E=S.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{k.current=!0,T(!0),v.current=0},O)},[O,T]);return S.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),a.jsx(ax,{...h,children:a.jsx(Tge,{scope:e,contentId:x,open:j,stateAttribute:M,trigger:m,onTriggerChange:p,onTriggerEnter:S.useCallback(()=>{u.isOpenDelayedRef.current?E():_()},[u.isOpenDelayedRef,E,_]),onTriggerLeave:S.useCallback(()=>{b?D():(window.clearTimeout(v.current),v.current=0)},[D,b]),onOpen:_,onClose:D,disableHoverableContent:b,children:t})})};WP.displayName=Vf;var I4="TooltipTrigger",GP=S.forwardRef((n,e)=>{const{__scopeTooltip:t,...r}=n,s=_0(I4,t),i=c3(I4,t),l=e1(t),c=S.useRef(null),u=Cn(e,c,s.onTriggerChange),h=S.useRef(!1),m=S.useRef(!1),p=S.useCallback(()=>h.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),a.jsx(lx,{asChild:!0,...l,children:a.jsx(Yt.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:u,onPointerMove:$e(n.onPointerMove,x=>{x.pointerType!=="touch"&&!m.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),m.current=!0)}),onPointerLeave:$e(n.onPointerLeave,()=>{s.onTriggerLeave(),m.current=!1}),onPointerDown:$e(n.onPointerDown,()=>{s.open&&s.onClose(),h.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:$e(n.onFocus,()=>{h.current||s.onOpen()}),onBlur:$e(n.onBlur,s.onClose),onClick:$e(n.onClick,s.onClose)})})});GP.displayName=I4;var u3="TooltipPortal",[Mge,Age]=Jx(u3,{forceMount:void 0}),XP=n=>{const{__scopeTooltip:e,forceMount:t,children:r,container:s}=n,i=_0(u3,e);return a.jsx(Mge,{scope:e,forceMount:t,children:a.jsx(Ls,{present:t||i.open,children:a.jsx(ix,{asChild:!0,container:s,children:r})})})};XP.displayName=u3;var wd="TooltipContent",YP=S.forwardRef((n,e)=>{const t=Age(wd,n.__scopeTooltip),{forceMount:r=t.forceMount,side:s="top",...i}=n,l=_0(wd,n.__scopeTooltip);return a.jsx(Ls,{present:r||l.open,children:l.disableHoverableContent?a.jsx(KP,{side:s,...i,ref:e}):a.jsx(Ege,{side:s,...i,ref:e})})}),Ege=S.forwardRef((n,e)=>{const t=_0(wd,n.__scopeTooltip),r=c3(wd,n.__scopeTooltip),s=S.useRef(null),i=Cn(e,s),[l,c]=S.useState(null),{trigger:u,onClose:h}=t,m=s.current,{onPointerInTransitChange:p}=r,x=S.useCallback(()=>{c(null),p(!1)},[p]),v=S.useCallback((b,O)=>{const k=b.currentTarget,j={x:b.clientX,y:b.clientY},T=Pge(j,k.getBoundingClientRect()),M=Lge(j,T),_=Bge(O.getBoundingClientRect()),D=Fge([...M,..._]);c(D),p(!0)},[p]);return S.useEffect(()=>()=>x(),[x]),S.useEffect(()=>{if(u&&m){const b=k=>v(k,m),O=k=>v(k,u);return u.addEventListener("pointerleave",b),m.addEventListener("pointerleave",O),()=>{u.removeEventListener("pointerleave",b),m.removeEventListener("pointerleave",O)}}},[u,m,v,x]),S.useEffect(()=>{if(l){const b=O=>{const k=O.target,j={x:O.clientX,y:O.clientY},T=u?.contains(k)||m?.contains(k),M=!Ige(j,l);T?x():M&&(x(),h())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,m,l,h,x]),a.jsx(KP,{...n,ref:i})}),[_ge,Dge]=Jx(Vf,{isInside:!1}),Rge=jge("TooltipContent"),KP=S.forwardRef((n,e)=>{const{__scopeTooltip:t,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:l,...c}=n,u=_0(wd,t),h=e1(t),{onClose:m}=u;return S.useEffect(()=>(document.addEventListener(B4,m),()=>document.removeEventListener(B4,m)),[m]),S.useEffect(()=>{if(u.trigger){const p=x=>{x.target?.contains(u.trigger)&&m()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[u.trigger,m]),a.jsx(Y4,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:p=>p.preventDefault(),onDismiss:m,children:a.jsxs(K4,{"data-state":u.stateAttribute,...h,...c,ref:e,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[a.jsx(Rge,{children:r}),a.jsx(_ge,{scope:t,isInside:!0,children:a.jsx(dF,{id:u.contentId,role:"tooltip",children:s||r})})]})})});YP.displayName=wd;var ZP="TooltipArrow",zge=S.forwardRef((n,e)=>{const{__scopeTooltip:t,...r}=n,s=e1(t);return Dge(ZP,t).isInside?null:a.jsx(Z4,{...s,...r,ref:e})});zge.displayName=ZP;function Pge(n,e){const t=Math.abs(e.top-n.y),r=Math.abs(e.bottom-n.y),s=Math.abs(e.right-n.x),i=Math.abs(e.left-n.x);switch(Math.min(t,r,s,i)){case i:return"left";case s:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Lge(n,e,t=5){const r=[];switch(e){case"top":r.push({x:n.x-t,y:n.y+t},{x:n.x+t,y:n.y+t});break;case"bottom":r.push({x:n.x-t,y:n.y-t},{x:n.x+t,y:n.y-t});break;case"left":r.push({x:n.x+t,y:n.y-t},{x:n.x+t,y:n.y+t});break;case"right":r.push({x:n.x-t,y:n.y-t},{x:n.x-t,y:n.y+t});break}return r}function Bge(n){const{top:e,right:t,bottom:r,left:s}=n;return[{x:s,y:e},{x:t,y:e},{x:t,y:r},{x:s,y:r}]}function Ige(n,e){const{x:t,y:r}=n;let s=!1;for(let i=0,l=e.length-1;i<e.length;l=i++){const c=e[i],u=e[l],h=c.x,m=c.y,p=u.x,x=u.y;m>r!=x>r&&t<(p-h)*(r-m)/(x-m)+h&&(s=!s)}return s}function Fge(n){const e=n.slice();return e.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),qge(e)}function qge(n){if(n.length<=1)return n.slice();const e=[];for(let r=0;r<n.length;r++){const s=n[r];for(;e.length>=2;){const i=e[e.length-1],l=e[e.length-2];if((i.x-l.x)*(s.y-l.y)>=(i.y-l.y)*(s.x-l.x))e.pop();else break}e.push(s)}e.pop();const t=[];for(let r=n.length-1;r>=0;r--){const s=n[r];for(;t.length>=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(s.y-l.y)>=(i.y-l.y)*(s.x-l.x))t.pop();else break}t.push(s)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var Qge=VP,$ge=WP,Hge=GP,Uge=XP,JP=YP;const Vge=Qge,Wge=$ge,Gge=Hge,eL=S.forwardRef(({className:n,sideOffset:e=4,...t},r)=>a.jsx(Uge,{children:a.jsx(JP,{ref:r,sideOffset:e,className:ve("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",n),...t})}));eL.displayName=JP.displayName;function Xge({children:n}){RH();const[e,t]=S.useState(!0),[r,s]=S.useState(!1),[i,l]=S.useState(!1),{theme:c,setTheme:u}=fw(),h=LI(),m=ba();S.useEffect(()=>{const O=k=>{(k.metaKey||k.ctrlKey)&&k.key==="k"&&(k.preventDefault(),l(!0))};return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[]);const p=[{title:"概览",items:[{icon:fg,label:"首页",path:"/"}]},{title:"麦麦配置编辑",items:[{icon:io,label:"麦麦主程序配置",path:"/config/bot"},{icon:$9,label:"麦麦模型提供商配置",path:"/config/modelProvider"},{icon:H9,label:"麦麦模型配置",path:"/config/model"},{icon:mk,label:"麦麦适配器配置",path:"/config/adapter"}]},{title:"麦麦资源管理",items:[{icon:J4,label:"表情包管理",path:"/resource/emoji"},{icon:Gf,label:"表达方式管理",path:"/resource/expression"},{icon:U9,label:"人物信息管理",path:"/resource/person"}]},{title:"扩展与监控",items:[{icon:gg,label:"插件市场",path:"/plugins"},{icon:mk,label:"插件配置",path:"/plugin-config"},{icon:mg,label:"日志查看器",path:"/logs"}]},{title:"系统",items:[{icon:dc,label:"系统设置",path:"/settings"}]}],v=c==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":c,b=()=>{localStorage.removeItem("access-token"),m({to:"/auth"})};return a.jsx(Vge,{delayDuration:300,children:a.jsxs("div",{className:"flex h-screen overflow-hidden",children:[a.jsxs("aside",{className:ve("fixed inset-y-0 left-0 z-50 flex flex-col border-r bg-card transition-all duration-300 lg:relative lg:z-0","w-64 lg:w-auto",e?"lg:w-64":"lg:w-16",r?"translate-x-0":"-translate-x-full lg:translate-x-0"),children:[a.jsx("div",{className:"flex h-16 items-center border-b px-4",children:a.jsxs("div",{className:ve("relative flex items-center justify-center flex-1 transition-all overflow-hidden","lg:flex-1",!e&&"lg:flex-none lg:w-8"),children:[a.jsxs("div",{className:ve("flex items-baseline gap-2",!e&&"lg:hidden"),children:[a.jsx("span",{className:"font-bold text-xl text-primary-gradient whitespace-nowrap",children:"MaiBot WebUI"}),a.jsx("span",{className:"text-xs text-primary/60 whitespace-nowrap",children:uH()})]}),!e&&a.jsx("span",{className:"hidden lg:block font-bold text-primary-gradient text-2xl",children:"M"})]})}),a.jsx(fn,{className:ve("flex-1 overflow-x-hidden",!e&&"lg:w-16"),children:a.jsx("nav",{className:ve("p-4",!e&&"lg:p-2 lg:w-16"),children:a.jsx("ul",{className:ve("space-y-6",!e&&"lg:space-y-3 lg:w-full"),children:p.map((O,k)=>a.jsxs("li",{children:[a.jsx("div",{className:ve("px-3 h-[1.25rem]","mb-2",!e&&"lg:mb-1 lg:invisible"),children:a.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/60 whitespace-nowrap",children:O.title})}),!e&&k>0&&a.jsx("div",{className:"hidden lg:block mb-2 border-t border-border"}),a.jsx("ul",{className:"space-y-1",children:O.items.map(j=>{const T=h({to:j.path}),M=j.icon,_=a.jsxs(a.Fragment,{children:[T&&a.jsx("div",{className:"absolute left-0 top-1/2 h-8 w-1 -translate-y-1/2 rounded-r-full bg-primary transition-opacity duration-300"}),a.jsxs("div",{className:ve("flex items-center transition-all duration-300",e?"gap-3":"gap-3 lg:gap-0"),children:[a.jsx(M,{className:ve("h-5 w-5 flex-shrink-0",T&&"text-primary"),strokeWidth:2,fill:"none"}),a.jsx("span",{className:ve("text-sm font-medium whitespace-nowrap transition-all duration-300",T&&"font-semibold",e?"opacity-100 max-w-[200px]":"opacity-100 max-w-[200px] lg:opacity-0 lg:max-w-0 lg:overflow-hidden"),children:j.label})]})]});return a.jsx("li",{className:"relative",children:a.jsxs(Wge,{children:[a.jsx(Gge,{asChild:!0,children:a.jsx(BI,{to:j.path,className:ve("relative flex items-center rounded-lg py-2 transition-all duration-300","hover:bg-accent hover:text-accent-foreground",T?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground",e?"px-3":"px-3 lg:px-0 lg:justify-center lg:w-12 lg:mx-auto"),onClick:()=>s(!1),children:_})}),!e&&a.jsx(eL,{side:"right",className:"hidden lg:block",children:a.jsx("p",{children:j.label})})]})},j.path)})})]},O.title))})})})]}),r&&a.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>s(!1)}),a.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[a.jsxs("header",{className:"flex h-16 items-center justify-between border-b bg-card/80 backdrop-blur-md px-4 sticky top-0 z-10",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("button",{onClick:()=>s(!r),className:"rounded-lg p-2 hover:bg-accent lg:hidden",children:a.jsx(LF,{className:"h-5 w-5"})}),a.jsx("button",{onClick:()=>t(!e),className:"hidden rounded-lg p-2 hover:bg-accent lg:block",title:e?"收起侧边栏":"展开侧边栏",children:a.jsx(Tc,{className:ve("h-5 w-5 transition-transform",!e&&"rotate-180")})})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{onClick:()=>l(!0),className:"relative hidden md:flex items-center w-64 h-9 pl-9 pr-16 bg-background/50 border rounded-md hover:bg-accent/50 transition-colors text-left",children:[a.jsx(Ps,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"搜索..."}),a.jsxs(Hz,{size:"sm",className:"absolute right-2 top-1/2 -translate-y-1/2",children:[a.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]}),a.jsx(tpe,{open:i,onOpenChange:l}),a.jsxs(ie,{variant:"ghost",size:"sm",onClick:()=>window.open("https://docs.mai-mai.org","_blank"),className:"gap-2",title:"查看麦麦文档",children:[a.jsx(BF,{className:"h-4 w-4"}),a.jsx("span",{className:"hidden sm:inline",children:"麦麦文档"})]}),a.jsx("button",{onClick:O=>{X$(v==="dark"?"light":"dark",u,O)},className:"rounded-lg p-2 hover:bg-accent",title:v==="dark"?"切换到浅色模式":"切换到深色模式",children:v==="dark"?a.jsx(Jb,{className:"h-5 w-5"}):a.jsx(e2,{className:"h-5 w-5"})}),a.jsx("div",{className:"h-6 w-px bg-border"}),a.jsxs(ie,{variant:"ghost",size:"sm",onClick:b,className:"gap-2",title:"登出系统",children:[a.jsx(pk,{className:"h-4 w-4"}),a.jsx("span",{className:"hidden sm:inline",children:"登出"})]})]})]}),a.jsxs(vge,{children:[a.jsx(yge,{asChild:!0,children:a.jsx("main",{className:"flex-1 overflow-hidden bg-background",children:n})}),a.jsxs(HP,{className:"w-64",children:[a.jsxs(Pi,{onClick:()=>m({to:"/"}),children:[a.jsx(fg,{className:"mr-2 h-4 w-4"}),"首页"]}),a.jsxs(Pi,{onClick:()=>m({to:"/settings"}),children:[a.jsx(dc,{className:"mr-2 h-4 w-4"}),"系统设置"]}),a.jsxs(Pi,{onClick:()=>m({to:"/logs"}),children:[a.jsx(mg,{className:"mr-2 h-4 w-4"}),"日志查看器"]}),a.jsx(Yh,{}),a.jsxs(bge,{children:[a.jsxs(QP,{children:[a.jsx(F9,{className:"mr-2 h-4 w-4"}),"切换主题"]}),a.jsxs($P,{className:"w-48",children:[a.jsxs(Pi,{onClick:()=>u("light"),disabled:c==="light",children:[a.jsx(Jb,{className:"mr-2 h-4 w-4"}),"浅色",c==="light"&&a.jsx(qu,{children:"✓"})]}),a.jsxs(Pi,{onClick:()=>u("dark"),disabled:c==="dark",children:[a.jsx(e2,{className:"mr-2 h-4 w-4"}),"深色",c==="dark"&&a.jsx(qu,{children:"✓"})]}),a.jsxs(Pi,{onClick:()=>u("system"),disabled:c==="system",children:[a.jsx(dc,{className:"mr-2 h-4 w-4"}),"跟随系统",c==="system"&&a.jsx(qu,{children:"✓"})]})]})]}),a.jsx(Yh,{}),a.jsxs(Pi,{onClick:()=>window.location.reload(),children:[a.jsx(IF,{className:"mr-2 h-4 w-4"}),"刷新页面",a.jsx(qu,{children:"⌘R"})]}),a.jsxs(Pi,{onClick:()=>l(!0),children:[a.jsx(Ps,{className:"mr-2 h-4 w-4"}),"搜索",a.jsx(qu,{children:"⌘K"})]}),a.jsx(Yh,{}),a.jsxs(Pi,{onClick:()=>window.open("https://docs.mai-mai.org","_blank"),children:[a.jsx(Kh,{className:"mr-2 h-4 w-4"}),"麦麦文档"]}),a.jsx(Yh,{}),a.jsxs(Pi,{onClick:b,className:"text-destructive focus:text-destructive",children:[a.jsx(pk,{className:"mr-2 h-4 w-4"}),"登出系统"]})]})]})]})]})})}const D0=II({component:()=>a.jsxs(a.Fragment,{children:[a.jsx(x9,{}),!1]}),beforeLoad:()=>{if(window.location.pathname==="/"&&!WT())throw qI({to:"/auth"})}}),Yge=Xr({getParentRoute:()=>D0,path:"/auth",component:zH}),Kge=Xr({getParentRoute:()=>D0,path:"/setup",component:eU}),qs=Xr({getParentRoute:()=>D0,id:"protected",component:()=>a.jsx(Xge,{children:a.jsx(x9,{})})}),Zge=Xr({getParentRoute:()=>qs,path:"/",component:W$}),Jge=Xr({getParentRoute:()=>qs,path:"/config/bot",component:Jee}),exe=Xr({getParentRoute:()=>qs,path:"/config/modelProvider",component:pte}),txe=Xr({getParentRoute:()=>qs,path:"/config/model",component:$te}),nxe=Xr({getParentRoute:()=>qs,path:"/config/adapter",component:Wte}),rxe=Xr({getParentRoute:()=>qs,path:"/resource/emoji",component:xde}),sxe=Xr({getParentRoute:()=>qs,path:"/resource/expression",component:Cde}),ixe=Xr({getParentRoute:()=>qs,path:"/resource/person",component:Bde}),axe=Xr({getParentRoute:()=>qs,path:"/logs",component:Eme}),lxe=Xr({getParentRoute:()=>qs,path:"/plugins",component:Yme}),oxe=Xr({getParentRoute:()=>qs,path:"/plugin-config",component:Kme}),cxe=Xr({getParentRoute:()=>qs,path:"/plugin-mirrors",component:Zme}),uxe=Xr({getParentRoute:()=>qs,path:"/settings",component:CH}),dxe=Xr({getParentRoute:()=>D0,path:"*",component:YT}),hxe=D0.addChildren([Yge,Kge,qs.addChildren([Zge,Jge,exe,txe,nxe,rxe,sxe,ixe,lxe,oxe,cxe,axe,uxe]),dxe]),fxe=FI({routeTree:hxe,defaultNotFoundComponent:YT});function mxe({children:n,defaultTheme:e="system",storageKey:t="ui-theme",...r}){const[s,i]=S.useState(()=>localStorage.getItem(t)||e);S.useEffect(()=>{const c=window.document.documentElement;if(c.classList.remove("light","dark"),s==="system"){const u=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";c.classList.add(u);return}c.classList.add(s)},[s]),S.useEffect(()=>{const c=localStorage.getItem("accent-color");if(c){const u=document.documentElement,m={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%",gradient:null},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%",gradient:null},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%",gradient:null},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%",gradient:null},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%",gradient:null},red:{hsl:"0 84% 60%",darkHsl:"0 90% 70%",gradient:null},"gradient-sunset":{hsl:"15 95% 60%",darkHsl:"15 95% 65%",gradient:"linear-gradient(135deg, hsl(25 95% 53%) 0%, hsl(330 81% 60%) 100%)"},"gradient-ocean":{hsl:"200 90% 55%",darkHsl:"200 90% 60%",gradient:"linear-gradient(135deg, hsl(221.2 83.2% 53.3%) 0%, hsl(189 94% 43%) 100%)"},"gradient-forest":{hsl:"150 70% 45%",darkHsl:"150 75% 40%",gradient:"linear-gradient(135deg, hsl(142 71% 45%) 0%, hsl(158 64% 52%) 100%)"},"gradient-aurora":{hsl:"310 85% 65%",darkHsl:"310 90% 70%",gradient:"linear-gradient(135deg, hsl(271 91% 65%) 0%, hsl(330 81% 60%) 100%)"},"gradient-fire":{hsl:"15 95% 55%",darkHsl:"15 95% 60%",gradient:"linear-gradient(135deg, hsl(0 84% 60%) 0%, hsl(25 95% 53%) 100%)"},"gradient-twilight":{hsl:"250 90% 60%",darkHsl:"250 95% 65%",gradient:"linear-gradient(135deg, hsl(239 84% 67%) 0%, hsl(271 91% 65%) 100%)"}}[c];m&&(u.style.setProperty("--primary",m.hsl),m.gradient?(u.style.setProperty("--primary-gradient",m.gradient),u.classList.add("has-gradient")):(u.style.removeProperty("--primary-gradient"),u.classList.remove("has-gradient")))}},[]);const l={theme:s,setTheme:c=>{localStorage.setItem(t,c),i(c)}};return a.jsx(xT.Provider,{...r,value:l,children:n})}function pxe({children:n,defaultEnabled:e=!0,defaultWavesEnabled:t=!0,storageKey:r="enable-animations",wavesStorageKey:s="enable-waves-background"}){const[i,l]=S.useState(()=>{const m=localStorage.getItem(r);return m!==null?m==="true":e}),[c,u]=S.useState(()=>{const m=localStorage.getItem(s);return m!==null?m==="true":t});S.useEffect(()=>{const m=document.documentElement;i?m.classList.remove("no-animations"):m.classList.add("no-animations"),localStorage.setItem(r,String(i))},[i,r]),S.useEffect(()=>{localStorage.setItem(s,String(c))},[c,s]);const h={enableAnimations:i,setEnableAnimations:l,enableWavesBackground:c,setEnableWavesBackground:u};return a.jsx(vT.Provider,{value:h,children:n})}var d3="ToastProvider",[h3,gxe,xxe]=nx("Toast"),[tL]=Hi("Toast",[xxe]),[vxe,t1]=tL(d3),nL=n=>{const{__scopeToast:e,label:t="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:l}=n,[c,u]=S.useState(null),[h,m]=S.useState(0),p=S.useRef(!1),x=S.useRef(!1);return t.trim()||console.error(`Invalid prop \`label\` supplied to \`${d3}\`. Expected non-empty \`string\`.`),a.jsx(h3.Provider,{scope:e,children:a.jsx(vxe,{scope:e,label:t,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:h,viewport:c,onViewportChange:u,onToastAdd:S.useCallback(()=>m(v=>v+1),[]),onToastRemove:S.useCallback(()=>m(v=>v-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:x,children:l})})};nL.displayName=d3;var rL="ToastViewport",yxe=["F8"],F4="toast.viewportPause",q4="toast.viewportResume",sL=S.forwardRef((n,e)=>{const{__scopeToast:t,hotkey:r=yxe,label:s="Notifications ({hotkey})",...i}=n,l=t1(rL,t),c=gxe(t),u=S.useRef(null),h=S.useRef(null),m=S.useRef(null),p=S.useRef(null),x=Cn(e,p,l.onViewportChange),v=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=l.toastCount>0;S.useEffect(()=>{const k=j=>{r.length!==0&&r.every(M=>j[M]||j.code===M)&&p.current?.focus()};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[r]),S.useEffect(()=>{const k=u.current,j=p.current;if(b&&k&&j){const T=()=>{if(!l.isClosePausedRef.current){const E=new CustomEvent(F4);j.dispatchEvent(E),l.isClosePausedRef.current=!0}},M=()=>{if(l.isClosePausedRef.current){const E=new CustomEvent(q4);j.dispatchEvent(E),l.isClosePausedRef.current=!1}},_=E=>{!k.contains(E.relatedTarget)&&M()},D=()=>{k.contains(document.activeElement)||M()};return k.addEventListener("focusin",T),k.addEventListener("focusout",_),k.addEventListener("pointermove",T),k.addEventListener("pointerleave",D),window.addEventListener("blur",T),window.addEventListener("focus",M),()=>{k.removeEventListener("focusin",T),k.removeEventListener("focusout",_),k.removeEventListener("pointermove",T),k.removeEventListener("pointerleave",D),window.removeEventListener("blur",T),window.removeEventListener("focus",M)}}},[b,l.isClosePausedRef]);const O=S.useCallback(({tabbingDirection:k})=>{const T=c().map(M=>{const _=M.ref.current,D=[_,..._xe(_)];return k==="forwards"?D:D.reverse()});return(k==="forwards"?T.reverse():T).flat()},[c]);return S.useEffect(()=>{const k=p.current;if(k){const j=T=>{const M=T.altKey||T.ctrlKey||T.metaKey;if(T.key==="Tab"&&!M){const D=document.activeElement,E=T.shiftKey;if(T.target===k&&E){h.current?.focus();return}const q=O({tabbingDirection:E?"backwards":"forwards"}),B=q.findIndex(U=>U===D);Xb(q.slice(B+1))?T.preventDefault():E?h.current?.focus():m.current?.focus()}};return k.addEventListener("keydown",j),()=>k.removeEventListener("keydown",j)}},[c,O]),a.jsxs(hF,{ref:u,role:"region","aria-label":s.replace("{hotkey}",v),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&a.jsx(Q4,{ref:h,onFocusFromOutsideViewport:()=>{const k=O({tabbingDirection:"forwards"});Xb(k)}}),a.jsx(h3.Slot,{scope:t,children:a.jsx(Yt.ol,{tabIndex:-1,...i,ref:x})}),b&&a.jsx(Q4,{ref:m,onFocusFromOutsideViewport:()=>{const k=O({tabbingDirection:"backwards"});Xb(k)}})]})});sL.displayName=rL;var iL="ToastFocusProxy",Q4=S.forwardRef((n,e)=>{const{__scopeToast:t,onFocusFromOutsideViewport:r,...s}=n,i=t1(iL,t);return a.jsx(I9,{tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:l=>{const c=l.relatedTarget;!i.viewport?.contains(c)&&r()}})});Q4.displayName=iL;var R0="Toast",bxe="toast.swipeStart",wxe="toast.swipeMove",Sxe="toast.swipeCancel",Oxe="toast.swipeEnd",aL=S.forwardRef((n,e)=>{const{forceMount:t,open:r,defaultOpen:s,onOpenChange:i,...l}=n,[c,u]=So({prop:r,defaultProp:s??!0,onChange:i,caller:R0});return a.jsx(Ls,{present:t||c,children:a.jsx(Nxe,{open:c,...l,ref:e,onClose:()=>u(!1),onPause:es(n.onPause),onResume:es(n.onResume),onSwipeStart:$e(n.onSwipeStart,h=>{h.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:$e(n.onSwipeMove,h=>{const{x:m,y:p}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","move"),h.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${m}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:$e(n.onSwipeCancel,h=>{h.currentTarget.setAttribute("data-swipe","cancel"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:$e(n.onSwipeEnd,h=>{const{x:m,y:p}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","end"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${m}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),u(!1)})})})});aL.displayName=R0;var[kxe,jxe]=tL(R0,{onClose(){}}),Nxe=S.forwardRef((n,e)=>{const{__scopeToast:t,type:r="foreground",duration:s,open:i,onClose:l,onEscapeKeyDown:c,onPause:u,onResume:h,onSwipeStart:m,onSwipeMove:p,onSwipeCancel:x,onSwipeEnd:v,...b}=n,O=t1(R0,t),[k,j]=S.useState(null),T=Cn(e,W=>j(W)),M=S.useRef(null),_=S.useRef(null),D=s||O.duration,E=S.useRef(0),z=S.useRef(D),Q=S.useRef(0),{onToastAdd:q,onToastRemove:B}=O,U=es(()=>{k?.contains(document.activeElement)&&O.viewport?.focus(),l()}),V=S.useCallback(W=>{!W||W===1/0||(window.clearTimeout(Q.current),E.current=new Date().getTime(),Q.current=window.setTimeout(U,W))},[U]);S.useEffect(()=>{const W=O.viewport;if(W){const J=()=>{V(z.current),h?.()},H=()=>{const ae=new Date().getTime()-E.current;z.current=z.current-ae,window.clearTimeout(Q.current),u?.()};return W.addEventListener(F4,H),W.addEventListener(q4,J),()=>{W.removeEventListener(F4,H),W.removeEventListener(q4,J)}}},[O.viewport,D,u,h,V]),S.useEffect(()=>{i&&!O.isClosePausedRef.current&&V(D)},[i,D,O.isClosePausedRef,V]),S.useEffect(()=>(q(),()=>B()),[q,B]);const ce=S.useMemo(()=>k?fL(k):null,[k]);return O.viewport?a.jsxs(a.Fragment,{children:[ce&&a.jsx(Cxe,{__scopeToast:t,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:ce}),a.jsx(kxe,{scope:t,onClose:U,children:g9.createPortal(a.jsx(h3.ItemSlot,{scope:t,children:a.jsx(fF,{asChild:!0,onEscapeKeyDown:$e(c,()=>{O.isFocusedToastEscapeKeyDownRef.current||U(),O.isFocusedToastEscapeKeyDownRef.current=!1}),children:a.jsx(Yt.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":O.swipeDirection,...b,ref:T,style:{userSelect:"none",touchAction:"none",...n.style},onKeyDown:$e(n.onKeyDown,W=>{W.key==="Escape"&&(c?.(W.nativeEvent),W.nativeEvent.defaultPrevented||(O.isFocusedToastEscapeKeyDownRef.current=!0,U()))}),onPointerDown:$e(n.onPointerDown,W=>{W.button===0&&(M.current={x:W.clientX,y:W.clientY})}),onPointerMove:$e(n.onPointerMove,W=>{if(!M.current)return;const J=W.clientX-M.current.x,H=W.clientY-M.current.y,ae=!!_.current,ne=["left","right"].includes(O.swipeDirection),ue=["left","up"].includes(O.swipeDirection)?Math.min:Math.max,R=ne?ue(0,J):0,me=ne?0:ue(0,H),Y=W.pointerType==="touch"?10:2,P={x:R,y:me},K={originalEvent:W,delta:P};ae?(_.current=P,$p(wxe,p,K,{discrete:!1})):p9(P,O.swipeDirection,Y)?(_.current=P,$p(bxe,m,K,{discrete:!1}),W.target.setPointerCapture(W.pointerId)):(Math.abs(J)>Y||Math.abs(H)>Y)&&(M.current=null)}),onPointerUp:$e(n.onPointerUp,W=>{const J=_.current,H=W.target;if(H.hasPointerCapture(W.pointerId)&&H.releasePointerCapture(W.pointerId),_.current=null,M.current=null,J){const ae=W.currentTarget,ne={originalEvent:W,delta:J};p9(J,O.swipeDirection,O.swipeThreshold)?$p(Oxe,v,ne,{discrete:!0}):$p(Sxe,x,ne,{discrete:!0}),ae.addEventListener("click",ue=>ue.preventDefault(),{once:!0})}})})})}),O.viewport)})]}):null}),Cxe=n=>{const{__scopeToast:e,children:t,...r}=n,s=t1(R0,e),[i,l]=S.useState(!1),[c,u]=S.useState(!1);return Axe(()=>l(!0)),S.useEffect(()=>{const h=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(h)},[]),c?null:a.jsx(ix,{asChild:!0,children:a.jsx(I9,{...r,children:i&&a.jsxs(a.Fragment,{children:[s.label," ",t]})})})},Txe="ToastTitle",lL=S.forwardRef((n,e)=>{const{__scopeToast:t,...r}=n;return a.jsx(Yt.div,{...r,ref:e})});lL.displayName=Txe;var Mxe="ToastDescription",oL=S.forwardRef((n,e)=>{const{__scopeToast:t,...r}=n;return a.jsx(Yt.div,{...r,ref:e})});oL.displayName=Mxe;var cL="ToastAction",uL=S.forwardRef((n,e)=>{const{altText:t,...r}=n;return t.trim()?a.jsx(hL,{altText:t,asChild:!0,children:a.jsx(f3,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${cL}\`. Expected non-empty \`string\`.`),null)});uL.displayName=cL;var dL="ToastClose",f3=S.forwardRef((n,e)=>{const{__scopeToast:t,...r}=n,s=jxe(dL,t);return a.jsx(hL,{asChild:!0,children:a.jsx(Yt.button,{type:"button",...r,ref:e,onClick:$e(n.onClick,s.onClose)})})});f3.displayName=dL;var hL=S.forwardRef((n,e)=>{const{__scopeToast:t,altText:r,...s}=n;return a.jsx(Yt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function fL(n){const e=[];return Array.from(n.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),Exe(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const l=r.dataset.radixToastAnnounceAlt;l&&e.push(l)}else e.push(...fL(r))}}),e}function $p(n,e,t,{discrete:r}){const s=t.originalEvent.currentTarget,i=new CustomEvent(n,{bubbles:!0,cancelable:!0,detail:t});e&&s.addEventListener(n,e,{once:!0}),r?B9(s,i):s.dispatchEvent(i)}var p9=(n,e,t=0)=>{const r=Math.abs(n.x),s=Math.abs(n.y),i=r>s;return e==="left"||e==="right"?i&&r>t:!i&&s>t};function Axe(n=()=>{}){const e=es(n);b9(()=>{let t=0,r=0;return t=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(t),window.cancelAnimationFrame(r)}},[e])}function Exe(n){return n.nodeType===n.ELEMENT_NODE}function _xe(n){const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function Xb(n){const e=document.activeElement;return n.some(t=>t===e?!0:(t.focus(),document.activeElement!==e))}var Dxe=nL,mL=sL,pL=aL,gL=lL,xL=oL,vL=uL,yL=f3;const Rxe=Dxe,bL=S.forwardRef(({className:n,...e},t)=>a.jsx(mL,{ref:t,className:ve("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",n),...e}));bL.displayName=mL.displayName;const zxe=Cd("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),wL=S.forwardRef(({className:n,variant:e,...t},r)=>a.jsx(pL,{ref:r,className:ve(zxe({variant:e}),n),...t}));wL.displayName=pL.displayName;const Pxe=S.forwardRef(({className:n,...e},t)=>a.jsx(vL,{ref:t,className:ve("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",n),...e}));Pxe.displayName=vL.displayName;const SL=S.forwardRef(({className:n,...e},t)=>a.jsx(yL,{ref:t,className:ve("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",n),"toast-close":"",...e,children:a.jsx(Xf,{className:"h-4 w-4"})}));SL.displayName=yL.displayName;const OL=S.forwardRef(({className:n,...e},t)=>a.jsx(gL,{ref:t,className:ve("text-sm font-semibold [&+div]:text-xs",n),...e}));OL.displayName=gL.displayName;const kL=S.forwardRef(({className:n,...e},t)=>a.jsx(xL,{ref:t,className:ve("text-sm opacity-90",n),...e}));kL.displayName=xL.displayName;function Lxe(){const{toasts:n}=Pr();return a.jsxs(Rxe,{children:[n.map(function({id:e,title:t,description:r,action:s,...i}){return a.jsxs(wL,{...i,children:[a.jsxs("div",{className:"grid gap-1",children:[t&&a.jsx(OL,{children:t}),r&&a.jsx(kL,{children:r})]}),s,a.jsx(SL,{})]},e)}),a.jsx(bL,{})]})}HF.createRoot(document.getElementById("root")).render(a.jsx(S.StrictMode,{children:a.jsx(mxe,{defaultTheme:"system",children:a.jsxs(pxe,{children:[a.jsx(QI,{router:fxe}),a.jsx(Lxe,{})]})})}));
|