From 3d1f26ae1b162551558f6652ce8f5aa49a8e2b88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A2=A8=E6=A2=93=E6=9F=92?= <1787882683@qq.com> Date: Fri, 28 Nov 2025 14:18:51 +0800 Subject: [PATCH] WebUI cf0eb78ac449cbbcda285bc83b96c816bec627cf --- ...{charts-0z-hIQr-.js => charts-Cdq_Jxe7.js} | 2 +- webui/dist/assets/icons-DMlhlQyz.js | 1 - webui/dist/assets/icons-wa0wi-vG.js | 1 + webui/dist/assets/index-Bzl8QBn9.css | 1 - .../{index--0Z4-njD.js => index-JgAL2W8G.js} | 152 +++++++++--------- webui/dist/assets/index-Rqzi5c1P.css | 1 + ...{router-SinpzM5S.js => router-DQNkr8RI.js} | 2 +- ...ndor-BLBhIcJ8.js => ui-vendor-BgfqR_Xz.js} | 2 +- webui/dist/index.html | 12 +- 9 files changed, 87 insertions(+), 87 deletions(-) rename webui/dist/assets/{charts-0z-hIQr-.js => charts-Cdq_Jxe7.js} (99%) delete mode 100644 webui/dist/assets/icons-DMlhlQyz.js create mode 100644 webui/dist/assets/icons-wa0wi-vG.js delete mode 100644 webui/dist/assets/index-Bzl8QBn9.css rename webui/dist/assets/{index--0Z4-njD.js => index-JgAL2W8G.js} (62%) create mode 100644 webui/dist/assets/index-Rqzi5c1P.css rename webui/dist/assets/{router-SinpzM5S.js => router-DQNkr8RI.js} (99%) rename webui/dist/assets/{ui-vendor-BLBhIcJ8.js => ui-vendor-BgfqR_Xz.js} (99%) diff --git a/webui/dist/assets/charts-0z-hIQr-.js b/webui/dist/assets/charts-Cdq_Jxe7.js similarity index 99% rename from webui/dist/assets/charts-0z-hIQr-.js rename to webui/dist/assets/charts-Cdq_Jxe7.js index 1b0cb22d..2a290019 100644 --- a/webui/dist/assets/charts-0z-hIQr-.js +++ b/webui/dist/assets/charts-Cdq_Jxe7.js @@ -1,4 +1,4 @@ -import{r as N,R as S,i as or}from"./router-SinpzM5S.js";import{c as Ai,g as ce}from"./react-vendor-Dtc2IqVY.js";function wx(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t-1}return ru=t,ru}var nu,wd;function h1(){if(wd)return nu;wd=1;var e=La();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return nu=t,nu}var iu,Od;function Ba(){if(Od)return iu;Od=1;var e=c1(),t=s1(),r=l1(),n=f1(),i=h1();function a(o){var u=-1,c=o==null?0:o.length;for(this.clear();++u0?1:-1},er=function(t){return ur(t)&&t.indexOf("%")===t.length-1},q=function(t){return R1(t)&&!gi(t)},D1=function(t){return J(t)},Se=function(t){return q(t)||ur(t)},N1=0,un=function(t){var r=++N1;return"".concat(t||"").concat(r)},Le=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!q(t)&&!ur(t))return n;var a;if(er(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return gi(a)&&(a=n),i&&a>r&&(a=r),a},qt=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},q1=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function K1(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function nf(e){"@babel/helpers - typeof";return nf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nf(e)}var Yd={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Et=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},Zd=null,Mu=null,Ih=function e(t){if(t===Zd&&Array.isArray(Mu))return Mu;var r=[];return N.Children.forEach(t,function(n){J(n)||($1.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),Mu=r,Zd=t,r};function Ye(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Et(i)}):n=[Et(t)],Ih(e).forEach(function(i){var a=Xe(i,"type.displayName")||Xe(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function He(e,t){var r=Ye(e,t);return r&&r[0]}var Jd=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!q(n)||n<=0||!q(i)||i<=0)},H1=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],G1=function(t){return t&&t.type&&ur(t.type)&&H1.indexOf(t.type)>=0},V1=function(t){return t&&nf(t)==="object"&&"clipDot"in t},X1=function(t,r,n,i){var a,o=(a=ju?.[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!X(t)&&(i&&o.includes(r)||F1.includes(r))||n&&$h.includes(r)},K=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(N.isValidElement(t)&&(i=t.props),!on(i))return null;var a={};return Object.keys(i).forEach(function(o){var u;X1((u=i)===null||u===void 0?void 0:u[o],o,r,n)&&(a[o]=i[o])}),a},af=function e(t,r){if(t===r)return!0;var n=N.Children.count(t);if(n!==N.Children.count(r))return!1;if(n===0)return!0;if(n===1)return Qd(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function eA(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function uf(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,u=e.title,c=e.desc,s=Q1(e,J1),f=i||{width:r,height:n,x:0,y:0},l=te("recharts-surface",a);return S.createElement("svg",of({},K(s,!0,"svg"),{className:l,width:r,height:n,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),S.createElement("title",null,u),S.createElement("desc",null,c),t)}var tA=["children","className"];function cf(){return cf=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nA(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var ne=S.forwardRef(function(e,t){var r=e.children,n=e.className,i=rA(e,tA),a=te("recharts-layer",n);return S.createElement("g",cf({className:a},K(i,!0),{ref:t}),r)}),st=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;aa?0:a+r),n=n>a?a:n,n<0&&(n+=a),a=r>n?0:n-r>>>0,r>>>=0;for(var o=Array(a);++i=a?r:e(r,n,i)}return Iu=t,Iu}var Cu,nv;function jx(){if(nv)return Cu;nv=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,a="\\ufe0e\\ufe0f",o="\\u200d",u=RegExp("["+o+e+i+a+"]");function c(s){return u.test(s)}return Cu=c,Cu}var ku,iv;function oA(){if(iv)return ku;iv=1;function e(t){return t.split("")}return ku=e,ku}var Ru,av;function uA(){if(av)return Ru;av=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,a="\\ufe0e\\ufe0f",o="["+e+"]",u="["+i+"]",c="\\ud83c[\\udffb-\\udfff]",s="(?:"+u+"|"+c+")",f="[^"+e+"]",l="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",p="\\u200d",y=s+"?",v="["+a+"]?",d="(?:"+p+"(?:"+[f,l,h].join("|")+")"+v+y+")*",m=v+y+d,x="(?:"+[f+u+"?",u,l,h,o].join("|")+")",w=RegExp(c+"(?="+c+")|"+x+m,"g");function O(g){return g.match(w)||[]}return Ru=O,Ru}var Du,ov;function cA(){if(ov)return Du;ov=1;var e=oA(),t=jx(),r=uA();function n(i){return t(i)?r(i):e(i)}return Du=n,Du}var Nu,uv;function sA(){if(uv)return Nu;uv=1;var e=aA(),t=jx(),r=cA(),n=Sx();function i(a){return function(o){o=n(o);var u=t(o)?r(o):void 0,c=u?u[0]:o.charAt(0),s=u?e(u,1).join(""):o.slice(1);return c[a]()+s}}return Nu=i,Nu}var qu,cv;function lA(){if(cv)return qu;cv=1;var e=sA(),t=e("toUpperCase");return qu=t,qu}var fA=lA();const Wa=ce(fA);function he(e){return function(){return e}}const Mx=Math.cos,Ui=Math.sin,pt=Math.sqrt,Wi=Math.PI,za=2*Wi,sf=Math.PI,lf=2*sf,Zt=1e-6,hA=lf-Zt;function $x(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return $x;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;iZt)if(!(Math.abs(l*c-s*f)>Zt)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-o,y=i-u,v=c*c+s*s,d=p*p+y*y,m=Math.sqrt(v),x=Math.sqrt(h),w=a*Math.tan((sf-Math.acos((v+h-d)/(2*m*x)))/2),O=w/x,g=w/m;Math.abs(O-1)>Zt&&this._append`L${t+O*f},${r+O*l}`,this._append`A${a},${a},0,0,${+(l*p>f*y)},${this._x1=t+g*c},${this._y1=r+g*s}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(i),c=n*Math.sin(i),s=t+u,f=r+c,l=1^o,h=o?i-a:a-i;this._x1===null?this._append`M${s},${f}`:(Math.abs(this._x1-s)>Zt||Math.abs(this._y1-f)>Zt)&&this._append`L${s},${f}`,n&&(h<0&&(h=h%lf+lf),h>hA?this._append`A${n},${n},0,1,${l},${t-u},${r-c}A${n},${n},0,1,${l},${this._x1=s},${this._y1=f}`:h>Zt&&this._append`A${n},${n},0,${+(h>=sf)},${l},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function Ch(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new dA(t)}function kh(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ix(e){this._context=e}Ix.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Ka(e){return new Ix(e)}function Cx(e){return e[0]}function kx(e){return e[1]}function Rx(e,t){var r=he(!0),n=null,i=Ka,a=null,o=Ch(u);e=typeof e=="function"?e:e===void 0?Cx:he(e),t=typeof t=="function"?t:t===void 0?kx:he(t);function u(c){var s,f=(c=kh(c)).length,l,h=!1,p;for(n==null&&(a=i(p=o())),s=0;s<=f;++s)!(s=p;--y)u.point(w[y],O[y]);u.lineEnd(),u.areaEnd()}m&&(w[h]=+e(d,h,l),O[h]=+t(d,h,l),u.point(n?+n(d,h,l):w[h],r?+r(d,h,l):O[h]))}if(x)return u=null,x+""||null}function f(){return Rx().defined(i).curve(o).context(a)}return s.x=function(l){return arguments.length?(e=typeof l=="function"?l:he(+l),n=null,s):e},s.x0=function(l){return arguments.length?(e=typeof l=="function"?l:he(+l),s):e},s.x1=function(l){return arguments.length?(n=l==null?null:typeof l=="function"?l:he(+l),s):n},s.y=function(l){return arguments.length?(t=typeof l=="function"?l:he(+l),r=null,s):t},s.y0=function(l){return arguments.length?(t=typeof l=="function"?l:he(+l),s):t},s.y1=function(l){return arguments.length?(r=l==null?null:typeof l=="function"?l:he(+l),s):r},s.lineX0=s.lineY0=function(){return f().x(e).y(t)},s.lineY1=function(){return f().x(e).y(r)},s.lineX1=function(){return f().x(n).y(t)},s.defined=function(l){return arguments.length?(i=typeof l=="function"?l:he(!!l),s):i},s.curve=function(l){return arguments.length?(o=l,a!=null&&(u=o(a)),s):o},s.context=function(l){return arguments.length?(l==null?a=u=null:u=o(a=l),s):a},s}class Dx{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function vA(e){return new Dx(e,!0)}function yA(e){return new Dx(e,!1)}const Rh={draw(e,t){const r=pt(t/Wi);e.moveTo(r,0),e.arc(0,0,r,0,za)}},gA={draw(e,t){const r=pt(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},Nx=pt(1/3),mA=Nx*2,bA={draw(e,t){const r=pt(t/mA),n=r*Nx;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},xA={draw(e,t){const r=pt(t),n=-r/2;e.rect(n,n,r,r)}},wA=.8908130915292852,qx=Ui(Wi/10)/Ui(7*Wi/10),OA=Ui(za/10)*qx,_A=-Mx(za/10)*qx,AA={draw(e,t){const r=pt(t*wA),n=OA*r,i=_A*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=za*a/5,u=Mx(o),c=Ui(o);e.lineTo(c*r,-u*r),e.lineTo(u*n-c*i,c*n+u*i)}e.closePath()}},Lu=pt(3),SA={draw(e,t){const r=-pt(t/(Lu*3));e.moveTo(0,r*2),e.lineTo(-Lu*r,-r),e.lineTo(Lu*r,-r),e.closePath()}},Je=-.5,Qe=pt(3)/2,ff=1/pt(12),PA=(ff/2+1)*3,TA={draw(e,t){const r=pt(t/PA),n=r/2,i=r*ff,a=n,o=r*ff+r,u=-a,c=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(u,c),e.lineTo(Je*n-Qe*i,Qe*n+Je*i),e.lineTo(Je*a-Qe*o,Qe*a+Je*o),e.lineTo(Je*u-Qe*c,Qe*u+Je*c),e.lineTo(Je*n+Qe*i,Je*i-Qe*n),e.lineTo(Je*a+Qe*o,Je*o-Qe*a),e.lineTo(Je*u+Qe*c,Je*c-Qe*u),e.closePath()}};function EA(e,t){let r=null,n=Ch(i);e=typeof e=="function"?e:he(e||Rh),t=typeof t=="function"?t:he(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:he(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:he(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function zi(){}function Ki(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function Lx(e){this._context=e}Lx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ki(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ki(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function jA(e){return new Lx(e)}function Bx(e){this._context=e}Bx.prototype={areaStart:zi,areaEnd:zi,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Ki(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function MA(e){return new Bx(e)}function Fx(e){this._context=e}Fx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Ki(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function $A(e){return new Fx(e)}function Ux(e){this._context=e}Ux.prototype={areaStart:zi,areaEnd:zi,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function IA(e){return new Ux(e)}function sv(e){return e<0?-1:1}function lv(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),u=(a*i+o*n)/(n+i);return(sv(a)+sv(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(u))||0}function fv(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Bu(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,u=(a-n)/3;e._context.bezierCurveTo(n+u,i+u*t,a-u,o-u*r,a,o)}function Hi(e){this._context=e}Hi.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Bu(this,this._t0,fv(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Bu(this,fv(this,r=lv(this,e,t)),r);break;default:Bu(this,this._t0,r=lv(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Wx(e){this._context=new zx(e)}(Wx.prototype=Object.create(Hi.prototype)).point=function(e,t){Hi.prototype.point.call(this,t,e)};function zx(e){this._context=e}zx.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function CA(e){return new Hi(e)}function kA(e){return new Wx(e)}function Kx(e){this._context=e}Kx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=hv(e),i=hv(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function DA(e){return new Ha(e,.5)}function NA(e){return new Ha(e,0)}function qA(e){return new Ha(e,1)}function Ir(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,u=a.length;r=0;)r[t]=t;return r}function LA(e,t){return e[t]}function BA(e){const t=[];return t.key=e,t}function FA(){var e=he([]),t=hf,r=Ir,n=LA;function i(a){var o=Array.from(e.apply(this,arguments),BA),u,c=o.length,s=-1,f;for(const l of a)for(u=0,++s;u0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function YA(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Hx={symbolCircle:Rh,symbolCross:gA,symbolDiamond:bA,symbolSquare:xA,symbolStar:AA,symbolTriangle:SA,symbolWye:TA},ZA=Math.PI/180,JA=function(t){var r="symbol".concat(Wa(t));return Hx[r]||Rh},QA=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*ZA;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},eS=function(t,r){Hx["symbol".concat(Wa(t))]=r},Dh=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,u=o===void 0?"area":o,c=XA(t,KA),s=dv(dv({},c),{},{type:n,size:a,sizeType:u}),f=function(){var d=JA(n),m=EA().type(d).size(QA(a,u,n));return m()},l=s.className,h=s.cx,p=s.cy,y=K(s,!0);return h===+h&&p===+p&&a===+a?S.createElement("path",pf({},y,{className:te("recharts-symbols",l),transform:"translate(".concat(h,", ").concat(p,")"),d:f()})):null};Dh.registerSymbol=eS;function Cr(e){"@babel/helpers - typeof";return Cr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cr(e)}function df(){return df=Object.assign?Object.assign.bind():function(e){for(var t=1;t-1}return ru=t,ru}var nu,wd;function h1(){if(wd)return nu;wd=1;var e=La();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return nu=t,nu}var iu,Od;function Ba(){if(Od)return iu;Od=1;var e=c1(),t=s1(),r=l1(),n=f1(),i=h1();function a(o){var u=-1,c=o==null?0:o.length;for(this.clear();++u0?1:-1},er=function(t){return ur(t)&&t.indexOf("%")===t.length-1},q=function(t){return R1(t)&&!gi(t)},D1=function(t){return J(t)},Se=function(t){return q(t)||ur(t)},N1=0,un=function(t){var r=++N1;return"".concat(t||"").concat(r)},Le=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!q(t)&&!ur(t))return n;var a;if(er(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return gi(a)&&(a=n),i&&a>r&&(a=r),a},qt=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},q1=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function K1(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function nf(e){"@babel/helpers - typeof";return nf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nf(e)}var Yd={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Et=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},Zd=null,Mu=null,Ih=function e(t){if(t===Zd&&Array.isArray(Mu))return Mu;var r=[];return N.Children.forEach(t,function(n){J(n)||($1.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),Mu=r,Zd=t,r};function Ye(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Et(i)}):n=[Et(t)],Ih(e).forEach(function(i){var a=Xe(i,"type.displayName")||Xe(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function He(e,t){var r=Ye(e,t);return r&&r[0]}var Jd=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!q(n)||n<=0||!q(i)||i<=0)},H1=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],G1=function(t){return t&&t.type&&ur(t.type)&&H1.indexOf(t.type)>=0},V1=function(t){return t&&nf(t)==="object"&&"clipDot"in t},X1=function(t,r,n,i){var a,o=(a=ju?.[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!X(t)&&(i&&o.includes(r)||F1.includes(r))||n&&$h.includes(r)},K=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(N.isValidElement(t)&&(i=t.props),!on(i))return null;var a={};return Object.keys(i).forEach(function(o){var u;X1((u=i)===null||u===void 0?void 0:u[o],o,r,n)&&(a[o]=i[o])}),a},af=function e(t,r){if(t===r)return!0;var n=N.Children.count(t);if(n!==N.Children.count(r))return!1;if(n===0)return!0;if(n===1)return Qd(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function eA(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function uf(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,u=e.title,c=e.desc,s=Q1(e,J1),f=i||{width:r,height:n,x:0,y:0},l=te("recharts-surface",a);return S.createElement("svg",of({},K(s,!0,"svg"),{className:l,width:r,height:n,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),S.createElement("title",null,u),S.createElement("desc",null,c),t)}var tA=["children","className"];function cf(){return cf=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nA(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var ne=S.forwardRef(function(e,t){var r=e.children,n=e.className,i=rA(e,tA),a=te("recharts-layer",n);return S.createElement("g",cf({className:a},K(i,!0),{ref:t}),r)}),st=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;aa?0:a+r),n=n>a?a:n,n<0&&(n+=a),a=r>n?0:n-r>>>0,r>>>=0;for(var o=Array(a);++i=a?r:e(r,n,i)}return Iu=t,Iu}var Cu,nv;function jx(){if(nv)return Cu;nv=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,a="\\ufe0e\\ufe0f",o="\\u200d",u=RegExp("["+o+e+i+a+"]");function c(s){return u.test(s)}return Cu=c,Cu}var ku,iv;function oA(){if(iv)return ku;iv=1;function e(t){return t.split("")}return ku=e,ku}var Ru,av;function uA(){if(av)return Ru;av=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,a="\\ufe0e\\ufe0f",o="["+e+"]",u="["+i+"]",c="\\ud83c[\\udffb-\\udfff]",s="(?:"+u+"|"+c+")",f="[^"+e+"]",l="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",p="\\u200d",y=s+"?",v="["+a+"]?",d="(?:"+p+"(?:"+[f,l,h].join("|")+")"+v+y+")*",m=v+y+d,x="(?:"+[f+u+"?",u,l,h,o].join("|")+")",w=RegExp(c+"(?="+c+")|"+x+m,"g");function O(g){return g.match(w)||[]}return Ru=O,Ru}var Du,ov;function cA(){if(ov)return Du;ov=1;var e=oA(),t=jx(),r=uA();function n(i){return t(i)?r(i):e(i)}return Du=n,Du}var Nu,uv;function sA(){if(uv)return Nu;uv=1;var e=aA(),t=jx(),r=cA(),n=Sx();function i(a){return function(o){o=n(o);var u=t(o)?r(o):void 0,c=u?u[0]:o.charAt(0),s=u?e(u,1).join(""):o.slice(1);return c[a]()+s}}return Nu=i,Nu}var qu,cv;function lA(){if(cv)return qu;cv=1;var e=sA(),t=e("toUpperCase");return qu=t,qu}var fA=lA();const Wa=ce(fA);function he(e){return function(){return e}}const Mx=Math.cos,Ui=Math.sin,pt=Math.sqrt,Wi=Math.PI,za=2*Wi,sf=Math.PI,lf=2*sf,Zt=1e-6,hA=lf-Zt;function $x(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return $x;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;iZt)if(!(Math.abs(l*c-s*f)>Zt)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-o,y=i-u,v=c*c+s*s,d=p*p+y*y,m=Math.sqrt(v),x=Math.sqrt(h),w=a*Math.tan((sf-Math.acos((v+h-d)/(2*m*x)))/2),O=w/x,g=w/m;Math.abs(O-1)>Zt&&this._append`L${t+O*f},${r+O*l}`,this._append`A${a},${a},0,0,${+(l*p>f*y)},${this._x1=t+g*c},${this._y1=r+g*s}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(i),c=n*Math.sin(i),s=t+u,f=r+c,l=1^o,h=o?i-a:a-i;this._x1===null?this._append`M${s},${f}`:(Math.abs(this._x1-s)>Zt||Math.abs(this._y1-f)>Zt)&&this._append`L${s},${f}`,n&&(h<0&&(h=h%lf+lf),h>hA?this._append`A${n},${n},0,1,${l},${t-u},${r-c}A${n},${n},0,1,${l},${this._x1=s},${this._y1=f}`:h>Zt&&this._append`A${n},${n},0,${+(h>=sf)},${l},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function Ch(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new dA(t)}function kh(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ix(e){this._context=e}Ix.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Ka(e){return new Ix(e)}function Cx(e){return e[0]}function kx(e){return e[1]}function Rx(e,t){var r=he(!0),n=null,i=Ka,a=null,o=Ch(u);e=typeof e=="function"?e:e===void 0?Cx:he(e),t=typeof t=="function"?t:t===void 0?kx:he(t);function u(c){var s,f=(c=kh(c)).length,l,h=!1,p;for(n==null&&(a=i(p=o())),s=0;s<=f;++s)!(s=p;--y)u.point(w[y],O[y]);u.lineEnd(),u.areaEnd()}m&&(w[h]=+e(d,h,l),O[h]=+t(d,h,l),u.point(n?+n(d,h,l):w[h],r?+r(d,h,l):O[h]))}if(x)return u=null,x+""||null}function f(){return Rx().defined(i).curve(o).context(a)}return s.x=function(l){return arguments.length?(e=typeof l=="function"?l:he(+l),n=null,s):e},s.x0=function(l){return arguments.length?(e=typeof l=="function"?l:he(+l),s):e},s.x1=function(l){return arguments.length?(n=l==null?null:typeof l=="function"?l:he(+l),s):n},s.y=function(l){return arguments.length?(t=typeof l=="function"?l:he(+l),r=null,s):t},s.y0=function(l){return arguments.length?(t=typeof l=="function"?l:he(+l),s):t},s.y1=function(l){return arguments.length?(r=l==null?null:typeof l=="function"?l:he(+l),s):r},s.lineX0=s.lineY0=function(){return f().x(e).y(t)},s.lineY1=function(){return f().x(e).y(r)},s.lineX1=function(){return f().x(n).y(t)},s.defined=function(l){return arguments.length?(i=typeof l=="function"?l:he(!!l),s):i},s.curve=function(l){return arguments.length?(o=l,a!=null&&(u=o(a)),s):o},s.context=function(l){return arguments.length?(l==null?a=u=null:u=o(a=l),s):a},s}class Dx{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function vA(e){return new Dx(e,!0)}function yA(e){return new Dx(e,!1)}const Rh={draw(e,t){const r=pt(t/Wi);e.moveTo(r,0),e.arc(0,0,r,0,za)}},gA={draw(e,t){const r=pt(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},Nx=pt(1/3),mA=Nx*2,bA={draw(e,t){const r=pt(t/mA),n=r*Nx;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},xA={draw(e,t){const r=pt(t),n=-r/2;e.rect(n,n,r,r)}},wA=.8908130915292852,qx=Ui(Wi/10)/Ui(7*Wi/10),OA=Ui(za/10)*qx,_A=-Mx(za/10)*qx,AA={draw(e,t){const r=pt(t*wA),n=OA*r,i=_A*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=za*a/5,u=Mx(o),c=Ui(o);e.lineTo(c*r,-u*r),e.lineTo(u*n-c*i,c*n+u*i)}e.closePath()}},Lu=pt(3),SA={draw(e,t){const r=-pt(t/(Lu*3));e.moveTo(0,r*2),e.lineTo(-Lu*r,-r),e.lineTo(Lu*r,-r),e.closePath()}},Je=-.5,Qe=pt(3)/2,ff=1/pt(12),PA=(ff/2+1)*3,TA={draw(e,t){const r=pt(t/PA),n=r/2,i=r*ff,a=n,o=r*ff+r,u=-a,c=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(u,c),e.lineTo(Je*n-Qe*i,Qe*n+Je*i),e.lineTo(Je*a-Qe*o,Qe*a+Je*o),e.lineTo(Je*u-Qe*c,Qe*u+Je*c),e.lineTo(Je*n+Qe*i,Je*i-Qe*n),e.lineTo(Je*a+Qe*o,Je*o-Qe*a),e.lineTo(Je*u+Qe*c,Je*c-Qe*u),e.closePath()}};function EA(e,t){let r=null,n=Ch(i);e=typeof e=="function"?e:he(e||Rh),t=typeof t=="function"?t:he(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:he(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:he(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function zi(){}function Ki(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function Lx(e){this._context=e}Lx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ki(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ki(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function jA(e){return new Lx(e)}function Bx(e){this._context=e}Bx.prototype={areaStart:zi,areaEnd:zi,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Ki(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function MA(e){return new Bx(e)}function Fx(e){this._context=e}Fx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Ki(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function $A(e){return new Fx(e)}function Ux(e){this._context=e}Ux.prototype={areaStart:zi,areaEnd:zi,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function IA(e){return new Ux(e)}function sv(e){return e<0?-1:1}function lv(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),u=(a*i+o*n)/(n+i);return(sv(a)+sv(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(u))||0}function fv(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Bu(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,u=(a-n)/3;e._context.bezierCurveTo(n+u,i+u*t,a-u,o-u*r,a,o)}function Hi(e){this._context=e}Hi.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Bu(this,this._t0,fv(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Bu(this,fv(this,r=lv(this,e,t)),r);break;default:Bu(this,this._t0,r=lv(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Wx(e){this._context=new zx(e)}(Wx.prototype=Object.create(Hi.prototype)).point=function(e,t){Hi.prototype.point.call(this,t,e)};function zx(e){this._context=e}zx.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function CA(e){return new Hi(e)}function kA(e){return new Wx(e)}function Kx(e){this._context=e}Kx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=hv(e),i=hv(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function DA(e){return new Ha(e,.5)}function NA(e){return new Ha(e,0)}function qA(e){return new Ha(e,1)}function Ir(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,u=a.length;r=0;)r[t]=t;return r}function LA(e,t){return e[t]}function BA(e){const t=[];return t.key=e,t}function FA(){var e=he([]),t=hf,r=Ir,n=LA;function i(a){var o=Array.from(e.apply(this,arguments),BA),u,c=o.length,s=-1,f;for(const l of a)for(u=0,++s;u0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function YA(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Hx={symbolCircle:Rh,symbolCross:gA,symbolDiamond:bA,symbolSquare:xA,symbolStar:AA,symbolTriangle:SA,symbolWye:TA},ZA=Math.PI/180,JA=function(t){var r="symbol".concat(Wa(t));return Hx[r]||Rh},QA=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*ZA;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},eS=function(t,r){Hx["symbol".concat(Wa(t))]=r},Dh=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,u=o===void 0?"area":o,c=XA(t,KA),s=dv(dv({},c),{},{type:n,size:a,sizeType:u}),f=function(){var d=JA(n),m=EA().type(d).size(QA(a,u,n));return m()},l=s.className,h=s.cx,p=s.cy,y=K(s,!0);return h===+h&&p===+p&&a===+a?S.createElement("path",pf({},y,{className:te("recharts-symbols",l),transform:"translate(".concat(h,", ").concat(p,")"),d:f()})):null};Dh.registerSymbol=eS;function Cr(e){"@babel/helpers - typeof";return Cr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cr(e)}function df(){return df=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var x=p.inactive?s:p.color;return S.createElement("li",df({className:d,style:l,key:"legend-item-".concat(y)},cr(n.props,p,y)),S.createElement(uf,{width:o,height:o,viewBox:f,style:h},n.renderIcon(p)),S.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},v?v(m,p,y):m))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var u={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return S.createElement("ul",{className:"recharts-default-legend",style:u},this.renderItems())}}])})(N.PureComponent);Nn(Nh,"displayName","Legend");Nn(Nh,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Fu,yv;function lS(){if(yv)return Fu;yv=1;var e=Ba();function t(){this.__data__=new e,this.size=0}return Fu=t,Fu}var Uu,gv;function fS(){if(gv)return Uu;gv=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return Uu=e,Uu}var Wu,mv;function hS(){if(mv)return Wu;mv=1;function e(t){return this.__data__.get(t)}return Wu=e,Wu}var zu,bv;function pS(){if(bv)return zu;bv=1;function e(t){return this.__data__.has(t)}return zu=e,zu}var Ku,xv;function dS(){if(xv)return Ku;xv=1;var e=Ba(),t=Th(),r=Eh(),n=200;function i(a,o){var u=this.__data__;if(u instanceof e){var c=u.__data__;if(!t||c.lengthp))return!1;var v=l.get(o),d=l.get(u);if(v&&d)return v==u&&d==o;var m=-1,x=!0,w=c&i?new e:void 0;for(l.set(o,u),l.set(u,o);++m-1&&n%1==0&&n-1&&r%1==0&&r<=e}return pc=t,pc}var dc,zv;function _S(){if(zv)return dc;zv=1;var e=kt(),t=Kh(),r=ft(),n="[object Arguments]",i="[object Array]",a="[object Boolean]",o="[object Date]",u="[object Error]",c="[object Function]",s="[object Map]",f="[object Number]",l="[object Object]",h="[object RegExp]",p="[object Set]",y="[object String]",v="[object WeakMap]",d="[object ArrayBuffer]",m="[object DataView]",x="[object Float32Array]",w="[object Float64Array]",O="[object Int8Array]",g="[object Int16Array]",b="[object Int32Array]",_="[object Uint8Array]",A="[object Uint8ClampedArray]",P="[object Uint16Array]",j="[object Uint32Array]",T={};T[x]=T[w]=T[O]=T[g]=T[b]=T[_]=T[A]=T[P]=T[j]=!0,T[n]=T[i]=T[d]=T[a]=T[m]=T[o]=T[u]=T[c]=T[s]=T[f]=T[l]=T[h]=T[p]=T[y]=T[v]=!1;function E(M){return r(M)&&t(M.length)&&!!T[e(M)]}return dc=E,dc}var vc,Kv;function Ga(){if(Kv)return vc;Kv=1;function e(t){return function(r){return t(r)}}return vc=e,vc}var Pn={exports:{}};Pn.exports;var Hv;function Hh(){return Hv||(Hv=1,(function(e,t){var r=Ox(),n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,u=(function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}})();e.exports=u})(Pn,Pn.exports)),Pn.exports}var yc,Gv;function rw(){if(Gv)return yc;Gv=1;var e=_S(),t=Ga(),r=Hh(),n=r&&r.isTypedArray,i=n?t(n):e;return yc=i,yc}var gc,Vv;function nw(){if(Vv)return gc;Vv=1;var e=xS(),t=Uh(),r=Fe(),n=Wh(),i=zh(),a=rw(),o=Object.prototype,u=o.hasOwnProperty;function c(s,f){var l=r(s),h=!l&&t(s),p=!l&&!h&&n(s),y=!l&&!h&&!p&&a(s),v=l||h||p||y,d=v?e(s.length,String):[],m=d.length;for(var x in s)(f||u.call(s,x))&&!(v&&(x=="length"||p&&(x=="offset"||x=="parent")||y&&(x=="buffer"||x=="byteLength"||x=="byteOffset")||i(x,m)))&&d.push(x);return d}return gc=c,gc}var mc,Xv;function Gh(){if(Xv)return mc;Xv=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||e;return r===i}return mc=t,mc}var bc,Yv;function iw(){if(Yv)return bc;Yv=1;function e(t,r){return function(n){return t(r(n))}}return bc=e,bc}var xc,Zv;function AS(){if(Zv)return xc;Zv=1;var e=iw(),t=e(Object.keys,Object);return xc=t,xc}var wc,Jv;function SS(){if(Jv)return wc;Jv=1;var e=Gh(),t=AS(),r=Object.prototype,n=r.hasOwnProperty;function i(a){if(!e(a))return t(a);var o=[];for(var u in Object(a))n.call(a,u)&&u!="constructor"&&o.push(u);return o}return wc=i,wc}var Oc,Qv;function cn(){if(Qv)return Oc;Qv=1;var e=Ph(),t=Kh();function r(n){return n!=null&&t(n.length)&&!e(n)}return Oc=r,Oc}var _c,ey;function sn(){if(ey)return _c;ey=1;var e=nw(),t=SS(),r=cn();function n(i){return r(i)?e(i):t(i)}return _c=n,_c}var Ac,ty;function aw(){if(ty)return Ac;ty=1;var e=ew(),t=Fh(),r=sn();function n(i){return e(i,r,t)}return Ac=n,Ac}var Sc,ry;function PS(){if(ry)return Sc;ry=1;var e=aw(),t=1,r=Object.prototype,n=r.hasOwnProperty;function i(a,o,u,c,s,f){var l=u&t,h=e(a),p=h.length,y=e(o),v=y.length;if(p!=v&&!l)return!1;for(var d=p;d--;){var m=h[d];if(!(l?m in o:n.call(o,m)))return!1}var x=f.get(a),w=f.get(o);if(x&&w)return x==o&&w==a;var O=!0;f.set(a,o),f.set(o,a);for(var g=l;++d-1}return Zc=t,Zc}var Jc,jy;function KS(){if(jy)return Jc;jy=1;function e(t,r,n){for(var i=-1,a=t==null?0:t.length;++i=o){var m=s?null:i(c);if(m)return a(m);y=!1,h=n,d=new e}else d=s?[]:v;e:for(;++l=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function oP(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function uP(e){return e.value}function cP(e,t){if(S.isValidElement(e))return S.cloneElement(e,t);if(typeof e=="function")return S.createElement(e,t);t.ref;var r=aP(t,ZS);return S.createElement(Nh,r)}var Ny=1,jr=(function(e){function t(){var r;JS(this,t);for(var n=arguments.length,i=new Array(n),a=0;aNy||Math.abs(i.height-this.lastBoundingBox.height)>Ny)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Ot({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,u=i.verticalAlign,c=i.margin,s=i.chartWidth,f=i.chartHeight,l,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var p=this.getBBoxSnapshot();l={left:((s||0)-p.width)/2}}else l=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(u==="middle"){var y=this.getBBoxSnapshot();h={top:((f||0)-y.height)/2}}else h=u==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Ot(Ot({},l),h)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,u=i.height,c=i.wrapperStyle,s=i.payloadUniqBy,f=i.payload,l=Ot(Ot({position:"absolute",width:o||"auto",height:u||"auto"},this.getDefaultPosition(c)),c);return S.createElement("div",{className:"recharts-legend-wrapper",style:l,ref:function(p){n.wrapperNode=p}},cP(a,Ot(Ot({},this.props),{},{payload:lw(f,s,uP)})))}}],[{key:"getWithHeight",value:function(n,i){var a=Ot(Ot({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&q(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])})(N.PureComponent);Xa(jr,"displayName","Legend");Xa(jr,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var ns,qy;function sP(){if(qy)return ns;qy=1;var e=nn(),t=Uh(),r=Fe(),n=e?e.isConcatSpreadable:void 0;function i(a){return r(a)||t(a)||!!(n&&a&&a[n])}return ns=i,ns}var is,Ly;function Xh(){if(Ly)return is;Ly=1;var e=Bh(),t=sP();function r(n,i,a,o,u){var c=-1,s=n.length;for(a||(a=t),u||(u=[]);++c0&&a(f)?i>1?r(f,i-1,a,o,u):e(u,f):o||(u[u.length]=f)}return u}return is=r,is}var as,By;function lP(){if(By)return as;By=1;function e(t){return function(r,n,i){for(var a=-1,o=Object(r),u=i(r),c=u.length;c--;){var s=u[t?c:++a];if(n(o[s],s,o)===!1)break}return r}}return as=e,as}var os,Fy;function fP(){if(Fy)return os;Fy=1;var e=lP(),t=e();return os=t,os}var us,Uy;function pw(){if(Uy)return us;Uy=1;var e=fP(),t=sn();function r(n,i){return n&&e(n,i,t)}return us=r,us}var cs,Wy;function hP(){if(Wy)return cs;Wy=1;var e=cn();function t(r,n){return function(i,a){if(i==null)return i;if(!e(i))return r(i,a);for(var o=i.length,u=n?o:-1,c=Object(i);(n?u--:++un||u&&c&&f&&!s&&!l||a&&c&&f||!i&&f||!o)return 1;if(!a&&!u&&!l&&r=s)return f;var l=i[a];return f*(l=="desc"?-1:1)}}return r.index-n.index}return ps=t,ps}var ds,Xy;function yP(){if(Xy)return ds;Xy=1;var e=jh(),t=Mh(),r=xt(),n=dw(),i=pP(),a=Ga(),o=vP(),u=ln(),c=Fe();function s(f,l,h){l.length?l=e(l,function(v){return c(v)?function(d){return t(d,v.length===1?v[0]:v)}:v}):l=[u];var p=-1;l=e(l,a(r));var y=n(f,function(v,d,m){var x=e(l,function(w){return w(v)});return{criteria:x,index:++p,value:v}});return i(y,function(v,d){return o(v,d,h)})}return ds=s,ds}var vs,Yy;function gP(){if(Yy)return vs;Yy=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return vs=e,vs}var ys,Zy;function vw(){if(Zy)return ys;Zy=1;var e=gP(),t=Math.max;function r(n,i,a){return i=t(i===void 0?n.length-1:i,0),function(){for(var o=arguments,u=-1,c=t(o.length-i,0),s=Array(c);++u0){if(++a>=e)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return xs=n,xs}var ws,rg;function gw(){if(rg)return ws;rg=1;var e=bP(),t=xP(),r=t(e);return ws=r,ws}var Os,ng;function wP(){if(ng)return Os;ng=1;var e=ln(),t=vw(),r=gw();function n(i,a){return r(t(i,a,e),i+"")}return Os=n,Os}var _s,ig;function Ya(){if(ig)return _s;ig=1;var e=qa(),t=cn(),r=zh(),n=ht();function i(a,o,u){if(!n(u))return!1;var c=typeof o;return(c=="number"?t(u)&&r(o,u.length):c=="string"&&o in u)?e(u[o],a):!1}return _s=i,_s}var As,ag;function OP(){if(ag)return As;ag=1;var e=Xh(),t=yP(),r=wP(),n=Ya(),i=r(function(a,o){if(a==null)return[];var u=o.length;return u>1&&n(a,o[0],o[1])?o=[]:u>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),t(a,e(o,1),[])});return As=i,As}var _P=OP();const Zh=ce(_P);function qn(e){"@babel/helpers - typeof";return qn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qn(e)}function gf(){return gf=Object.assign?Object.assign.bind():function(e){for(var t=1;tt.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),M=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,c,o)=>o?o.toUpperCase():c.toLowerCase()),d=t=>{const a=M(t);return a.charAt(0).toUpperCase()+a.slice(1)},r=(...t)=>t.filter((a,c,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===c).join(" ").trim(),v=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};var m={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const x=s.forwardRef(({color:t="currentColor",size:a=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:y="",children:n,iconNode:k,...h},p)=>s.createElement("svg",{ref:p,...m,width:a,height:a,stroke:t,strokeWidth:o?Number(c)*24/Number(a):c,className:r("lucide",y),...!n&&!v(h)&&{"aria-hidden":"true"},...h},[...k.map(([i,l])=>s.createElement(i,l)),...Array.isArray(n)?n:[n]]));const e=(t,a)=>{const c=s.forwardRef(({className:o,...y},n)=>s.createElement(x,{ref:n,iconNode:a,className:r(`lucide-${_(d(t))}`,`lucide-${t}`,o),...y}));return c.displayName=d(t),c};const u=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],e2=e("activity",u);const g=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],a2=e("arrow-left",g);const f=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],t2=e("arrow-right",f);const $=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],c2=e("ban",$);const N=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],o2=e("book-open",N);const w=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],n2=e("bot",w);const z=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],s2=e("boxes",z);const b=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],y2=e("bug",b);const q=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],h2=e("calendar",q);const C=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],d2=e("chart-column",C);const j=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],r2=e("check",j);const V=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],k2=e("chevron-down",V);const A=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],p2=e("chevron-left",A);const H=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],i2=e("chevron-right",H);const L=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],l2=e("chevron-up",L);const S=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],_2=e("chevrons-left",S);const P=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],M2=e("chevrons-right",P);const U=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],v2=e("chevrons-up-down",U);const T=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],m2=e("circle-alert",T);const Z=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],x2=e("circle-check",Z);const R=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],u2=e("circle-question-mark",R);const B=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],g2=e("circle-user",B);const E=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],f2=e("circle-x",E);const D=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],$2=e("circle",D);const F=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],N2=e("clock",F);const O=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],w2=e("code-xml",O);const I=[["path",{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z",key:"1t2lqe"}],["path",{d:"M10 21.9V14L2.1 9.1",key:"o7czzq"}],["path",{d:"m10 14 11.9-6.9",key:"zm5e20"}],["path",{d:"M14 19.8v-8.1",key:"159ecu"}],["path",{d:"M18 17.5V9.4",key:"11uown"}]],z2=e("container",I);const G=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],b2=e("copy",G);const K=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],q2=e("database",K);const W=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],C2=e("dollar-sign",W);const X=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],j2=e("download",X);const Q=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],V2=e("external-link",Q);const J=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],A2=e("eye-off",J);const Y=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],H2=e("eye",Y);const e1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]],L2=e("file-search",e1);const a1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],S2=e("file-text",a1);const t1=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],P2=e("folder-open",t1);const c1=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],U2=e("funnel",c1);const o1=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],T2=e("graduation-cap",o1);const n1=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Z2=e("grip-vertical",n1);const s1=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],R2=e("hash",s1);const y1=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],B2=e("house",y1);const h1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],E2=e("info",h1);const d1=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],D2=e("key",d1);const r1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],F2=e("loader-circle",r1);const k1=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],O2=e("lock",k1);const p1=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],I2=e("log-out",p1);const i1=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],G2=e("menu",i1);const l1=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],K2=e("message-square",l1);const _1=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],W2=e("moon",_1);const M1=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],X2=e("network",M1);const v1=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Q2=e("package",v1);const m1=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],J2=e("palette",m1);const x1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],Y2=e("panels-top-left",x1);const u1=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],e0=e("pause",u1);const g1=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],a0=e("pencil",g1);const f1=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],t0=e("play",f1);const $1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],c0=e("plus",$1);const N1=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],o0=e("power",N1);const w1=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],n0=e("refresh-cw",w1);const z1=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],s0=e("rotate-ccw",z1);const b1=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],y0=e("rotate-cw",b1);const q1=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],h0=e("save",q1);const C1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],d0=e("search",C1);const j1=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],r0=e("server",j1);const V1=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],k0=e("settings-2",V1);const A1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],p0=e("settings",A1);const H1=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],i0=e("shield",H1);const L1=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],l0=e("skip-forward",L1);const S1=[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],_0=e("sliders-vertical",S1);const P1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],M0=e("smile",P1);const U1=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],v0=e("sparkles",U1);const T1=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],m0=e("square-pen",T1);const Z1=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],x0=e("star",Z1);const R1=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],u0=e("sun",R1);const B1=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],g0=e("terminal",B1);const E1=[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]],f0=e("thumbs-up",E1);const D1=[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]],$0=e("thumbs-down",D1);const F1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],N0=e("trash-2",F1);const O1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],w0=e("trending-up",O1);const I1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],z0=e("triangle-alert",I1);const G1=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],b0=e("type",G1);const K1=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],q0=e("upload",K1);const W1=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],C0=e("user",W1);const X1=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],j0=e("users",X1);const Q1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],V0=e("x",Q1);const J1=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],A0=e("zap",J1);export{M2 as $,e2 as A,n2 as B,N2 as C,C2 as D,A2 as E,S2 as F,h0 as G,B2 as H,E2 as I,o0 as J,D2 as K,O2 as L,K2 as M,c0 as N,N0 as O,J2 as P,L2 as Q,n0 as R,i0 as S,w0 as T,C0 as U,a0 as V,_2 as W,V0 as X,p2 as Y,A0 as Z,i2 as _,q2 as a,v2 as a0,Z2 as a1,T2 as a2,z2 as a3,Q2 as a4,q0 as a5,P2 as a6,j2 as a7,U2 as a8,m0 as a9,c2 as aa,R2 as ab,j0 as ac,X2 as ad,h2 as ae,e0 as af,t0 as ag,b0 as ah,x0 as ai,f0 as aj,$0 as ak,k0 as al,r0 as am,s2 as an,g2 as ao,d2 as ap,$2 as aq,_0 as ar,G2 as as,o2 as at,I2 as au,y0 as av,y2 as aw,p0 as b,z0 as c,r2 as d,b2 as e,H2 as f,x2 as g,f2 as h,s0 as i,u0 as j,W2 as k,m2 as l,u2 as m,g0 as n,V2 as o,F2 as p,v0 as q,M0 as r,l0 as s,t2 as t,d0 as u,a2 as v,k2 as w,l2 as x,Y2 as y,w2 as z}; diff --git a/webui/dist/assets/icons-wa0wi-vG.js b/webui/dist/assets/icons-wa0wi-vG.js new file mode 100644 index 00000000..9add2cce --- /dev/null +++ b/webui/dist/assets/icons-wa0wi-vG.js @@ -0,0 +1 @@ +import{r as s}from"./router-DQNkr8RI.js";const _=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),M=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,c,o)=>o?o.toUpperCase():c.toLowerCase()),d=t=>{const a=M(t);return a.charAt(0).toUpperCase()+a.slice(1)},k=(...t)=>t.filter((a,c,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===c).join(" ").trim(),m=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};var v={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const x=s.forwardRef(({color:t="currentColor",size:a=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:y="",children:n,iconNode:r,...h},p)=>s.createElement("svg",{ref:p,...v,width:a,height:a,stroke:t,strokeWidth:o?Number(c)*24/Number(a):c,className:k("lucide",y),...!n&&!m(h)&&{"aria-hidden":"true"},...h},[...r.map(([i,l])=>s.createElement(i,l)),...Array.isArray(n)?n:[n]]));const e=(t,a)=>{const c=s.forwardRef(({className:o,...y},n)=>s.createElement(x,{ref:n,iconNode:a,className:k(`lucide-${_(d(t))}`,`lucide-${t}`,o),...y}));return c.displayName=d(t),c};const f=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],o2=e("activity",f);const u=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],n2=e("arrow-left",u);const g=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],s2=e("arrow-right",g);const $=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],y2=e("ban",$);const N=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],h2=e("book-open",N);const w=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],d2=e("bot",w);const z=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],k2=e("boxes",z);const b=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],r2=e("bug",b);const q=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],p2=e("calendar",q);const j=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],i2=e("chart-column",j);const C=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],l2=e("check",C);const V=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],_2=e("chevron-down",V);const A=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],M2=e("chevron-left",A);const H=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],m2=e("chevron-right",H);const L=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],v2=e("chevron-up",L);const S=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],x2=e("chevrons-left",S);const P=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],f2=e("chevrons-right",P);const U=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],u2=e("chevrons-up-down",U);const T=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],g2=e("circle-alert",T);const Z=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],$2=e("circle-check",Z);const R=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],N2=e("circle-question-mark",R);const B=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],w2=e("circle-user",B);const E=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],z2=e("circle-x",E);const D=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],b2=e("circle",D);const O=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],q2=e("clock",O);const F=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],j2=e("code-xml",F);const W=[["path",{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z",key:"1t2lqe"}],["path",{d:"M10 21.9V14L2.1 9.1",key:"o7czzq"}],["path",{d:"m10 14 11.9-6.9",key:"zm5e20"}],["path",{d:"M14 19.8v-8.1",key:"159ecu"}],["path",{d:"M18 17.5V9.4",key:"11uown"}]],C2=e("container",W);const I=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],V2=e("copy",I);const G=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],A2=e("database",G);const K=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],H2=e("dollar-sign",K);const X=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],L2=e("download",X);const Q=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],S2=e("external-link",Q);const J=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],P2=e("eye-off",J);const Y=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],U2=e("eye",Y);const e1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]],T2=e("file-search",e1);const a1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Z2=e("file-text",a1);const t1=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],R2=e("folder-open",t1);const c1=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],B2=e("funnel",c1);const o1=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],E2=e("graduation-cap",o1);const n1=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],D2=e("grip-vertical",n1);const s1=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],O2=e("hash",s1);const y1=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],F2=e("house",y1);const h1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],W2=e("info",h1);const d1=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],I2=e("key",d1);const k1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],G2=e("loader-circle",k1);const r1=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],K2=e("lock",r1);const p1=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],X2=e("log-out",p1);const i1=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Q2=e("menu",i1);const l1=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],J2=e("message-square",l1);const _1=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Y2=e("moon",_1);const M1=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],e0=e("network",M1);const m1=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],a0=e("package",m1);const v1=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],t0=e("palette",v1);const x1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],c0=e("panels-top-left",x1);const f1=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],o0=e("pause",f1);const u1=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],n0=e("pen",u1);const g1=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],s0=e("pencil",g1);const $1=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],y0=e("play",$1);const N1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],h0=e("plus",N1);const w1=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],d0=e("power",w1);const z1=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],k0=e("refresh-cw",z1);const b1=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],r0=e("rotate-ccw",b1);const q1=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],p0=e("rotate-cw",q1);const j1=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],i0=e("save",j1);const C1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],l0=e("search",C1);const V1=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],_0=e("send",V1);const A1=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],M0=e("server",A1);const H1=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],m0=e("settings-2",H1);const L1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],v0=e("settings",L1);const S1=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],x0=e("shield",S1);const P1=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],f0=e("skip-forward",P1);const U1=[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],u0=e("sliders-vertical",U1);const T1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],g0=e("smile",T1);const Z1=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],$0=e("sparkles",Z1);const R1=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],N0=e("square-pen",R1);const B1=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],w0=e("star",B1);const E1=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],z0=e("sun",E1);const D1=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],b0=e("terminal",D1);const O1=[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]],q0=e("thumbs-up",O1);const F1=[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]],j0=e("thumbs-down",F1);const W1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],C0=e("trash-2",W1);const I1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],V0=e("trending-up",I1);const G1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],A0=e("triangle-alert",G1);const K1=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],H0=e("type",K1);const X1=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],L0=e("upload",X1);const Q1=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],S0=e("user",Q1);const J1=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],P0=e("users",J1);const Y1=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],U0=e("wifi-off",Y1);const e2=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],T0=e("wifi",e2);const a2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Z0=e("x",a2);const t2=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],R0=e("zap",t2);export{f2 as $,o2 as A,d2 as B,q2 as C,H2 as D,P2 as E,Z2 as F,i0 as G,F2 as H,W2 as I,d0 as J,I2 as K,K2 as L,J2 as M,h0 as N,C0 as O,t0 as P,T2 as Q,k0 as R,x0 as S,V0 as T,S0 as U,s0 as V,x2 as W,Z0 as X,M2 as Y,R0 as Z,m2 as _,A2 as a,u2 as a0,D2 as a1,E2 as a2,C2 as a3,a0 as a4,L0 as a5,R2 as a6,L2 as a7,B2 as a8,N0 as a9,r2 as aA,y2 as aa,O2 as ab,P0 as ac,e0 as ad,p2 as ae,o0 as af,y0 as ag,H0 as ah,w0 as ai,q0 as aj,j0 as ak,m0 as al,T0 as am,U0 as an,n0 as ao,_0 as ap,M0 as aq,k2 as ar,w2 as as,i2 as at,b2 as au,u0 as av,Q2 as aw,h2 as ax,X2 as ay,p0 as az,v0 as b,A0 as c,l2 as d,V2 as e,U2 as f,$2 as g,z2 as h,r0 as i,z0 as j,Y2 as k,g2 as l,N2 as m,b0 as n,S2 as o,G2 as p,$0 as q,g0 as r,f0 as s,s2 as t,l0 as u,n2 as v,_2 as w,v2 as x,c0 as y,j2 as z}; diff --git a/webui/dist/assets/index-Bzl8QBn9.css b/webui/dist/assets/index-Bzl8QBn9.css deleted file mode 100644 index f43286e9..00000000 --- a/webui/dist/assets/index-Bzl8QBn9.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 221.2 83.2% 53.3%;--primary-foreground: 210 40% 98%;--primary-gradient: none;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 221.2 83.2% 53.3%;--radius: .5rem;--chart-1: 221.2 83.2% 53.3%;--chart-2: 160 60% 45%;--chart-3: 30 80% 55%;--chart-4: 280 65% 60%;--chart-5: 340 75% 55%}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 217.2 91.2% 59.8%;--primary-foreground: 222.2 47.4% 11.2%;--primary-gradient: none;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 224.3 76.3% 48%;--chart-1: 217.2 91.2% 59.8%;--chart-2: 160 60% 50%;--chart-3: 30 80% 60%;--chart-4: 280 65% 65%;--chart-5: 340 75% 60%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield;-webkit-appearance:textfield;appearance:textfield}.\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.bottom-1\/4{bottom:25%}.bottom-4{bottom:1rem}.left-0{left:0}.left-1{left:.25rem}.left-1\/2{left:50%}.left-1\/4{left:25%}.left-2{left:.5rem}.left-2\.5{left:.625rem}.left-3{left:.75rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-1{right:.25rem}.right-1\.5{right:.375rem}.right-1\/4{right:25%}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-1\/4{top:25%}.top-2{top:.5rem}.top-2\.5{top:.625rem}.top-3{top:.75rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.order-1{order:1}.order-2{order:2}.col-span-2{grid-column:span 2 / span 2}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.-mt-2{margin-top:-.5rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-12{margin-top:3rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-auto{aspect-ratio:auto}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.size-4{width:1rem;height:1rem}.size-\[--cell-size\]{width:var(--cell-size);height:var(--cell-size)}.h-0\.5{height:.125rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[--cell-size\]{height:var(--cell-size)}.h-\[1\.25rem\]{height:1.25rem}.h-\[1px\]{height:1px}.h-\[200px\]{height:200px}.h-\[250px\]{height:250px}.h-\[280px\]{height:280px}.h-\[300px\]{height:300px}.h-\[400px\]{height:400px}.h-\[calc\(100vh-200px\)\]{height:calc(100vh - 200px)}.h-\[calc\(100vh-240px\)\]{height:calc(100vh - 240px)}.h-\[calc\(100vh-260px\)\]{height:calc(100vh - 260px)}.h-\[calc\(100vh-4rem\)\]{height:calc(100vh - 4rem)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\[--radix-context-menu-content-available-height\]{max-height:var(--radix-context-menu-content-available-height)}.max-h-\[--radix-select-content-available-height\]{max-height:var(--radix-select-content-available-height)}.max-h-\[300px\]{max-height:300px}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(90vh-120px\)\]{max-height:calc(90vh - 120px)}.max-h-\[calc\(90vh-8rem\)\]{max-height:calc(90vh - 8rem)}.max-h-none{max-height:none}.max-h-screen{max-height:100vh}.min-h-0{min-height:0px}.min-h-10{min-height:2.5rem}.min-h-\[100px\]{min-height:100px}.min-h-\[300px\]{min-height:300px}.min-h-\[60px\]{min-height:60px}.min-h-screen{min-height:100vh}.w-0{width:0px}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\[--cell-size\]{width:var(--cell-size)}.w-\[100px\]{width:100px}.w-\[120px\]{width:120px}.w-\[130px\]{width:130px}.w-\[1px\]{width:1px}.w-\[65px\]{width:65px}.w-\[95vw\]{width:95vw}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-\[--cell-size\]{min-width:var(--cell-size)}.min-w-\[100px\]{min-width:100px}.min-w-\[120px\]{min-width:120px}.min-w-\[80px\]{min-width:80px}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.min-w-full{min-width:100%}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-\[150px\]{max-width:150px}.max-w-\[200px\]{max-width:200px}.max-w-\[60px\]{max-width:60px}.max-w-\[95vw\]{max-width:95vw}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.origin-\[--radix-context-menu-content-transform-origin\]{transform-origin:var(--radix-context-menu-content-transform-origin)}.origin-\[--radix-popover-content-transform-origin\]{transform-origin:var(--radix-popover-content-transform-origin)}.origin-\[--radix-select-content-transform-origin\]{transform-origin:var(--radix-select-content-transform-origin)}.origin-\[--radix-tooltip-content-transform-origin\]{transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-move{cursor:move}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize{resize:both}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-l-md{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.rounded-r-md{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-4{border-width:4px}.border-\[1\.5px\]{border-width:1.5px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[--color-border\]{border-color:var(--color-border)}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-amber-500\/50{border-color:#f59e0b80}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-700{--tw-border-opacity: 1;border-color:rgb(29 78 216 / var(--tw-border-opacity, 1))}.border-border{border-color:hsl(var(--border))}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-current{border-color:currentColor}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-green-700{--tw-border-opacity: 1;border-color:rgb(21 128 61 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-muted{border-color:hsl(var(--muted))}.border-muted-foreground\/30{border-color:hsl(var(--muted-foreground) / .3)}.border-muted-foreground\/50{border-color:hsl(var(--muted-foreground) / .5)}.border-orange-600{--tw-border-opacity: 1;border-color:rgb(234 88 12 / var(--tw-border-opacity, 1))}.border-primary{border-color:hsl(var(--primary))}.border-primary\/20{border-color:hsl(var(--primary) / .2)}.border-primary\/30{border-color:hsl(var(--primary) / .3)}.border-primary\/50{border-color:hsl(var(--primary) / .5)}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-red-500\/50{border-color:#ef444480}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.border-yellow-500\/50{border-color:#eab30880}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\[--color-bg\]{background-color:var(--color-bg)}.bg-accent{background-color:hsl(var(--accent))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500\/10{background-color:#f59e0b1a}.bg-background{background-color:hsl(var(--background))}.bg-background\/50{background-color:hsl(var(--background) / .5)}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-background\/95{background-color:hsl(var(--background) / .95)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/50{background-color:#00000080}.bg-black\/80{background-color:#000c}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-900\/20{background-color:#1e3a8a33}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-card\/80{background-color:hsl(var(--card) / .8)}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-gray-800\/20{background-color:#1f293733}.bg-gray-800\/30{background-color:#1f29374d}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/20{background-color:hsl(var(--muted) / .2)}.bg-muted\/30{background-color:hsl(var(--muted) / .3)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-orange-50{--tw-bg-opacity: 1;background-color:rgb(255 247 237 / var(--tw-bg-opacity, 1))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-orange-600{--tw-bg-opacity: 1;background-color:rgb(234 88 12 / var(--tw-bg-opacity, 1))}.bg-pink-500{--tw-bg-opacity: 1;background-color:rgb(236 72 153 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/5{background-color:hsl(var(--primary) / .05)}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-red-900\/20{background-color:#7f1d1d33}.bg-red-900\/30{background-color:#7f1d1d4d}.bg-secondary{background-color:hsl(var(--secondary))}.bg-secondary\/5{background-color:hsl(var(--secondary) / .05)}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-300{--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}.bg-slate-400{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.bg-slate-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/10{background-color:#eab3081a}.bg-yellow-500\/5{background-color:#eab3080d}.bg-yellow-900\/20{background-color:#713f1233}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-500{--tw-gradient-from: #22c55e var(--tw-gradient-from-position);--tw-gradient-to: rgb(34 197 94 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-indigo-500{--tw-gradient-from: #6366f1 var(--tw-gradient-from-position);--tw-gradient-to: rgb(99 102 241 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-orange-500{--tw-gradient-from: #f97316 var(--tw-gradient-from-position);--tw-gradient-to: rgb(249 115 22 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary\/5{--tw-gradient-from: hsl(var(--primary) / .05) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from: #a855f7 var(--tw-gradient-from-position);--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-500{--tw-gradient-from: #ef4444 var(--tw-gradient-from-position);--tw-gradient-to: rgb(239 68 68 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-200{--tw-gradient-from: #e2e8f0 var(--tw-gradient-from-position);--tw-gradient-to: rgb(226 232 240 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-300{--tw-gradient-from: #cbd5e1 var(--tw-gradient-from-position);--tw-gradient-to: rgb(203 213 225 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-400{--tw-gradient-from: #94a3b8 var(--tw-gradient-from-position);--tw-gradient-to: rgb(148 163 184 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-background{--tw-gradient-to: hsl(var(--background) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--background)) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-blue-600{--tw-gradient-to: #2563eb var(--tw-gradient-to-position)}.to-cyan-500{--tw-gradient-to: #06b6d4 var(--tw-gradient-to-position)}.to-emerald-500{--tw-gradient-to: #10b981 var(--tw-gradient-to-position)}.to-green-600{--tw-gradient-to: #16a34a var(--tw-gradient-to-position)}.to-orange-500{--tw-gradient-to: #f97316 var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to: #ec4899 var(--tw-gradient-to-position)}.to-primary\/10{--tw-gradient-to: hsl(var(--primary) / .1) var(--tw-gradient-to-position)}.to-purple-500{--tw-gradient-to: #a855f7 var(--tw-gradient-to-position)}.to-secondary\/5{--tw-gradient-to: hsl(var(--secondary) / .05) var(--tw-gradient-to-position)}.to-slate-700{--tw-gradient-to: #334155 var(--tw-gradient-to-position)}.to-slate-800{--tw-gradient-to: #1e293b var(--tw-gradient-to-position)}.to-slate-900{--tw-gradient-to: #0f172a var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.fill-yellow-400{fill:#facc15}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\[--cell-size\]{padding-left:var(--cell-size);padding-right:var(--cell-size)}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-0{padding-bottom:0}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pl-10{padding-left:2.5rem}.pl-11{padding-left:2.75rem}.pl-2{padding-left:.5rem}.pl-4{padding-left:1rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-10{padding-right:2.5rem}.pr-16{padding-right:4rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pr-6{padding-right:1.5rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[0\.8rem\]{font-size:.8rem}.text-\[10px\]{font-size:10px}.text-\[150px\]{font-size:150px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-black{font-weight:900}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.tracking-tight{letter-spacing:-.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/50{color:hsl(var(--muted-foreground) / .5)}.text-muted-foreground\/60{color:hsl(var(--muted-foreground) / .6)}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-orange-900{--tw-text-opacity: 1;color:rgb(124 45 18 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-primary\/10{color:hsl(var(--primary) / .1)}.text-primary\/30{color:hsl(var(--primary) / .3)}.text-primary\/60{color:hsl(var(--primary) / .6)}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.text-yellow-900{--tw-text-opacity: 1;color:rgb(113 63 18 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-primary{--tw-ring-color: hsl(var(--primary))}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.blur-3xl{--tw-blur: blur(64px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-xl{--tw-backdrop-blur: blur(24px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.text-primary-gradient{color:hsl(var(--primary))}.has-gradient .text-primary-gradient{background:var(--primary-gradient);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent}.\[--cell-size\:2rem\]{--cell-size: 2rem}.no-animations *,.no-animations *:before,.no-animations *:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}.no-animations *:hover{transition-duration:.01ms!important}::view-transition-old(root),::view-transition-new(root){animation:none;mix-blend-mode:normal}::view-transition-old(root){z-index:1}::view-transition-new(root){z-index:999}.__floater{z-index:99999!important;pointer-events:auto!important}.react-joyride__overlay,.react-joyride__spotlight{z-index:99998!important}.react-joyride__tooltip{pointer-events:auto!important}#tour-portal-container *{pointer-events:auto}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:border-primary\/50:hover{border-color:hsl(var(--primary) / .5)}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-accent\/50:hover{background-color:hsl(var(--accent) / .5)}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-orange-700:hover{--tw-bg-opacity: 1;background-color:rgb(194 65 12 / var(--tw-bg-opacity, 1))}.hover\:bg-primary\/10:hover{background-color:hsl(var(--primary) / .1)}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-secondary\/90:hover{background-color:hsl(var(--secondary) / .9)}.hover\:bg-transparent:hover{background-color:transparent}.hover\:bg-white\/5:hover{background-color:#ffffff0d}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-green-700:hover{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.hover\:text-orange-700:hover{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.hover\:text-primary\/80:hover{color:hsl(var(--primary) / .8)}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.hover\:text-yellow-300:hover{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.hover\:text-yellow-800:hover{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:ring-2:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.hover\:ring-primary:hover{--tw-ring-color: hsl(var(--primary))}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:bg-gray-100:focus{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-0:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-red-500:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.active\:cursor-grabbing:active{cursor:grabbing}.active\:border-primary\/70:active{border-color:hsl(var(--primary) / .7)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group[open] .group-open\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:opacity-100{opacity:1}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.destructive .group-\[\.destructive\]\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-selected\:text-muted-foreground[aria-selected=true]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked],.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes fade-out{0%{opacity:1}to{opacity:0}}.data-\[state\=closed\]\:animate-fade-out[data-state=closed]{animation:fade-out .15s ease-in}.data-\[state\=closed\]\:animate-slide-out-to-right[data-state=closed]{animation:slide-out-to-right .2s ease-in}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.data-\[state\=open\]\:animate-fade-in[data-state=open]{animation:fade-in .2s ease-out}@keyframes slide-in-from-right{0%{transform:translate(100%)}to{transform:translate(0)}}.data-\[state\=open\]\:animate-slide-in-from-right[data-state=open]{animation:slide-in-from-right .3s ease-out}@keyframes slide-out-to-right{0%{transform:translate(0)}to{transform:translate(100%)}}.data-\[swipe\=end\]\:animate-slide-out-to-right[data-swipe=end]{animation:slide-out-to-right .2s ease-in}.data-\[range-end\=true\]\:rounded-md[data-range-end=true]{border-radius:calc(var(--radius) - 2px)}.data-\[range-middle\=true\]\:rounded-none[data-range-middle=true]{border-radius:0}.data-\[range-start\=true\]\:rounded-md[data-range-start=true]{border-radius:calc(var(--radius) - 2px)}.data-\[selected\=true\]\:rounded-none[data-selected=true]{border-radius:0}.data-\[range-end\=true\]\:bg-primary[data-range-end=true]{background-color:hsl(var(--primary))}.data-\[range-middle\=true\]\:bg-accent[data-range-middle=true]{background-color:hsl(var(--accent))}.data-\[range-start\=true\]\:bg-primary[data-range-start=true],.data-\[selected-single\=true\]\:bg-primary[data-selected-single=true]{background-color:hsl(var(--primary))}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:hsl(var(--muted-foreground))}.data-\[range-end\=true\]\:text-primary-foreground[data-range-end=true]{color:hsl(var(--primary-foreground))}.data-\[range-middle\=true\]\:text-accent-foreground[data-range-middle=true]{color:hsl(var(--accent-foreground))}.data-\[range-start\=true\]\:text-primary-foreground[data-range-start=true],.data-\[selected-single\=true\]\:text-primary-foreground[data-selected-single=true]{color:hsl(var(--primary-foreground))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:hsl(var(--accent-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=active\]\:duration-300[data-state=active]{transition-duration:.3s}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:relative{position:relative}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:z-10{z-index:10}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:border-ring{border-color:hsl(var(--ring))}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:ring-\[3px\]{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:ring-ring\/50{--tw-ring-color: hsl(var(--ring) / .5)}.dark\:border-amber-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(146 64 14 / var(--tw-border-opacity, 1))}.dark\:border-blue-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 64 175 / var(--tw-border-opacity, 1))}.dark\:border-blue-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 58 138 / var(--tw-border-opacity, 1))}.dark\:border-gray-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(17 24 39 / var(--tw-border-opacity, 1))}.dark\:border-green-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(22 101 52 / var(--tw-border-opacity, 1))}.dark\:border-yellow-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(113 63 18 / var(--tw-border-opacity, 1))}.dark\:bg-amber-950\/30:is(.dark *){background-color:#451a034d}.dark\:bg-blue-500\/20:is(.dark *){background-color:#3b82f633}.dark\:bg-blue-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(23 37 84 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-950\/20:is(.dark *){background-color:#17255433}.dark\:bg-blue-950\/30:is(.dark *){background-color:#1725544d}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800\/30:is(.dark *){background-color:#1f29374d}.dark\:bg-gray-800\/50:is(.dark *){background-color:#1f293780}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity, 1))}.dark\:bg-green-900\/30:is(.dark *){background-color:#14532d4d}.dark\:bg-green-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(5 46 22 / var(--tw-bg-opacity, 1))}.dark\:bg-orange-950\/20:is(.dark *){background-color:#43140733}.dark\:bg-red-500\/20:is(.dark *){background-color:#ef444433}.dark\:bg-red-600\/30:is(.dark *){background-color:#dc26264d}.dark\:bg-red-900\/30:is(.dark *){background-color:#7f1d1d4d}.dark\:bg-red-950\/50:is(.dark *){background-color:#450a0a80}.dark\:bg-yellow-500\/20:is(.dark *){background-color:#eab30833}.dark\:bg-yellow-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(113 63 18 / var(--tw-bg-opacity, 1))}.dark\:bg-yellow-950\/30:is(.dark *){background-color:#4220064d}.dark\:text-amber-100:is(.dark *){--tw-text-opacity: 1;color:rgb(254 243 199 / var(--tw-text-opacity, 1))}.dark\:text-amber-400:is(.dark *){--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.dark\:text-blue-100:is(.dark *){--tw-text-opacity: 1;color:rgb(219 234 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-200:is(.dark *){--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:text-blue-400:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\:text-cyan-500:is(.dark *){--tw-text-opacity: 1;color:rgb(6 182 212 / var(--tw-text-opacity, 1))}.dark\:text-gray-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-gray-600:is(.dark *){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-orange-100:is(.dark *){--tw-text-opacity: 1;color:rgb(255 237 213 / var(--tw-text-opacity, 1))}.dark\:text-orange-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 215 170 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-red-500:is(.dark *){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.dark\:text-yellow-100:is(.dark *){--tw-text-opacity: 1;color:rgb(254 249 195 / var(--tw-text-opacity, 1))}.dark\:text-yellow-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.dark\:text-yellow-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.dark\:text-yellow-400:is(.dark *){--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.dark\:text-yellow-500:is(.dark *){--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.dark\:hover\:bg-gray-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-yellow-200:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.dark\:focus\:bg-gray-800:focus:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}@media(min-width:640px){.sm\:right-2{right:.5rem}.sm\:right-3{right:.75rem}.sm\:top-2{top:.5rem}.sm\:top-3{top:.75rem}.sm\:order-1{order:1}.sm\:order-2{order:2}.sm\:col-span-2{grid-column:span 2 / span 2}.sm\:mx-0{margin-left:0;margin-right:0}.sm\:mb-3{margin-bottom:.75rem}.sm\:mb-4{margin-bottom:1rem}.sm\:mb-6{margin-bottom:1.5rem}.sm\:ml-1{margin-left:.25rem}.sm\:mr-1{margin-right:.25rem}.sm\:mr-2{margin-right:.5rem}.sm\:mt-0{margin-top:0}.sm\:mt-2{margin-top:.5rem}.sm\:mt-3{margin-top:.75rem}.sm\:mt-6{margin-top:1.5rem}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:h-10{height:2.5rem}.sm\:h-12{height:3rem}.sm\:h-2{height:.5rem}.sm\:h-24{height:6rem}.sm\:h-3{height:.75rem}.sm\:h-4{height:1rem}.sm\:h-8{height:2rem}.sm\:h-\[300px\]{height:300px}.sm\:h-\[400px\]{height:400px}.sm\:h-\[500px\]{height:500px}.sm\:h-\[calc\(100vh-280px\)\]{height:calc(100vh - 280px)}.sm\:w-10{width:2.5rem}.sm\:w-2{width:.5rem}.sm\:w-24{width:6rem}.sm\:w-3{width:.75rem}.sm\:w-4{width:1rem}.sm\:w-8{width:2rem}.sm\:w-\[140px\]{width:140px}.sm\:w-\[160px\]{width:160px}.sm\:w-\[200px\]{width:200px}.sm\:w-\[500px\]{width:500px}.sm\:w-auto{width:auto}.sm\:w-full{width:100%}.sm\:min-w-\[120px\]{min-width:120px}.sm\:max-w-2xl{max-width:42rem}.sm\:max-w-\[420px\]{max-width:420px}.sm\:max-w-\[900px\]{max-width:900px}.sm\:max-w-md{max-width:28rem}.sm\:max-w-sm{max-width:24rem}.sm\:flex-1{flex:1 1 0%}.sm\:flex-none{flex:none}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.sm\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-start{align-items:flex-start}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-0{gap:0px}.sm\:gap-1{gap:.25rem}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:gap-6{gap:1.5rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.sm\:space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.sm\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.sm\:space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:p-3{padding:.75rem}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:pb-4{padding-bottom:1rem}.sm\:text-left{text-align:left}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}.sm\:text-\[200px\]{font-size:200px}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}.sm\:text-xs{font-size:.75rem;line-height:1rem}}@media(min-width:768px){.md\:top-4{top:1rem}.md\:mb-4{margin-bottom:1rem}.md\:mb-6{margin-bottom:1.5rem}.md\:mb-8{margin-bottom:2rem}.md\:mt-8{margin-top:2rem}.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:h-16{height:4rem}.md\:h-4{height:1rem}.md\:h-5{height:1.25rem}.md\:h-8{height:2rem}.md\:h-96{height:24rem}.md\:h-\[500px\]{height:500px}.md\:min-h-\[400px\]{min-height:400px}.md\:w-16{width:4rem}.md\:w-4{width:1rem}.md\:w-5{width:1.25rem}.md\:w-8{width:2rem}.md\:w-96{width:24rem}.md\:max-w-none{max-width:none}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:gap-2{gap:.5rem}.md\:gap-3{gap:.75rem}.md\:gap-4{gap:1rem}.md\:gap-6{gap:1.5rem}.md\:space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.md\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.md\:whitespace-normal{white-space:normal}.md\:p-12{padding:3rem}.md\:p-4{padding:1rem}.md\:p-6{padding:1.5rem}.md\:p-8{padding:2rem}.md\:text-2xl{font-size:1.5rem;line-height:2rem}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-base{font-size:1rem;line-height:1.5rem}.md\:text-lg{font-size:1.125rem;line-height:1.75rem}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:text-xs{font-size:.75rem;line-height:1rem}}@media(min-width:1024px){.lg\:invisible{visibility:hidden}.lg\:relative{position:relative}.lg\:z-0{z-index:0}.lg\:mx-auto{margin-left:auto;margin-right:auto}.lg\:mb-1{margin-bottom:.25rem}.lg\:block{display:block}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:w-12{width:3rem}.lg\:w-16{width:4rem}.lg\:w-64{width:16rem}.lg\:w-8{width:2rem}.lg\:w-\[130px\]{width:130px}.lg\:w-\[160px\]{width:160px}.lg\:w-\[180px\]{width:180px}.lg\:w-\[200px\]{width:200px}.lg\:w-\[240px\]{width:240px}.lg\:w-\[75px\]{width:75px}.lg\:w-auto{width:auto}.lg\:w-full{width:100%}.lg\:max-w-0{max-width:0px}.lg\:flex-1{flex:1 1 0%}.lg\:flex-none{flex:none}.lg\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.lg\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.lg\:justify-center{justify-content:center}.lg\:gap-0{gap:0px}.lg\:space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.lg\:overflow-hidden{overflow:hidden}.lg\:p-2{padding:.5rem}.lg\:p-6{padding:1.5rem}.lg\:px-0{padding-left:0;padding-right:0}.lg\:px-6{padding-left:1.5rem;padding-right:1.5rem}.lg\:pb-6{padding-bottom:1.5rem}.lg\:text-3xl{font-size:1.875rem;line-height:2.25rem}.lg\:opacity-0{opacity:0}}@media(min-width:1280px){.xl\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}}.\[\&\+div\]\:text-xs+div{font-size:.75rem;line-height:1rem}.\[\&\:first-child\[data-selected\=true\]_button\]\:rounded-l-md:first-child[data-selected=true] button{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\:last-child\[data-selected\=true\]_button\]\:rounded-r-md:last-child[data-selected=true] button{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y: 2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>span\]\:text-xs>span{font-size:.75rem;line-height:1rem}.\[\&\>span\]\:opacity-70>span{opacity:.7}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:size-3\.5>svg{width:.875rem;height:.875rem}.\[\&\>svg\]\:h-2\.5>svg{height:.625rem}.\[\&\>svg\]\:h-3>svg{height:.75rem}.\[\&\>svg\]\:w-2\.5>svg{width:.625rem}.\[\&\>svg\]\:w-3>svg{width:.75rem}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\]\:text-muted-foreground>svg{color:hsl(var(--muted-foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:hsl(var(--muted-foreground))}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:hsl(var(--border) / .5)}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:hsl(var(--border))}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-layer\]\:outline-none .recharts-layer{outline:2px solid transparent;outline-offset:2px}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:hsl(var(--muted))}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-sector\]\:outline-none .recharts-sector,.\[\&_\.recharts-surface\]\:outline-none .recharts-surface{outline:2px solid transparent;outline-offset:2px}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:invisible svg{visibility:hidden}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}[data-slot=card-content] .\[\[data-slot\=card-content\]_\&\]\:bg-transparent,[data-slot=popover-content] .\[\[data-slot\=popover-content\]_\&\]\:bg-transparent{background-color:transparent}@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2) format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff) format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff) format("woff"),url(/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff) format("woff"),url(/assets/KaTeX_Fraktur-Regular-CB_wures.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Main-Bold-Cx986IdX.woff2) format("woff2"),url(/assets/KaTeX_Main-Bold-Jm3AIy58.woff) format("woff"),url(/assets/KaTeX_Main-Bold-waoOVXN0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2) format("woff2"),url(/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff) format("woff"),url(/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2) format("woff2"),url(/assets/KaTeX_Main-Italic-BMLOBm91.woff) format("woff"),url(/assets/KaTeX_Main-Italic-3WenGoN9.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Main-Regular-B22Nviop.woff2) format("woff2"),url(/assets/KaTeX_Main-Regular-Dr94JaBh.woff) format("woff"),url(/assets/KaTeX_Main-Regular-ypZvNtVU.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2) format("woff2"),url(/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff) format("woff"),url(/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Math-Italic-t53AETM-.woff2) format("woff2"),url(/assets/KaTeX_Math-Italic-DA0__PXp.woff) format("woff"),url(/assets/KaTeX_Math-Italic-flOr_0UB.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff) format("woff"),url(/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff) format("woff"),url(/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff) format("woff"),url(/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Script-Regular-D3wIWfF6.woff2) format("woff2"),url(/assets/KaTeX_Script-Regular-D5yQViql.woff) format("woff"),url(/assets/KaTeX_Script-Regular-C5JkGWo-.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2) format("woff2"),url(/assets/KaTeX_Size1-Regular-C195tn64.woff) format("woff"),url(/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2) format("woff2"),url(/assets/KaTeX_Size2-Regular-oD1tc_U0.woff) format("woff"),url(/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC) format("woff2"),url(/assets/KaTeX_Size3-Regular-CTq5MqoE.woff) format("woff"),url(/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2) format("woff2"),url(/assets/KaTeX_Size4-Regular-BF-4gkZK.woff) format("woff"),url(/assets/KaTeX_Size4-Regular-DWFBv043.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2) format("woff2"),url(/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff) format("woff"),url(/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf) format("truetype")}.katex{font: 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.25"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}.react-flow{direction:ltr}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;cursor:grab}.react-flow__pane.selection{cursor:pointer}.react-flow__pane.dragging{cursor:grabbing}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow .react-flow__edges{pointer-events:none;overflow:visible}.react-flow__edge-path,.react-flow__connection-path{stroke:#b1b1b7;stroke-width:1;fill:none}.react-flow__edge{pointer-events:visibleStroke;cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge:focus .react-flow__edge-path,.react-flow__edge:focus-visible .react-flow__edge-path{stroke:#555}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge-textbg{fill:#fff}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__connectionline{z-index:1001}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:grab}.react-flow__node.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background:#1a192b;border:1px solid white;border-radius:100%}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:-4px;transform:translate(-50%)}.react-flow__handle-top{left:50%;top:-4px;transform:translate(-50%)}.react-flow__handle-left{top:50%;left:-4px;transform:translateY(-50%)}.react-flow__handle-right{right:-4px;top:50%;transform:translateY(-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.center{left:50%;transform:translate(-50%)}.react-flow__attribution{font-size:10px;background:#ffffff80;padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-default,.react-flow__node-input,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:3px;width:150px;font-size:12px;color:#222;text-align:center;border-width:1px;border-style:solid;border-color:#1a192b;background-color:#fff}.react-flow__node-default.selectable:hover,.react-flow__node-input.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:0 1px 4px 1px #00000014}.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:0 0 0 .5px #1a192b}.react-flow__node-group{background-color:#f0f0f040}.react-flow__nodesselection-rect,.react-flow__selection{background:#0059dc14;border:1px dotted rgba(0,89,220,.8)}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls{box-shadow:0 0 2px 1px #00000014}.react-flow__controls-button{border:none;background:#fefefe;border-bottom:1px solid #eee;box-sizing:content-box;display:flex;justify-content:center;align-items:center;width:16px;height:16px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:5px}.react-flow__controls-button:hover{background:#f4f4f4}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__minimap{background-color:#fff}.react-flow__minimap svg{display:block}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:4px;height:4px;border:1px solid #fff;border-radius:1px;background-color:#3367d9;transform:translate(-50%,-50%)}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:#3367d9;border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%} diff --git a/webui/dist/assets/index--0Z4-njD.js b/webui/dist/assets/index-JgAL2W8G.js similarity index 62% rename from webui/dist/assets/index--0Z4-njD.js rename to webui/dist/assets/index-JgAL2W8G.js index f5e48ce0..dadd1eea 100644 --- a/webui/dist/assets/index--0Z4-njD.js +++ b/webui/dist/assets/index-JgAL2W8G.js @@ -1,65 +1,65 @@ -import{r as b,j as o,u as Zi,R as ae,c as K1,b as pa,d as eJ,e as tJ,L as nJ,f as rJ,g as ks,h as sJ,k as iJ,O as Az,l as aJ}from"./router-SinpzM5S.js";import{a as oJ,b as lJ,g as gd}from"./react-vendor-Dtc2IqVY.js";import{c as Rz,R as cJ,T as uJ,L as dJ,a as hJ,C as Qx,X as Vx,Y as Am,b as fJ,B as h4,d as Ux,P as mJ,e as pJ,f as gJ,_ as xJ,g as vJ,h as Ge,i as yJ,j as d9,k as bJ,l as h9,m as wJ,n as SJ,o as kJ,r as Dz,p as OJ,q as cj,s as Pz,t as xd,u as uj,v as jJ,w as NJ,x as zz,y as Iz,z as Lz,A as dj,D as hj,E as fj,F as CJ,G as TJ,H as EJ,I as _J,J as MJ,K as AJ,M as RJ,N as mj,O as Ay,Q as DJ,S as PJ,U as pj,V as zJ,W as IJ,Z as Bz,$ as Fz,a0 as qz,a1 as $z,a2 as Ry,a3 as Hz,a4 as Qz,a5 as LJ,a6 as BJ,a7 as FJ,a8 as qJ,a9 as $J,aa as HJ,ab as QJ,ac as VJ,ad as Vz,ae as Uz,af as UJ,ag as WJ,ah as GJ,ai as XJ,aj as YJ,ak as KJ,al as ZJ,am as JJ,an as eee,ao as tee,ap as nee,aq as ree,ar as see,as as iee,at as aee,au as oee}from"./charts-0z-hIQr-.js";import{c as Ra,a as Dy,u as Ui,P as gn,b as nt,d as Yn,e as Np,f as Gl,g as qs,h as si,i as gj,j as xj,k as vj,S as lee,l as Wz,m as Gz,R as Xz,O as Py,n as yj,C as zy,o as Iy,T as bj,D as wj,p as Sj,q as Yz,r as Kz,W as cee,s as Zz,I as uee,t as Jz,v as eI,w as dee,x as tI,V as hee,L as nI,y as rI,z as fee,A as mee,B as sI,E as pee,F as gee,G as Hc,H as Ly,J as gf,K as iI,M as aI,N as oI,Q as lI,U as kj,X as Oj,Y as By,Z as Fy,_ as jj,$ as cI,a0 as xee,a1 as uI,a2 as vee,a3 as yee,a4 as dI,a5 as bee}from"./ui-vendor-BLBhIcJ8.js";import{R as Qs,A as wee,D as See,a as G3,Z as X3,C as _h,M as Cp,T as kee,X as Tp,P as hI,S as Oee,b as Xu,I as Oa,c as Wa,d as Ro,e as Tv,E as Ev,f as Ea,g as Qc,h as jee,i as Nee,j as Y3,k as K3,L as f9,K as fI,l as Vc,m as qy,n as Cee,F as Pl,o as Mh,p as Uc,q as Tee,B as Eee,U as mI,r as Nj,s as _ee,t as Mee,u as Ni,H as M0,v as pI,w as nd,x as A0,y as Aee,z as Ree,G as $y,J as Cj,N as zs,O as Sn,Q as _v,V as Yu,W as Ep,Y as vd,_ as yd,$ as _p,a0 as Tj,a1 as Dee,a2 as Pee,a3 as zee,a4 as Uh,a5 as m9,a6 as Iee,a7 as Ku,a8 as Z3,a9 as R0,aa as Lee,ab as J3,ac as Bee,ad as gI,ae as p9,af as Fee,ag as qee,ah as $ee,ai as _c,aj as f4,ak as g9,al as Hee,am as xI,an as vI,ao as yI,ap as Qee,aq as Vee,ar as x9,as as Uee,at as Wee,au as v9,av as Gee,aw as Xee}from"./icons-DMlhlQyz.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 a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(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=n(s);fetch(s.href,i)}})();var m4={exports:{}},Rm={},p4={exports:{}},g4={};var y9;function Yee(){return y9||(y9=1,(function(t){function e(B,X){var J=B.length;B.push(X);e:for(;0>>1,R=B[G];if(0>>1;Gs(q,J))Vs(te,q)?(B[G]=te,B[V]=J,G=V):(B[G]=q,B[W]=J,G=W);else if(Vs(te,J))B[G]=te,B[V]=J,G=V;else break e}}return X}function s(B,X){var J=B.sortIndex-X.sortIndex;return J!==0?J:B.id-X.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var c=[],d=[],h=1,m=null,g=3,x=!1,y=!1,w=!1,S=!1,k=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function T(B){for(var X=n(d);X!==null;){if(X.callback===null)r(d);else if(X.startTime<=B)r(d),X.sortIndex=X.expirationTime,e(c,X);else break;X=n(d)}}function E(B){if(w=!1,T(B),!y)if(n(c)!==null)y=!0,_||(_=!0,U());else{var X=n(d);X!==null&&Q(E,X.startTime-B)}}var _=!1,M=-1,I=5,P=-1;function L(){return S?!0:!(t.unstable_now()-PB&&L());){var G=m.callback;if(typeof G=="function"){m.callback=null,g=m.priorityLevel;var R=G(m.expirationTime<=B);if(B=t.unstable_now(),typeof R=="function"){m.callback=R,T(B),X=!0;break t}m===n(c)&&r(c),T(B)}else r(c);m=n(c)}if(m!==null)X=!0;else{var ie=n(d);ie!==null&&Q(E,ie.startTime-B),X=!1}}break e}finally{m=null,g=J,x=!1}X=void 0}}finally{X?U():_=!1}}}var U;if(typeof N=="function")U=function(){N(H)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,z=ee.port2;ee.port1.onmessage=H,U=function(){z.postMessage(null)}}else U=function(){k(H,0)};function Q(B,X){M=k(function(){B(t.unstable_now())},X)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(B){B.callback=null},t.unstable_forceFrameRate=function(B){0>B||125G?(B.sortIndex=J,e(d,B),n(c)===null&&B===n(d)&&(w?(j(M),M=-1):w=!0,Q(E,J-G))):(B.sortIndex=R,e(c,B),y||x||(y=!0,_||(_=!0,U()))),B},t.unstable_shouldYield=L,t.unstable_wrapCallback=function(B){var X=g;return function(){var J=g;g=X;try{return B.apply(this,arguments)}finally{g=J}}}})(g4)),g4}var b9;function Kee(){return b9||(b9=1,p4.exports=Yee()),p4.exports}var w9;function Zee(){if(w9)return Rm;w9=1;var t=Kee(),e=oJ(),n=lJ();function r(u){var f="https://react.dev/errors/"+u;if(1R||(u.current=G[R],G[R]=null,R--)}function q(u,f){R++,G[R]=u.current,u.current=f}var V=ie(null),te=ie(null),ne=ie(null),K=ie(null);function se(u,f){switch(q(ne,f),q(te,u),q(V,null),f.nodeType){case 9:case 11:u=(u=f.documentElement)&&(u=u.namespaceURI)?DT(u):0;break;default:if(u=f.tagName,f=f.namespaceURI)f=DT(f),u=PT(f,u);else switch(u){case"svg":u=1;break;case"math":u=2;break;default:u=0}}W(V),q(V,u)}function re(){W(V),W(te),W(ne)}function oe(u){u.memoizedState!==null&&q(K,u);var f=V.current,p=PT(f,u.type);f!==p&&(q(te,u),q(V,p))}function Te(u){te.current===u&&(W(V),W(te)),K.current===u&&(W(K),Tm._currentValue=J)}var We,Ye;function Je(u){if(We===void 0)try{throw Error()}catch(p){var f=p.stack.trim().match(/\n( *(at )?)/);We=f&&f[1]||"",Ye=-1{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(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=n(s);fetch(s.href,i)}})();var b4={exports:{}},Pm={},w4={exports:{}},S4={};var j9;function pte(){return j9||(j9=1,(function(t){function e(F,Y){var J=F.length;F.push(Y);e:for(;0>>1,R=F[X];if(0>>1;Xs(I,J))Vs(ee,I)?(F[X]=ee,F[V]=J,X=V):(F[X]=I,F[G]=J,X=G);else if(Vs(ee,J))F[X]=ee,F[V]=J,X=V;else break e}}return Y}function s(F,Y){var J=F.sortIndex-Y.sortIndex;return J!==0?J:F.id-Y.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var c=[],d=[],h=1,m=null,g=3,x=!1,y=!1,w=!1,S=!1,k=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function T(F){for(var Y=n(d);Y!==null;){if(Y.callback===null)r(d);else if(Y.startTime<=F)r(d),Y.sortIndex=Y.expirationTime,e(c,Y);else break;Y=n(d)}}function E(F){if(w=!1,T(F),!y)if(n(c)!==null)y=!0,_||(_=!0,U());else{var Y=n(d);Y!==null&&Q(E,Y.startTime-F)}}var _=!1,A=-1,L=5,P=-1;function B(){return S?!0:!(t.unstable_now()-PF&&B());){var X=m.callback;if(typeof X=="function"){m.callback=null,g=m.priorityLevel;var R=X(m.expirationTime<=F);if(F=t.unstable_now(),typeof R=="function"){m.callback=R,T(F),Y=!0;break t}m===n(c)&&r(c),T(F)}else r(c);m=n(c)}if(m!==null)Y=!0;else{var ie=n(d);ie!==null&&Q(E,ie.startTime-F),Y=!1}}break e}finally{m=null,g=J,x=!1}Y=void 0}}finally{Y?U():_=!1}}}var U;if(typeof N=="function")U=function(){N($)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,z=te.port2;te.port1.onmessage=$,U=function(){z.postMessage(null)}}else U=function(){k($,0)};function Q(F,Y){A=k(function(){F(t.unstable_now())},Y)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(F){F.callback=null},t.unstable_forceFrameRate=function(F){0>F||125X?(F.sortIndex=J,e(d,F),n(c)===null&&F===n(d)&&(w?(j(A),A=-1):w=!0,Q(E,J-X))):(F.sortIndex=R,e(c,F),y||x||(y=!0,_||(_=!0,U()))),F},t.unstable_shouldYield=B,t.unstable_wrapCallback=function(F){var Y=g;return function(){var J=g;g=Y;try{return F.apply(this,arguments)}finally{g=J}}}})(S4)),S4}var N9;function gte(){return N9||(N9=1,w4.exports=pte()),w4.exports}var C9;function xte(){if(C9)return Pm;C9=1;var t=gte(),e=kJ(),n=OJ();function r(u){var f="https://react.dev/errors/"+u;if(1R||(u.current=X[R],X[R]=null,R--)}function I(u,f){R++,X[R]=u.current,u.current=f}var V=ie(null),ee=ie(null),ne=ie(null),W=ie(null);function se(u,f){switch(I(ne,f),I(ee,u),I(V,null),f.nodeType){case 9:case 11:u=(u=f.documentElement)&&(u=u.namespaceURI)?FT(u):0;break;default:if(u=f.tagName,f=f.namespaceURI)f=FT(f),u=qT(f,u);else switch(u){case"svg":u=1;break;case"math":u=2;break;default:u=0}}G(V),I(V,u)}function re(){G(V),G(ee),G(ne)}function oe(u){u.memoizedState!==null&&I(W,u);var f=V.current,p=qT(f,u.type);f!==p&&(I(ee,u),I(V,p))}function Te(u){ee.current===u&&(G(V),G(ee)),W.current===u&&(G(W),_m._currentValue=J)}var We,Ye;function Je(u){if(We===void 0)try{throw Error()}catch(p){var f=p.stack.trim().match(/\n( *(at )?)/);We=f&&f[1]||"",Ye=-1)":-1O||ue[v]!==we[O]){var Ee=` `+ue[v].replace(" at new "," at ");return u.displayName&&Ee.includes("")&&(Ee=Ee.replace("",u.displayName)),Ee}while(1<=v&&0<=O);break}}}finally{Oe=!1,Error.prepareStackTrace=p}return(p=u?u.displayName||u.name:"")?Je(p):""}function Ue(u,f){switch(u.tag){case 26:case 27:case 5:return Je(u.type);case 16:return Je("Lazy");case 13:return u.child!==f&&f!==null?Je("Suspense Fallback"):Je("Suspense");case 19:return Je("SuspenseList");case 0:case 15:return Ve(u.type,!1);case 11:return Ve(u.type.render,!1);case 1:return Ve(u.type,!0);case 31:return Je("Activity");default:return""}}function He(u){try{var f="",p=null;do f+=Ue(u,p),p=u,u=u.return;while(u);return f}catch(v){return` Error generating stack: `+v.message+` -`+v.stack}}var Ot=Object.prototype.hasOwnProperty,xt=t.unstable_scheduleCallback,kn=t.unstable_cancelCallback,It=t.unstable_shouldYield,Yt=t.unstable_requestPaint,_t=t.unstable_now,mt=t.unstable_getCurrentPriorityLevel,Ne=t.unstable_ImmediatePriority,Ie=t.unstable_UserBlockingPriority,st=t.unstable_NormalPriority,yt=t.unstable_LowPriority,Pt=t.unstable_IdlePriority,At=t.log,zn=t.unstable_setDisableYieldValue,Fe=null,rt=null;function tn(u){if(typeof At=="function"&&zn(u),rt&&typeof rt.setStrictMode=="function")try{rt.setStrictMode(Fe,u)}catch{}}var Rt=Math.clz32?Math.clz32:it,ke=Math.log,Pe=Math.LN2;function it(u){return u>>>=0,u===0?32:31-(ke(u)/Pe|0)|0}var ot=256,nn=262144,Kt=4194304;function pt(u){var f=u&42;if(f!==0)return f;switch(u&-u){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 u&261888;case 262144:case 524288:case 1048576:case 2097152:return u&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return u&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return u}}function xr(u,f,p){var v=u.pendingLanes;if(v===0)return 0;var O=0,C=u.suspendedLanes,F=u.pingedLanes;u=u.warmLanes;var Y=v&134217727;return Y!==0?(v=Y&~C,v!==0?O=pt(v):(F&=Y,F!==0?O=pt(F):p||(p=Y&~u,p!==0&&(O=pt(p))))):(Y=v&~C,Y!==0?O=pt(Y):F!==0?O=pt(F):p||(p=v&~u,p!==0&&(O=pt(p)))),O===0?0:f!==0&&f!==O&&(f&C)===0&&(C=O&-O,p=f&-f,C>=p||C===32&&(p&4194048)!==0)?f:O}function Ur(u,f){return(u.pendingLanes&~(u.suspendedLanes&~u.pingedLanes)&f)===0}function Wr(u,f){switch(u){case 1:case 2:case 4:case 8:case 64:return f+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 f+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 vr(){var u=Kt;return Kt<<=1,(Kt&62914560)===0&&(Kt=4194304),u}function In(u){for(var f=[],p=0;31>p;p++)f.push(u);return f}function cr(u,f){u.pendingLanes|=f,f!==268435456&&(u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0)}function nr(u,f,p,v,O,C){var F=u.pendingLanes;u.pendingLanes=p,u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0,u.expiredLanes&=p,u.entangledLanes&=p,u.errorRecoveryDisabledLanes&=p,u.shellSuspendCounter=0;var Y=u.entanglements,ue=u.expirationTimes,we=u.hiddenUpdates;for(p=F&~p;0"u")return null;try{return u.activeElement||u.body}catch{return u.body}}var GY=/[\n"\\]/g;function ta(u){return u.replace(GY,function(f){return"\\"+f.charCodeAt(0).toString(16)+" "})}function aw(u,f,p,v,O,C,F,Y){u.name="",F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?u.type=F:u.removeAttribute("type"),f!=null?F==="number"?(f===0&&u.value===""||u.value!=f)&&(u.value=""+ea(f)):u.value!==""+ea(f)&&(u.value=""+ea(f)):F!=="submit"&&F!=="reset"||u.removeAttribute("value"),f!=null?ow(u,F,ea(f)):p!=null?ow(u,F,ea(p)):v!=null&&u.removeAttribute("value"),O==null&&C!=null&&(u.defaultChecked=!!C),O!=null&&(u.checked=O&&typeof O!="function"&&typeof O!="symbol"),Y!=null&&typeof Y!="function"&&typeof Y!="symbol"&&typeof Y!="boolean"?u.name=""+ea(Y):u.removeAttribute("name")}function T7(u,f,p,v,O,C,F,Y){if(C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(u.type=C),f!=null||p!=null){if(!(C!=="submit"&&C!=="reset"||f!=null)){iw(u);return}p=p!=null?""+ea(p):"",f=f!=null?""+ea(f):p,Y||f===u.value||(u.value=f),u.defaultValue=f}v=v??O,v=typeof v!="function"&&typeof v!="symbol"&&!!v,u.checked=Y?u.checked:!!v,u.defaultChecked=!!v,F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"&&(u.name=F),iw(u)}function ow(u,f,p){f==="number"&&Dg(u.ownerDocument)===u||u.defaultValue===""+p||(u.defaultValue=""+p)}function Nd(u,f,p,v){if(u=u.options,f){f={};for(var O=0;O"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hw=!1;if(el)try{var Uf={};Object.defineProperty(Uf,"passive",{get:function(){hw=!0}}),window.addEventListener("test",Uf,Uf),window.removeEventListener("test",Uf,Uf)}catch{hw=!1}var tc=null,fw=null,zg=null;function P7(){if(zg)return zg;var u,f=fw,p=f.length,v,O="value"in tc?tc.value:tc.textContent,C=O.length;for(u=0;u=Xf),q7=" ",$7=!1;function H7(u,f){switch(u){case"keyup":return SK.indexOf(f.keyCode)!==-1;case"keydown":return f.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Q7(u){return u=u.detail,typeof u=="object"&&"data"in u?u.data:null}var _d=!1;function OK(u,f){switch(u){case"compositionend":return Q7(f);case"keypress":return f.which!==32?null:($7=!0,q7);case"textInput":return u=f.data,u===q7&&$7?null:u;default:return null}}function jK(u,f){if(_d)return u==="compositionend"||!vw&&H7(u,f)?(u=P7(),zg=fw=tc=null,_d=!1,u):null;switch(u){case"paste":return null;case"keypress":if(!(f.ctrlKey||f.altKey||f.metaKey)||f.ctrlKey&&f.altKey){if(f.char&&1=f)return{node:p,offset:f-u};u=v}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=Z7(p)}}function eC(u,f){return u&&f?u===f?!0:u&&u.nodeType===3?!1:f&&f.nodeType===3?eC(u,f.parentNode):"contains"in u?u.contains(f):u.compareDocumentPosition?!!(u.compareDocumentPosition(f)&16):!1:!1}function tC(u){u=u!=null&&u.ownerDocument!=null&&u.ownerDocument.defaultView!=null?u.ownerDocument.defaultView:window;for(var f=Dg(u.document);f instanceof u.HTMLIFrameElement;){try{var p=typeof f.contentWindow.location.href=="string"}catch{p=!1}if(p)u=f.contentWindow;else break;f=Dg(u.document)}return f}function ww(u){var f=u&&u.nodeName&&u.nodeName.toLowerCase();return f&&(f==="input"&&(u.type==="text"||u.type==="search"||u.type==="tel"||u.type==="url"||u.type==="password")||f==="textarea"||u.contentEditable==="true")}var RK=el&&"documentMode"in document&&11>=document.documentMode,Md=null,Sw=null,Jf=null,kw=!1;function nC(u,f,p){var v=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;kw||Md==null||Md!==Dg(v)||(v=Md,"selectionStart"in v&&ww(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),Jf&&Zf(Jf,v)||(Jf=v,v=Ex(Sw,"onSelect"),0>=F,O-=F,ao=1<<32-Rt(f)+O|p<Zt?(fn=vt,vt=null):fn=vt.sibling;var Bn=Se(pe,vt,ye[Zt],Me);if(Bn===null){vt===null&&(vt=fn);break}u&&vt&&Bn.alternate===null&&f(pe,vt),fe=C(Bn,fe,Zt),Ln===null?Nt=Bn:Ln.sibling=Bn,Ln=Bn,vt=fn}if(Zt===ye.length)return p(pe,vt),vn&&nl(pe,Zt),Nt;if(vt===null){for(;ZtZt?(fn=vt,vt=null):fn=vt.sibling;var kc=Se(pe,vt,Bn.value,Me);if(kc===null){vt===null&&(vt=fn);break}u&&vt&&kc.alternate===null&&f(pe,vt),fe=C(kc,fe,Zt),Ln===null?Nt=kc:Ln.sibling=kc,Ln=kc,vt=fn}if(Bn.done)return p(pe,vt),vn&&nl(pe,Zt),Nt;if(vt===null){for(;!Bn.done;Zt++,Bn=ye.next())Bn=Re(pe,Bn.value,Me),Bn!==null&&(fe=C(Bn,fe,Zt),Ln===null?Nt=Bn:Ln.sibling=Bn,Ln=Bn);return vn&&nl(pe,Zt),Nt}for(vt=v(vt);!Bn.done;Zt++,Bn=ye.next())Bn=Ce(vt,pe,Zt,Bn.value,Me),Bn!==null&&(u&&Bn.alternate!==null&&vt.delete(Bn.key===null?Zt:Bn.key),fe=C(Bn,fe,Zt),Ln===null?Nt=Bn:Ln.sibling=Bn,Ln=Bn);return u&&vt.forEach(function(JZ){return f(pe,JZ)}),vn&&nl(pe,Zt),Nt}function Jn(pe,fe,ye,Me){if(typeof ye=="object"&&ye!==null&&ye.type===w&&ye.key===null&&(ye=ye.props.children),typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case x:e:{for(var Nt=ye.key;fe!==null;){if(fe.key===Nt){if(Nt=ye.type,Nt===w){if(fe.tag===7){p(pe,fe.sibling),Me=O(fe,ye.props.children),Me.return=pe,pe=Me;break e}}else if(fe.elementType===Nt||typeof Nt=="object"&&Nt!==null&&Nt.$$typeof===I&&ju(Nt)===fe.type){p(pe,fe.sibling),Me=O(fe,ye.props),im(Me,ye),Me.return=pe,pe=Me;break e}p(pe,fe);break}else f(pe,fe);fe=fe.sibling}ye.type===w?(Me=bu(ye.props.children,pe.mode,Me,ye.key),Me.return=pe,pe=Me):(Me=Ug(ye.type,ye.key,ye.props,null,pe.mode,Me),im(Me,ye),Me.return=pe,pe=Me)}return F(pe);case y:e:{for(Nt=ye.key;fe!==null;){if(fe.key===Nt)if(fe.tag===4&&fe.stateNode.containerInfo===ye.containerInfo&&fe.stateNode.implementation===ye.implementation){p(pe,fe.sibling),Me=O(fe,ye.children||[]),Me.return=pe,pe=Me;break e}else{p(pe,fe);break}else f(pe,fe);fe=fe.sibling}Me=_w(ye,pe.mode,Me),Me.return=pe,pe=Me}return F(pe);case I:return ye=ju(ye),Jn(pe,fe,ye,Me)}if(Q(ye))return ut(pe,fe,ye,Me);if(U(ye)){if(Nt=U(ye),typeof Nt!="function")throw Error(r(150));return ye=Nt.call(ye),Mt(pe,fe,ye,Me)}if(typeof ye.then=="function")return Jn(pe,fe,Jg(ye),Me);if(ye.$$typeof===N)return Jn(pe,fe,Xg(pe,ye),Me);ex(pe,ye)}return typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint"?(ye=""+ye,fe!==null&&fe.tag===6?(p(pe,fe.sibling),Me=O(fe,ye),Me.return=pe,pe=Me):(p(pe,fe),Me=Ew(ye,pe.mode,Me),Me.return=pe,pe=Me),F(pe)):p(pe,fe)}return function(pe,fe,ye,Me){try{sm=0;var Nt=Jn(pe,fe,ye,Me);return $d=null,Nt}catch(vt){if(vt===qd||vt===Kg)throw vt;var Ln=Ai(29,vt,null,pe.mode);return Ln.lanes=Me,Ln.return=pe,Ln}finally{}}}var Cu=jC(!0),NC=jC(!1),ac=!1;function $w(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hw(u,f){u=u.updateQueue,f.updateQueue===u&&(f.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,callbacks:null})}function oc(u){return{lane:u,tag:0,payload:null,callback:null,next:null}}function lc(u,f,p){var v=u.updateQueue;if(v===null)return null;if(v=v.shared,(Hn&2)!==0){var O=v.pending;return O===null?f.next=f:(f.next=O.next,O.next=f),v.pending=f,f=Vg(u),cC(u,null,p),f}return Qg(u,v,f,p),Vg(u)}function am(u,f,p){if(f=f.updateQueue,f!==null&&(f=f.shared,(p&4194048)!==0)){var v=f.lanes;v&=u.pendingLanes,p|=v,f.lanes=p,gs(u,p)}}function Qw(u,f){var p=u.updateQueue,v=u.alternate;if(v!==null&&(v=v.updateQueue,p===v)){var O=null,C=null;if(p=p.firstBaseUpdate,p!==null){do{var F={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};C===null?O=C=F:C=C.next=F,p=p.next}while(p!==null);C===null?O=C=f:C=C.next=f}else O=C=f;p={baseState:v.baseState,firstBaseUpdate:O,lastBaseUpdate:C,shared:v.shared,callbacks:v.callbacks},u.updateQueue=p;return}u=p.lastBaseUpdate,u===null?p.firstBaseUpdate=f:u.next=f,p.lastBaseUpdate=f}var Vw=!1;function om(){if(Vw){var u=Fd;if(u!==null)throw u}}function lm(u,f,p,v){Vw=!1;var O=u.updateQueue;ac=!1;var C=O.firstBaseUpdate,F=O.lastBaseUpdate,Y=O.shared.pending;if(Y!==null){O.shared.pending=null;var ue=Y,we=ue.next;ue.next=null,F===null?C=we:F.next=we,F=ue;var Ee=u.alternate;Ee!==null&&(Ee=Ee.updateQueue,Y=Ee.lastBaseUpdate,Y!==F&&(Y===null?Ee.firstBaseUpdate=we:Y.next=we,Ee.lastBaseUpdate=ue))}if(C!==null){var Re=O.baseState;F=0,Ee=we=ue=null,Y=C;do{var Se=Y.lane&-536870913,Ce=Se!==Y.lane;if(Ce?(hn&Se)===Se:(v&Se)===Se){Se!==0&&Se===Bd&&(Vw=!0),Ee!==null&&(Ee=Ee.next={lane:0,tag:Y.tag,payload:Y.payload,callback:null,next:null});e:{var ut=u,Mt=Y;Se=f;var Jn=p;switch(Mt.tag){case 1:if(ut=Mt.payload,typeof ut=="function"){Re=ut.call(Jn,Re,Se);break e}Re=ut;break e;case 3:ut.flags=ut.flags&-65537|128;case 0:if(ut=Mt.payload,Se=typeof ut=="function"?ut.call(Jn,Re,Se):ut,Se==null)break e;Re=m({},Re,Se);break e;case 2:ac=!0}}Se=Y.callback,Se!==null&&(u.flags|=64,Ce&&(u.flags|=8192),Ce=O.callbacks,Ce===null?O.callbacks=[Se]:Ce.push(Se))}else Ce={lane:Se,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},Ee===null?(we=Ee=Ce,ue=Re):Ee=Ee.next=Ce,F|=Se;if(Y=Y.next,Y===null){if(Y=O.shared.pending,Y===null)break;Ce=Y,Y=Ce.next,Ce.next=null,O.lastBaseUpdate=Ce,O.shared.pending=null}}while(!0);Ee===null&&(ue=Re),O.baseState=ue,O.firstBaseUpdate=we,O.lastBaseUpdate=Ee,C===null&&(O.shared.lanes=0),fc|=F,u.lanes=F,u.memoizedState=Re}}function CC(u,f){if(typeof u!="function")throw Error(r(191,u));u.call(f)}function TC(u,f){var p=u.callbacks;if(p!==null)for(u.callbacks=null,u=0;uC?C:8;var F=B.T,Y={};B.T=Y,u2(u,!1,f,p);try{var ue=O(),we=B.S;if(we!==null&&we(Y,ue),ue!==null&&typeof ue=="object"&&typeof ue.then=="function"){var Ee=$K(ue,v);dm(u,f,Ee,Ii(u))}else dm(u,f,v,Ii(u))}catch(Re){dm(u,f,{then:function(){},status:"rejected",reason:Re},Ii())}finally{X.p=C,F!==null&&Y.types!==null&&(F.types=Y.types),B.T=F}}function GK(){}function l2(u,f,p,v){if(u.tag!==5)throw Error(r(476));var O=a8(u).queue;i8(u,O,f,J,p===null?GK:function(){return o8(u),p(v)})}function a8(u){var f=u.memoizedState;if(f!==null)return f;f={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:al,lastRenderedState:J},next:null};var p={};return f.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:al,lastRenderedState:p},next:null},u.memoizedState=f,u=u.alternate,u!==null&&(u.memoizedState=f),f}function o8(u){var f=a8(u);f.next===null&&(f=u.alternate.memoizedState),dm(u,f.next.queue,{},Ii())}function c2(){return Ts(Tm)}function l8(){return $r().memoizedState}function c8(){return $r().memoizedState}function XK(u){for(var f=u.return;f!==null;){switch(f.tag){case 24:case 3:var p=Ii();u=oc(p);var v=lc(f,u,p);v!==null&&(hi(v,f,p),am(v,f,p)),f={cache:Lw()},u.payload=f;return}f=f.return}}function YK(u,f,p){var v=Ii();p={lane:v,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},ux(u)?d8(f,p):(p=Cw(u,f,p,v),p!==null&&(hi(p,u,v),h8(p,f,v)))}function u8(u,f,p){var v=Ii();dm(u,f,p,v)}function dm(u,f,p,v){var O={lane:v,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(ux(u))d8(f,O);else{var C=u.alternate;if(u.lanes===0&&(C===null||C.lanes===0)&&(C=f.lastRenderedReducer,C!==null))try{var F=f.lastRenderedState,Y=C(F,p);if(O.hasEagerState=!0,O.eagerState=Y,Mi(Y,F))return Qg(u,f,O,0),rr===null&&Hg(),!1}catch{}finally{}if(p=Cw(u,f,O,v),p!==null)return hi(p,u,v),h8(p,f,v),!0}return!1}function u2(u,f,p,v){if(v={lane:2,revertLane:$2(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},ux(u)){if(f)throw Error(r(479))}else f=Cw(u,p,v,2),f!==null&&hi(f,u,2)}function ux(u){var f=u.alternate;return u===Wt||f!==null&&f===Wt}function d8(u,f){Qd=rx=!0;var p=u.pending;p===null?f.next=f:(f.next=p.next,p.next=f),u.pending=f}function h8(u,f,p){if((p&4194048)!==0){var v=f.lanes;v&=u.pendingLanes,p|=v,f.lanes=p,gs(u,p)}}var hm={readContext:Ts,use:ax,useCallback:Pr,useContext:Pr,useEffect:Pr,useImperativeHandle:Pr,useLayoutEffect:Pr,useInsertionEffect:Pr,useMemo:Pr,useReducer:Pr,useRef:Pr,useState:Pr,useDebugValue:Pr,useDeferredValue:Pr,useTransition:Pr,useSyncExternalStore:Pr,useId:Pr,useHostTransitionStatus:Pr,useFormState:Pr,useActionState:Pr,useOptimistic:Pr,useMemoCache:Pr,useCacheRefresh:Pr};hm.useEffectEvent=Pr;var f8={readContext:Ts,use:ax,useCallback:function(u,f){return Xs().memoizedState=[u,f===void 0?null:f],u},useContext:Ts,useEffect:YC,useImperativeHandle:function(u,f,p){p=p!=null?p.concat([u]):null,lx(4194308,4,e8.bind(null,f,u),p)},useLayoutEffect:function(u,f){return lx(4194308,4,u,f)},useInsertionEffect:function(u,f){lx(4,2,u,f)},useMemo:function(u,f){var p=Xs();f=f===void 0?null:f;var v=u();if(Tu){tn(!0);try{u()}finally{tn(!1)}}return p.memoizedState=[v,f],v},useReducer:function(u,f,p){var v=Xs();if(p!==void 0){var O=p(f);if(Tu){tn(!0);try{p(f)}finally{tn(!1)}}}else O=f;return v.memoizedState=v.baseState=O,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:O},v.queue=u,u=u.dispatch=YK.bind(null,Wt,u),[v.memoizedState,u]},useRef:function(u){var f=Xs();return u={current:u},f.memoizedState=u},useState:function(u){u=r2(u);var f=u.queue,p=u8.bind(null,Wt,f);return f.dispatch=p,[u.memoizedState,p]},useDebugValue:a2,useDeferredValue:function(u,f){var p=Xs();return o2(p,u,f)},useTransition:function(){var u=r2(!1);return u=i8.bind(null,Wt,u.queue,!0,!1),Xs().memoizedState=u,[!1,u]},useSyncExternalStore:function(u,f,p){var v=Wt,O=Xs();if(vn){if(p===void 0)throw Error(r(407));p=p()}else{if(p=f(),rr===null)throw Error(r(349));(hn&127)!==0||DC(v,f,p)}O.memoizedState=p;var C={value:p,getSnapshot:f};return O.queue=C,YC(zC.bind(null,v,C,u),[u]),v.flags|=2048,Ud(9,{destroy:void 0},PC.bind(null,v,C,p,f),null),p},useId:function(){var u=Xs(),f=rr.identifierPrefix;if(vn){var p=oo,v=ao;p=(v&~(1<<32-Rt(v)-1)).toString(32)+p,f="_"+f+"R_"+p,p=sx++,0<\/script>",C=C.removeChild(C.firstChild);break;case"select":C=typeof v.is=="string"?F.createElement("select",{is:v.is}):F.createElement("select"),v.multiple?C.multiple=!0:v.size&&(C.size=v.size);break;default:C=typeof v.is=="string"?F.createElement(O,{is:v.is}):F.createElement(O)}}C[Cr]=f,C[Tr]=v;e:for(F=f.child;F!==null;){if(F.tag===5||F.tag===6)C.appendChild(F.stateNode);else if(F.tag!==4&&F.tag!==27&&F.child!==null){F.child.return=F,F=F.child;continue}if(F===f)break e;for(;F.sibling===null;){if(F.return===null||F.return===f)break e;F=F.return}F.sibling.return=F.return,F=F.sibling}f.stateNode=C;e:switch(_s(C,O,v),O){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}v&&ll(f)}}return mr(f),O2(f,f.type,u===null?null:u.memoizedProps,f.pendingProps,p),null;case 6:if(u&&f.stateNode!=null)u.memoizedProps!==v&&ll(f);else{if(typeof v!="string"&&f.stateNode===null)throw Error(r(166));if(u=ne.current,Id(f)){if(u=f.stateNode,p=f.memoizedProps,v=null,O=Cs,O!==null)switch(O.tag){case 27:case 5:v=O.memoizedProps}u[Cr]=f,u=!!(u.nodeValue===p||v!==null&&v.suppressHydrationWarning===!0||AT(u.nodeValue,p)),u||sc(f,!0)}else u=_x(u).createTextNode(v),u[Cr]=f,f.stateNode=u}return mr(f),null;case 31:if(p=f.memoizedState,u===null||u.memoizedState!==null){if(v=Id(f),p!==null){if(u===null){if(!v)throw Error(r(318));if(u=f.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(557));u[Cr]=f}else wu(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;mr(f),u=!1}else p=Dw(),u!==null&&u.memoizedState!==null&&(u.memoizedState.hydrationErrors=p),u=!0;if(!u)return f.flags&256?(Di(f),f):(Di(f),null);if((f.flags&128)!==0)throw Error(r(558))}return mr(f),null;case 13:if(v=f.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(O=Id(f),v!==null&&v.dehydrated!==null){if(u===null){if(!O)throw Error(r(318));if(O=f.memoizedState,O=O!==null?O.dehydrated:null,!O)throw Error(r(317));O[Cr]=f}else wu(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;mr(f),O=!1}else O=Dw(),u!==null&&u.memoizedState!==null&&(u.memoizedState.hydrationErrors=O),O=!0;if(!O)return f.flags&256?(Di(f),f):(Di(f),null)}return Di(f),(f.flags&128)!==0?(f.lanes=p,f):(p=v!==null,u=u!==null&&u.memoizedState!==null,p&&(v=f.child,O=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(O=v.alternate.memoizedState.cachePool.pool),C=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(C=v.memoizedState.cachePool.pool),C!==O&&(v.flags|=2048)),p!==u&&p&&(f.child.flags|=8192),px(f,f.updateQueue),mr(f),null);case 4:return re(),u===null&&U2(f.stateNode.containerInfo),mr(f),null;case 10:return sl(f.type),mr(f),null;case 19:if(W(qr),v=f.memoizedState,v===null)return mr(f),null;if(O=(f.flags&128)!==0,C=v.rendering,C===null)if(O)mm(v,!1);else{if(zr!==0||u!==null&&(u.flags&128)!==0)for(u=f.child;u!==null;){if(C=nx(u),C!==null){for(f.flags|=128,mm(v,!1),u=C.updateQueue,f.updateQueue=u,px(f,u),f.subtreeFlags=0,u=p,p=f.child;p!==null;)uC(p,u),p=p.sibling;return q(qr,qr.current&1|2),vn&&nl(f,v.treeForkCount),f.child}u=u.sibling}v.tail!==null&&_t()>bx&&(f.flags|=128,O=!0,mm(v,!1),f.lanes=4194304)}else{if(!O)if(u=nx(C),u!==null){if(f.flags|=128,O=!0,u=u.updateQueue,f.updateQueue=u,px(f,u),mm(v,!0),v.tail===null&&v.tailMode==="hidden"&&!C.alternate&&!vn)return mr(f),null}else 2*_t()-v.renderingStartTime>bx&&p!==536870912&&(f.flags|=128,O=!0,mm(v,!1),f.lanes=4194304);v.isBackwards?(C.sibling=f.child,f.child=C):(u=v.last,u!==null?u.sibling=C:f.child=C,v.last=C)}return v.tail!==null?(u=v.tail,v.rendering=u,v.tail=u.sibling,v.renderingStartTime=_t(),u.sibling=null,p=qr.current,q(qr,O?p&1|2:p&1),vn&&nl(f,v.treeForkCount),u):(mr(f),null);case 22:case 23:return Di(f),Ww(),v=f.memoizedState!==null,u!==null?u.memoizedState!==null!==v&&(f.flags|=8192):v&&(f.flags|=8192),v?(p&536870912)!==0&&(f.flags&128)===0&&(mr(f),f.subtreeFlags&6&&(f.flags|=8192)):mr(f),p=f.updateQueue,p!==null&&px(f,p.retryQueue),p=null,u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(p=u.memoizedState.cachePool.pool),v=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(v=f.memoizedState.cachePool.pool),v!==p&&(f.flags|=2048),u!==null&&W(Ou),null;case 24:return p=null,u!==null&&(p=u.memoizedState.cache),f.memoizedState.cache!==p&&(f.flags|=2048),sl(Xr),mr(f),null;case 25:return null;case 30:return null}throw Error(r(156,f.tag))}function tZ(u,f){switch(Aw(f),f.tag){case 1:return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 3:return sl(Xr),re(),u=f.flags,(u&65536)!==0&&(u&128)===0?(f.flags=u&-65537|128,f):null;case 26:case 27:case 5:return Te(f),null;case 31:if(f.memoizedState!==null){if(Di(f),f.alternate===null)throw Error(r(340));wu()}return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 13:if(Di(f),u=f.memoizedState,u!==null&&u.dehydrated!==null){if(f.alternate===null)throw Error(r(340));wu()}return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 19:return W(qr),null;case 4:return re(),null;case 10:return sl(f.type),null;case 22:case 23:return Di(f),Ww(),u!==null&&W(Ou),u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 24:return sl(Xr),null;case 25:return null;default:return null}}function I8(u,f){switch(Aw(f),f.tag){case 3:sl(Xr),re();break;case 26:case 27:case 5:Te(f);break;case 4:re();break;case 31:f.memoizedState!==null&&Di(f);break;case 13:Di(f);break;case 19:W(qr);break;case 10:sl(f.type);break;case 22:case 23:Di(f),Ww(),u!==null&&W(Ou);break;case 24:sl(Xr)}}function pm(u,f){try{var p=f.updateQueue,v=p!==null?p.lastEffect:null;if(v!==null){var O=v.next;p=O;do{if((p.tag&u)===u){v=void 0;var C=p.create,F=p.inst;v=C(),F.destroy=v}p=p.next}while(p!==O)}}catch(Y){Un(f,f.return,Y)}}function dc(u,f,p){try{var v=f.updateQueue,O=v!==null?v.lastEffect:null;if(O!==null){var C=O.next;v=C;do{if((v.tag&u)===u){var F=v.inst,Y=F.destroy;if(Y!==void 0){F.destroy=void 0,O=f;var ue=p,we=Y;try{we()}catch(Ee){Un(O,ue,Ee)}}}v=v.next}while(v!==C)}}catch(Ee){Un(f,f.return,Ee)}}function L8(u){var f=u.updateQueue;if(f!==null){var p=u.stateNode;try{TC(f,p)}catch(v){Un(u,u.return,v)}}}function B8(u,f,p){p.props=Eu(u.type,u.memoizedProps),p.state=u.memoizedState;try{p.componentWillUnmount()}catch(v){Un(u,f,v)}}function gm(u,f){try{var p=u.ref;if(p!==null){switch(u.tag){case 26:case 27:case 5:var v=u.stateNode;break;case 30:v=u.stateNode;break;default:v=u.stateNode}typeof p=="function"?u.refCleanup=p(v):p.current=v}}catch(O){Un(u,f,O)}}function lo(u,f){var p=u.ref,v=u.refCleanup;if(p!==null)if(typeof v=="function")try{v()}catch(O){Un(u,f,O)}finally{u.refCleanup=null,u=u.alternate,u!=null&&(u.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(O){Un(u,f,O)}else p.current=null}function F8(u){var f=u.type,p=u.memoizedProps,v=u.stateNode;try{e:switch(f){case"button":case"input":case"select":case"textarea":p.autoFocus&&v.focus();break e;case"img":p.src?v.src=p.src:p.srcSet&&(v.srcset=p.srcSet)}}catch(O){Un(u,u.return,O)}}function j2(u,f,p){try{var v=u.stateNode;kZ(v,u.type,p,f),v[Tr]=f}catch(O){Un(u,u.return,O)}}function q8(u){return u.tag===5||u.tag===3||u.tag===26||u.tag===27&&vc(u.type)||u.tag===4}function N2(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||q8(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&u.tag!==18;){if(u.tag===27&&vc(u.type)||u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function C2(u,f,p){var v=u.tag;if(v===5||v===6)u=u.stateNode,f?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(u,f):(f=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,f.appendChild(u),p=p._reactRootContainer,p!=null||f.onclick!==null||(f.onclick=Jo));else if(v!==4&&(v===27&&vc(u.type)&&(p=u.stateNode,f=null),u=u.child,u!==null))for(C2(u,f,p),u=u.sibling;u!==null;)C2(u,f,p),u=u.sibling}function gx(u,f,p){var v=u.tag;if(v===5||v===6)u=u.stateNode,f?p.insertBefore(u,f):p.appendChild(u);else if(v!==4&&(v===27&&vc(u.type)&&(p=u.stateNode),u=u.child,u!==null))for(gx(u,f,p),u=u.sibling;u!==null;)gx(u,f,p),u=u.sibling}function $8(u){var f=u.stateNode,p=u.memoizedProps;try{for(var v=u.type,O=f.attributes;O.length;)f.removeAttributeNode(O[0]);_s(f,v,p),f[Cr]=u,f[Tr]=p}catch(C){Un(u,u.return,C)}}var cl=!1,Zr=!1,T2=!1,H8=typeof WeakSet=="function"?WeakSet:Set,xs=null;function nZ(u,f){if(u=u.containerInfo,X2=Ix,u=tC(u),ww(u)){if("selectionStart"in u)var p={start:u.selectionStart,end:u.selectionEnd};else e:{p=(p=u.ownerDocument)&&p.defaultView||window;var v=p.getSelection&&p.getSelection();if(v&&v.rangeCount!==0){p=v.anchorNode;var O=v.anchorOffset,C=v.focusNode;v=v.focusOffset;try{p.nodeType,C.nodeType}catch{p=null;break e}var F=0,Y=-1,ue=-1,we=0,Ee=0,Re=u,Se=null;t:for(;;){for(var Ce;Re!==p||O!==0&&Re.nodeType!==3||(Y=F+O),Re!==C||v!==0&&Re.nodeType!==3||(ue=F+v),Re.nodeType===3&&(F+=Re.nodeValue.length),(Ce=Re.firstChild)!==null;)Se=Re,Re=Ce;for(;;){if(Re===u)break t;if(Se===p&&++we===O&&(Y=F),Se===C&&++Ee===v&&(ue=F),(Ce=Re.nextSibling)!==null)break;Re=Se,Se=Re.parentNode}Re=Ce}p=Y===-1||ue===-1?null:{start:Y,end:ue}}else p=null}p=p||{start:0,end:0}}else p=null;for(Y2={focusedElem:u,selectionRange:p},Ix=!1,xs=f;xs!==null;)if(f=xs,u=f.child,(f.subtreeFlags&1028)!==0&&u!==null)u.return=f,xs=u;else for(;xs!==null;){switch(f=xs,C=f.alternate,u=f.flags,f.tag){case 0:if((u&4)!==0&&(u=f.updateQueue,u=u!==null?u.events:null,u!==null))for(p=0;p title"))),_s(C,v,p),C[Cr]=u,Gr(C),v=C;break e;case"link":var F=XT("link","href",O).get(v+(p.href||""));if(F){for(var Y=0;YJn&&(F=Jn,Jn=Mt,Mt=F);var pe=J7(Y,Mt),fe=J7(Y,Jn);if(pe&&fe&&(Ce.rangeCount!==1||Ce.anchorNode!==pe.node||Ce.anchorOffset!==pe.offset||Ce.focusNode!==fe.node||Ce.focusOffset!==fe.offset)){var ye=Re.createRange();ye.setStart(pe.node,pe.offset),Ce.removeAllRanges(),Mt>Jn?(Ce.addRange(ye),Ce.extend(fe.node,fe.offset)):(ye.setEnd(fe.node,fe.offset),Ce.addRange(ye))}}}}for(Re=[],Ce=Y;Ce=Ce.parentNode;)Ce.nodeType===1&&Re.push({element:Ce,left:Ce.scrollLeft,top:Ce.scrollTop});for(typeof Y.focus=="function"&&Y.focus(),Y=0;Yp?32:p,B.T=null,p=P2,P2=null;var C=pc,F=ml;if(os=0,Kd=pc=null,ml=0,(Hn&6)!==0)throw Error(r(331));var Y=Hn;if(Hn|=4,eT(C.current),K8(C,C.current,F,p),Hn=Y,Sm(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(Fe,C)}catch{}return!0}finally{X.p=O,B.T=v,vT(u,f)}}function bT(u,f,p){f=ra(p,f),f=m2(u.stateNode,f,2),u=lc(u,f,2),u!==null&&(cr(u,2),co(u))}function Un(u,f,p){if(u.tag===3)bT(u,u,p);else for(;f!==null;){if(f.tag===3){bT(f,u,p);break}else if(f.tag===1){var v=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(mc===null||!mc.has(v))){u=ra(p,u),p=w8(2),v=lc(f,p,2),v!==null&&(S8(p,v,f,u),cr(v,2),co(v));break}}f=f.return}}function B2(u,f,p){var v=u.pingCache;if(v===null){v=u.pingCache=new iZ;var O=new Set;v.set(f,O)}else O=v.get(f),O===void 0&&(O=new Set,v.set(f,O));O.has(p)||(M2=!0,O.add(p),u=uZ.bind(null,u,f,p),f.then(u,u))}function uZ(u,f,p){var v=u.pingCache;v!==null&&v.delete(f),u.pingedLanes|=u.suspendedLanes&p,u.warmLanes&=~p,rr===u&&(hn&p)===p&&(zr===4||zr===3&&(hn&62914560)===hn&&300>_t()-yx?(Hn&2)===0&&Zd(u,0):A2|=p,Yd===hn&&(Yd=0)),co(u)}function wT(u,f){f===0&&(f=vr()),u=yu(u,f),u!==null&&(cr(u,f),co(u))}function dZ(u){var f=u.memoizedState,p=0;f!==null&&(p=f.retryLane),wT(u,p)}function hZ(u,f){var p=0;switch(u.tag){case 31:case 13:var v=u.stateNode,O=u.memoizedState;O!==null&&(p=O.retryLane);break;case 19:v=u.stateNode;break;case 22:v=u.stateNode._retryCache;break;default:throw Error(r(314))}v!==null&&v.delete(f),wT(u,p)}function fZ(u,f){return xt(u,f)}var Nx=null,eh=null,F2=!1,Cx=!1,q2=!1,xc=0;function co(u){u!==eh&&u.next===null&&(eh===null?Nx=eh=u:eh=eh.next=u),Cx=!0,F2||(F2=!0,pZ())}function Sm(u,f){if(!q2&&Cx){q2=!0;do for(var p=!1,v=Nx;v!==null;){if(u!==0){var O=v.pendingLanes;if(O===0)var C=0;else{var F=v.suspendedLanes,Y=v.pingedLanes;C=(1<<31-Rt(42|u)+1)-1,C&=O&~(F&~Y),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(p=!0,jT(v,C))}else C=hn,C=xr(v,v===rr?C:0,v.cancelPendingCommit!==null||v.timeoutHandle!==-1),(C&3)===0||Ur(v,C)||(p=!0,jT(v,C));v=v.next}while(p);q2=!1}}function mZ(){ST()}function ST(){Cx=F2=!1;var u=0;xc!==0&&jZ()&&(u=xc);for(var f=_t(),p=null,v=Nx;v!==null;){var O=v.next,C=kT(v,f);C===0?(v.next=null,p===null?Nx=O:p.next=O,O===null&&(eh=p)):(p=v,(u!==0||(C&3)!==0)&&(Cx=!0)),v=O}os!==0&&os!==5||Sm(u),xc!==0&&(xc=0)}function kT(u,f){for(var p=u.suspendedLanes,v=u.pingedLanes,O=u.expirationTimes,C=u.pendingLanes&-62914561;0Y)break;var Ee=ue.transferSize,Re=ue.initiatorType;Ee&&RT(Re)&&(ue=ue.responseEnd,F+=Ee*(ue"u"?null:document;function VT(u,f,p){var v=th;if(v&&typeof f=="string"&&f){var O=ta(f);O='link[rel="'+u+'"][href="'+O+'"]',typeof p=="string"&&(O+='[crossorigin="'+p+'"]'),QT.has(O)||(QT.add(O),u={rel:u,crossOrigin:p,href:f},v.querySelector(O)===null&&(f=v.createElement("link"),_s(f,"link",u),Gr(f),v.head.appendChild(f)))}}function DZ(u){pl.D(u),VT("dns-prefetch",u,null)}function PZ(u,f){pl.C(u,f),VT("preconnect",u,f)}function zZ(u,f,p){pl.L(u,f,p);var v=th;if(v&&u&&f){var O='link[rel="preload"][as="'+ta(f)+'"]';f==="image"&&p&&p.imageSrcSet?(O+='[imagesrcset="'+ta(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(O+='[imagesizes="'+ta(p.imageSizes)+'"]')):O+='[href="'+ta(u)+'"]';var C=O;switch(f){case"style":C=nh(u);break;case"script":C=rh(u)}ca.has(C)||(u=m({rel:"preload",href:f==="image"&&p&&p.imageSrcSet?void 0:u,as:f},p),ca.set(C,u),v.querySelector(O)!==null||f==="style"&&v.querySelector(Nm(C))||f==="script"&&v.querySelector(Cm(C))||(f=v.createElement("link"),_s(f,"link",u),Gr(f),v.head.appendChild(f)))}}function IZ(u,f){pl.m(u,f);var p=th;if(p&&u){var v=f&&typeof f.as=="string"?f.as:"script",O='link[rel="modulepreload"][as="'+ta(v)+'"][href="'+ta(u)+'"]',C=O;switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":C=rh(u)}if(!ca.has(C)&&(u=m({rel:"modulepreload",href:u},f),ca.set(C,u),p.querySelector(O)===null)){switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(Cm(C)))return}v=p.createElement("link"),_s(v,"link",u),Gr(v),p.head.appendChild(v)}}}function LZ(u,f,p){pl.S(u,f,p);var v=th;if(v&&u){var O=ec(v).hoistableStyles,C=nh(u);f=f||"default";var F=O.get(C);if(!F){var Y={loading:0,preload:null};if(F=v.querySelector(Nm(C)))Y.loading=5;else{u=m({rel:"stylesheet",href:u,"data-precedence":f},p),(p=ca.get(C))&&r4(u,p);var ue=F=v.createElement("link");Gr(ue),_s(ue,"link",u),ue._p=new Promise(function(we,Ee){ue.onload=we,ue.onerror=Ee}),ue.addEventListener("load",function(){Y.loading|=1}),ue.addEventListener("error",function(){Y.loading|=2}),Y.loading|=4,Ax(F,f,v)}F={type:"stylesheet",instance:F,count:1,state:Y},O.set(C,F)}}}function BZ(u,f){pl.X(u,f);var p=th;if(p&&u){var v=ec(p).hoistableScripts,O=rh(u),C=v.get(O);C||(C=p.querySelector(Cm(O)),C||(u=m({src:u,async:!0},f),(f=ca.get(O))&&s4(u,f),C=p.createElement("script"),Gr(C),_s(C,"link",u),p.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},v.set(O,C))}}function FZ(u,f){pl.M(u,f);var p=th;if(p&&u){var v=ec(p).hoistableScripts,O=rh(u),C=v.get(O);C||(C=p.querySelector(Cm(O)),C||(u=m({src:u,async:!0,type:"module"},f),(f=ca.get(O))&&s4(u,f),C=p.createElement("script"),Gr(C),_s(C,"link",u),p.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},v.set(O,C))}}function UT(u,f,p,v){var O=(O=ne.current)?Mx(O):null;if(!O)throw Error(r(446));switch(u){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(f=nh(p.href),p=ec(O).hoistableStyles,v=p.get(f),v||(v={type:"style",instance:null,count:0,state:null},p.set(f,v)),v):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){u=nh(p.href);var C=ec(O).hoistableStyles,F=C.get(u);if(F||(O=O.ownerDocument||O,F={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},C.set(u,F),(C=O.querySelector(Nm(u)))&&!C._p&&(F.instance=C,F.state.loading=5),ca.has(u)||(p={rel:"preload",as:"style",href:p.href,crossOrigin:p.crossOrigin,integrity:p.integrity,media:p.media,hrefLang:p.hrefLang,referrerPolicy:p.referrerPolicy},ca.set(u,p),C||qZ(O,u,p,F.state))),f&&v===null)throw Error(r(528,""));return F}if(f&&v!==null)throw Error(r(529,""));return null;case"script":return f=p.async,p=p.src,typeof p=="string"&&f&&typeof f!="function"&&typeof f!="symbol"?(f=rh(p),p=ec(O).hoistableScripts,v=p.get(f),v||(v={type:"script",instance:null,count:0,state:null},p.set(f,v)),v):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,u))}}function nh(u){return'href="'+ta(u)+'"'}function Nm(u){return'link[rel="stylesheet"]['+u+"]"}function WT(u){return m({},u,{"data-precedence":u.precedence,precedence:null})}function qZ(u,f,p,v){u.querySelector('link[rel="preload"][as="style"]['+f+"]")?v.loading=1:(f=u.createElement("link"),v.preload=f,f.addEventListener("load",function(){return v.loading|=1}),f.addEventListener("error",function(){return v.loading|=2}),_s(f,"link",p),Gr(f),u.head.appendChild(f))}function rh(u){return'[src="'+ta(u)+'"]'}function Cm(u){return"script[async]"+u}function GT(u,f,p){if(f.count++,f.instance===null)switch(f.type){case"style":var v=u.querySelector('style[data-href~="'+ta(p.href)+'"]');if(v)return f.instance=v,Gr(v),v;var O=m({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return v=(u.ownerDocument||u).createElement("style"),Gr(v),_s(v,"style",O),Ax(v,p.precedence,u),f.instance=v;case"stylesheet":O=nh(p.href);var C=u.querySelector(Nm(O));if(C)return f.state.loading|=4,f.instance=C,Gr(C),C;v=WT(p),(O=ca.get(O))&&r4(v,O),C=(u.ownerDocument||u).createElement("link"),Gr(C);var F=C;return F._p=new Promise(function(Y,ue){F.onload=Y,F.onerror=ue}),_s(C,"link",v),f.state.loading|=4,Ax(C,p.precedence,u),f.instance=C;case"script":return C=rh(p.src),(O=u.querySelector(Cm(C)))?(f.instance=O,Gr(O),O):(v=p,(O=ca.get(C))&&(v=m({},p),s4(v,O)),u=u.ownerDocument||u,O=u.createElement("script"),Gr(O),_s(O,"link",v),u.head.appendChild(O),f.instance=O);case"void":return null;default:throw Error(r(443,f.type))}else f.type==="stylesheet"&&(f.state.loading&4)===0&&(v=f.instance,f.state.loading|=4,Ax(v,p.precedence,u));return f.instance}function Ax(u,f,p){for(var v=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),O=v.length?v[v.length-1]:null,C=O,F=0;F title"):null)}function $Z(u,f,p){if(p===1||f.itemProp!=null)return!1;switch(u){case"meta":case"title":return!0;case"style":if(typeof f.precedence!="string"||typeof f.href!="string"||f.href==="")break;return!0;case"link":if(typeof f.rel!="string"||typeof f.href!="string"||f.href===""||f.onLoad||f.onError)break;switch(f.rel){case"stylesheet":return u=f.disabled,typeof f.precedence=="string"&&u==null;default:return!0}case"script":if(f.async&&typeof f.async!="function"&&typeof f.async!="symbol"&&!f.onLoad&&!f.onError&&f.src&&typeof f.src=="string")return!0}return!1}function KT(u){return!(u.type==="stylesheet"&&(u.state.loading&3)===0)}function HZ(u,f,p,v){if(p.type==="stylesheet"&&(typeof v.media!="string"||matchMedia(v.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var O=nh(v.href),C=f.querySelector(Nm(O));if(C){f=C._p,f!==null&&typeof f=="object"&&typeof f.then=="function"&&(u.count++,u=Dx.bind(u),f.then(u,u)),p.state.loading|=4,p.instance=C,Gr(C);return}C=f.ownerDocument||f,v=WT(v),(O=ca.get(O))&&r4(v,O),C=C.createElement("link"),Gr(C);var F=C;F._p=new Promise(function(Y,ue){F.onload=Y,F.onerror=ue}),_s(C,"link",v),p.instance=C}u.stylesheets===null&&(u.stylesheets=new Map),u.stylesheets.set(p,f),(f=p.state.preload)&&(p.state.loading&3)===0&&(u.count++,p=Dx.bind(u),f.addEventListener("load",p),f.addEventListener("error",p))}}var i4=0;function QZ(u,f){return u.stylesheets&&u.count===0&&zx(u,u.stylesheets),0i4?50:800)+f);return u.unsuspend=p,function(){u.unsuspend=null,clearTimeout(v),clearTimeout(O)}}:null}function Dx(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)zx(this,this.stylesheets);else if(this.unsuspend){var u=this.unsuspend;this.unsuspend=null,u()}}}var Px=null;function zx(u,f){u.stylesheets=null,u.unsuspend!==null&&(u.count++,Px=new Map,f.forEach(VZ,u),Px=null,Dx.call(u))}function VZ(u,f){if(!(f.state.loading&4)){var p=Px.get(u);if(p)var v=p.get(null);else{p=new Map,Px.set(u,p);for(var O=u.querySelectorAll("link[data-precedence],style[data-precedence]"),C=0;C"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),m4.exports=Zee(),m4.exports}var ete=Jee();function bI(t,e){return function(){return t.apply(e,arguments)}}const{toString:tte}=Object.prototype,{getPrototypeOf:Ej}=Object,{iterator:Hy,toStringTag:wI}=Symbol,Qy=(t=>e=>{const n=tte.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),eo=t=>(t=t.toLowerCase(),e=>Qy(e)===t),Vy=t=>e=>typeof e===t,{isArray:xf}=Array,Wh=Vy("undefined");function Mp(t){return t!==null&&!Wh(t)&&t.constructor!==null&&!Wh(t.constructor)&&wi(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const SI=eo("ArrayBuffer");function nte(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&SI(t.buffer),e}const rte=Vy("string"),wi=Vy("function"),kI=Vy("number"),Ap=t=>t!==null&&typeof t=="object",ste=t=>t===!0||t===!1,Z1=t=>{if(Qy(t)!=="object")return!1;const e=Ej(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(wI in t)&&!(Hy in t)},ite=t=>{if(!Ap(t)||Mp(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},ate=eo("Date"),ote=eo("File"),lte=eo("Blob"),cte=eo("FileList"),ute=t=>Ap(t)&&wi(t.pipe),dte=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||wi(t.append)&&((e=Qy(t))==="formdata"||e==="object"&&wi(t.toString)&&t.toString()==="[object FormData]"))},hte=eo("URLSearchParams"),[fte,mte,pte,gte]=["ReadableStream","Request","Response","Headers"].map(eo),xte=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Rp(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,s;if(typeof t!="object"&&(t=[t]),xf(t))for(r=0,s=t.length;r0;)if(s=n[r],e===s.toLowerCase())return s;return null}const $u=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,jI=t=>!Wh(t)&&t!==$u;function ek(){const{caseless:t,skipUndefined:e}=jI(this)&&this||{},n={},r=(s,i)=>{const a=t&&OI(n,i)||i;Z1(n[a])&&Z1(s)?n[a]=ek(n[a],s):Z1(s)?n[a]=ek({},s):xf(s)?n[a]=s.slice():(!e||!Wh(s))&&(n[a]=s)};for(let s=0,i=arguments.length;s(Rp(e,(s,i)=>{n&&wi(s)?t[i]=bI(s,n):t[i]=s},{allOwnKeys:r}),t),yte=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),bte=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},wte=(t,e,n,r)=>{let s,i,a;const l={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),i=s.length;i-- >0;)a=s[i],(!r||r(a,t,e))&&!l[a]&&(e[a]=t[a],l[a]=!0);t=n!==!1&&Ej(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Ste=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},kte=t=>{if(!t)return null;if(xf(t))return t;let e=t.length;if(!kI(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},Ote=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Ej(Uint8Array)),jte=(t,e)=>{const r=(t&&t[Hy]).call(t);let s;for(;(s=r.next())&&!s.done;){const i=s.value;e.call(t,i[0],i[1])}},Nte=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},Cte=eo("HTMLFormElement"),Tte=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),k9=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Ete=eo("RegExp"),NI=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Rp(n,(s,i)=>{let a;(a=e(s,i,t))!==!1&&(r[i]=a||s)}),Object.defineProperties(t,r)},_te=t=>{NI(t,(e,n)=>{if(wi(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(wi(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Mte=(t,e)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return xf(t)?r(t):r(String(t).split(e)),n},Ate=()=>{},Rte=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function Dte(t){return!!(t&&wi(t.append)&&t[wI]==="FormData"&&t[Hy])}const Pte=t=>{const e=new Array(10),n=(r,s)=>{if(Ap(r)){if(e.indexOf(r)>=0)return;if(Mp(r))return r;if(!("toJSON"in r)){e[s]=r;const i=xf(r)?[]:{};return Rp(r,(a,l)=>{const c=n(a,s+1);!Wh(c)&&(i[l]=c)}),e[s]=void 0,i}}return r};return n(t,0)},zte=eo("AsyncFunction"),Ite=t=>t&&(Ap(t)||wi(t))&&wi(t.then)&&wi(t.catch),CI=((t,e)=>t?setImmediate:e?((n,r)=>($u.addEventListener("message",({source:s,data:i})=>{s===$u&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),$u.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",wi($u.postMessage)),Lte=typeof queueMicrotask<"u"?queueMicrotask.bind($u):typeof process<"u"&&process.nextTick||CI,Bte=t=>t!=null&&wi(t[Hy]),je={isArray:xf,isArrayBuffer:SI,isBuffer:Mp,isFormData:dte,isArrayBufferView:nte,isString:rte,isNumber:kI,isBoolean:ste,isObject:Ap,isPlainObject:Z1,isEmptyObject:ite,isReadableStream:fte,isRequest:mte,isResponse:pte,isHeaders:gte,isUndefined:Wh,isDate:ate,isFile:ote,isBlob:lte,isRegExp:Ete,isFunction:wi,isStream:ute,isURLSearchParams:hte,isTypedArray:Ote,isFileList:cte,forEach:Rp,merge:ek,extend:vte,trim:xte,stripBOM:yte,inherits:bte,toFlatObject:wte,kindOf:Qy,kindOfTest:eo,endsWith:Ste,toArray:kte,forEachEntry:jte,matchAll:Nte,isHTMLForm:Cte,hasOwnProperty:k9,hasOwnProp:k9,reduceDescriptors:NI,freezeMethods:_te,toObjectSet:Mte,toCamelCase:Tte,noop:Ate,toFiniteNumber:Rte,findKey:OI,global:$u,isContextDefined:jI,isSpecCompliantForm:Dte,toJSONObject:Pte,isAsyncFn:zte,isThenable:Ite,setImmediate:CI,asap:Lte,isIterable:Bte};function Xt(t,e,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}je.inherits(Xt,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:je.toJSONObject(this.config),code:this.code,status:this.status}}});const TI=Xt.prototype,EI={};["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(t=>{EI[t]={value:t}});Object.defineProperties(Xt,EI);Object.defineProperty(TI,"isAxiosError",{value:!0});Xt.from=(t,e,n,r,s,i)=>{const a=Object.create(TI);je.toFlatObject(t,a,function(h){return h!==Error.prototype},d=>d!=="isAxiosError");const l=t&&t.message?t.message:"Error",c=e==null&&t?t.code:e;return Xt.call(a,l,c,n,r,s),t&&a.cause==null&&Object.defineProperty(a,"cause",{value:t,configurable:!0}),a.name=t&&t.name||"Error",i&&Object.assign(a,i),a};const Fte=null;function tk(t){return je.isPlainObject(t)||je.isArray(t)}function _I(t){return je.endsWith(t,"[]")?t.slice(0,-2):t}function O9(t,e,n){return t?t.concat(e).map(function(s,i){return s=_I(s),!n&&i?"["+s+"]":s}).join(n?".":""):e}function qte(t){return je.isArray(t)&&!t.some(tk)}const $te=je.toFlatObject(je,{},null,function(e){return/^is[A-Z]/.test(e)});function Uy(t,e,n){if(!je.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=je.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,S){return!je.isUndefined(S[w])});const r=n.metaTokens,s=n.visitor||h,i=n.dots,a=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&je.isSpecCompliantForm(e);if(!je.isFunction(s))throw new TypeError("visitor must be a function");function d(y){if(y===null)return"";if(je.isDate(y))return y.toISOString();if(je.isBoolean(y))return y.toString();if(!c&&je.isBlob(y))throw new Xt("Blob is not supported. Use a Buffer instead.");return je.isArrayBuffer(y)||je.isTypedArray(y)?c&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function h(y,w,S){let k=y;if(y&&!S&&typeof y=="object"){if(je.endsWith(w,"{}"))w=r?w:w.slice(0,-2),y=JSON.stringify(y);else if(je.isArray(y)&&qte(y)||(je.isFileList(y)||je.endsWith(w,"[]"))&&(k=je.toArray(y)))return w=_I(w),k.forEach(function(N,T){!(je.isUndefined(N)||N===null)&&e.append(a===!0?O9([w],T,i):a===null?w:w+"[]",d(N))}),!1}return tk(y)?!0:(e.append(O9(S,w,i),d(y)),!1)}const m=[],g=Object.assign($te,{defaultVisitor:h,convertValue:d,isVisitable:tk});function x(y,w){if(!je.isUndefined(y)){if(m.indexOf(y)!==-1)throw Error("Circular reference detected in "+w.join("."));m.push(y),je.forEach(y,function(k,j){(!(je.isUndefined(k)||k===null)&&s.call(e,k,je.isString(j)?j.trim():j,w,g))===!0&&x(k,w?w.concat(j):[j])}),m.pop()}}if(!je.isObject(t))throw new TypeError("data must be an object");return x(t),e}function j9(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function _j(t,e){this._pairs=[],t&&Uy(t,this,e)}const MI=_j.prototype;MI.append=function(e,n){this._pairs.push([e,n])};MI.toString=function(e){const n=e?function(r){return e.call(this,r,j9)}:j9;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Hte(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function AI(t,e,n){if(!e)return t;const r=n&&n.encode||Hte;je.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(e,n):i=je.isURLSearchParams(e)?e.toString():new _j(e,n).toString(r),i){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class N9{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,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){je.forEach(this.handlers,function(r){r!==null&&e(r)})}}const RI={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Qte=typeof URLSearchParams<"u"?URLSearchParams:_j,Vte=typeof FormData<"u"?FormData:null,Ute=typeof Blob<"u"?Blob:null,Wte={isBrowser:!0,classes:{URLSearchParams:Qte,FormData:Vte,Blob:Ute},protocols:["http","https","file","blob","url","data"]},Mj=typeof window<"u"&&typeof document<"u",nk=typeof navigator=="object"&&navigator||void 0,Gte=Mj&&(!nk||["ReactNative","NativeScript","NS"].indexOf(nk.product)<0),Xte=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Yte=Mj&&window.location.href||"http://localhost",Kte=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Mj,hasStandardBrowserEnv:Gte,hasStandardBrowserWebWorkerEnv:Xte,navigator:nk,origin:Yte},Symbol.toStringTag,{value:"Module"})),$s={...Kte,...Wte};function Zte(t,e){return Uy(t,new $s.classes.URLSearchParams,{visitor:function(n,r,s,i){return $s.isNode&&je.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function Jte(t){return je.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function ene(t){const e={},n=Object.keys(t);let r;const s=n.length;let i;for(r=0;r=n.length;return a=!a&&je.isArray(s)?s.length:a,c?(je.hasOwnProp(s,a)?s[a]=[s[a],r]:s[a]=r,!l):((!s[a]||!je.isObject(s[a]))&&(s[a]=[]),e(n,r,s[a],i)&&je.isArray(s[a])&&(s[a]=ene(s[a])),!l)}if(je.isFormData(t)&&je.isFunction(t.entries)){const n={};return je.forEachEntry(t,(r,s)=>{e(Jte(r),s,n,0)}),n}return null}function tne(t,e,n){if(je.isString(t))try{return(e||JSON.parse)(t),je.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Dp={transitional:RI,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=je.isObject(e);if(i&&je.isHTMLForm(e)&&(e=new FormData(e)),je.isFormData(e))return s?JSON.stringify(DI(e)):e;if(je.isArrayBuffer(e)||je.isBuffer(e)||je.isStream(e)||je.isFile(e)||je.isBlob(e)||je.isReadableStream(e))return e;if(je.isArrayBufferView(e))return e.buffer;if(je.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Zte(e,this.formSerializer).toString();if((l=je.isFileList(e))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Uy(l?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),tne(e)):e}],transformResponse:[function(e){const n=this.transitional||Dp.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(je.isResponse(e)||je.isReadableStream(e))return e;if(e&&je.isString(e)&&(r&&!this.responseType||s)){const a=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(e,this.parseReviver)}catch(l){if(a)throw l.name==="SyntaxError"?Xt.from(l,Xt.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:$s.classes.FormData,Blob:$s.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};je.forEach(["delete","get","head","post","put","patch"],t=>{Dp.headers[t]={}});const nne=je.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"]),rne=t=>{const e={};let n,r,s;return t&&t.split(` -`).forEach(function(a){s=a.indexOf(":"),n=a.substring(0,s).trim().toLowerCase(),r=a.substring(s+1).trim(),!(!n||e[n]&&nne[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},C9=Symbol("internals");function Dm(t){return t&&String(t).trim().toLowerCase()}function J1(t){return t===!1||t==null?t:je.isArray(t)?t.map(J1):String(t)}function sne(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const ine=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function x4(t,e,n,r,s){if(je.isFunction(r))return r.call(this,e,n);if(s&&(e=n),!!je.isString(e)){if(je.isString(r))return e.indexOf(r)!==-1;if(je.isRegExp(r))return r.test(e)}}function ane(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function one(t,e){const n=je.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(s,i,a){return this[r].call(this,e,s,i,a)},configurable:!0})})}let Si=class{constructor(e){e&&this.set(e)}set(e,n,r){const s=this;function i(l,c,d){const h=Dm(c);if(!h)throw new Error("header name must be a non-empty string");const m=je.findKey(s,h);(!m||s[m]===void 0||d===!0||d===void 0&&s[m]!==!1)&&(s[m||c]=J1(l))}const a=(l,c)=>je.forEach(l,(d,h)=>i(d,h,c));if(je.isPlainObject(e)||e instanceof this.constructor)a(e,n);else if(je.isString(e)&&(e=e.trim())&&!ine(e))a(rne(e),n);else if(je.isObject(e)&&je.isIterable(e)){let l={},c,d;for(const h of e){if(!je.isArray(h))throw TypeError("Object iterator must return a key-value pair");l[d=h[0]]=(c=l[d])?je.isArray(c)?[...c,h[1]]:[c,h[1]]:h[1]}a(l,n)}else e!=null&&i(n,e,r);return this}get(e,n){if(e=Dm(e),e){const r=je.findKey(this,e);if(r){const s=this[r];if(!n)return s;if(n===!0)return sne(s);if(je.isFunction(n))return n.call(this,s,r);if(je.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Dm(e),e){const r=je.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||x4(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let s=!1;function i(a){if(a=Dm(a),a){const l=je.findKey(r,a);l&&(!n||x4(r,r[l],l,n))&&(delete r[l],s=!0)}}return je.isArray(e)?e.forEach(i):i(e),s}clear(e){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!e||x4(this,this[i],i,e,!0))&&(delete this[i],s=!0)}return s}normalize(e){const n=this,r={};return je.forEach(this,(s,i)=>{const a=je.findKey(r,i);if(a){n[a]=J1(s),delete n[i];return}const l=e?ane(i):String(i).trim();l!==i&&delete n[i],n[l]=J1(s),r[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return je.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=e&&je.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).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,...n){const r=new this(e);return n.forEach(s=>r.set(s)),r}static accessor(e){const r=(this[C9]=this[C9]={accessors:{}}).accessors,s=this.prototype;function i(a){const l=Dm(a);r[l]||(one(s,a),r[l]=!0)}return je.isArray(e)?e.forEach(i):i(e),this}};Si.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);je.reduceDescriptors(Si.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});je.freezeMethods(Si);function v4(t,e){const n=this||Dp,r=e||n,s=Si.from(r.headers);let i=r.data;return je.forEach(t,function(l){i=l.call(n,i,s.normalize(),e?e.status:void 0)}),s.normalize(),i}function PI(t){return!!(t&&t.__CANCEL__)}function vf(t,e,n){Xt.call(this,t??"canceled",Xt.ERR_CANCELED,e,n),this.name="CanceledError"}je.inherits(vf,Xt,{__CANCEL__:!0});function zI(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new Xt("Request failed with status code "+n.status,[Xt.ERR_BAD_REQUEST,Xt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function lne(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function cne(t,e){t=t||10;const n=new Array(t),r=new Array(t);let s=0,i=0,a;return e=e!==void 0?e:1e3,function(c){const d=Date.now(),h=r[i];a||(a=d),n[s]=c,r[s]=d;let m=i,g=0;for(;m!==s;)g+=n[m++],m=m%t;if(s=(s+1)%t,s===i&&(i=(i+1)%t),d-a{n=h,s=null,i&&(clearTimeout(i),i=null),t(...d)};return[(...d)=>{const h=Date.now(),m=h-n;m>=r?a(d,h):(s=d,i||(i=setTimeout(()=>{i=null,a(s)},r-m)))},()=>s&&a(s)]}const Mv=(t,e,n=3)=>{let r=0;const s=cne(50,250);return une(i=>{const a=i.loaded,l=i.lengthComputable?i.total:void 0,c=a-r,d=s(c),h=a<=l;r=a;const m={loaded:a,total:l,progress:l?a/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&h?(l-a)/d:void 0,event:i,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(m)},n)},T9=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},E9=t=>(...e)=>je.asap(()=>t(...e)),dne=$s.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,$s.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL($s.origin),$s.navigator&&/(msie|trident)/i.test($s.navigator.userAgent)):()=>!0,hne=$s.hasStandardBrowserEnv?{write(t,e,n,r,s,i,a){if(typeof document>"u")return;const l=[`${t}=${encodeURIComponent(e)}`];je.isNumber(n)&&l.push(`expires=${new Date(n).toUTCString()}`),je.isString(r)&&l.push(`path=${r}`),je.isString(s)&&l.push(`domain=${s}`),i===!0&&l.push("secure"),je.isString(a)&&l.push(`SameSite=${a}`),document.cookie=l.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function fne(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function mne(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function II(t,e,n){let r=!fne(e);return t&&(r||n==!1)?mne(t,e):e}const _9=t=>t instanceof Si?{...t}:t;function rd(t,e){e=e||{};const n={};function r(d,h,m,g){return je.isPlainObject(d)&&je.isPlainObject(h)?je.merge.call({caseless:g},d,h):je.isPlainObject(h)?je.merge({},h):je.isArray(h)?h.slice():h}function s(d,h,m,g){if(je.isUndefined(h)){if(!je.isUndefined(d))return r(void 0,d,m,g)}else return r(d,h,m,g)}function i(d,h){if(!je.isUndefined(h))return r(void 0,h)}function a(d,h){if(je.isUndefined(h)){if(!je.isUndefined(d))return r(void 0,d)}else return r(void 0,h)}function l(d,h,m){if(m in e)return r(d,h);if(m in t)return r(void 0,d)}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(d,h,m)=>s(_9(d),_9(h),m,!0)};return je.forEach(Object.keys({...t,...e}),function(h){const m=c[h]||s,g=m(t[h],e[h],h);je.isUndefined(g)&&m!==l||(n[h]=g)}),n}const LI=t=>{const e=rd({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:a,auth:l}=e;if(e.headers=a=Si.from(a),e.url=AI(II(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),je.isFormData(n)){if($s.hasStandardBrowserEnv||$s.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(je.isFunction(n.getHeaders)){const c=n.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([h,m])=>{d.includes(h.toLowerCase())&&a.set(h,m)})}}if($s.hasStandardBrowserEnv&&(r&&je.isFunction(r)&&(r=r(e)),r||r!==!1&&dne(e.url))){const c=s&&i&&hne.read(i);c&&a.set(s,c)}return e},pne=typeof XMLHttpRequest<"u",gne=pne&&function(t){return new Promise(function(n,r){const s=LI(t);let i=s.data;const a=Si.from(s.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=s,h,m,g,x,y;function w(){x&&x(),y&&y(),s.cancelToken&&s.cancelToken.unsubscribe(h),s.signal&&s.signal.removeEventListener("abort",h)}let S=new XMLHttpRequest;S.open(s.method.toUpperCase(),s.url,!0),S.timeout=s.timeout;function k(){if(!S)return;const N=Si.from("getAllResponseHeaders"in S&&S.getAllResponseHeaders()),E={data:!l||l==="text"||l==="json"?S.responseText:S.response,status:S.status,statusText:S.statusText,headers:N,config:t,request:S};zI(function(M){n(M),w()},function(M){r(M),w()},E),S=null}"onloadend"in S?S.onloadend=k:S.onreadystatechange=function(){!S||S.readyState!==4||S.status===0&&!(S.responseURL&&S.responseURL.indexOf("file:")===0)||setTimeout(k)},S.onabort=function(){S&&(r(new Xt("Request aborted",Xt.ECONNABORTED,t,S)),S=null)},S.onerror=function(T){const E=T&&T.message?T.message:"Network Error",_=new Xt(E,Xt.ERR_NETWORK,t,S);_.event=T||null,r(_),S=null},S.ontimeout=function(){let T=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const E=s.transitional||RI;s.timeoutErrorMessage&&(T=s.timeoutErrorMessage),r(new Xt(T,E.clarifyTimeoutError?Xt.ETIMEDOUT:Xt.ECONNABORTED,t,S)),S=null},i===void 0&&a.setContentType(null),"setRequestHeader"in S&&je.forEach(a.toJSON(),function(T,E){S.setRequestHeader(E,T)}),je.isUndefined(s.withCredentials)||(S.withCredentials=!!s.withCredentials),l&&l!=="json"&&(S.responseType=s.responseType),d&&([g,y]=Mv(d,!0),S.addEventListener("progress",g)),c&&S.upload&&([m,x]=Mv(c),S.upload.addEventListener("progress",m),S.upload.addEventListener("loadend",x)),(s.cancelToken||s.signal)&&(h=N=>{S&&(r(!N||N.type?new vf(null,t,S):N),S.abort(),S=null)},s.cancelToken&&s.cancelToken.subscribe(h),s.signal&&(s.signal.aborted?h():s.signal.addEventListener("abort",h)));const j=lne(s.url);if(j&&$s.protocols.indexOf(j)===-1){r(new Xt("Unsupported protocol "+j+":",Xt.ERR_BAD_REQUEST,t));return}S.send(i||null)})},xne=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,s;const i=function(d){if(!s){s=!0,l();const h=d instanceof Error?d:this.reason;r.abort(h instanceof Xt?h:new vf(h instanceof Error?h.message:h))}};let a=e&&setTimeout(()=>{a=null,i(new Xt(`timeout ${e} of ms exceeded`,Xt.ETIMEDOUT))},e);const l=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),t=null)};t.forEach(d=>d.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>je.asap(l),c}},vne=function*(t,e){let n=t.byteLength;if(n{const s=yne(t,e);let i=0,a,l=c=>{a||(a=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:d,value:h}=await s.next();if(d){l(),c.close();return}let m=h.byteLength;if(n){let g=i+=m;n(g)}c.enqueue(new Uint8Array(h))}catch(d){throw l(d),d}},cancel(c){return l(c),s.return()}},{highWaterMark:2})},A9=64*1024,{isFunction:Wx}=je,wne=(({Request:t,Response:e})=>({Request:t,Response:e}))(je.global),{ReadableStream:R9,TextEncoder:D9}=je.global,P9=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Sne=t=>{t=je.merge.call({skipUndefined:!0},wne,t);const{fetch:e,Request:n,Response:r}=t,s=e?Wx(e):typeof fetch=="function",i=Wx(n),a=Wx(r);if(!s)return!1;const l=s&&Wx(R9),c=s&&(typeof D9=="function"?(y=>w=>y.encode(w))(new D9):async y=>new Uint8Array(await new n(y).arrayBuffer())),d=i&&l&&P9(()=>{let y=!1;const w=new n($s.origin,{body:new R9,method:"POST",get duplex(){return y=!0,"half"}}).headers.has("Content-Type");return y&&!w}),h=a&&l&&P9(()=>je.isReadableStream(new r("").body)),m={stream:h&&(y=>y.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!m[y]&&(m[y]=(w,S)=>{let k=w&&w[y];if(k)return k.call(w);throw new Xt(`Response type '${y}' is not supported`,Xt.ERR_NOT_SUPPORT,S)})});const g=async y=>{if(y==null)return 0;if(je.isBlob(y))return y.size;if(je.isSpecCompliantForm(y))return(await new n($s.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(je.isArrayBufferView(y)||je.isArrayBuffer(y))return y.byteLength;if(je.isURLSearchParams(y)&&(y=y+""),je.isString(y))return(await c(y)).byteLength},x=async(y,w)=>{const S=je.toFiniteNumber(y.getContentLength());return S??g(w)};return async y=>{let{url:w,method:S,data:k,signal:j,cancelToken:N,timeout:T,onDownloadProgress:E,onUploadProgress:_,responseType:M,headers:I,withCredentials:P="same-origin",fetchOptions:L}=LI(y),H=e||fetch;M=M?(M+"").toLowerCase():"text";let U=xne([j,N&&N.toAbortSignal()],T),ee=null;const z=U&&U.unsubscribe&&(()=>{U.unsubscribe()});let Q;try{if(_&&d&&S!=="get"&&S!=="head"&&(Q=await x(I,k))!==0){let ie=new n(w,{method:"POST",body:k,duplex:"half"}),W;if(je.isFormData(k)&&(W=ie.headers.get("content-type"))&&I.setContentType(W),ie.body){const[q,V]=T9(Q,Mv(E9(_)));k=M9(ie.body,A9,q,V)}}je.isString(P)||(P=P?"include":"omit");const B=i&&"credentials"in n.prototype,X={...L,signal:U,method:S.toUpperCase(),headers:I.normalize().toJSON(),body:k,duplex:"half",credentials:B?P:void 0};ee=i&&new n(w,X);let J=await(i?H(ee,L):H(w,X));const G=h&&(M==="stream"||M==="response");if(h&&(E||G&&z)){const ie={};["status","statusText","headers"].forEach(te=>{ie[te]=J[te]});const W=je.toFiniteNumber(J.headers.get("content-length")),[q,V]=E&&T9(W,Mv(E9(E),!0))||[];J=new r(M9(J.body,A9,q,()=>{V&&V(),z&&z()}),ie)}M=M||"text";let R=await m[je.findKey(m,M)||"text"](J,y);return!G&&z&&z(),await new Promise((ie,W)=>{zI(ie,W,{data:R,headers:Si.from(J.headers),status:J.status,statusText:J.statusText,config:y,request:ee})})}catch(B){throw z&&z(),B&&B.name==="TypeError"&&/Load failed|fetch/i.test(B.message)?Object.assign(new Xt("Network Error",Xt.ERR_NETWORK,y,ee),{cause:B.cause||B}):Xt.from(B,B&&B.code,y,ee)}}},kne=new Map,BI=t=>{let e=t&&t.env||{};const{fetch:n,Request:r,Response:s}=e,i=[r,s,n];let a=i.length,l=a,c,d,h=kne;for(;l--;)c=i[l],d=h.get(c),d===void 0&&h.set(c,d=l?new Map:Sne(e)),h=d;return d};BI();const Aj={http:Fte,xhr:gne,fetch:{get:BI}};je.forEach(Aj,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const z9=t=>`- ${t}`,One=t=>je.isFunction(t)||t===null||t===!1;function jne(t,e){t=je.isArray(t)?t:[t];const{length:n}=t;let r,s;const i={};for(let a=0;a`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=n?a.length>1?`since : -`+a.map(z9).join(` -`):" "+z9(a[0]):"as no adapter specified";throw new Xt("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return s}const FI={getAdapter:jne,adapters:Aj};function y4(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new vf(null,t)}function I9(t){return y4(t),t.headers=Si.from(t.headers),t.data=v4.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),FI.getAdapter(t.adapter||Dp.adapter,t)(t).then(function(r){return y4(t),r.data=v4.call(t,t.transformResponse,r),r.headers=Si.from(r.headers),r},function(r){return PI(r)||(y4(t),r&&r.response&&(r.response.data=v4.call(t,t.transformResponse,r.response),r.response.headers=Si.from(r.response.headers))),Promise.reject(r)})}const qI="1.13.2",Wy={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Wy[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const L9={};Wy.transitional=function(e,n,r){function s(i,a){return"[Axios v"+qI+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,l)=>{if(e===!1)throw new Xt(s(a," has been removed"+(n?" in "+n:"")),Xt.ERR_DEPRECATED);return n&&!L9[a]&&(L9[a]=!0,console.warn(s(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,a,l):!0}};Wy.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function Nne(t,e,n){if(typeof t!="object")throw new Xt("options must be an object",Xt.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let s=r.length;for(;s-- >0;){const i=r[s],a=e[i];if(a){const l=t[i],c=l===void 0||a(l,i,t);if(c!==!0)throw new Xt("option "+i+" must be "+c,Xt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Xt("Unknown option "+i,Xt.ERR_BAD_OPTION)}}const ev={assertOptions:Nne,validators:Wy},uo=ev.validators;let Zu=class{constructor(e){this.defaults=e||{},this.interceptors={request:new N9,response:new N9}}async request(e,n){try{return await this._request(e,n)}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,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=rd(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&ev.assertOptions(r,{silentJSONParsing:uo.transitional(uo.boolean),forcedJSONParsing:uo.transitional(uo.boolean),clarifyTimeoutError:uo.transitional(uo.boolean)},!1),s!=null&&(je.isFunction(s)?n.paramsSerializer={serialize:s}:ev.assertOptions(s,{encode:uo.function,serialize:uo.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ev.assertOptions(n,{baseUrl:uo.spelling("baseURL"),withXsrfToken:uo.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&je.merge(i.common,i[n.method]);i&&je.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),n.headers=Si.concat(a,i);const l=[];let c=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(c=c&&w.synchronous,l.unshift(w.fulfilled,w.rejected))});const d=[];this.interceptors.response.forEach(function(w){d.push(w.fulfilled,w.rejected)});let h,m=0,g;if(!c){const y=[I9.bind(this),void 0];for(y.unshift(...l),y.push(...d),g=y.length,h=Promise.resolve(n);m{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 a=new Promise(l=>{r.subscribe(l),i=l}).then(s);return a.cancel=function(){r.unsubscribe(i)},a},e(function(i,a,l){r.reason||(r.reason=new vf(i,a,l),n(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 n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new $I(function(s){e=s}),cancel:e}}};function Tne(t){return function(n){return t.apply(null,n)}}function Ene(t){return je.isObject(t)&&t.isAxiosError===!0}const rk={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(rk).forEach(([t,e])=>{rk[e]=t});function HI(t){const e=new Zu(t),n=bI(Zu.prototype.request,e);return je.extend(n,Zu.prototype,e,{allOwnKeys:!0}),je.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return HI(rd(t,s))},n}const Br=HI(Dp);Br.Axios=Zu;Br.CanceledError=vf;Br.CancelToken=Cne;Br.isCancel=PI;Br.VERSION=qI;Br.toFormData=Uy;Br.AxiosError=Xt;Br.Cancel=Br.CanceledError;Br.all=function(e){return Promise.all(e)};Br.spread=Tne;Br.isAxiosError=Ene;Br.mergeConfig=rd;Br.AxiosHeaders=Si;Br.formToJSON=t=>DI(je.isHTMLForm(t)?new FormData(t):t);Br.getAdapter=FI.getAdapter;Br.HttpStatusCode=rk;Br.default=Br;const{Axios:wDe,AxiosError:SDe,CanceledError:kDe,isCancel:ODe,CancelToken:jDe,VERSION:NDe,all:CDe,Cancel:TDe,isAxiosError:EDe,spread:_De,toFormData:MDe,AxiosHeaders:ADe,HttpStatusCode:RDe,formToJSON:DDe,getAdapter:PDe,mergeConfig:zDe}=Br,_ne=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r({classGroupId:t,validator:e}),QI=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Av="-",B9=[],Ane="arbitrary..",Rne=t=>{const e=Pne(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Dne(a);const l=a.split(Av),c=l[0]===""&&l.length>1?1:0;return VI(l,c,e)},getConflictingClassGroupIds:(a,l)=>{if(l){const c=r[a],d=n[a];return c?d?_ne(d,c):c:d||B9}return n[a]||B9}}},VI=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const d=VI(t,e+1,i);if(d)return d}const a=n.validators;if(a===null)return;const l=e===0?t.join(Av):t.slice(e).join(Av),c=a.length;for(let d=0;dt.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?Ane+r:void 0})(),Pne=t=>{const{theme:e,classGroups:n}=t;return zne(n,e)},zne=(t,e)=>{const n=QI();for(const r in t){const s=t[r];Rj(s,n,r,e)}return n},Rj=(t,e,n,r)=>{const s=t.length;for(let i=0;i{if(typeof t=="string"){Lne(t,e,n);return}if(typeof t=="function"){Bne(t,e,n,r);return}Fne(t,e,n,r)},Lne=(t,e,n)=>{const r=t===""?e:UI(e,t);r.classGroupId=n},Bne=(t,e,n,r)=>{if(qne(t)){Rj(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(Mne(n,t))},Fne=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let a=0;a{let n=t;const r=e.split(Av),s=r.length;for(let i=0;i"isThemeGetter"in t&&t.isThemeGetter===!0,$ne=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const s=(i,a)=>{n[i]=a,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(i){let a=n[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in n?n[i]=a:s(i,a)}}},sk="!",F9=":",Hne=[],q9=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),Qne=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let a=0,l=0,c=0,d;const h=s.length;for(let w=0;wc?d-c:void 0;return q9(i,x,g,y)};if(e){const s=e+F9,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):q9(Hne,!1,a,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},Vne=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},Une=t=>({cache:$ne(t.cacheSize),parseClassName:Qne(t),sortModifiers:Vne(t),...Rne(t)}),Wne=/\s+/,Gne=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i}=e,a=[],l=t.trim().split(Wne);let c="";for(let d=l.length-1;d>=0;d-=1){const h=l[d],{isExternal:m,modifiers:g,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:w}=n(h);if(m){c=h+(c.length>0?" "+c:c);continue}let S=!!w,k=r(S?y.substring(0,w):y);if(!k){if(!S){c=h+(c.length>0?" "+c:c);continue}if(k=r(y),!k){c=h+(c.length>0?" "+c:c);continue}S=!1}const j=g.length===0?"":g.length===1?g[0]:i(g).join(":"),N=x?j+sk:j,T=N+k;if(a.indexOf(T)>-1)continue;a.push(T);const E=s(k,S);for(let _=0;_0?" "+c:c)}return c},Xne=(...t)=>{let e=0,n,r,s="";for(;e{if(typeof t=="string")return t;let e,n="";for(let r=0;r{let n,r,s,i;const a=c=>{const d=e.reduce((h,m)=>m(h),t());return n=Une(d),r=n.cache.get,s=n.cache.set,i=l,l(c)},l=c=>{const d=r(c);if(d)return d;const h=Gne(c,n);return s(c,h),h};return i=a,(...c)=>i(Xne(...c))},Kne=[],ls=t=>{const e=n=>n[t]||Kne;return e.isThemeGetter=!0,e},GI=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,XI=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Zne=/^\d+\/\d+$/,Jne=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ere=/\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$/,tre=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,nre=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,rre=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ih=t=>Zne.test(t),rn=t=>!!t&&!Number.isNaN(Number(t)),Oc=t=>!!t&&Number.isInteger(Number(t)),b4=t=>t.endsWith("%")&&rn(t.slice(0,-1)),gl=t=>Jne.test(t),sre=()=>!0,ire=t=>ere.test(t)&&!tre.test(t),YI=()=>!1,are=t=>nre.test(t),ore=t=>rre.test(t),lre=t=>!dt(t)&&!ht(t),cre=t=>yf(t,JI,YI),dt=t=>GI.test(t),Au=t=>yf(t,eL,ire),w4=t=>yf(t,mre,rn),$9=t=>yf(t,KI,YI),ure=t=>yf(t,ZI,ore),Gx=t=>yf(t,tL,are),ht=t=>XI.test(t),Pm=t=>bf(t,eL),dre=t=>bf(t,pre),H9=t=>bf(t,KI),hre=t=>bf(t,JI),fre=t=>bf(t,ZI),Xx=t=>bf(t,tL,!0),yf=(t,e,n)=>{const r=GI.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},bf=(t,e,n=!1)=>{const r=XI.exec(t);return r?r[1]?e(r[1]):n:!1},KI=t=>t==="position"||t==="percentage",ZI=t=>t==="image"||t==="url",JI=t=>t==="length"||t==="size"||t==="bg-size",eL=t=>t==="length",mre=t=>t==="number",pre=t=>t==="family-name",tL=t=>t==="shadow",gre=()=>{const t=ls("color"),e=ls("font"),n=ls("text"),r=ls("font-weight"),s=ls("tracking"),i=ls("leading"),a=ls("breakpoint"),l=ls("container"),c=ls("spacing"),d=ls("radius"),h=ls("shadow"),m=ls("inset-shadow"),g=ls("text-shadow"),x=ls("drop-shadow"),y=ls("blur"),w=ls("perspective"),S=ls("aspect"),k=ls("ease"),j=ls("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...T(),ht,dt],_=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],I=()=>[ht,dt,c],P=()=>[ih,"full","auto",...I()],L=()=>[Oc,"none","subgrid",ht,dt],H=()=>["auto",{span:["full",Oc,ht,dt]},Oc,ht,dt],U=()=>[Oc,"auto",ht,dt],ee=()=>["auto","min","max","fr",ht,dt],z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...I()],X=()=>[ih,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],J=()=>[t,ht,dt],G=()=>[...T(),H9,$9,{position:[ht,dt]}],R=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ie=()=>["auto","cover","contain",hre,cre,{size:[ht,dt]}],W=()=>[b4,Pm,Au],q=()=>["","none","full",d,ht,dt],V=()=>["",rn,Pm,Au],te=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>[rn,b4,H9,$9],se=()=>["","none",y,ht,dt],re=()=>["none",rn,ht,dt],oe=()=>["none",rn,ht,dt],Te=()=>[rn,ht,dt],We=()=>[ih,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[gl],breakpoint:[gl],color:[sre],container:[gl],"drop-shadow":[gl],ease:["in","out","in-out"],font:[lre],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[gl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[gl],shadow:[gl],spacing:["px",rn],text:[gl],"text-shadow":[gl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ih,dt,ht,S]}],container:["container"],columns:[{columns:[rn,dt,ht,l]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{start:P()}],end:[{end:P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[Oc,"auto",ht,dt]}],basis:[{basis:[ih,"full","auto",l,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[rn,ih,"auto","initial","none",dt]}],grow:[{grow:["",rn,ht,dt]}],shrink:[{shrink:["",rn,ht,dt]}],order:[{order:[Oc,"first","last","none",ht,dt]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:H()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:H()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...z(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...z()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":z()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],w:[{w:[l,"screen",...X()]}],"min-w":[{"min-w":[l,"screen","none",...X()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[a]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",n,Pm,Au]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ht,w4]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",b4,dt]}],"font-family":[{font:[dre,dt,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,ht,dt]}],"line-clamp":[{"line-clamp":[rn,"none",ht,w4]}],leading:[{leading:[i,...I()]}],"list-image":[{"list-image":["none",ht,dt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ht,dt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:J()}],"text-color":[{text:J()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[rn,"from-font","auto",ht,Au]}],"text-decoration-color":[{decoration:J()}],"underline-offset":[{"underline-offset":[rn,"auto",ht,dt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ht,dt]}],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",ht,dt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:G()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Oc,ht,dt],radial:["",ht,dt],conic:[Oc,ht,dt]},fre,ure]}],"bg-color":[{bg:J()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:J()}],"gradient-via":[{via:J()}],"gradient-to":[{to:J()}],rounded:[{rounded:q()}],"rounded-s":[{"rounded-s":q()}],"rounded-e":[{"rounded-e":q()}],"rounded-t":[{"rounded-t":q()}],"rounded-r":[{"rounded-r":q()}],"rounded-b":[{"rounded-b":q()}],"rounded-l":[{"rounded-l":q()}],"rounded-ss":[{"rounded-ss":q()}],"rounded-se":[{"rounded-se":q()}],"rounded-ee":[{"rounded-ee":q()}],"rounded-es":[{"rounded-es":q()}],"rounded-tl":[{"rounded-tl":q()}],"rounded-tr":[{"rounded-tr":q()}],"rounded-br":[{"rounded-br":q()}],"rounded-bl":[{"rounded-bl":q()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":V()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"border-color":[{border:J()}],"border-color-x":[{"border-x":J()}],"border-color-y":[{"border-y":J()}],"border-color-s":[{"border-s":J()}],"border-color-e":[{"border-e":J()}],"border-color-t":[{"border-t":J()}],"border-color-r":[{"border-r":J()}],"border-color-b":[{"border-b":J()}],"border-color-l":[{"border-l":J()}],"divide-color":[{divide:J()}],"outline-style":[{outline:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[rn,ht,dt]}],"outline-w":[{outline:["",rn,Pm,Au]}],"outline-color":[{outline:J()}],shadow:[{shadow:["","none",h,Xx,Gx]}],"shadow-color":[{shadow:J()}],"inset-shadow":[{"inset-shadow":["none",m,Xx,Gx]}],"inset-shadow-color":[{"inset-shadow":J()}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:J()}],"ring-offset-w":[{"ring-offset":[rn,Au]}],"ring-offset-color":[{"ring-offset":J()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":J()}],"text-shadow":[{"text-shadow":["none",g,Xx,Gx]}],"text-shadow-color":[{"text-shadow":J()}],opacity:[{opacity:[rn,ht,dt]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],"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":[rn]}],"mask-image-linear-from-pos":[{"mask-linear-from":K()}],"mask-image-linear-to-pos":[{"mask-linear-to":K()}],"mask-image-linear-from-color":[{"mask-linear-from":J()}],"mask-image-linear-to-color":[{"mask-linear-to":J()}],"mask-image-t-from-pos":[{"mask-t-from":K()}],"mask-image-t-to-pos":[{"mask-t-to":K()}],"mask-image-t-from-color":[{"mask-t-from":J()}],"mask-image-t-to-color":[{"mask-t-to":J()}],"mask-image-r-from-pos":[{"mask-r-from":K()}],"mask-image-r-to-pos":[{"mask-r-to":K()}],"mask-image-r-from-color":[{"mask-r-from":J()}],"mask-image-r-to-color":[{"mask-r-to":J()}],"mask-image-b-from-pos":[{"mask-b-from":K()}],"mask-image-b-to-pos":[{"mask-b-to":K()}],"mask-image-b-from-color":[{"mask-b-from":J()}],"mask-image-b-to-color":[{"mask-b-to":J()}],"mask-image-l-from-pos":[{"mask-l-from":K()}],"mask-image-l-to-pos":[{"mask-l-to":K()}],"mask-image-l-from-color":[{"mask-l-from":J()}],"mask-image-l-to-color":[{"mask-l-to":J()}],"mask-image-x-from-pos":[{"mask-x-from":K()}],"mask-image-x-to-pos":[{"mask-x-to":K()}],"mask-image-x-from-color":[{"mask-x-from":J()}],"mask-image-x-to-color":[{"mask-x-to":J()}],"mask-image-y-from-pos":[{"mask-y-from":K()}],"mask-image-y-to-pos":[{"mask-y-to":K()}],"mask-image-y-from-color":[{"mask-y-from":J()}],"mask-image-y-to-color":[{"mask-y-to":J()}],"mask-image-radial":[{"mask-radial":[ht,dt]}],"mask-image-radial-from-pos":[{"mask-radial-from":K()}],"mask-image-radial-to-pos":[{"mask-radial-to":K()}],"mask-image-radial-from-color":[{"mask-radial-from":J()}],"mask-image-radial-to-color":[{"mask-radial-to":J()}],"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":T()}],"mask-image-conic-pos":[{"mask-conic":[rn]}],"mask-image-conic-from-pos":[{"mask-conic-from":K()}],"mask-image-conic-to-pos":[{"mask-conic-to":K()}],"mask-image-conic-from-color":[{"mask-conic-from":J()}],"mask-image-conic-to-color":[{"mask-conic-to":J()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:G()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ht,dt]}],filter:[{filter:["","none",ht,dt]}],blur:[{blur:se()}],brightness:[{brightness:[rn,ht,dt]}],contrast:[{contrast:[rn,ht,dt]}],"drop-shadow":[{"drop-shadow":["","none",x,Xx,Gx]}],"drop-shadow-color":[{"drop-shadow":J()}],grayscale:[{grayscale:["",rn,ht,dt]}],"hue-rotate":[{"hue-rotate":[rn,ht,dt]}],invert:[{invert:["",rn,ht,dt]}],saturate:[{saturate:[rn,ht,dt]}],sepia:[{sepia:["",rn,ht,dt]}],"backdrop-filter":[{"backdrop-filter":["","none",ht,dt]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[rn,ht,dt]}],"backdrop-contrast":[{"backdrop-contrast":[rn,ht,dt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",rn,ht,dt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[rn,ht,dt]}],"backdrop-invert":[{"backdrop-invert":["",rn,ht,dt]}],"backdrop-opacity":[{"backdrop-opacity":[rn,ht,dt]}],"backdrop-saturate":[{"backdrop-saturate":[rn,ht,dt]}],"backdrop-sepia":[{"backdrop-sepia":["",rn,ht,dt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ht,dt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[rn,"initial",ht,dt]}],ease:[{ease:["linear","initial",k,ht,dt]}],delay:[{delay:[rn,ht,dt]}],animate:[{animate:["none",j,ht,dt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,ht,dt]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:oe()}],"scale-x":[{"scale-x":oe()}],"scale-y":[{"scale-y":oe()}],"scale-z":[{"scale-z":oe()}],"scale-3d":["scale-3d"],skew:[{skew:Te()}],"skew-x":[{"skew-x":Te()}],"skew-y":[{"skew-y":Te()}],transform:[{transform:[ht,dt,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:We()}],"translate-x":[{"translate-x":We()}],"translate-y":[{"translate-y":We()}],"translate-z":[{"translate-z":We()}],"translate-none":["translate-none"],accent:[{accent:J()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:J()}],"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",ht,dt]}],"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":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",ht,dt]}],fill:[{fill:["none",...J()]}],"stroke-w":[{stroke:[rn,Pm,Au,w4]}],stroke:[{stroke:["none",...J()]}],"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"]}},xre=Yne(gre);function ve(...t){return xre(Rz(t))}const qt=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:ve("rounded-xl border bg-card text-card-foreground shadow",t),...e}));qt.displayName="Card";const Fn=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:ve("flex flex-col space-y-1.5 p-6",t),...e}));Fn.displayName="CardHeader";const qn=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:ve("font-semibold leading-none tracking-tight",t),...e}));qn.displayName="CardTitle";const ts=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:ve("text-sm text-muted-foreground",t),...e}));ts.displayName="CardDescription";const Gn=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:ve("p-6 pt-0",t),...e}));Gn.displayName="CardContent";const nL=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:ve("flex items-center p-6 pt-0",t),...e}));nL.displayName="CardFooter";var S4="rovingFocusGroup.onEntryFocus",vre={bubbles:!1,cancelable:!0},Pp="RovingFocusGroup",[ik,rL,yre]=Dy(Pp),[bre,Gy]=Ra(Pp,[yre]),[wre,Sre]=bre(Pp),sL=b.forwardRef((t,e)=>o.jsx(ik.Provider,{scope:t.__scopeRovingFocusGroup,children:o.jsx(ik.Slot,{scope:t.__scopeRovingFocusGroup,children:o.jsx(kre,{...t,ref:e})})}));sL.displayName=Pp;var kre=b.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:h=!1,...m}=t,g=b.useRef(null),x=Yn(e,g),y=Np(i),[w,S]=Gl({prop:a,defaultProp:l??null,onChange:c,caller:Pp}),[k,j]=b.useState(!1),N=qs(d),T=rL(n),E=b.useRef(!1),[_,M]=b.useState(0);return b.useEffect(()=>{const I=g.current;if(I)return I.addEventListener(S4,N),()=>I.removeEventListener(S4,N)},[N]),o.jsx(wre,{scope:n,orientation:r,dir:y,loop:s,currentTabStopId:w,onItemFocus:b.useCallback(I=>S(I),[S]),onItemShiftTab:b.useCallback(()=>j(!0),[]),onFocusableItemAdd:b.useCallback(()=>M(I=>I+1),[]),onFocusableItemRemove:b.useCallback(()=>M(I=>I-1),[]),children:o.jsx(gn.div,{tabIndex:k||_===0?-1:0,"data-orientation":r,...m,ref:x,style:{outline:"none",...t.style},onMouseDown:nt(t.onMouseDown,()=>{E.current=!0}),onFocus:nt(t.onFocus,I=>{const P=!E.current;if(I.target===I.currentTarget&&P&&!k){const L=new CustomEvent(S4,vre);if(I.currentTarget.dispatchEvent(L),!L.defaultPrevented){const H=T().filter(B=>B.focusable),U=H.find(B=>B.active),ee=H.find(B=>B.id===w),Q=[U,ee,...H].filter(Boolean).map(B=>B.ref.current);oL(Q,h)}}E.current=!1}),onBlur:nt(t.onBlur,()=>j(!1))})})}),iL="RovingFocusGroupItem",aL=b.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:a,...l}=t,c=Ui(),d=i||c,h=Sre(iL,n),m=h.currentTabStopId===d,g=rL(n),{onFocusableItemAdd:x,onFocusableItemRemove:y,currentTabStopId:w}=h;return b.useEffect(()=>{if(r)return x(),()=>y()},[r,x,y]),o.jsx(ik.ItemSlot,{scope:n,id:d,focusable:r,active:s,children:o.jsx(gn.span,{tabIndex:m?0:-1,"data-orientation":h.orientation,...l,ref:e,onMouseDown:nt(t.onMouseDown,S=>{r?h.onItemFocus(d):S.preventDefault()}),onFocus:nt(t.onFocus,()=>h.onItemFocus(d)),onKeyDown:nt(t.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){h.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const k=Nre(S,h.orientation,h.dir);if(k!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let N=g().filter(T=>T.focusable).map(T=>T.ref.current);if(k==="last")N.reverse();else if(k==="prev"||k==="next"){k==="prev"&&N.reverse();const T=N.indexOf(S.currentTarget);N=h.loop?Cre(N,T+1):N.slice(T+1)}setTimeout(()=>oL(N))}}),children:typeof a=="function"?a({isCurrentTabStop:m,hasTabStop:w!=null}):a})})});aL.displayName=iL;var Ore={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function jre(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Nre(t,e,n){const r=jre(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Ore[r]}function oL(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function Cre(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var lL=sL,cL=aL,Xy="Tabs",[Tre]=Ra(Xy,[Gy]),uL=Gy(),[Ere,Dj]=Tre(Xy),dL=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:a="horizontal",dir:l,activationMode:c="automatic",...d}=t,h=Np(l),[m,g]=Gl({prop:r,onChange:s,defaultProp:i??"",caller:Xy});return o.jsx(Ere,{scope:n,baseId:Ui(),value:m,onValueChange:g,orientation:a,dir:h,activationMode:c,children:o.jsx(gn.div,{dir:h,"data-orientation":a,...d,ref:e})})});dL.displayName=Xy;var hL="TabsList",fL=b.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...s}=t,i=Dj(hL,n),a=uL(n);return o.jsx(lL,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:o.jsx(gn.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:e})})});fL.displayName=hL;var mL="TabsTrigger",pL=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=t,a=Dj(mL,n),l=uL(n),c=vL(a.baseId,r),d=yL(a.baseId,r),h=r===a.value;return o.jsx(cL,{asChild:!0,...l,focusable:!s,active:h,children:o.jsx(gn.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":d,"data-state":h?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...i,ref:e,onMouseDown:nt(t.onMouseDown,m=>{!s&&m.button===0&&m.ctrlKey===!1?a.onValueChange(r):m.preventDefault()}),onKeyDown:nt(t.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&a.onValueChange(r)}),onFocus:nt(t.onFocus,()=>{const m=a.activationMode!=="manual";!h&&!s&&m&&a.onValueChange(r)})})})});pL.displayName=mL;var gL="TabsContent",xL=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...a}=t,l=Dj(gL,n),c=vL(l.baseId,r),d=yL(l.baseId,r),h=r===l.value,m=b.useRef(h);return b.useEffect(()=>{const g=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(g)},[]),o.jsx(si,{present:s||h,children:({present:g})=>o.jsx(gn.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!g,id:d,tabIndex:0,...a,ref:e,style:{...t.style,animationDuration:m.current?"0s":void 0},children:g&&i})})});xL.displayName=gL;function vL(t,e){return`${t}-trigger-${e}`}function yL(t,e){return`${t}-content-${e}`}var _re=dL,bL=fL,wL=pL,SL=xL;const ja=_re,Wi=b.forwardRef(({className:t,...e},n)=>o.jsx(bL,{ref:n,className:ve("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...e}));Wi.displayName=bL.displayName;const Lt=b.forwardRef(({className:t,...e},n)=>o.jsx(wL,{ref:n,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",t),...e}));Lt.displayName=wL.displayName;const un=b.forwardRef(({className:t,...e},n)=>o.jsx(SL,{ref:n,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",t),...e}));un.displayName=SL.displayName;function Mre(t,e){return b.useReducer((n,r)=>e[n][r]??n,t)}var Pj="ScrollArea",[kL]=Ra(Pj),[Are,Da]=kL(Pj),OL=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:i=600,...a}=t,[l,c]=b.useState(null),[d,h]=b.useState(null),[m,g]=b.useState(null),[x,y]=b.useState(null),[w,S]=b.useState(null),[k,j]=b.useState(0),[N,T]=b.useState(0),[E,_]=b.useState(!1),[M,I]=b.useState(!1),P=Yn(e,H=>c(H)),L=Np(s);return o.jsx(Are,{scope:n,type:r,dir:L,scrollHideDelay:i,scrollArea:l,viewport:d,onViewportChange:h,content:m,onContentChange:g,scrollbarX:x,onScrollbarXChange:y,scrollbarXEnabled:E,onScrollbarXEnabledChange:_,scrollbarY:w,onScrollbarYChange:S,scrollbarYEnabled:M,onScrollbarYEnabledChange:I,onCornerWidthChange:j,onCornerHeightChange:T,children:o.jsx(gn.div,{dir:L,...a,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":k+"px","--radix-scroll-area-corner-height":N+"px",...t.style}})})});OL.displayName=Pj;var jL="ScrollAreaViewport",NL=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,nonce:s,...i}=t,a=Da(jL,n),l=b.useRef(null),c=Yn(e,l,a.onViewportChange);return o.jsxs(o.Fragment,{children:[o.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}),o.jsx(gn.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...t.style},children:o.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});NL.displayName=jL;var Bo="ScrollAreaScrollbar",zj=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Da(Bo,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=s,l=t.orientation==="horizontal";return b.useEffect(()=>(l?i(!0):a(!0),()=>{l?i(!1):a(!1)}),[l,i,a]),s.type==="hover"?o.jsx(Rre,{...r,ref:e,forceMount:n}):s.type==="scroll"?o.jsx(Dre,{...r,ref:e,forceMount:n}):s.type==="auto"?o.jsx(CL,{...r,ref:e,forceMount:n}):s.type==="always"?o.jsx(Ij,{...r,ref:e}):null});zj.displayName=Bo;var Rre=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Da(Bo,t.__scopeScrollArea),[i,a]=b.useState(!1);return b.useEffect(()=>{const l=s.scrollArea;let c=0;if(l){const d=()=>{window.clearTimeout(c),a(!0)},h=()=>{c=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return l.addEventListener("pointerenter",d),l.addEventListener("pointerleave",h),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",d),l.removeEventListener("pointerleave",h)}}},[s.scrollArea,s.scrollHideDelay]),o.jsx(si,{present:n||i,children:o.jsx(CL,{"data-state":i?"visible":"hidden",...r,ref:e})})}),Dre=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Da(Bo,t.__scopeScrollArea),i=t.orientation==="horizontal",a=Ky(()=>c("SCROLL_END"),100),[l,c]=Mre("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 b.useEffect(()=>{if(l==="idle"){const d=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(d)}},[l,s.scrollHideDelay,c]),b.useEffect(()=>{const d=s.viewport,h=i?"scrollLeft":"scrollTop";if(d){let m=d[h];const g=()=>{const x=d[h];m!==x&&(c("SCROLL"),a()),m=x};return d.addEventListener("scroll",g),()=>d.removeEventListener("scroll",g)}},[s.viewport,i,c,a]),o.jsx(si,{present:n||l!=="hidden",children:o.jsx(Ij,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:nt(t.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:nt(t.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),CL=b.forwardRef((t,e)=>{const n=Da(Bo,t.__scopeScrollArea),{forceMount:r,...s}=t,[i,a]=b.useState(!1),l=t.orientation==="horizontal",c=Ky(()=>{if(n.viewport){const d=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=t,s=Da(Bo,t.__scopeScrollArea),i=b.useRef(null),a=b.useRef(0),[l,c]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=AL(l.viewport,l.content),h={...r,sizes:l,onSizesChange:c,hasThumb:d>0&&d<1,onThumbChange:g=>i.current=g,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:g=>a.current=g};function m(g,x){return Fre(g,a.current,l,x)}return n==="horizontal"?o.jsx(Pre,{...h,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const g=s.viewport.scrollLeft,x=Q9(g,l,s.dir);i.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollLeft=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollLeft=m(g,s.dir))}}):n==="vertical"?o.jsx(zre,{...h,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const g=s.viewport.scrollTop,x=Q9(g,l);i.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollTop=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollTop=m(g))}}):null}),Pre=b.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=Da(Bo,t.__scopeScrollArea),[a,l]=b.useState(),c=b.useRef(null),d=Yn(e,c,i.onScrollbarXChange);return b.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),o.jsx(EL,{"data-orientation":"horizontal",...s,ref:d,sizes:n,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":Yy(n)+"px",...t.style},onThumbPointerDown:h=>t.onThumbPointerDown(h.x),onDragScroll:h=>t.onDragScroll(h.x),onWheelScroll:(h,m)=>{if(i.viewport){const g=i.viewport.scrollLeft+h.deltaX;t.onWheelScroll(g),DL(g,m)&&h.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Dv(a.paddingLeft),paddingEnd:Dv(a.paddingRight)}})}})}),zre=b.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=Da(Bo,t.__scopeScrollArea),[a,l]=b.useState(),c=b.useRef(null),d=Yn(e,c,i.onScrollbarYChange);return b.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),o.jsx(EL,{"data-orientation":"vertical",...s,ref:d,sizes:n,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":Yy(n)+"px",...t.style},onThumbPointerDown:h=>t.onThumbPointerDown(h.y),onDragScroll:h=>t.onDragScroll(h.y),onWheelScroll:(h,m)=>{if(i.viewport){const g=i.viewport.scrollTop+h.deltaY;t.onWheelScroll(g),DL(g,m)&&h.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Dv(a.paddingTop),paddingEnd:Dv(a.paddingBottom)}})}})}),[Ire,TL]=kL(Bo),EL=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:d,onWheelScroll:h,onResize:m,...g}=t,x=Da(Bo,n),[y,w]=b.useState(null),S=Yn(e,P=>w(P)),k=b.useRef(null),j=b.useRef(""),N=x.viewport,T=r.content-r.viewport,E=qs(h),_=qs(c),M=Ky(m,10);function I(P){if(k.current){const L=P.clientX-k.current.left,H=P.clientY-k.current.top;d({x:L,y:H})}}return b.useEffect(()=>{const P=L=>{const H=L.target;y?.contains(H)&&E(L,T)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[N,y,T,E]),b.useEffect(_,[r,_]),Gh(y,M),Gh(x.content,M),o.jsx(Ire,{scope:n,scrollbar:y,hasThumb:s,onThumbChange:qs(i),onThumbPointerUp:qs(a),onThumbPositionChange:_,onThumbPointerDown:qs(l),children:o.jsx(gn.div,{...g,ref:S,style:{position:"absolute",...g.style},onPointerDown:nt(t.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),k.current=y.getBoundingClientRect(),j.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),I(P))}),onPointerMove:nt(t.onPointerMove,I),onPointerUp:nt(t.onPointerUp,P=>{const L=P.target;L.hasPointerCapture(P.pointerId)&&L.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=j.current,x.viewport&&(x.viewport.style.scrollBehavior=""),k.current=null})})})}),Rv="ScrollAreaThumb",_L=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=TL(Rv,t.__scopeScrollArea);return o.jsx(si,{present:n||s.hasThumb,children:o.jsx(Lre,{ref:e,...r})})}),Lre=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...s}=t,i=Da(Rv,n),a=TL(Rv,n),{onThumbPositionChange:l}=a,c=Yn(e,m=>a.onThumbChange(m)),d=b.useRef(void 0),h=Ky(()=>{d.current&&(d.current(),d.current=void 0)},100);return b.useEffect(()=>{const m=i.viewport;if(m){const g=()=>{if(h(),!d.current){const x=qre(m,l);d.current=x,l()}};return l(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[i.viewport,h,l]),o.jsx(gn.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:nt(t.onPointerDownCapture,m=>{const x=m.target.getBoundingClientRect(),y=m.clientX-x.left,w=m.clientY-x.top;a.onThumbPointerDown({x:y,y:w})}),onPointerUp:nt(t.onPointerUp,a.onThumbPointerUp)})});_L.displayName=Rv;var Lj="ScrollAreaCorner",ML=b.forwardRef((t,e)=>{const n=Da(Lj,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?o.jsx(Bre,{...t,ref:e}):null});ML.displayName=Lj;var Bre=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,s=Da(Lj,n),[i,a]=b.useState(0),[l,c]=b.useState(0),d=!!(i&&l);return Gh(s.scrollbarX,()=>{const h=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(h),c(h)}),Gh(s.scrollbarY,()=>{const h=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(h),a(h)}),d?o.jsx(gn.div,{...r,ref:e,style:{width:i,height:l,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function Dv(t){return t?parseInt(t,10):0}function AL(t,e){const n=t/e;return isNaN(n)?0:n}function Yy(t){const e=AL(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function Fre(t,e,n,r="ltr"){const s=Yy(n),i=s/2,a=e||i,l=s-a,c=n.scrollbar.paddingStart+a,d=n.scrollbar.size-n.scrollbar.paddingEnd-l,h=n.content-n.viewport,m=r==="ltr"?[0,h]:[h*-1,0];return RL([c,d],m)(t)}function Q9(t,e,n="ltr"){const r=Yy(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-s,a=e.content-e.viewport,l=i-r,c=n==="ltr"?[0,a]:[a*-1,0],d=xj(t,c);return RL([0,a],[0,l])(d)}function RL(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function DL(t,e){return t>0&&t{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return(function s(){const i={left:t.scrollLeft,top:t.scrollTop},a=n.left!==i.left,l=n.top!==i.top;(a||l)&&e(),n=i,r=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(r)};function Ky(t,e){const n=qs(t),r=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),b.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function Gh(t,e){const n=qs(e);gj(()=>{let r=0;if(t){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(t),()=>{window.cancelAnimationFrame(r),s.unobserve(t)}}},[t,n])}var PL=OL,$re=NL,Hre=ML;const wn=b.forwardRef(({className:t,children:e,viewportRef:n,...r},s)=>o.jsxs(PL,{ref:s,className:ve("relative overflow-hidden",t),...r,children:[o.jsx($re,{ref:n,className:"h-full w-full rounded-[inherit]",children:e}),o.jsx(ak,{}),o.jsx(ak,{orientation:"horizontal"}),o.jsx(Hre,{})]}));wn.displayName=PL.displayName;const ak=b.forwardRef(({className:t,orientation:e="vertical",...n},r)=>o.jsx(zj,{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]",t),...n,children:o.jsx(_L,{className:"relative flex-1 rounded-full bg-border"})}));ak.displayName=zj.displayName;function Qre({className:t,...e}){return o.jsx("div",{className:ve("animate-pulse rounded-md bg-primary/10",t),...e})}function Vre(t,e=[]){let n=[];function r(i,a){const l=b.createContext(a);l.displayName=i+"Context";const c=n.length;n=[...n,a];const d=m=>{const{scope:g,children:x,...y}=m,w=g?.[t]?.[c]||l,S=b.useMemo(()=>y,Object.values(y));return o.jsx(w.Provider,{value:S,children:x})};d.displayName=i+"Provider";function h(m,g){const x=g?.[t]?.[c]||l,y=b.useContext(x);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${m}\` must be used within \`${i}\``)}return[d,h]}const s=()=>{const i=n.map(a=>b.createContext(a));return function(l){const c=l?.[t]||i;return b.useMemo(()=>({[`__scope${t}`]:{...l,[t]:c}}),[l,c])}};return s.scopeName=t,[r,Ure(s,...e)]}function Ure(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((l,{useScope:c,scopeName:d})=>{const m=c(i)[`__scope${d}`];return{...l,...m}},{});return b.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var Wre=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],zL=Wre.reduce((t,e)=>{const n=vj(`Primitive.${e}`),r=b.forwardRef((s,i)=>{const{asChild:a,...l}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),Bj="Progress",Fj=100,[Gre]=Vre(Bj),[Xre,Yre]=Gre(Bj),IL=b.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=Kre,...a}=t;(s||s===0)&&!V9(s)&&console.error(Zre(`${s}`,"Progress"));const l=V9(s)?s:Fj;r!==null&&!U9(r,l)&&console.error(Jre(`${r}`,"Progress"));const c=U9(r,l)?r:null,d=Pv(c)?i(c,l):void 0;return o.jsx(Xre,{scope:n,value:c,max:l,children:o.jsx(zL.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":Pv(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":FL(c,l),"data-value":c??void 0,"data-max":l,...a,ref:e})})});IL.displayName=Bj;var LL="ProgressIndicator",BL=b.forwardRef((t,e)=>{const{__scopeProgress:n,...r}=t,s=Yre(LL,n);return o.jsx(zL.div,{"data-state":FL(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:e})});BL.displayName=LL;function Kre(t,e){return`${Math.round(t/e*100)}%`}function FL(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function Pv(t){return typeof t=="number"}function V9(t){return Pv(t)&&!isNaN(t)&&t>0}function U9(t,e){return Pv(t)&&!isNaN(t)&&t<=e&&t>=0}function Zre(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Fj}\`.`}function Jre(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: +`+v.stack}}var Ot=Object.prototype.hasOwnProperty,xt=t.unstable_scheduleCallback,kn=t.unstable_cancelCallback,It=t.unstable_shouldYield,Yt=t.unstable_requestPaint,_t=t.unstable_now,mt=t.unstable_getCurrentPriorityLevel,Ne=t.unstable_ImmediatePriority,Ie=t.unstable_UserBlockingPriority,st=t.unstable_NormalPriority,yt=t.unstable_LowPriority,Pt=t.unstable_IdlePriority,Mt=t.log,zn=t.unstable_setDisableYieldValue,Fe=null,rt=null;function tn(u){if(typeof Mt=="function"&&zn(u),rt&&typeof rt.setStrictMode=="function")try{rt.setStrictMode(Fe,u)}catch{}}var Rt=Math.clz32?Math.clz32:it,ke=Math.log,Pe=Math.LN2;function it(u){return u>>>=0,u===0?32:31-(ke(u)/Pe|0)|0}var ot=256,nn=262144,Kt=4194304;function pt(u){var f=u&42;if(f!==0)return f;switch(u&-u){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 u&261888;case 262144:case 524288:case 1048576:case 2097152:return u&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return u&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return u}}function xr(u,f,p){var v=u.pendingLanes;if(v===0)return 0;var O=0,C=u.suspendedLanes,q=u.pingedLanes;u=u.warmLanes;var K=v&134217727;return K!==0?(v=K&~C,v!==0?O=pt(v):(q&=K,q!==0?O=pt(q):p||(p=K&~u,p!==0&&(O=pt(p))))):(K=v&~C,K!==0?O=pt(K):q!==0?O=pt(q):p||(p=v&~u,p!==0&&(O=pt(p)))),O===0?0:f!==0&&f!==O&&(f&C)===0&&(C=O&-O,p=f&-f,C>=p||C===32&&(p&4194048)!==0)?f:O}function Ur(u,f){return(u.pendingLanes&~(u.suspendedLanes&~u.pingedLanes)&f)===0}function Wr(u,f){switch(u){case 1:case 2:case 4:case 8:case 64:return f+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 f+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 vr(){var u=Kt;return Kt<<=1,(Kt&62914560)===0&&(Kt=4194304),u}function In(u){for(var f=[],p=0;31>p;p++)f.push(u);return f}function cr(u,f){u.pendingLanes|=f,f!==268435456&&(u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0)}function nr(u,f,p,v,O,C){var q=u.pendingLanes;u.pendingLanes=p,u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0,u.expiredLanes&=p,u.entangledLanes&=p,u.errorRecoveryDisabledLanes&=p,u.shellSuspendCounter=0;var K=u.entanglements,ue=u.expirationTimes,we=u.hiddenUpdates;for(p=q&~p;0"u")return null;try{return u.activeElement||u.body}catch{return u.body}}var cK=/[\n"\\]/g;function ta(u){return u.replace(cK,function(f){return"\\"+f.charCodeAt(0).toString(16)+" "})}function hw(u,f,p,v,O,C,q,K){u.name="",q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?u.type=q:u.removeAttribute("type"),f!=null?q==="number"?(f===0&&u.value===""||u.value!=f)&&(u.value=""+ea(f)):u.value!==""+ea(f)&&(u.value=""+ea(f)):q!=="submit"&&q!=="reset"||u.removeAttribute("value"),f!=null?fw(u,q,ea(f)):p!=null?fw(u,q,ea(p)):v!=null&&u.removeAttribute("value"),O==null&&C!=null&&(u.defaultChecked=!!C),O!=null&&(u.checked=O&&typeof O!="function"&&typeof O!="symbol"),K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"?u.name=""+ea(K):u.removeAttribute("name")}function D7(u,f,p,v,O,C,q,K){if(C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(u.type=C),f!=null||p!=null){if(!(C!=="submit"&&C!=="reset"||f!=null)){dw(u);return}p=p!=null?""+ea(p):"",f=f!=null?""+ea(f):p,K||f===u.value||(u.value=f),u.defaultValue=f}v=v??O,v=typeof v!="function"&&typeof v!="symbol"&&!!v,u.checked=K?u.checked:!!v,u.defaultChecked=!!v,q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"&&(u.name=q),dw(u)}function fw(u,f,p){f==="number"&&zg(u.ownerDocument)===u||u.defaultValue===""+p||(u.defaultValue=""+p)}function Nd(u,f,p,v){if(u=u.options,f){f={};for(var O=0;O"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vw=!1;if(tl)try{var Gf={};Object.defineProperty(Gf,"passive",{get:function(){vw=!0}}),window.addEventListener("test",Gf,Gf),window.removeEventListener("test",Gf,Gf)}catch{vw=!1}var nc=null,yw=null,Lg=null;function q7(){if(Lg)return Lg;var u,f=yw,p=f.length,v,O="value"in nc?nc.value:nc.textContent,C=O.length;for(u=0;u=Kf),W7=" ",G7=!1;function X7(u,f){switch(u){case"keyup":return IK.indexOf(f.keyCode)!==-1;case"keydown":return f.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Y7(u){return u=u.detail,typeof u=="object"&&"data"in u?u.data:null}var _d=!1;function BK(u,f){switch(u){case"compositionend":return Y7(f);case"keypress":return f.which!==32?null:(G7=!0,W7);case"textInput":return u=f.data,u===W7&&G7?null:u;default:return null}}function FK(u,f){if(_d)return u==="compositionend"||!Ow&&X7(u,f)?(u=q7(),Lg=yw=nc=null,_d=!1,u):null;switch(u){case"paste":return null;case"keypress":if(!(f.ctrlKey||f.altKey||f.metaKey)||f.ctrlKey&&f.altKey){if(f.char&&1=f)return{node:p,offset:f-u};u=v}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=sC(p)}}function aC(u,f){return u&&f?u===f?!0:u&&u.nodeType===3?!1:f&&f.nodeType===3?aC(u,f.parentNode):"contains"in u?u.contains(f):u.compareDocumentPosition?!!(u.compareDocumentPosition(f)&16):!1:!1}function oC(u){u=u!=null&&u.ownerDocument!=null&&u.ownerDocument.defaultView!=null?u.ownerDocument.defaultView:window;for(var f=zg(u.document);f instanceof u.HTMLIFrameElement;){try{var p=typeof f.contentWindow.location.href=="string"}catch{p=!1}if(p)u=f.contentWindow;else break;f=zg(u.document)}return f}function Cw(u){var f=u&&u.nodeName&&u.nodeName.toLowerCase();return f&&(f==="input"&&(u.type==="text"||u.type==="search"||u.type==="tel"||u.type==="url"||u.type==="password")||f==="textarea"||u.contentEditable==="true")}var GK=tl&&"documentMode"in document&&11>=document.documentMode,Ad=null,Tw=null,tm=null,Ew=!1;function lC(u,f,p){var v=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;Ew||Ad==null||Ad!==zg(v)||(v=Ad,"selectionStart"in v&&Cw(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),tm&&em(tm,v)||(tm=v,v=Ax(Tw,"onSelect"),0>=q,O-=q,ao=1<<32-Rt(f)+O|p<Zt?(fn=vt,vt=null):fn=vt.sibling;var Bn=Se(pe,vt,ye[Zt],Ae);if(Bn===null){vt===null&&(vt=fn);break}u&&vt&&Bn.alternate===null&&f(pe,vt),fe=C(Bn,fe,Zt),Ln===null?Nt=Bn:Ln.sibling=Bn,Ln=Bn,vt=fn}if(Zt===ye.length)return p(pe,vt),yn&&rl(pe,Zt),Nt;if(vt===null){for(;ZtZt?(fn=vt,vt=null):fn=vt.sibling;var Oc=Se(pe,vt,Bn.value,Ae);if(Oc===null){vt===null&&(vt=fn);break}u&&vt&&Oc.alternate===null&&f(pe,vt),fe=C(Oc,fe,Zt),Ln===null?Nt=Oc:Ln.sibling=Oc,Ln=Oc,vt=fn}if(Bn.done)return p(pe,vt),yn&&rl(pe,Zt),Nt;if(vt===null){for(;!Bn.done;Zt++,Bn=ye.next())Bn=Re(pe,Bn.value,Ae),Bn!==null&&(fe=C(Bn,fe,Zt),Ln===null?Nt=Bn:Ln.sibling=Bn,Ln=Bn);return yn&&rl(pe,Zt),Nt}for(vt=v(vt);!Bn.done;Zt++,Bn=ye.next())Bn=Ce(vt,pe,Zt,Bn.value,Ae),Bn!==null&&(u&&Bn.alternate!==null&&vt.delete(Bn.key===null?Zt:Bn.key),fe=C(Bn,fe,Zt),Ln===null?Nt=Bn:Ln.sibling=Bn,Ln=Bn);return u&&vt.forEach(function(mJ){return f(pe,mJ)}),yn&&rl(pe,Zt),Nt}function Jn(pe,fe,ye,Ae){if(typeof ye=="object"&&ye!==null&&ye.type===w&&ye.key===null&&(ye=ye.props.children),typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case x:e:{for(var Nt=ye.key;fe!==null;){if(fe.key===Nt){if(Nt=ye.type,Nt===w){if(fe.tag===7){p(pe,fe.sibling),Ae=O(fe,ye.props.children),Ae.return=pe,pe=Ae;break e}}else if(fe.elementType===Nt||typeof Nt=="object"&&Nt!==null&&Nt.$$typeof===L&&ju(Nt)===fe.type){p(pe,fe.sibling),Ae=O(fe,ye.props),om(Ae,ye),Ae.return=pe,pe=Ae;break e}p(pe,fe);break}else f(pe,fe);fe=fe.sibling}ye.type===w?(Ae=bu(ye.props.children,pe.mode,Ae,ye.key),Ae.return=pe,pe=Ae):(Ae=Gg(ye.type,ye.key,ye.props,null,pe.mode,Ae),om(Ae,ye),Ae.return=pe,pe=Ae)}return q(pe);case y:e:{for(Nt=ye.key;fe!==null;){if(fe.key===Nt)if(fe.tag===4&&fe.stateNode.containerInfo===ye.containerInfo&&fe.stateNode.implementation===ye.implementation){p(pe,fe.sibling),Ae=O(fe,ye.children||[]),Ae.return=pe,pe=Ae;break e}else{p(pe,fe);break}else f(pe,fe);fe=fe.sibling}Ae=zw(ye,pe.mode,Ae),Ae.return=pe,pe=Ae}return q(pe);case L:return ye=ju(ye),Jn(pe,fe,ye,Ae)}if(Q(ye))return ut(pe,fe,ye,Ae);if(U(ye)){if(Nt=U(ye),typeof Nt!="function")throw Error(r(150));return ye=Nt.call(ye),At(pe,fe,ye,Ae)}if(typeof ye.then=="function")return Jn(pe,fe,tx(ye),Ae);if(ye.$$typeof===N)return Jn(pe,fe,Kg(pe,ye),Ae);nx(pe,ye)}return typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint"?(ye=""+ye,fe!==null&&fe.tag===6?(p(pe,fe.sibling),Ae=O(fe,ye),Ae.return=pe,pe=Ae):(p(pe,fe),Ae=Pw(ye,pe.mode,Ae),Ae.return=pe,pe=Ae),q(pe)):p(pe,fe)}return function(pe,fe,ye,Ae){try{am=0;var Nt=Jn(pe,fe,ye,Ae);return $d=null,Nt}catch(vt){if(vt===qd||vt===Jg)throw vt;var Ln=Mi(29,vt,null,pe.mode);return Ln.lanes=Ae,Ln.return=pe,Ln}finally{}}}var Cu=AC(!0),MC=AC(!1),oc=!1;function Gw(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xw(u,f){u=u.updateQueue,f.updateQueue===u&&(f.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,callbacks:null})}function lc(u){return{lane:u,tag:0,payload:null,callback:null,next:null}}function cc(u,f,p){var v=u.updateQueue;if(v===null)return null;if(v=v.shared,(Hn&2)!==0){var O=v.pending;return O===null?f.next=f:(f.next=O.next,O.next=f),v.pending=f,f=Wg(u),pC(u,null,p),f}return Ug(u,v,f,p),Wg(u)}function lm(u,f,p){if(f=f.updateQueue,f!==null&&(f=f.shared,(p&4194048)!==0)){var v=f.lanes;v&=u.pendingLanes,p|=v,f.lanes=p,xs(u,p)}}function Yw(u,f){var p=u.updateQueue,v=u.alternate;if(v!==null&&(v=v.updateQueue,p===v)){var O=null,C=null;if(p=p.firstBaseUpdate,p!==null){do{var q={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};C===null?O=C=q:C=C.next=q,p=p.next}while(p!==null);C===null?O=C=f:C=C.next=f}else O=C=f;p={baseState:v.baseState,firstBaseUpdate:O,lastBaseUpdate:C,shared:v.shared,callbacks:v.callbacks},u.updateQueue=p;return}u=p.lastBaseUpdate,u===null?p.firstBaseUpdate=f:u.next=f,p.lastBaseUpdate=f}var Kw=!1;function cm(){if(Kw){var u=Fd;if(u!==null)throw u}}function um(u,f,p,v){Kw=!1;var O=u.updateQueue;oc=!1;var C=O.firstBaseUpdate,q=O.lastBaseUpdate,K=O.shared.pending;if(K!==null){O.shared.pending=null;var ue=K,we=ue.next;ue.next=null,q===null?C=we:q.next=we,q=ue;var Ee=u.alternate;Ee!==null&&(Ee=Ee.updateQueue,K=Ee.lastBaseUpdate,K!==q&&(K===null?Ee.firstBaseUpdate=we:K.next=we,Ee.lastBaseUpdate=ue))}if(C!==null){var Re=O.baseState;q=0,Ee=we=ue=null,K=C;do{var Se=K.lane&-536870913,Ce=Se!==K.lane;if(Ce?(hn&Se)===Se:(v&Se)===Se){Se!==0&&Se===Bd&&(Kw=!0),Ee!==null&&(Ee=Ee.next={lane:0,tag:K.tag,payload:K.payload,callback:null,next:null});e:{var ut=u,At=K;Se=f;var Jn=p;switch(At.tag){case 1:if(ut=At.payload,typeof ut=="function"){Re=ut.call(Jn,Re,Se);break e}Re=ut;break e;case 3:ut.flags=ut.flags&-65537|128;case 0:if(ut=At.payload,Se=typeof ut=="function"?ut.call(Jn,Re,Se):ut,Se==null)break e;Re=m({},Re,Se);break e;case 2:oc=!0}}Se=K.callback,Se!==null&&(u.flags|=64,Ce&&(u.flags|=8192),Ce=O.callbacks,Ce===null?O.callbacks=[Se]:Ce.push(Se))}else Ce={lane:Se,tag:K.tag,payload:K.payload,callback:K.callback,next:null},Ee===null?(we=Ee=Ce,ue=Re):Ee=Ee.next=Ce,q|=Se;if(K=K.next,K===null){if(K=O.shared.pending,K===null)break;Ce=K,K=Ce.next,Ce.next=null,O.lastBaseUpdate=Ce,O.shared.pending=null}}while(!0);Ee===null&&(ue=Re),O.baseState=ue,O.firstBaseUpdate=we,O.lastBaseUpdate=Ee,C===null&&(O.shared.lanes=0),mc|=q,u.lanes=q,u.memoizedState=Re}}function RC(u,f){if(typeof u!="function")throw Error(r(191,u));u.call(f)}function DC(u,f){var p=u.callbacks;if(p!==null)for(u.callbacks=null,u=0;uC?C:8;var q=F.T,K={};F.T=K,g2(u,!1,f,p);try{var ue=O(),we=F.S;if(we!==null&&we(K,ue),ue!==null&&typeof ue=="object"&&typeof ue.then=="function"){var Ee=rZ(ue,v);fm(u,f,Ee,Ii(u))}else fm(u,f,v,Ii(u))}catch(Re){fm(u,f,{then:function(){},status:"rejected",reason:Re},Ii())}finally{Y.p=C,q!==null&&K.types!==null&&(q.types=K.types),F.T=q}}function cZ(){}function m2(u,f,p,v){if(u.tag!==5)throw Error(r(476));var O=h8(u).queue;d8(u,O,f,J,p===null?cZ:function(){return f8(u),p(v)})}function h8(u){var f=u.memoizedState;if(f!==null)return f;f={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ol,lastRenderedState:J},next:null};var p={};return f.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ol,lastRenderedState:p},next:null},u.memoizedState=f,u=u.alternate,u!==null&&(u.memoizedState=f),f}function f8(u){var f=h8(u);f.next===null&&(f=u.alternate.memoizedState),fm(u,f.next.queue,{},Ii())}function p2(){return Ts(_m)}function m8(){return $r().memoizedState}function p8(){return $r().memoizedState}function uZ(u){for(var f=u.return;f!==null;){switch(f.tag){case 24:case 3:var p=Ii();u=lc(p);var v=cc(f,u,p);v!==null&&(hi(v,f,p),lm(v,f,p)),f={cache:Qw()},u.payload=f;return}f=f.return}}function dZ(u,f,p){var v=Ii();p={lane:v,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},hx(u)?x8(f,p):(p=Rw(u,f,p,v),p!==null&&(hi(p,u,v),v8(p,f,v)))}function g8(u,f,p){var v=Ii();fm(u,f,p,v)}function fm(u,f,p,v){var O={lane:v,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(hx(u))x8(f,O);else{var C=u.alternate;if(u.lanes===0&&(C===null||C.lanes===0)&&(C=f.lastRenderedReducer,C!==null))try{var q=f.lastRenderedState,K=C(q,p);if(O.hasEagerState=!0,O.eagerState=K,Ai(K,q))return Ug(u,f,O,0),rr===null&&Vg(),!1}catch{}finally{}if(p=Rw(u,f,O,v),p!==null)return hi(p,u,v),v8(p,f,v),!0}return!1}function g2(u,f,p,v){if(v={lane:2,revertLane:G2(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},hx(u)){if(f)throw Error(r(479))}else f=Rw(u,p,v,2),f!==null&&hi(f,u,2)}function hx(u){var f=u.alternate;return u===Wt||f!==null&&f===Wt}function x8(u,f){Qd=ix=!0;var p=u.pending;p===null?f.next=f:(f.next=p.next,p.next=f),u.pending=f}function v8(u,f,p){if((p&4194048)!==0){var v=f.lanes;v&=u.pendingLanes,p|=v,f.lanes=p,xs(u,p)}}var mm={readContext:Ts,use:lx,useCallback:Pr,useContext:Pr,useEffect:Pr,useImperativeHandle:Pr,useLayoutEffect:Pr,useInsertionEffect:Pr,useMemo:Pr,useReducer:Pr,useRef:Pr,useState:Pr,useDebugValue:Pr,useDeferredValue:Pr,useTransition:Pr,useSyncExternalStore:Pr,useId:Pr,useHostTransitionStatus:Pr,useFormState:Pr,useActionState:Pr,useOptimistic:Pr,useMemoCache:Pr,useCacheRefresh:Pr};mm.useEffectEvent=Pr;var y8={readContext:Ts,use:lx,useCallback:function(u,f){return Ys().memoizedState=[u,f===void 0?null:f],u},useContext:Ts,useEffect:n8,useImperativeHandle:function(u,f,p){p=p!=null?p.concat([u]):null,ux(4194308,4,a8.bind(null,f,u),p)},useLayoutEffect:function(u,f){return ux(4194308,4,u,f)},useInsertionEffect:function(u,f){ux(4,2,u,f)},useMemo:function(u,f){var p=Ys();f=f===void 0?null:f;var v=u();if(Tu){tn(!0);try{u()}finally{tn(!1)}}return p.memoizedState=[v,f],v},useReducer:function(u,f,p){var v=Ys();if(p!==void 0){var O=p(f);if(Tu){tn(!0);try{p(f)}finally{tn(!1)}}}else O=f;return v.memoizedState=v.baseState=O,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:O},v.queue=u,u=u.dispatch=dZ.bind(null,Wt,u),[v.memoizedState,u]},useRef:function(u){var f=Ys();return u={current:u},f.memoizedState=u},useState:function(u){u=c2(u);var f=u.queue,p=g8.bind(null,Wt,f);return f.dispatch=p,[u.memoizedState,p]},useDebugValue:h2,useDeferredValue:function(u,f){var p=Ys();return f2(p,u,f)},useTransition:function(){var u=c2(!1);return u=d8.bind(null,Wt,u.queue,!0,!1),Ys().memoizedState=u,[!1,u]},useSyncExternalStore:function(u,f,p){var v=Wt,O=Ys();if(yn){if(p===void 0)throw Error(r(407));p=p()}else{if(p=f(),rr===null)throw Error(r(349));(hn&127)!==0||FC(v,f,p)}O.memoizedState=p;var C={value:p,getSnapshot:f};return O.queue=C,n8($C.bind(null,v,C,u),[u]),v.flags|=2048,Ud(9,{destroy:void 0},qC.bind(null,v,C,p,f),null),p},useId:function(){var u=Ys(),f=rr.identifierPrefix;if(yn){var p=oo,v=ao;p=(v&~(1<<32-Rt(v)-1)).toString(32)+p,f="_"+f+"R_"+p,p=ax++,0<\/script>",C=C.removeChild(C.firstChild);break;case"select":C=typeof v.is=="string"?q.createElement("select",{is:v.is}):q.createElement("select"),v.multiple?C.multiple=!0:v.size&&(C.size=v.size);break;default:C=typeof v.is=="string"?q.createElement(O,{is:v.is}):q.createElement(O)}}C[Cr]=f,C[Tr]=v;e:for(q=f.child;q!==null;){if(q.tag===5||q.tag===6)C.appendChild(q.stateNode);else if(q.tag!==4&&q.tag!==27&&q.child!==null){q.child.return=q,q=q.child;continue}if(q===f)break e;for(;q.sibling===null;){if(q.return===null||q.return===f)break e;q=q.return}q.sibling.return=q.return,q=q.sibling}f.stateNode=C;e:switch(_s(C,O,v),O){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}v&&cl(f)}}return mr(f),_2(f,f.type,u===null?null:u.memoizedProps,f.pendingProps,p),null;case 6:if(u&&f.stateNode!=null)u.memoizedProps!==v&&cl(f);else{if(typeof v!="string"&&f.stateNode===null)throw Error(r(166));if(u=ne.current,Id(f)){if(u=f.stateNode,p=f.memoizedProps,v=null,O=Cs,O!==null)switch(O.tag){case 27:case 5:v=O.memoizedProps}u[Cr]=f,u=!!(u.nodeValue===p||v!==null&&v.suppressHydrationWarning===!0||LT(u.nodeValue,p)),u||ic(f,!0)}else u=Mx(u).createTextNode(v),u[Cr]=f,f.stateNode=u}return mr(f),null;case 31:if(p=f.memoizedState,u===null||u.memoizedState!==null){if(v=Id(f),p!==null){if(u===null){if(!v)throw Error(r(318));if(u=f.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(557));u[Cr]=f}else wu(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;mr(f),u=!1}else p=Fw(),u!==null&&u.memoizedState!==null&&(u.memoizedState.hydrationErrors=p),u=!0;if(!u)return f.flags&256?(Di(f),f):(Di(f),null);if((f.flags&128)!==0)throw Error(r(558))}return mr(f),null;case 13:if(v=f.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(O=Id(f),v!==null&&v.dehydrated!==null){if(u===null){if(!O)throw Error(r(318));if(O=f.memoizedState,O=O!==null?O.dehydrated:null,!O)throw Error(r(317));O[Cr]=f}else wu(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;mr(f),O=!1}else O=Fw(),u!==null&&u.memoizedState!==null&&(u.memoizedState.hydrationErrors=O),O=!0;if(!O)return f.flags&256?(Di(f),f):(Di(f),null)}return Di(f),(f.flags&128)!==0?(f.lanes=p,f):(p=v!==null,u=u!==null&&u.memoizedState!==null,p&&(v=f.child,O=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(O=v.alternate.memoizedState.cachePool.pool),C=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(C=v.memoizedState.cachePool.pool),C!==O&&(v.flags|=2048)),p!==u&&p&&(f.child.flags|=8192),xx(f,f.updateQueue),mr(f),null);case 4:return re(),u===null&&Z2(f.stateNode.containerInfo),mr(f),null;case 10:return il(f.type),mr(f),null;case 19:if(G(qr),v=f.memoizedState,v===null)return mr(f),null;if(O=(f.flags&128)!==0,C=v.rendering,C===null)if(O)gm(v,!1);else{if(zr!==0||u!==null&&(u.flags&128)!==0)for(u=f.child;u!==null;){if(C=sx(u),C!==null){for(f.flags|=128,gm(v,!1),u=C.updateQueue,f.updateQueue=u,xx(f,u),f.subtreeFlags=0,u=p,p=f.child;p!==null;)gC(p,u),p=p.sibling;return I(qr,qr.current&1|2),yn&&rl(f,v.treeForkCount),f.child}u=u.sibling}v.tail!==null&&_t()>Sx&&(f.flags|=128,O=!0,gm(v,!1),f.lanes=4194304)}else{if(!O)if(u=sx(C),u!==null){if(f.flags|=128,O=!0,u=u.updateQueue,f.updateQueue=u,xx(f,u),gm(v,!0),v.tail===null&&v.tailMode==="hidden"&&!C.alternate&&!yn)return mr(f),null}else 2*_t()-v.renderingStartTime>Sx&&p!==536870912&&(f.flags|=128,O=!0,gm(v,!1),f.lanes=4194304);v.isBackwards?(C.sibling=f.child,f.child=C):(u=v.last,u!==null?u.sibling=C:f.child=C,v.last=C)}return v.tail!==null?(u=v.tail,v.rendering=u,v.tail=u.sibling,v.renderingStartTime=_t(),u.sibling=null,p=qr.current,I(qr,O?p&1|2:p&1),yn&&rl(f,v.treeForkCount),u):(mr(f),null);case 22:case 23:return Di(f),Jw(),v=f.memoizedState!==null,u!==null?u.memoizedState!==null!==v&&(f.flags|=8192):v&&(f.flags|=8192),v?(p&536870912)!==0&&(f.flags&128)===0&&(mr(f),f.subtreeFlags&6&&(f.flags|=8192)):mr(f),p=f.updateQueue,p!==null&&xx(f,p.retryQueue),p=null,u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(p=u.memoizedState.cachePool.pool),v=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(v=f.memoizedState.cachePool.pool),v!==p&&(f.flags|=2048),u!==null&&G(Ou),null;case 24:return p=null,u!==null&&(p=u.memoizedState.cache),f.memoizedState.cache!==p&&(f.flags|=2048),il(Xr),mr(f),null;case 25:return null;case 30:return null}throw Error(r(156,f.tag))}function gZ(u,f){switch(Lw(f),f.tag){case 1:return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 3:return il(Xr),re(),u=f.flags,(u&65536)!==0&&(u&128)===0?(f.flags=u&-65537|128,f):null;case 26:case 27:case 5:return Te(f),null;case 31:if(f.memoizedState!==null){if(Di(f),f.alternate===null)throw Error(r(340));wu()}return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 13:if(Di(f),u=f.memoizedState,u!==null&&u.dehydrated!==null){if(f.alternate===null)throw Error(r(340));wu()}return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 19:return G(qr),null;case 4:return re(),null;case 10:return il(f.type),null;case 22:case 23:return Di(f),Jw(),u!==null&&G(Ou),u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 24:return il(Xr),null;case 25:return null;default:return null}}function H8(u,f){switch(Lw(f),f.tag){case 3:il(Xr),re();break;case 26:case 27:case 5:Te(f);break;case 4:re();break;case 31:f.memoizedState!==null&&Di(f);break;case 13:Di(f);break;case 19:G(qr);break;case 10:il(f.type);break;case 22:case 23:Di(f),Jw(),u!==null&&G(Ou);break;case 24:il(Xr)}}function xm(u,f){try{var p=f.updateQueue,v=p!==null?p.lastEffect:null;if(v!==null){var O=v.next;p=O;do{if((p.tag&u)===u){v=void 0;var C=p.create,q=p.inst;v=C(),q.destroy=v}p=p.next}while(p!==O)}}catch(K){Un(f,f.return,K)}}function hc(u,f,p){try{var v=f.updateQueue,O=v!==null?v.lastEffect:null;if(O!==null){var C=O.next;v=C;do{if((v.tag&u)===u){var q=v.inst,K=q.destroy;if(K!==void 0){q.destroy=void 0,O=f;var ue=p,we=K;try{we()}catch(Ee){Un(O,ue,Ee)}}}v=v.next}while(v!==C)}}catch(Ee){Un(f,f.return,Ee)}}function Q8(u){var f=u.updateQueue;if(f!==null){var p=u.stateNode;try{DC(f,p)}catch(v){Un(u,u.return,v)}}}function V8(u,f,p){p.props=Eu(u.type,u.memoizedProps),p.state=u.memoizedState;try{p.componentWillUnmount()}catch(v){Un(u,f,v)}}function vm(u,f){try{var p=u.ref;if(p!==null){switch(u.tag){case 26:case 27:case 5:var v=u.stateNode;break;case 30:v=u.stateNode;break;default:v=u.stateNode}typeof p=="function"?u.refCleanup=p(v):p.current=v}}catch(O){Un(u,f,O)}}function lo(u,f){var p=u.ref,v=u.refCleanup;if(p!==null)if(typeof v=="function")try{v()}catch(O){Un(u,f,O)}finally{u.refCleanup=null,u=u.alternate,u!=null&&(u.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(O){Un(u,f,O)}else p.current=null}function U8(u){var f=u.type,p=u.memoizedProps,v=u.stateNode;try{e:switch(f){case"button":case"input":case"select":case"textarea":p.autoFocus&&v.focus();break e;case"img":p.src?v.src=p.src:p.srcSet&&(v.srcset=p.srcSet)}}catch(O){Un(u,u.return,O)}}function A2(u,f,p){try{var v=u.stateNode;LZ(v,u.type,p,f),v[Tr]=f}catch(O){Un(u,u.return,O)}}function W8(u){return u.tag===5||u.tag===3||u.tag===26||u.tag===27&&yc(u.type)||u.tag===4}function M2(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||W8(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&u.tag!==18;){if(u.tag===27&&yc(u.type)||u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function R2(u,f,p){var v=u.tag;if(v===5||v===6)u=u.stateNode,f?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(u,f):(f=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,f.appendChild(u),p=p._reactRootContainer,p!=null||f.onclick!==null||(f.onclick=el));else if(v!==4&&(v===27&&yc(u.type)&&(p=u.stateNode,f=null),u=u.child,u!==null))for(R2(u,f,p),u=u.sibling;u!==null;)R2(u,f,p),u=u.sibling}function vx(u,f,p){var v=u.tag;if(v===5||v===6)u=u.stateNode,f?p.insertBefore(u,f):p.appendChild(u);else if(v!==4&&(v===27&&yc(u.type)&&(p=u.stateNode),u=u.child,u!==null))for(vx(u,f,p),u=u.sibling;u!==null;)vx(u,f,p),u=u.sibling}function G8(u){var f=u.stateNode,p=u.memoizedProps;try{for(var v=u.type,O=f.attributes;O.length;)f.removeAttributeNode(O[0]);_s(f,v,p),f[Cr]=u,f[Tr]=p}catch(C){Un(u,u.return,C)}}var ul=!1,Zr=!1,D2=!1,X8=typeof WeakSet=="function"?WeakSet:Set,vs=null;function xZ(u,f){if(u=u.containerInfo,t4=Bx,u=oC(u),Cw(u)){if("selectionStart"in u)var p={start:u.selectionStart,end:u.selectionEnd};else e:{p=(p=u.ownerDocument)&&p.defaultView||window;var v=p.getSelection&&p.getSelection();if(v&&v.rangeCount!==0){p=v.anchorNode;var O=v.anchorOffset,C=v.focusNode;v=v.focusOffset;try{p.nodeType,C.nodeType}catch{p=null;break e}var q=0,K=-1,ue=-1,we=0,Ee=0,Re=u,Se=null;t:for(;;){for(var Ce;Re!==p||O!==0&&Re.nodeType!==3||(K=q+O),Re!==C||v!==0&&Re.nodeType!==3||(ue=q+v),Re.nodeType===3&&(q+=Re.nodeValue.length),(Ce=Re.firstChild)!==null;)Se=Re,Re=Ce;for(;;){if(Re===u)break t;if(Se===p&&++we===O&&(K=q),Se===C&&++Ee===v&&(ue=q),(Ce=Re.nextSibling)!==null)break;Re=Se,Se=Re.parentNode}Re=Ce}p=K===-1||ue===-1?null:{start:K,end:ue}}else p=null}p=p||{start:0,end:0}}else p=null;for(n4={focusedElem:u,selectionRange:p},Bx=!1,vs=f;vs!==null;)if(f=vs,u=f.child,(f.subtreeFlags&1028)!==0&&u!==null)u.return=f,vs=u;else for(;vs!==null;){switch(f=vs,C=f.alternate,u=f.flags,f.tag){case 0:if((u&4)!==0&&(u=f.updateQueue,u=u!==null?u.events:null,u!==null))for(p=0;p title"))),_s(C,v,p),C[Cr]=u,Gr(C),v=C;break e;case"link":var q=t9("link","href",O).get(v+(p.href||""));if(q){for(var K=0;KJn&&(q=Jn,Jn=At,At=q);var pe=iC(K,At),fe=iC(K,Jn);if(pe&&fe&&(Ce.rangeCount!==1||Ce.anchorNode!==pe.node||Ce.anchorOffset!==pe.offset||Ce.focusNode!==fe.node||Ce.focusOffset!==fe.offset)){var ye=Re.createRange();ye.setStart(pe.node,pe.offset),Ce.removeAllRanges(),At>Jn?(Ce.addRange(ye),Ce.extend(fe.node,fe.offset)):(ye.setEnd(fe.node,fe.offset),Ce.addRange(ye))}}}}for(Re=[],Ce=K;Ce=Ce.parentNode;)Ce.nodeType===1&&Re.push({element:Ce,left:Ce.scrollLeft,top:Ce.scrollTop});for(typeof K.focus=="function"&&K.focus(),K=0;Kp?32:p,F.T=null,p=q2,q2=null;var C=gc,q=pl;if(ls=0,Kd=gc=null,pl=0,(Hn&6)!==0)throw Error(r(331));var K=Hn;if(Hn|=4,aT(C.current),rT(C,C.current,q,p),Hn=K,Om(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(Fe,C)}catch{}return!0}finally{Y.p=O,F.T=v,OT(u,f)}}function NT(u,f,p){f=ra(p,f),f=b2(u.stateNode,f,2),u=cc(u,f,2),u!==null&&(cr(u,2),co(u))}function Un(u,f,p){if(u.tag===3)NT(u,u,p);else for(;f!==null;){if(f.tag===3){NT(f,u,p);break}else if(f.tag===1){var v=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(pc===null||!pc.has(v))){u=ra(p,u),p=C8(2),v=cc(f,p,2),v!==null&&(T8(p,v,f,u),cr(v,2),co(v));break}}f=f.return}}function V2(u,f,p){var v=u.pingCache;if(v===null){v=u.pingCache=new bZ;var O=new Set;v.set(f,O)}else O=v.get(f),O===void 0&&(O=new Set,v.set(f,O));O.has(p)||(I2=!0,O.add(p),u=jZ.bind(null,u,f,p),f.then(u,u))}function jZ(u,f,p){var v=u.pingCache;v!==null&&v.delete(f),u.pingedLanes|=u.suspendedLanes&p,u.warmLanes&=~p,rr===u&&(hn&p)===p&&(zr===4||zr===3&&(hn&62914560)===hn&&300>_t()-wx?(Hn&2)===0&&Zd(u,0):L2|=p,Yd===hn&&(Yd=0)),co(u)}function CT(u,f){f===0&&(f=vr()),u=yu(u,f),u!==null&&(cr(u,f),co(u))}function NZ(u){var f=u.memoizedState,p=0;f!==null&&(p=f.retryLane),CT(u,p)}function CZ(u,f){var p=0;switch(u.tag){case 31:case 13:var v=u.stateNode,O=u.memoizedState;O!==null&&(p=O.retryLane);break;case 19:v=u.stateNode;break;case 22:v=u.stateNode._retryCache;break;default:throw Error(r(314))}v!==null&&v.delete(f),CT(u,p)}function TZ(u,f){return xt(u,f)}var Tx=null,eh=null,U2=!1,Ex=!1,W2=!1,vc=0;function co(u){u!==eh&&u.next===null&&(eh===null?Tx=eh=u:eh=eh.next=u),Ex=!0,U2||(U2=!0,_Z())}function Om(u,f){if(!W2&&Ex){W2=!0;do for(var p=!1,v=Tx;v!==null;){if(u!==0){var O=v.pendingLanes;if(O===0)var C=0;else{var q=v.suspendedLanes,K=v.pingedLanes;C=(1<<31-Rt(42|u)+1)-1,C&=O&~(q&~K),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(p=!0,AT(v,C))}else C=hn,C=xr(v,v===rr?C:0,v.cancelPendingCommit!==null||v.timeoutHandle!==-1),(C&3)===0||Ur(v,C)||(p=!0,AT(v,C));v=v.next}while(p);W2=!1}}function EZ(){TT()}function TT(){Ex=U2=!1;var u=0;vc!==0&&FZ()&&(u=vc);for(var f=_t(),p=null,v=Tx;v!==null;){var O=v.next,C=ET(v,f);C===0?(v.next=null,p===null?Tx=O:p.next=O,O===null&&(eh=p)):(p=v,(u!==0||(C&3)!==0)&&(Ex=!0)),v=O}ls!==0&&ls!==5||Om(u),vc!==0&&(vc=0)}function ET(u,f){for(var p=u.suspendedLanes,v=u.pingedLanes,O=u.expirationTimes,C=u.pendingLanes&-62914561;0K)break;var Ee=ue.transferSize,Re=ue.initiatorType;Ee&&BT(Re)&&(ue=ue.responseEnd,q+=Ee*(ue"u"?null:document;function KT(u,f,p){var v=th;if(v&&typeof f=="string"&&f){var O=ta(f);O='link[rel="'+u+'"][href="'+O+'"]',typeof p=="string"&&(O+='[crossorigin="'+p+'"]'),YT.has(O)||(YT.add(O),u={rel:u,crossOrigin:p,href:f},v.querySelector(O)===null&&(f=v.createElement("link"),_s(f,"link",u),Gr(f),v.head.appendChild(f)))}}function XZ(u){gl.D(u),KT("dns-prefetch",u,null)}function YZ(u,f){gl.C(u,f),KT("preconnect",u,f)}function KZ(u,f,p){gl.L(u,f,p);var v=th;if(v&&u&&f){var O='link[rel="preload"][as="'+ta(f)+'"]';f==="image"&&p&&p.imageSrcSet?(O+='[imagesrcset="'+ta(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(O+='[imagesizes="'+ta(p.imageSizes)+'"]')):O+='[href="'+ta(u)+'"]';var C=O;switch(f){case"style":C=nh(u);break;case"script":C=rh(u)}ca.has(C)||(u=m({rel:"preload",href:f==="image"&&p&&p.imageSrcSet?void 0:u,as:f},p),ca.set(C,u),v.querySelector(O)!==null||f==="style"&&v.querySelector(Tm(C))||f==="script"&&v.querySelector(Em(C))||(f=v.createElement("link"),_s(f,"link",u),Gr(f),v.head.appendChild(f)))}}function ZZ(u,f){gl.m(u,f);var p=th;if(p&&u){var v=f&&typeof f.as=="string"?f.as:"script",O='link[rel="modulepreload"][as="'+ta(v)+'"][href="'+ta(u)+'"]',C=O;switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":C=rh(u)}if(!ca.has(C)&&(u=m({rel:"modulepreload",href:u},f),ca.set(C,u),p.querySelector(O)===null)){switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(Em(C)))return}v=p.createElement("link"),_s(v,"link",u),Gr(v),p.head.appendChild(v)}}}function JZ(u,f,p){gl.S(u,f,p);var v=th;if(v&&u){var O=tc(v).hoistableStyles,C=nh(u);f=f||"default";var q=O.get(C);if(!q){var K={loading:0,preload:null};if(q=v.querySelector(Tm(C)))K.loading=5;else{u=m({rel:"stylesheet",href:u,"data-precedence":f},p),(p=ca.get(C))&&c4(u,p);var ue=q=v.createElement("link");Gr(ue),_s(ue,"link",u),ue._p=new Promise(function(we,Ee){ue.onload=we,ue.onerror=Ee}),ue.addEventListener("load",function(){K.loading|=1}),ue.addEventListener("error",function(){K.loading|=2}),K.loading|=4,Dx(q,f,v)}q={type:"stylesheet",instance:q,count:1,state:K},O.set(C,q)}}}function eJ(u,f){gl.X(u,f);var p=th;if(p&&u){var v=tc(p).hoistableScripts,O=rh(u),C=v.get(O);C||(C=p.querySelector(Em(O)),C||(u=m({src:u,async:!0},f),(f=ca.get(O))&&u4(u,f),C=p.createElement("script"),Gr(C),_s(C,"link",u),p.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},v.set(O,C))}}function tJ(u,f){gl.M(u,f);var p=th;if(p&&u){var v=tc(p).hoistableScripts,O=rh(u),C=v.get(O);C||(C=p.querySelector(Em(O)),C||(u=m({src:u,async:!0,type:"module"},f),(f=ca.get(O))&&u4(u,f),C=p.createElement("script"),Gr(C),_s(C,"link",u),p.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},v.set(O,C))}}function ZT(u,f,p,v){var O=(O=ne.current)?Rx(O):null;if(!O)throw Error(r(446));switch(u){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(f=nh(p.href),p=tc(O).hoistableStyles,v=p.get(f),v||(v={type:"style",instance:null,count:0,state:null},p.set(f,v)),v):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){u=nh(p.href);var C=tc(O).hoistableStyles,q=C.get(u);if(q||(O=O.ownerDocument||O,q={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},C.set(u,q),(C=O.querySelector(Tm(u)))&&!C._p&&(q.instance=C,q.state.loading=5),ca.has(u)||(p={rel:"preload",as:"style",href:p.href,crossOrigin:p.crossOrigin,integrity:p.integrity,media:p.media,hrefLang:p.hrefLang,referrerPolicy:p.referrerPolicy},ca.set(u,p),C||nJ(O,u,p,q.state))),f&&v===null)throw Error(r(528,""));return q}if(f&&v!==null)throw Error(r(529,""));return null;case"script":return f=p.async,p=p.src,typeof p=="string"&&f&&typeof f!="function"&&typeof f!="symbol"?(f=rh(p),p=tc(O).hoistableScripts,v=p.get(f),v||(v={type:"script",instance:null,count:0,state:null},p.set(f,v)),v):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,u))}}function nh(u){return'href="'+ta(u)+'"'}function Tm(u){return'link[rel="stylesheet"]['+u+"]"}function JT(u){return m({},u,{"data-precedence":u.precedence,precedence:null})}function nJ(u,f,p,v){u.querySelector('link[rel="preload"][as="style"]['+f+"]")?v.loading=1:(f=u.createElement("link"),v.preload=f,f.addEventListener("load",function(){return v.loading|=1}),f.addEventListener("error",function(){return v.loading|=2}),_s(f,"link",p),Gr(f),u.head.appendChild(f))}function rh(u){return'[src="'+ta(u)+'"]'}function Em(u){return"script[async]"+u}function e9(u,f,p){if(f.count++,f.instance===null)switch(f.type){case"style":var v=u.querySelector('style[data-href~="'+ta(p.href)+'"]');if(v)return f.instance=v,Gr(v),v;var O=m({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return v=(u.ownerDocument||u).createElement("style"),Gr(v),_s(v,"style",O),Dx(v,p.precedence,u),f.instance=v;case"stylesheet":O=nh(p.href);var C=u.querySelector(Tm(O));if(C)return f.state.loading|=4,f.instance=C,Gr(C),C;v=JT(p),(O=ca.get(O))&&c4(v,O),C=(u.ownerDocument||u).createElement("link"),Gr(C);var q=C;return q._p=new Promise(function(K,ue){q.onload=K,q.onerror=ue}),_s(C,"link",v),f.state.loading|=4,Dx(C,p.precedence,u),f.instance=C;case"script":return C=rh(p.src),(O=u.querySelector(Em(C)))?(f.instance=O,Gr(O),O):(v=p,(O=ca.get(C))&&(v=m({},p),u4(v,O)),u=u.ownerDocument||u,O=u.createElement("script"),Gr(O),_s(O,"link",v),u.head.appendChild(O),f.instance=O);case"void":return null;default:throw Error(r(443,f.type))}else f.type==="stylesheet"&&(f.state.loading&4)===0&&(v=f.instance,f.state.loading|=4,Dx(v,p.precedence,u));return f.instance}function Dx(u,f,p){for(var v=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),O=v.length?v[v.length-1]:null,C=O,q=0;q title"):null)}function rJ(u,f,p){if(p===1||f.itemProp!=null)return!1;switch(u){case"meta":case"title":return!0;case"style":if(typeof f.precedence!="string"||typeof f.href!="string"||f.href==="")break;return!0;case"link":if(typeof f.rel!="string"||typeof f.href!="string"||f.href===""||f.onLoad||f.onError)break;switch(f.rel){case"stylesheet":return u=f.disabled,typeof f.precedence=="string"&&u==null;default:return!0}case"script":if(f.async&&typeof f.async!="function"&&typeof f.async!="symbol"&&!f.onLoad&&!f.onError&&f.src&&typeof f.src=="string")return!0}return!1}function r9(u){return!(u.type==="stylesheet"&&(u.state.loading&3)===0)}function sJ(u,f,p,v){if(p.type==="stylesheet"&&(typeof v.media!="string"||matchMedia(v.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var O=nh(v.href),C=f.querySelector(Tm(O));if(C){f=C._p,f!==null&&typeof f=="object"&&typeof f.then=="function"&&(u.count++,u=zx.bind(u),f.then(u,u)),p.state.loading|=4,p.instance=C,Gr(C);return}C=f.ownerDocument||f,v=JT(v),(O=ca.get(O))&&c4(v,O),C=C.createElement("link"),Gr(C);var q=C;q._p=new Promise(function(K,ue){q.onload=K,q.onerror=ue}),_s(C,"link",v),p.instance=C}u.stylesheets===null&&(u.stylesheets=new Map),u.stylesheets.set(p,f),(f=p.state.preload)&&(p.state.loading&3)===0&&(u.count++,p=zx.bind(u),f.addEventListener("load",p),f.addEventListener("error",p))}}var d4=0;function iJ(u,f){return u.stylesheets&&u.count===0&&Lx(u,u.stylesheets),0d4?50:800)+f);return u.unsuspend=p,function(){u.unsuspend=null,clearTimeout(v),clearTimeout(O)}}:null}function zx(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Lx(this,this.stylesheets);else if(this.unsuspend){var u=this.unsuspend;this.unsuspend=null,u()}}}var Ix=null;function Lx(u,f){u.stylesheets=null,u.unsuspend!==null&&(u.count++,Ix=new Map,f.forEach(aJ,u),Ix=null,zx.call(u))}function aJ(u,f){if(!(f.state.loading&4)){var p=Ix.get(u);if(p)var v=p.get(null);else{p=new Map,Ix.set(u,p);for(var O=u.querySelectorAll("link[data-precedence],style[data-precedence]"),C=0;C"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),b4.exports=xte(),b4.exports}var yte=vte();function NI(t,e){return function(){return t.apply(e,arguments)}}const{toString:bte}=Object.prototype,{getPrototypeOf:Rj}=Object,{iterator:Xy,toStringTag:CI}=Symbol,Yy=(t=>e=>{const n=bte.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),eo=t=>(t=t.toLowerCase(),e=>Yy(e)===t),Ky=t=>e=>typeof e===t,{isArray:yf}=Array,Xh=Ky("undefined");function Rp(t){return t!==null&&!Xh(t)&&t.constructor!==null&&!Xh(t.constructor)&&wi(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const TI=eo("ArrayBuffer");function wte(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&TI(t.buffer),e}const Ste=Ky("string"),wi=Ky("function"),EI=Ky("number"),Dp=t=>t!==null&&typeof t=="object",kte=t=>t===!0||t===!1,ev=t=>{if(Yy(t)!=="object")return!1;const e=Rj(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(CI in t)&&!(Xy in t)},Ote=t=>{if(!Dp(t)||Rp(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},jte=eo("Date"),Nte=eo("File"),Cte=eo("Blob"),Tte=eo("FileList"),Ete=t=>Dp(t)&&wi(t.pipe),_te=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||wi(t.append)&&((e=Yy(t))==="formdata"||e==="object"&&wi(t.toString)&&t.toString()==="[object FormData]"))},Ate=eo("URLSearchParams"),[Mte,Rte,Dte,Pte]=["ReadableStream","Request","Response","Headers"].map(eo),zte=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Pp(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,s;if(typeof t!="object"&&(t=[t]),yf(t))for(r=0,s=t.length;r0;)if(s=n[r],e===s.toLowerCase())return s;return null}const $u=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,AI=t=>!Xh(t)&&t!==$u;function ak(){const{caseless:t,skipUndefined:e}=AI(this)&&this||{},n={},r=(s,i)=>{const a=t&&_I(n,i)||i;ev(n[a])&&ev(s)?n[a]=ak(n[a],s):ev(s)?n[a]=ak({},s):yf(s)?n[a]=s.slice():(!e||!Xh(s))&&(n[a]=s)};for(let s=0,i=arguments.length;s(Pp(e,(s,i)=>{n&&wi(s)?t[i]=NI(s,n):t[i]=s},{allOwnKeys:r}),t),Lte=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Bte=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},Fte=(t,e,n,r)=>{let s,i,a;const l={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),i=s.length;i-- >0;)a=s[i],(!r||r(a,t,e))&&!l[a]&&(e[a]=t[a],l[a]=!0);t=n!==!1&&Rj(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},qte=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},$te=t=>{if(!t)return null;if(yf(t))return t;let e=t.length;if(!EI(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},Hte=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Rj(Uint8Array)),Qte=(t,e)=>{const r=(t&&t[Xy]).call(t);let s;for(;(s=r.next())&&!s.done;){const i=s.value;e.call(t,i[0],i[1])}},Vte=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},Ute=eo("HTMLFormElement"),Wte=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),E9=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Gte=eo("RegExp"),MI=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Pp(n,(s,i)=>{let a;(a=e(s,i,t))!==!1&&(r[i]=a||s)}),Object.defineProperties(t,r)},Xte=t=>{MI(t,(e,n)=>{if(wi(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(wi(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Yte=(t,e)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return yf(t)?r(t):r(String(t).split(e)),n},Kte=()=>{},Zte=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function Jte(t){return!!(t&&wi(t.append)&&t[CI]==="FormData"&&t[Xy])}const ene=t=>{const e=new Array(10),n=(r,s)=>{if(Dp(r)){if(e.indexOf(r)>=0)return;if(Rp(r))return r;if(!("toJSON"in r)){e[s]=r;const i=yf(r)?[]:{};return Pp(r,(a,l)=>{const c=n(a,s+1);!Xh(c)&&(i[l]=c)}),e[s]=void 0,i}}return r};return n(t,0)},tne=eo("AsyncFunction"),nne=t=>t&&(Dp(t)||wi(t))&&wi(t.then)&&wi(t.catch),RI=((t,e)=>t?setImmediate:e?((n,r)=>($u.addEventListener("message",({source:s,data:i})=>{s===$u&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),$u.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",wi($u.postMessage)),rne=typeof queueMicrotask<"u"?queueMicrotask.bind($u):typeof process<"u"&&process.nextTick||RI,sne=t=>t!=null&&wi(t[Xy]),je={isArray:yf,isArrayBuffer:TI,isBuffer:Rp,isFormData:_te,isArrayBufferView:wte,isString:Ste,isNumber:EI,isBoolean:kte,isObject:Dp,isPlainObject:ev,isEmptyObject:Ote,isReadableStream:Mte,isRequest:Rte,isResponse:Dte,isHeaders:Pte,isUndefined:Xh,isDate:jte,isFile:Nte,isBlob:Cte,isRegExp:Gte,isFunction:wi,isStream:Ete,isURLSearchParams:Ate,isTypedArray:Hte,isFileList:Tte,forEach:Pp,merge:ak,extend:Ite,trim:zte,stripBOM:Lte,inherits:Bte,toFlatObject:Fte,kindOf:Yy,kindOfTest:eo,endsWith:qte,toArray:$te,forEachEntry:Qte,matchAll:Vte,isHTMLForm:Ute,hasOwnProperty:E9,hasOwnProp:E9,reduceDescriptors:MI,freezeMethods:Xte,toObjectSet:Yte,toCamelCase:Wte,noop:Kte,toFiniteNumber:Zte,findKey:_I,global:$u,isContextDefined:AI,isSpecCompliantForm:Jte,toJSONObject:ene,isAsyncFn:tne,isThenable:nne,setImmediate:RI,asap:rne,isIterable:sne};function Xt(t,e,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}je.inherits(Xt,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:je.toJSONObject(this.config),code:this.code,status:this.status}}});const DI=Xt.prototype,PI={};["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(t=>{PI[t]={value:t}});Object.defineProperties(Xt,PI);Object.defineProperty(DI,"isAxiosError",{value:!0});Xt.from=(t,e,n,r,s,i)=>{const a=Object.create(DI);je.toFlatObject(t,a,function(h){return h!==Error.prototype},d=>d!=="isAxiosError");const l=t&&t.message?t.message:"Error",c=e==null&&t?t.code:e;return Xt.call(a,l,c,n,r,s),t&&a.cause==null&&Object.defineProperty(a,"cause",{value:t,configurable:!0}),a.name=t&&t.name||"Error",i&&Object.assign(a,i),a};const ine=null;function ok(t){return je.isPlainObject(t)||je.isArray(t)}function zI(t){return je.endsWith(t,"[]")?t.slice(0,-2):t}function _9(t,e,n){return t?t.concat(e).map(function(s,i){return s=zI(s),!n&&i?"["+s+"]":s}).join(n?".":""):e}function ane(t){return je.isArray(t)&&!t.some(ok)}const one=je.toFlatObject(je,{},null,function(e){return/^is[A-Z]/.test(e)});function Zy(t,e,n){if(!je.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=je.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,S){return!je.isUndefined(S[w])});const r=n.metaTokens,s=n.visitor||h,i=n.dots,a=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&je.isSpecCompliantForm(e);if(!je.isFunction(s))throw new TypeError("visitor must be a function");function d(y){if(y===null)return"";if(je.isDate(y))return y.toISOString();if(je.isBoolean(y))return y.toString();if(!c&&je.isBlob(y))throw new Xt("Blob is not supported. Use a Buffer instead.");return je.isArrayBuffer(y)||je.isTypedArray(y)?c&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function h(y,w,S){let k=y;if(y&&!S&&typeof y=="object"){if(je.endsWith(w,"{}"))w=r?w:w.slice(0,-2),y=JSON.stringify(y);else if(je.isArray(y)&&ane(y)||(je.isFileList(y)||je.endsWith(w,"[]"))&&(k=je.toArray(y)))return w=zI(w),k.forEach(function(N,T){!(je.isUndefined(N)||N===null)&&e.append(a===!0?_9([w],T,i):a===null?w:w+"[]",d(N))}),!1}return ok(y)?!0:(e.append(_9(S,w,i),d(y)),!1)}const m=[],g=Object.assign(one,{defaultVisitor:h,convertValue:d,isVisitable:ok});function x(y,w){if(!je.isUndefined(y)){if(m.indexOf(y)!==-1)throw Error("Circular reference detected in "+w.join("."));m.push(y),je.forEach(y,function(k,j){(!(je.isUndefined(k)||k===null)&&s.call(e,k,je.isString(j)?j.trim():j,w,g))===!0&&x(k,w?w.concat(j):[j])}),m.pop()}}if(!je.isObject(t))throw new TypeError("data must be an object");return x(t),e}function A9(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Dj(t,e){this._pairs=[],t&&Zy(t,this,e)}const II=Dj.prototype;II.append=function(e,n){this._pairs.push([e,n])};II.toString=function(e){const n=e?function(r){return e.call(this,r,A9)}:A9;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function lne(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function LI(t,e,n){if(!e)return t;const r=n&&n.encode||lne;je.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(e,n):i=je.isURLSearchParams(e)?e.toString():new Dj(e,n).toString(r),i){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class M9{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,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){je.forEach(this.handlers,function(r){r!==null&&e(r)})}}const BI={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},cne=typeof URLSearchParams<"u"?URLSearchParams:Dj,une=typeof FormData<"u"?FormData:null,dne=typeof Blob<"u"?Blob:null,hne={isBrowser:!0,classes:{URLSearchParams:cne,FormData:une,Blob:dne},protocols:["http","https","file","blob","url","data"]},Pj=typeof window<"u"&&typeof document<"u",lk=typeof navigator=="object"&&navigator||void 0,fne=Pj&&(!lk||["ReactNative","NativeScript","NS"].indexOf(lk.product)<0),mne=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",pne=Pj&&window.location.href||"http://localhost",gne=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Pj,hasStandardBrowserEnv:fne,hasStandardBrowserWebWorkerEnv:mne,navigator:lk,origin:pne},Symbol.toStringTag,{value:"Module"})),Hs={...gne,...hne};function xne(t,e){return Zy(t,new Hs.classes.URLSearchParams,{visitor:function(n,r,s,i){return Hs.isNode&&je.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function vne(t){return je.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function yne(t){const e={},n=Object.keys(t);let r;const s=n.length;let i;for(r=0;r=n.length;return a=!a&&je.isArray(s)?s.length:a,c?(je.hasOwnProp(s,a)?s[a]=[s[a],r]:s[a]=r,!l):((!s[a]||!je.isObject(s[a]))&&(s[a]=[]),e(n,r,s[a],i)&&je.isArray(s[a])&&(s[a]=yne(s[a])),!l)}if(je.isFormData(t)&&je.isFunction(t.entries)){const n={};return je.forEachEntry(t,(r,s)=>{e(vne(r),s,n,0)}),n}return null}function bne(t,e,n){if(je.isString(t))try{return(e||JSON.parse)(t),je.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const zp={transitional:BI,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=je.isObject(e);if(i&&je.isHTMLForm(e)&&(e=new FormData(e)),je.isFormData(e))return s?JSON.stringify(FI(e)):e;if(je.isArrayBuffer(e)||je.isBuffer(e)||je.isStream(e)||je.isFile(e)||je.isBlob(e)||je.isReadableStream(e))return e;if(je.isArrayBufferView(e))return e.buffer;if(je.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return xne(e,this.formSerializer).toString();if((l=je.isFileList(e))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Zy(l?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),bne(e)):e}],transformResponse:[function(e){const n=this.transitional||zp.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(je.isResponse(e)||je.isReadableStream(e))return e;if(e&&je.isString(e)&&(r&&!this.responseType||s)){const a=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(e,this.parseReviver)}catch(l){if(a)throw l.name==="SyntaxError"?Xt.from(l,Xt.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Hs.classes.FormData,Blob:Hs.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};je.forEach(["delete","get","head","post","put","patch"],t=>{zp.headers[t]={}});const wne=je.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"]),Sne=t=>{const e={};let n,r,s;return t&&t.split(` +`).forEach(function(a){s=a.indexOf(":"),n=a.substring(0,s).trim().toLowerCase(),r=a.substring(s+1).trim(),!(!n||e[n]&&wne[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},R9=Symbol("internals");function zm(t){return t&&String(t).trim().toLowerCase()}function tv(t){return t===!1||t==null?t:je.isArray(t)?t.map(tv):String(t)}function kne(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const One=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function k4(t,e,n,r,s){if(je.isFunction(r))return r.call(this,e,n);if(s&&(e=n),!!je.isString(e)){if(je.isString(r))return e.indexOf(r)!==-1;if(je.isRegExp(r))return r.test(e)}}function jne(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function Nne(t,e){const n=je.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(s,i,a){return this[r].call(this,e,s,i,a)},configurable:!0})})}let Si=class{constructor(e){e&&this.set(e)}set(e,n,r){const s=this;function i(l,c,d){const h=zm(c);if(!h)throw new Error("header name must be a non-empty string");const m=je.findKey(s,h);(!m||s[m]===void 0||d===!0||d===void 0&&s[m]!==!1)&&(s[m||c]=tv(l))}const a=(l,c)=>je.forEach(l,(d,h)=>i(d,h,c));if(je.isPlainObject(e)||e instanceof this.constructor)a(e,n);else if(je.isString(e)&&(e=e.trim())&&!One(e))a(Sne(e),n);else if(je.isObject(e)&&je.isIterable(e)){let l={},c,d;for(const h of e){if(!je.isArray(h))throw TypeError("Object iterator must return a key-value pair");l[d=h[0]]=(c=l[d])?je.isArray(c)?[...c,h[1]]:[c,h[1]]:h[1]}a(l,n)}else e!=null&&i(n,e,r);return this}get(e,n){if(e=zm(e),e){const r=je.findKey(this,e);if(r){const s=this[r];if(!n)return s;if(n===!0)return kne(s);if(je.isFunction(n))return n.call(this,s,r);if(je.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=zm(e),e){const r=je.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||k4(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let s=!1;function i(a){if(a=zm(a),a){const l=je.findKey(r,a);l&&(!n||k4(r,r[l],l,n))&&(delete r[l],s=!0)}}return je.isArray(e)?e.forEach(i):i(e),s}clear(e){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!e||k4(this,this[i],i,e,!0))&&(delete this[i],s=!0)}return s}normalize(e){const n=this,r={};return je.forEach(this,(s,i)=>{const a=je.findKey(r,i);if(a){n[a]=tv(s),delete n[i];return}const l=e?jne(i):String(i).trim();l!==i&&delete n[i],n[l]=tv(s),r[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return je.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=e&&je.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).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,...n){const r=new this(e);return n.forEach(s=>r.set(s)),r}static accessor(e){const r=(this[R9]=this[R9]={accessors:{}}).accessors,s=this.prototype;function i(a){const l=zm(a);r[l]||(Nne(s,a),r[l]=!0)}return je.isArray(e)?e.forEach(i):i(e),this}};Si.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);je.reduceDescriptors(Si.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});je.freezeMethods(Si);function O4(t,e){const n=this||zp,r=e||n,s=Si.from(r.headers);let i=r.data;return je.forEach(t,function(l){i=l.call(n,i,s.normalize(),e?e.status:void 0)}),s.normalize(),i}function qI(t){return!!(t&&t.__CANCEL__)}function bf(t,e,n){Xt.call(this,t??"canceled",Xt.ERR_CANCELED,e,n),this.name="CanceledError"}je.inherits(bf,Xt,{__CANCEL__:!0});function $I(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new Xt("Request failed with status code "+n.status,[Xt.ERR_BAD_REQUEST,Xt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Cne(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Tne(t,e){t=t||10;const n=new Array(t),r=new Array(t);let s=0,i=0,a;return e=e!==void 0?e:1e3,function(c){const d=Date.now(),h=r[i];a||(a=d),n[s]=c,r[s]=d;let m=i,g=0;for(;m!==s;)g+=n[m++],m=m%t;if(s=(s+1)%t,s===i&&(i=(i+1)%t),d-a{n=h,s=null,i&&(clearTimeout(i),i=null),t(...d)};return[(...d)=>{const h=Date.now(),m=h-n;m>=r?a(d,h):(s=d,i||(i=setTimeout(()=>{i=null,a(s)},r-m)))},()=>s&&a(s)]}const zv=(t,e,n=3)=>{let r=0;const s=Tne(50,250);return Ene(i=>{const a=i.loaded,l=i.lengthComputable?i.total:void 0,c=a-r,d=s(c),h=a<=l;r=a;const m={loaded:a,total:l,progress:l?a/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&h?(l-a)/d:void 0,event:i,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(m)},n)},D9=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},P9=t=>(...e)=>je.asap(()=>t(...e)),_ne=Hs.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Hs.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Hs.origin),Hs.navigator&&/(msie|trident)/i.test(Hs.navigator.userAgent)):()=>!0,Ane=Hs.hasStandardBrowserEnv?{write(t,e,n,r,s,i,a){if(typeof document>"u")return;const l=[`${t}=${encodeURIComponent(e)}`];je.isNumber(n)&&l.push(`expires=${new Date(n).toUTCString()}`),je.isString(r)&&l.push(`path=${r}`),je.isString(s)&&l.push(`domain=${s}`),i===!0&&l.push("secure"),je.isString(a)&&l.push(`SameSite=${a}`),document.cookie=l.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Mne(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Rne(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function HI(t,e,n){let r=!Mne(e);return t&&(r||n==!1)?Rne(t,e):e}const z9=t=>t instanceof Si?{...t}:t;function rd(t,e){e=e||{};const n={};function r(d,h,m,g){return je.isPlainObject(d)&&je.isPlainObject(h)?je.merge.call({caseless:g},d,h):je.isPlainObject(h)?je.merge({},h):je.isArray(h)?h.slice():h}function s(d,h,m,g){if(je.isUndefined(h)){if(!je.isUndefined(d))return r(void 0,d,m,g)}else return r(d,h,m,g)}function i(d,h){if(!je.isUndefined(h))return r(void 0,h)}function a(d,h){if(je.isUndefined(h)){if(!je.isUndefined(d))return r(void 0,d)}else return r(void 0,h)}function l(d,h,m){if(m in e)return r(d,h);if(m in t)return r(void 0,d)}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(d,h,m)=>s(z9(d),z9(h),m,!0)};return je.forEach(Object.keys({...t,...e}),function(h){const m=c[h]||s,g=m(t[h],e[h],h);je.isUndefined(g)&&m!==l||(n[h]=g)}),n}const QI=t=>{const e=rd({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:a,auth:l}=e;if(e.headers=a=Si.from(a),e.url=LI(HI(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),je.isFormData(n)){if(Hs.hasStandardBrowserEnv||Hs.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(je.isFunction(n.getHeaders)){const c=n.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([h,m])=>{d.includes(h.toLowerCase())&&a.set(h,m)})}}if(Hs.hasStandardBrowserEnv&&(r&&je.isFunction(r)&&(r=r(e)),r||r!==!1&&_ne(e.url))){const c=s&&i&&Ane.read(i);c&&a.set(s,c)}return e},Dne=typeof XMLHttpRequest<"u",Pne=Dne&&function(t){return new Promise(function(n,r){const s=QI(t);let i=s.data;const a=Si.from(s.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=s,h,m,g,x,y;function w(){x&&x(),y&&y(),s.cancelToken&&s.cancelToken.unsubscribe(h),s.signal&&s.signal.removeEventListener("abort",h)}let S=new XMLHttpRequest;S.open(s.method.toUpperCase(),s.url,!0),S.timeout=s.timeout;function k(){if(!S)return;const N=Si.from("getAllResponseHeaders"in S&&S.getAllResponseHeaders()),E={data:!l||l==="text"||l==="json"?S.responseText:S.response,status:S.status,statusText:S.statusText,headers:N,config:t,request:S};$I(function(A){n(A),w()},function(A){r(A),w()},E),S=null}"onloadend"in S?S.onloadend=k:S.onreadystatechange=function(){!S||S.readyState!==4||S.status===0&&!(S.responseURL&&S.responseURL.indexOf("file:")===0)||setTimeout(k)},S.onabort=function(){S&&(r(new Xt("Request aborted",Xt.ECONNABORTED,t,S)),S=null)},S.onerror=function(T){const E=T&&T.message?T.message:"Network Error",_=new Xt(E,Xt.ERR_NETWORK,t,S);_.event=T||null,r(_),S=null},S.ontimeout=function(){let T=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const E=s.transitional||BI;s.timeoutErrorMessage&&(T=s.timeoutErrorMessage),r(new Xt(T,E.clarifyTimeoutError?Xt.ETIMEDOUT:Xt.ECONNABORTED,t,S)),S=null},i===void 0&&a.setContentType(null),"setRequestHeader"in S&&je.forEach(a.toJSON(),function(T,E){S.setRequestHeader(E,T)}),je.isUndefined(s.withCredentials)||(S.withCredentials=!!s.withCredentials),l&&l!=="json"&&(S.responseType=s.responseType),d&&([g,y]=zv(d,!0),S.addEventListener("progress",g)),c&&S.upload&&([m,x]=zv(c),S.upload.addEventListener("progress",m),S.upload.addEventListener("loadend",x)),(s.cancelToken||s.signal)&&(h=N=>{S&&(r(!N||N.type?new bf(null,t,S):N),S.abort(),S=null)},s.cancelToken&&s.cancelToken.subscribe(h),s.signal&&(s.signal.aborted?h():s.signal.addEventListener("abort",h)));const j=Cne(s.url);if(j&&Hs.protocols.indexOf(j)===-1){r(new Xt("Unsupported protocol "+j+":",Xt.ERR_BAD_REQUEST,t));return}S.send(i||null)})},zne=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,s;const i=function(d){if(!s){s=!0,l();const h=d instanceof Error?d:this.reason;r.abort(h instanceof Xt?h:new bf(h instanceof Error?h.message:h))}};let a=e&&setTimeout(()=>{a=null,i(new Xt(`timeout ${e} of ms exceeded`,Xt.ETIMEDOUT))},e);const l=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),t=null)};t.forEach(d=>d.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>je.asap(l),c}},Ine=function*(t,e){let n=t.byteLength;if(n{const s=Lne(t,e);let i=0,a,l=c=>{a||(a=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:d,value:h}=await s.next();if(d){l(),c.close();return}let m=h.byteLength;if(n){let g=i+=m;n(g)}c.enqueue(new Uint8Array(h))}catch(d){throw l(d),d}},cancel(c){return l(c),s.return()}},{highWaterMark:2})},L9=64*1024,{isFunction:Xx}=je,Fne=(({Request:t,Response:e})=>({Request:t,Response:e}))(je.global),{ReadableStream:B9,TextEncoder:F9}=je.global,q9=(t,...e)=>{try{return!!t(...e)}catch{return!1}},qne=t=>{t=je.merge.call({skipUndefined:!0},Fne,t);const{fetch:e,Request:n,Response:r}=t,s=e?Xx(e):typeof fetch=="function",i=Xx(n),a=Xx(r);if(!s)return!1;const l=s&&Xx(B9),c=s&&(typeof F9=="function"?(y=>w=>y.encode(w))(new F9):async y=>new Uint8Array(await new n(y).arrayBuffer())),d=i&&l&&q9(()=>{let y=!1;const w=new n(Hs.origin,{body:new B9,method:"POST",get duplex(){return y=!0,"half"}}).headers.has("Content-Type");return y&&!w}),h=a&&l&&q9(()=>je.isReadableStream(new r("").body)),m={stream:h&&(y=>y.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!m[y]&&(m[y]=(w,S)=>{let k=w&&w[y];if(k)return k.call(w);throw new Xt(`Response type '${y}' is not supported`,Xt.ERR_NOT_SUPPORT,S)})});const g=async y=>{if(y==null)return 0;if(je.isBlob(y))return y.size;if(je.isSpecCompliantForm(y))return(await new n(Hs.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(je.isArrayBufferView(y)||je.isArrayBuffer(y))return y.byteLength;if(je.isURLSearchParams(y)&&(y=y+""),je.isString(y))return(await c(y)).byteLength},x=async(y,w)=>{const S=je.toFiniteNumber(y.getContentLength());return S??g(w)};return async y=>{let{url:w,method:S,data:k,signal:j,cancelToken:N,timeout:T,onDownloadProgress:E,onUploadProgress:_,responseType:A,headers:L,withCredentials:P="same-origin",fetchOptions:B}=QI(y),$=e||fetch;A=A?(A+"").toLowerCase():"text";let U=zne([j,N&&N.toAbortSignal()],T),te=null;const z=U&&U.unsubscribe&&(()=>{U.unsubscribe()});let Q;try{if(_&&d&&S!=="get"&&S!=="head"&&(Q=await x(L,k))!==0){let ie=new n(w,{method:"POST",body:k,duplex:"half"}),G;if(je.isFormData(k)&&(G=ie.headers.get("content-type"))&&L.setContentType(G),ie.body){const[I,V]=D9(Q,zv(P9(_)));k=I9(ie.body,L9,I,V)}}je.isString(P)||(P=P?"include":"omit");const F=i&&"credentials"in n.prototype,Y={...B,signal:U,method:S.toUpperCase(),headers:L.normalize().toJSON(),body:k,duplex:"half",credentials:F?P:void 0};te=i&&new n(w,Y);let J=await(i?$(te,B):$(w,Y));const X=h&&(A==="stream"||A==="response");if(h&&(E||X&&z)){const ie={};["status","statusText","headers"].forEach(ee=>{ie[ee]=J[ee]});const G=je.toFiniteNumber(J.headers.get("content-length")),[I,V]=E&&D9(G,zv(P9(E),!0))||[];J=new r(I9(J.body,L9,I,()=>{V&&V(),z&&z()}),ie)}A=A||"text";let R=await m[je.findKey(m,A)||"text"](J,y);return!X&&z&&z(),await new Promise((ie,G)=>{$I(ie,G,{data:R,headers:Si.from(J.headers),status:J.status,statusText:J.statusText,config:y,request:te})})}catch(F){throw z&&z(),F&&F.name==="TypeError"&&/Load failed|fetch/i.test(F.message)?Object.assign(new Xt("Network Error",Xt.ERR_NETWORK,y,te),{cause:F.cause||F}):Xt.from(F,F&&F.code,y,te)}}},$ne=new Map,VI=t=>{let e=t&&t.env||{};const{fetch:n,Request:r,Response:s}=e,i=[r,s,n];let a=i.length,l=a,c,d,h=$ne;for(;l--;)c=i[l],d=h.get(c),d===void 0&&h.set(c,d=l?new Map:qne(e)),h=d;return d};VI();const zj={http:ine,xhr:Pne,fetch:{get:VI}};je.forEach(zj,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const $9=t=>`- ${t}`,Hne=t=>je.isFunction(t)||t===null||t===!1;function Qne(t,e){t=je.isArray(t)?t:[t];const{length:n}=t;let r,s;const i={};for(let a=0;a`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=n?a.length>1?`since : +`+a.map($9).join(` +`):" "+$9(a[0]):"as no adapter specified";throw new Xt("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return s}const UI={getAdapter:Qne,adapters:zj};function j4(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new bf(null,t)}function H9(t){return j4(t),t.headers=Si.from(t.headers),t.data=O4.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),UI.getAdapter(t.adapter||zp.adapter,t)(t).then(function(r){return j4(t),r.data=O4.call(t,t.transformResponse,r),r.headers=Si.from(r.headers),r},function(r){return qI(r)||(j4(t),r&&r.response&&(r.response.data=O4.call(t,t.transformResponse,r.response),r.response.headers=Si.from(r.response.headers))),Promise.reject(r)})}const WI="1.13.2",Jy={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Jy[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Q9={};Jy.transitional=function(e,n,r){function s(i,a){return"[Axios v"+WI+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,l)=>{if(e===!1)throw new Xt(s(a," has been removed"+(n?" in "+n:"")),Xt.ERR_DEPRECATED);return n&&!Q9[a]&&(Q9[a]=!0,console.warn(s(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,a,l):!0}};Jy.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function Vne(t,e,n){if(typeof t!="object")throw new Xt("options must be an object",Xt.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let s=r.length;for(;s-- >0;){const i=r[s],a=e[i];if(a){const l=t[i],c=l===void 0||a(l,i,t);if(c!==!0)throw new Xt("option "+i+" must be "+c,Xt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Xt("Unknown option "+i,Xt.ERR_BAD_OPTION)}}const nv={assertOptions:Vne,validators:Jy},uo=nv.validators;let Zu=class{constructor(e){this.defaults=e||{},this.interceptors={request:new M9,response:new M9}}async request(e,n){try{return await this._request(e,n)}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,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=rd(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&nv.assertOptions(r,{silentJSONParsing:uo.transitional(uo.boolean),forcedJSONParsing:uo.transitional(uo.boolean),clarifyTimeoutError:uo.transitional(uo.boolean)},!1),s!=null&&(je.isFunction(s)?n.paramsSerializer={serialize:s}:nv.assertOptions(s,{encode:uo.function,serialize:uo.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),nv.assertOptions(n,{baseUrl:uo.spelling("baseURL"),withXsrfToken:uo.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&je.merge(i.common,i[n.method]);i&&je.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),n.headers=Si.concat(a,i);const l=[];let c=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(c=c&&w.synchronous,l.unshift(w.fulfilled,w.rejected))});const d=[];this.interceptors.response.forEach(function(w){d.push(w.fulfilled,w.rejected)});let h,m=0,g;if(!c){const y=[H9.bind(this),void 0];for(y.unshift(...l),y.push(...d),g=y.length,h=Promise.resolve(n);m{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 a=new Promise(l=>{r.subscribe(l),i=l}).then(s);return a.cancel=function(){r.unsubscribe(i)},a},e(function(i,a,l){r.reason||(r.reason=new bf(i,a,l),n(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 n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new GI(function(s){e=s}),cancel:e}}};function Wne(t){return function(n){return t.apply(null,n)}}function Gne(t){return je.isObject(t)&&t.isAxiosError===!0}const ck={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(ck).forEach(([t,e])=>{ck[e]=t});function XI(t){const e=new Zu(t),n=NI(Zu.prototype.request,e);return je.extend(n,Zu.prototype,e,{allOwnKeys:!0}),je.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return XI(rd(t,s))},n}const Br=XI(zp);Br.Axios=Zu;Br.CanceledError=bf;Br.CancelToken=Une;Br.isCancel=qI;Br.VERSION=WI;Br.toFormData=Zy;Br.AxiosError=Xt;Br.Cancel=Br.CanceledError;Br.all=function(e){return Promise.all(e)};Br.spread=Wne;Br.isAxiosError=Gne;Br.mergeConfig=rd;Br.AxiosHeaders=Si;Br.formToJSON=t=>FI(je.isHTMLForm(t)?new FormData(t):t);Br.getAdapter=UI.getAdapter;Br.HttpStatusCode=ck;Br.default=Br;const{Axios:nPe,AxiosError:rPe,CanceledError:sPe,isCancel:iPe,CancelToken:aPe,VERSION:oPe,all:lPe,Cancel:cPe,isAxiosError:uPe,spread:dPe,toFormData:hPe,AxiosHeaders:fPe,HttpStatusCode:mPe,formToJSON:pPe,getAdapter:gPe,mergeConfig:xPe}=Br,Xne=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r({classGroupId:t,validator:e}),YI=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Iv="-",V9=[],Kne="arbitrary..",Zne=t=>{const e=ere(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Jne(a);const l=a.split(Iv),c=l[0]===""&&l.length>1?1:0;return KI(l,c,e)},getConflictingClassGroupIds:(a,l)=>{if(l){const c=r[a],d=n[a];return c?d?Xne(d,c):c:d||V9}return n[a]||V9}}},KI=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const d=KI(t,e+1,i);if(d)return d}const a=n.validators;if(a===null)return;const l=e===0?t.join(Iv):t.slice(e).join(Iv),c=a.length;for(let d=0;dt.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?Kne+r:void 0})(),ere=t=>{const{theme:e,classGroups:n}=t;return tre(n,e)},tre=(t,e)=>{const n=YI();for(const r in t){const s=t[r];Ij(s,n,r,e)}return n},Ij=(t,e,n,r)=>{const s=t.length;for(let i=0;i{if(typeof t=="string"){rre(t,e,n);return}if(typeof t=="function"){sre(t,e,n,r);return}ire(t,e,n,r)},rre=(t,e,n)=>{const r=t===""?e:ZI(e,t);r.classGroupId=n},sre=(t,e,n,r)=>{if(are(t)){Ij(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(Yne(n,t))},ire=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let a=0;a{let n=t;const r=e.split(Iv),s=r.length;for(let i=0;i"isThemeGetter"in t&&t.isThemeGetter===!0,ore=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const s=(i,a)=>{n[i]=a,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(i){let a=n[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in n?n[i]=a:s(i,a)}}},uk="!",U9=":",lre=[],W9=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),cre=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let a=0,l=0,c=0,d;const h=s.length;for(let w=0;wc?d-c:void 0;return W9(i,x,g,y)};if(e){const s=e+U9,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):W9(lre,!1,a,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},ure=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},dre=t=>({cache:ore(t.cacheSize),parseClassName:cre(t),sortModifiers:ure(t),...Zne(t)}),hre=/\s+/,fre=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i}=e,a=[],l=t.trim().split(hre);let c="";for(let d=l.length-1;d>=0;d-=1){const h=l[d],{isExternal:m,modifiers:g,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:w}=n(h);if(m){c=h+(c.length>0?" "+c:c);continue}let S=!!w,k=r(S?y.substring(0,w):y);if(!k){if(!S){c=h+(c.length>0?" "+c:c);continue}if(k=r(y),!k){c=h+(c.length>0?" "+c:c);continue}S=!1}const j=g.length===0?"":g.length===1?g[0]:i(g).join(":"),N=x?j+uk:j,T=N+k;if(a.indexOf(T)>-1)continue;a.push(T);const E=s(k,S);for(let _=0;_0?" "+c:c)}return c},mre=(...t)=>{let e=0,n,r,s="";for(;e{if(typeof t=="string")return t;let e,n="";for(let r=0;r{let n,r,s,i;const a=c=>{const d=e.reduce((h,m)=>m(h),t());return n=dre(d),r=n.cache.get,s=n.cache.set,i=l,l(c)},l=c=>{const d=r(c);if(d)return d;const h=fre(c,n);return s(c,h),h};return i=a,(...c)=>i(mre(...c))},gre=[],cs=t=>{const e=n=>n[t]||gre;return e.isThemeGetter=!0,e},eL=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tL=/^\((?:(\w[\w-]*):)?(.+)\)$/i,xre=/^\d+\/\d+$/,vre=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,yre=/\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$/,bre=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,wre=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Sre=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ih=t=>xre.test(t),rn=t=>!!t&&!Number.isNaN(Number(t)),jc=t=>!!t&&Number.isInteger(Number(t)),N4=t=>t.endsWith("%")&&rn(t.slice(0,-1)),xl=t=>vre.test(t),kre=()=>!0,Ore=t=>yre.test(t)&&!bre.test(t),nL=()=>!1,jre=t=>wre.test(t),Nre=t=>Sre.test(t),Cre=t=>!dt(t)&&!ht(t),Tre=t=>wf(t,iL,nL),dt=t=>eL.test(t),Mu=t=>wf(t,aL,Ore),C4=t=>wf(t,Rre,rn),G9=t=>wf(t,rL,nL),Ere=t=>wf(t,sL,Nre),Yx=t=>wf(t,oL,jre),ht=t=>tL.test(t),Im=t=>Sf(t,aL),_re=t=>Sf(t,Dre),X9=t=>Sf(t,rL),Are=t=>Sf(t,iL),Mre=t=>Sf(t,sL),Kx=t=>Sf(t,oL,!0),wf=(t,e,n)=>{const r=eL.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Sf=(t,e,n=!1)=>{const r=tL.exec(t);return r?r[1]?e(r[1]):n:!1},rL=t=>t==="position"||t==="percentage",sL=t=>t==="image"||t==="url",iL=t=>t==="length"||t==="size"||t==="bg-size",aL=t=>t==="length",Rre=t=>t==="number",Dre=t=>t==="family-name",oL=t=>t==="shadow",Pre=()=>{const t=cs("color"),e=cs("font"),n=cs("text"),r=cs("font-weight"),s=cs("tracking"),i=cs("leading"),a=cs("breakpoint"),l=cs("container"),c=cs("spacing"),d=cs("radius"),h=cs("shadow"),m=cs("inset-shadow"),g=cs("text-shadow"),x=cs("drop-shadow"),y=cs("blur"),w=cs("perspective"),S=cs("aspect"),k=cs("ease"),j=cs("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...T(),ht,dt],_=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],L=()=>[ht,dt,c],P=()=>[ih,"full","auto",...L()],B=()=>[jc,"none","subgrid",ht,dt],$=()=>["auto",{span:["full",jc,ht,dt]},jc,ht,dt],U=()=>[jc,"auto",ht,dt],te=()=>["auto","min","max","fr",ht,dt],z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...L()],Y=()=>[ih,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],J=()=>[t,ht,dt],X=()=>[...T(),X9,G9,{position:[ht,dt]}],R=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ie=()=>["auto","cover","contain",Are,Tre,{size:[ht,dt]}],G=()=>[N4,Im,Mu],I=()=>["","none","full",d,ht,dt],V=()=>["",rn,Im,Mu],ee=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>[rn,N4,X9,G9],se=()=>["","none",y,ht,dt],re=()=>["none",rn,ht,dt],oe=()=>["none",rn,ht,dt],Te=()=>[rn,ht,dt],We=()=>[ih,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[xl],breakpoint:[xl],color:[kre],container:[xl],"drop-shadow":[xl],ease:["in","out","in-out"],font:[Cre],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[xl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[xl],shadow:[xl],spacing:["px",rn],text:[xl],"text-shadow":[xl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ih,dt,ht,S]}],container:["container"],columns:[{columns:[rn,dt,ht,l]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{start:P()}],end:[{end:P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[jc,"auto",ht,dt]}],basis:[{basis:[ih,"full","auto",l,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[rn,ih,"auto","initial","none",dt]}],grow:[{grow:["",rn,ht,dt]}],shrink:[{shrink:["",rn,ht,dt]}],order:[{order:[jc,"first","last","none",ht,dt]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...z(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...z()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":z()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],w:[{w:[l,"screen",...Y()]}],"min-w":[{"min-w":[l,"screen","none",...Y()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[a]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",n,Im,Mu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ht,C4]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",N4,dt]}],"font-family":[{font:[_re,dt,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,ht,dt]}],"line-clamp":[{"line-clamp":[rn,"none",ht,C4]}],leading:[{leading:[i,...L()]}],"list-image":[{"list-image":["none",ht,dt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ht,dt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:J()}],"text-color":[{text:J()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ee(),"wavy"]}],"text-decoration-thickness":[{decoration:[rn,"from-font","auto",ht,Mu]}],"text-decoration-color":[{decoration:J()}],"underline-offset":[{"underline-offset":[rn,"auto",ht,dt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ht,dt]}],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",ht,dt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:X()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},jc,ht,dt],radial:["",ht,dt],conic:[jc,ht,dt]},Mre,Ere]}],"bg-color":[{bg:J()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:J()}],"gradient-via":[{via:J()}],"gradient-to":[{to:J()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":V()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ee(),"hidden","none"]}],"divide-style":[{divide:[...ee(),"hidden","none"]}],"border-color":[{border:J()}],"border-color-x":[{"border-x":J()}],"border-color-y":[{"border-y":J()}],"border-color-s":[{"border-s":J()}],"border-color-e":[{"border-e":J()}],"border-color-t":[{"border-t":J()}],"border-color-r":[{"border-r":J()}],"border-color-b":[{"border-b":J()}],"border-color-l":[{"border-l":J()}],"divide-color":[{divide:J()}],"outline-style":[{outline:[...ee(),"none","hidden"]}],"outline-offset":[{"outline-offset":[rn,ht,dt]}],"outline-w":[{outline:["",rn,Im,Mu]}],"outline-color":[{outline:J()}],shadow:[{shadow:["","none",h,Kx,Yx]}],"shadow-color":[{shadow:J()}],"inset-shadow":[{"inset-shadow":["none",m,Kx,Yx]}],"inset-shadow-color":[{"inset-shadow":J()}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:J()}],"ring-offset-w":[{"ring-offset":[rn,Mu]}],"ring-offset-color":[{"ring-offset":J()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":J()}],"text-shadow":[{"text-shadow":["none",g,Kx,Yx]}],"text-shadow-color":[{"text-shadow":J()}],opacity:[{opacity:[rn,ht,dt]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],"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":[rn]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":J()}],"mask-image-linear-to-color":[{"mask-linear-to":J()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":J()}],"mask-image-t-to-color":[{"mask-t-to":J()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":J()}],"mask-image-r-to-color":[{"mask-r-to":J()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":J()}],"mask-image-b-to-color":[{"mask-b-to":J()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":J()}],"mask-image-l-to-color":[{"mask-l-to":J()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":J()}],"mask-image-x-to-color":[{"mask-x-to":J()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":J()}],"mask-image-y-to-color":[{"mask-y-to":J()}],"mask-image-radial":[{"mask-radial":[ht,dt]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":J()}],"mask-image-radial-to-color":[{"mask-radial-to":J()}],"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":T()}],"mask-image-conic-pos":[{"mask-conic":[rn]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":J()}],"mask-image-conic-to-color":[{"mask-conic-to":J()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:X()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ht,dt]}],filter:[{filter:["","none",ht,dt]}],blur:[{blur:se()}],brightness:[{brightness:[rn,ht,dt]}],contrast:[{contrast:[rn,ht,dt]}],"drop-shadow":[{"drop-shadow":["","none",x,Kx,Yx]}],"drop-shadow-color":[{"drop-shadow":J()}],grayscale:[{grayscale:["",rn,ht,dt]}],"hue-rotate":[{"hue-rotate":[rn,ht,dt]}],invert:[{invert:["",rn,ht,dt]}],saturate:[{saturate:[rn,ht,dt]}],sepia:[{sepia:["",rn,ht,dt]}],"backdrop-filter":[{"backdrop-filter":["","none",ht,dt]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[rn,ht,dt]}],"backdrop-contrast":[{"backdrop-contrast":[rn,ht,dt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",rn,ht,dt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[rn,ht,dt]}],"backdrop-invert":[{"backdrop-invert":["",rn,ht,dt]}],"backdrop-opacity":[{"backdrop-opacity":[rn,ht,dt]}],"backdrop-saturate":[{"backdrop-saturate":[rn,ht,dt]}],"backdrop-sepia":[{"backdrop-sepia":["",rn,ht,dt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ht,dt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[rn,"initial",ht,dt]}],ease:[{ease:["linear","initial",k,ht,dt]}],delay:[{delay:[rn,ht,dt]}],animate:[{animate:["none",j,ht,dt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,ht,dt]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:oe()}],"scale-x":[{"scale-x":oe()}],"scale-y":[{"scale-y":oe()}],"scale-z":[{"scale-z":oe()}],"scale-3d":["scale-3d"],skew:[{skew:Te()}],"skew-x":[{"skew-x":Te()}],"skew-y":[{"skew-y":Te()}],transform:[{transform:[ht,dt,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:We()}],"translate-x":[{"translate-x":We()}],"translate-y":[{"translate-y":We()}],"translate-z":[{"translate-z":We()}],"translate-none":["translate-none"],accent:[{accent:J()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:J()}],"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",ht,dt]}],"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":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",ht,dt]}],fill:[{fill:["none",...J()]}],"stroke-w":[{stroke:[rn,Im,Mu,C4]}],stroke:[{stroke:["none",...J()]}],"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"]}},zre=pre(Pre);function xe(...t){return zre(Fz(t))}const qt=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:xe("rounded-xl border bg-card text-card-foreground shadow",t),...e}));qt.displayName="Card";const Fn=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:xe("flex flex-col space-y-1.5 p-6",t),...e}));Fn.displayName="CardHeader";const qn=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:xe("font-semibold leading-none tracking-tight",t),...e}));qn.displayName="CardTitle";const ts=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:xe("text-sm text-muted-foreground",t),...e}));ts.displayName="CardDescription";const Gn=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:xe("p-6 pt-0",t),...e}));Gn.displayName="CardContent";const lL=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:xe("flex items-center p-6 pt-0",t),...e}));lL.displayName="CardFooter";var T4="rovingFocusGroup.onEntryFocus",Ire={bubbles:!1,cancelable:!0},Ip="RovingFocusGroup",[dk,cL,Lre]=By(Ip),[Bre,eb]=Ra(Ip,[Lre]),[Fre,qre]=Bre(Ip),uL=b.forwardRef((t,e)=>o.jsx(dk.Provider,{scope:t.__scopeRovingFocusGroup,children:o.jsx(dk.Slot,{scope:t.__scopeRovingFocusGroup,children:o.jsx($re,{...t,ref:e})})}));uL.displayName=Ip;var $re=b.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:h=!1,...m}=t,g=b.useRef(null),x=Yn(e,g),y=Ep(i),[w,S]=Xl({prop:a,defaultProp:l??null,onChange:c,caller:Ip}),[k,j]=b.useState(!1),N=Rs(d),T=cL(n),E=b.useRef(!1),[_,A]=b.useState(0);return b.useEffect(()=>{const L=g.current;if(L)return L.addEventListener(T4,N),()=>L.removeEventListener(T4,N)},[N]),o.jsx(Fre,{scope:n,orientation:r,dir:y,loop:s,currentTabStopId:w,onItemFocus:b.useCallback(L=>S(L),[S]),onItemShiftTab:b.useCallback(()=>j(!0),[]),onFocusableItemAdd:b.useCallback(()=>A(L=>L+1),[]),onFocusableItemRemove:b.useCallback(()=>A(L=>L-1),[]),children:o.jsx(xn.div,{tabIndex:k||_===0?-1:0,"data-orientation":r,...m,ref:x,style:{outline:"none",...t.style},onMouseDown:nt(t.onMouseDown,()=>{E.current=!0}),onFocus:nt(t.onFocus,L=>{const P=!E.current;if(L.target===L.currentTarget&&P&&!k){const B=new CustomEvent(T4,Ire);if(L.currentTarget.dispatchEvent(B),!B.defaultPrevented){const $=T().filter(F=>F.focusable),U=$.find(F=>F.active),te=$.find(F=>F.id===w),Q=[U,te,...$].filter(Boolean).map(F=>F.ref.current);fL(Q,h)}}E.current=!1}),onBlur:nt(t.onBlur,()=>j(!1))})})}),dL="RovingFocusGroupItem",hL=b.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:a,...l}=t,c=Ui(),d=i||c,h=qre(dL,n),m=h.currentTabStopId===d,g=cL(n),{onFocusableItemAdd:x,onFocusableItemRemove:y,currentTabStopId:w}=h;return b.useEffect(()=>{if(r)return x(),()=>y()},[r,x,y]),o.jsx(dk.ItemSlot,{scope:n,id:d,focusable:r,active:s,children:o.jsx(xn.span,{tabIndex:m?0:-1,"data-orientation":h.orientation,...l,ref:e,onMouseDown:nt(t.onMouseDown,S=>{r?h.onItemFocus(d):S.preventDefault()}),onFocus:nt(t.onFocus,()=>h.onItemFocus(d)),onKeyDown:nt(t.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){h.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const k=Vre(S,h.orientation,h.dir);if(k!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let N=g().filter(T=>T.focusable).map(T=>T.ref.current);if(k==="last")N.reverse();else if(k==="prev"||k==="next"){k==="prev"&&N.reverse();const T=N.indexOf(S.currentTarget);N=h.loop?Ure(N,T+1):N.slice(T+1)}setTimeout(()=>fL(N))}}),children:typeof a=="function"?a({isCurrentTabStop:m,hasTabStop:w!=null}):a})})});hL.displayName=dL;var Hre={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Qre(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Vre(t,e,n){const r=Qre(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Hre[r]}function fL(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function Ure(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var mL=uL,pL=hL,tb="Tabs",[Wre]=Ra(tb,[eb]),gL=eb(),[Gre,Lj]=Wre(tb),xL=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:a="horizontal",dir:l,activationMode:c="automatic",...d}=t,h=Ep(l),[m,g]=Xl({prop:r,onChange:s,defaultProp:i??"",caller:tb});return o.jsx(Gre,{scope:n,baseId:Ui(),value:m,onValueChange:g,orientation:a,dir:h,activationMode:c,children:o.jsx(xn.div,{dir:h,"data-orientation":a,...d,ref:e})})});xL.displayName=tb;var vL="TabsList",yL=b.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...s}=t,i=Lj(vL,n),a=gL(n);return o.jsx(mL,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:o.jsx(xn.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:e})})});yL.displayName=vL;var bL="TabsTrigger",wL=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=t,a=Lj(bL,n),l=gL(n),c=OL(a.baseId,r),d=jL(a.baseId,r),h=r===a.value;return o.jsx(pL,{asChild:!0,...l,focusable:!s,active:h,children:o.jsx(xn.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":d,"data-state":h?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...i,ref:e,onMouseDown:nt(t.onMouseDown,m=>{!s&&m.button===0&&m.ctrlKey===!1?a.onValueChange(r):m.preventDefault()}),onKeyDown:nt(t.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&a.onValueChange(r)}),onFocus:nt(t.onFocus,()=>{const m=a.activationMode!=="manual";!h&&!s&&m&&a.onValueChange(r)})})})});wL.displayName=bL;var SL="TabsContent",kL=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...a}=t,l=Lj(SL,n),c=OL(l.baseId,r),d=jL(l.baseId,r),h=r===l.value,m=b.useRef(h);return b.useEffect(()=>{const g=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(g)},[]),o.jsx(ii,{present:s||h,children:({present:g})=>o.jsx(xn.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!g,id:d,tabIndex:0,...a,ref:e,style:{...t.style,animationDuration:m.current?"0s":void 0},children:g&&i})})});kL.displayName=SL;function OL(t,e){return`${t}-trigger-${e}`}function jL(t,e){return`${t}-content-${e}`}var Xre=xL,NL=yL,CL=wL,TL=kL;const ja=Xre,Wi=b.forwardRef(({className:t,...e},n)=>o.jsx(NL,{ref:n,className:xe("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...e}));Wi.displayName=NL.displayName;const Lt=b.forwardRef(({className:t,...e},n)=>o.jsx(CL,{ref:n,className:xe("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",t),...e}));Lt.displayName=CL.displayName;const un=b.forwardRef(({className:t,...e},n)=>o.jsx(TL,{ref:n,className:xe("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",t),...e}));un.displayName=TL.displayName;function Yre(t,e){return b.useReducer((n,r)=>e[n][r]??n,t)}var Bj="ScrollArea",[EL]=Ra(Bj),[Kre,Da]=EL(Bj),_L=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:i=600,...a}=t,[l,c]=b.useState(null),[d,h]=b.useState(null),[m,g]=b.useState(null),[x,y]=b.useState(null),[w,S]=b.useState(null),[k,j]=b.useState(0),[N,T]=b.useState(0),[E,_]=b.useState(!1),[A,L]=b.useState(!1),P=Yn(e,$=>c($)),B=Ep(s);return o.jsx(Kre,{scope:n,type:r,dir:B,scrollHideDelay:i,scrollArea:l,viewport:d,onViewportChange:h,content:m,onContentChange:g,scrollbarX:x,onScrollbarXChange:y,scrollbarXEnabled:E,onScrollbarXEnabledChange:_,scrollbarY:w,onScrollbarYChange:S,scrollbarYEnabled:A,onScrollbarYEnabledChange:L,onCornerWidthChange:j,onCornerHeightChange:T,children:o.jsx(xn.div,{dir:B,...a,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":k+"px","--radix-scroll-area-corner-height":N+"px",...t.style}})})});_L.displayName=Bj;var AL="ScrollAreaViewport",ML=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,nonce:s,...i}=t,a=Da(AL,n),l=b.useRef(null),c=Yn(e,l,a.onViewportChange);return o.jsxs(o.Fragment,{children:[o.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}),o.jsx(xn.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...t.style},children:o.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});ML.displayName=AL;var Fo="ScrollAreaScrollbar",Fj=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Da(Fo,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=s,l=t.orientation==="horizontal";return b.useEffect(()=>(l?i(!0):a(!0),()=>{l?i(!1):a(!1)}),[l,i,a]),s.type==="hover"?o.jsx(Zre,{...r,ref:e,forceMount:n}):s.type==="scroll"?o.jsx(Jre,{...r,ref:e,forceMount:n}):s.type==="auto"?o.jsx(RL,{...r,ref:e,forceMount:n}):s.type==="always"?o.jsx(qj,{...r,ref:e}):null});Fj.displayName=Fo;var Zre=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Da(Fo,t.__scopeScrollArea),[i,a]=b.useState(!1);return b.useEffect(()=>{const l=s.scrollArea;let c=0;if(l){const d=()=>{window.clearTimeout(c),a(!0)},h=()=>{c=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return l.addEventListener("pointerenter",d),l.addEventListener("pointerleave",h),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",d),l.removeEventListener("pointerleave",h)}}},[s.scrollArea,s.scrollHideDelay]),o.jsx(ii,{present:n||i,children:o.jsx(RL,{"data-state":i?"visible":"hidden",...r,ref:e})})}),Jre=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Da(Fo,t.__scopeScrollArea),i=t.orientation==="horizontal",a=rb(()=>c("SCROLL_END"),100),[l,c]=Yre("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 b.useEffect(()=>{if(l==="idle"){const d=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(d)}},[l,s.scrollHideDelay,c]),b.useEffect(()=>{const d=s.viewport,h=i?"scrollLeft":"scrollTop";if(d){let m=d[h];const g=()=>{const x=d[h];m!==x&&(c("SCROLL"),a()),m=x};return d.addEventListener("scroll",g),()=>d.removeEventListener("scroll",g)}},[s.viewport,i,c,a]),o.jsx(ii,{present:n||l!=="hidden",children:o.jsx(qj,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:nt(t.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:nt(t.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),RL=b.forwardRef((t,e)=>{const n=Da(Fo,t.__scopeScrollArea),{forceMount:r,...s}=t,[i,a]=b.useState(!1),l=t.orientation==="horizontal",c=rb(()=>{if(n.viewport){const d=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=t,s=Da(Fo,t.__scopeScrollArea),i=b.useRef(null),a=b.useRef(0),[l,c]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=LL(l.viewport,l.content),h={...r,sizes:l,onSizesChange:c,hasThumb:d>0&&d<1,onThumbChange:g=>i.current=g,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:g=>a.current=g};function m(g,x){return ise(g,a.current,l,x)}return n==="horizontal"?o.jsx(ese,{...h,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const g=s.viewport.scrollLeft,x=Y9(g,l,s.dir);i.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollLeft=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollLeft=m(g,s.dir))}}):n==="vertical"?o.jsx(tse,{...h,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const g=s.viewport.scrollTop,x=Y9(g,l);i.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollTop=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollTop=m(g))}}):null}),ese=b.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=Da(Fo,t.__scopeScrollArea),[a,l]=b.useState(),c=b.useRef(null),d=Yn(e,c,i.onScrollbarXChange);return b.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),o.jsx(PL,{"data-orientation":"horizontal",...s,ref:d,sizes:n,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":nb(n)+"px",...t.style},onThumbPointerDown:h=>t.onThumbPointerDown(h.x),onDragScroll:h=>t.onDragScroll(h.x),onWheelScroll:(h,m)=>{if(i.viewport){const g=i.viewport.scrollLeft+h.deltaX;t.onWheelScroll(g),FL(g,m)&&h.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Bv(a.paddingLeft),paddingEnd:Bv(a.paddingRight)}})}})}),tse=b.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=Da(Fo,t.__scopeScrollArea),[a,l]=b.useState(),c=b.useRef(null),d=Yn(e,c,i.onScrollbarYChange);return b.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),o.jsx(PL,{"data-orientation":"vertical",...s,ref:d,sizes:n,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":nb(n)+"px",...t.style},onThumbPointerDown:h=>t.onThumbPointerDown(h.y),onDragScroll:h=>t.onDragScroll(h.y),onWheelScroll:(h,m)=>{if(i.viewport){const g=i.viewport.scrollTop+h.deltaY;t.onWheelScroll(g),FL(g,m)&&h.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Bv(a.paddingTop),paddingEnd:Bv(a.paddingBottom)}})}})}),[nse,DL]=EL(Fo),PL=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:d,onWheelScroll:h,onResize:m,...g}=t,x=Da(Fo,n),[y,w]=b.useState(null),S=Yn(e,P=>w(P)),k=b.useRef(null),j=b.useRef(""),N=x.viewport,T=r.content-r.viewport,E=Rs(h),_=Rs(c),A=rb(m,10);function L(P){if(k.current){const B=P.clientX-k.current.left,$=P.clientY-k.current.top;d({x:B,y:$})}}return b.useEffect(()=>{const P=B=>{const $=B.target;y?.contains($)&&E(B,T)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[N,y,T,E]),b.useEffect(_,[r,_]),Yh(y,A),Yh(x.content,A),o.jsx(nse,{scope:n,scrollbar:y,hasThumb:s,onThumbChange:Rs(i),onThumbPointerUp:Rs(a),onThumbPositionChange:_,onThumbPointerDown:Rs(l),children:o.jsx(xn.div,{...g,ref:S,style:{position:"absolute",...g.style},onPointerDown:nt(t.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),k.current=y.getBoundingClientRect(),j.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),L(P))}),onPointerMove:nt(t.onPointerMove,L),onPointerUp:nt(t.onPointerUp,P=>{const B=P.target;B.hasPointerCapture(P.pointerId)&&B.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=j.current,x.viewport&&(x.viewport.style.scrollBehavior=""),k.current=null})})})}),Lv="ScrollAreaThumb",zL=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=DL(Lv,t.__scopeScrollArea);return o.jsx(ii,{present:n||s.hasThumb,children:o.jsx(rse,{ref:e,...r})})}),rse=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...s}=t,i=Da(Lv,n),a=DL(Lv,n),{onThumbPositionChange:l}=a,c=Yn(e,m=>a.onThumbChange(m)),d=b.useRef(void 0),h=rb(()=>{d.current&&(d.current(),d.current=void 0)},100);return b.useEffect(()=>{const m=i.viewport;if(m){const g=()=>{if(h(),!d.current){const x=ase(m,l);d.current=x,l()}};return l(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[i.viewport,h,l]),o.jsx(xn.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:nt(t.onPointerDownCapture,m=>{const x=m.target.getBoundingClientRect(),y=m.clientX-x.left,w=m.clientY-x.top;a.onThumbPointerDown({x:y,y:w})}),onPointerUp:nt(t.onPointerUp,a.onThumbPointerUp)})});zL.displayName=Lv;var $j="ScrollAreaCorner",IL=b.forwardRef((t,e)=>{const n=Da($j,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?o.jsx(sse,{...t,ref:e}):null});IL.displayName=$j;var sse=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,s=Da($j,n),[i,a]=b.useState(0),[l,c]=b.useState(0),d=!!(i&&l);return Yh(s.scrollbarX,()=>{const h=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(h),c(h)}),Yh(s.scrollbarY,()=>{const h=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(h),a(h)}),d?o.jsx(xn.div,{...r,ref:e,style:{width:i,height:l,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function Bv(t){return t?parseInt(t,10):0}function LL(t,e){const n=t/e;return isNaN(n)?0:n}function nb(t){const e=LL(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function ise(t,e,n,r="ltr"){const s=nb(n),i=s/2,a=e||i,l=s-a,c=n.scrollbar.paddingStart+a,d=n.scrollbar.size-n.scrollbar.paddingEnd-l,h=n.content-n.viewport,m=r==="ltr"?[0,h]:[h*-1,0];return BL([c,d],m)(t)}function Y9(t,e,n="ltr"){const r=nb(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-s,a=e.content-e.viewport,l=i-r,c=n==="ltr"?[0,a]:[a*-1,0],d=Sj(t,c);return BL([0,a],[0,l])(d)}function BL(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function FL(t,e){return t>0&&t{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return(function s(){const i={left:t.scrollLeft,top:t.scrollTop},a=n.left!==i.left,l=n.top!==i.top;(a||l)&&e(),n=i,r=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(r)};function rb(t,e){const n=Rs(t),r=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),b.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function Yh(t,e){const n=Rs(e);Uh(()=>{let r=0;if(t){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(t),()=>{window.cancelAnimationFrame(r),s.unobserve(t)}}},[t,n])}var qL=_L,ose=ML,lse=IL;const gn=b.forwardRef(({className:t,children:e,viewportRef:n,...r},s)=>o.jsxs(qL,{ref:s,className:xe("relative overflow-hidden",t),...r,children:[o.jsx(ose,{ref:n,className:"h-full w-full rounded-[inherit]",children:e}),o.jsx(hk,{}),o.jsx(hk,{orientation:"horizontal"}),o.jsx(lse,{})]}));gn.displayName=qL.displayName;const hk=b.forwardRef(({className:t,orientation:e="vertical",...n},r)=>o.jsx(Fj,{ref:r,orientation:e,className:xe("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]",t),...n,children:o.jsx(zL,{className:"relative flex-1 rounded-full bg-border"})}));hk.displayName=Fj.displayName;function cse({className:t,...e}){return o.jsx("div",{className:xe("animate-pulse rounded-md bg-primary/10",t),...e})}function use(t,e=[]){let n=[];function r(i,a){const l=b.createContext(a);l.displayName=i+"Context";const c=n.length;n=[...n,a];const d=m=>{const{scope:g,children:x,...y}=m,w=g?.[t]?.[c]||l,S=b.useMemo(()=>y,Object.values(y));return o.jsx(w.Provider,{value:S,children:x})};d.displayName=i+"Provider";function h(m,g){const x=g?.[t]?.[c]||l,y=b.useContext(x);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${m}\` must be used within \`${i}\``)}return[d,h]}const s=()=>{const i=n.map(a=>b.createContext(a));return function(l){const c=l?.[t]||i;return b.useMemo(()=>({[`__scope${t}`]:{...l,[t]:c}}),[l,c])}};return s.scopeName=t,[r,dse(s,...e)]}function dse(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((l,{useScope:c,scopeName:d})=>{const m=c(i)[`__scope${d}`];return{...l,...m}},{});return b.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var hse=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$L=hse.reduce((t,e)=>{const n=Fy(`Primitive.${e}`),r=b.forwardRef((s,i)=>{const{asChild:a,...l}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),Hj="Progress",Qj=100,[fse]=use(Hj),[mse,pse]=fse(Hj),HL=b.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=gse,...a}=t;(s||s===0)&&!K9(s)&&console.error(xse(`${s}`,"Progress"));const l=K9(s)?s:Qj;r!==null&&!Z9(r,l)&&console.error(vse(`${r}`,"Progress"));const c=Z9(r,l)?r:null,d=Fv(c)?i(c,l):void 0;return o.jsx(mse,{scope:n,value:c,max:l,children:o.jsx($L.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":Fv(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":UL(c,l),"data-value":c??void 0,"data-max":l,...a,ref:e})})});HL.displayName=Hj;var QL="ProgressIndicator",VL=b.forwardRef((t,e)=>{const{__scopeProgress:n,...r}=t,s=pse(QL,n);return o.jsx($L.div,{"data-state":UL(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:e})});VL.displayName=QL;function gse(t,e){return`${Math.round(t/e*100)}%`}function UL(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function Fv(t){return typeof t=="number"}function K9(t){return Fv(t)&&!isNaN(t)&&t>0}function Z9(t,e){return Fv(t)&&!isNaN(t)&&t<=e&&t>=0}function xse(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Qj}\`.`}function vse(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: - a positive number - - less than the value passed to \`max\` (or ${Fj} if no \`max\` prop is set) + - less than the value passed to \`max\` (or ${Qj} if no \`max\` prop is set) - \`null\` or \`undefined\` if the progress is indeterminate. -Defaulting to \`null\`.`}var qL=IL,ese=BL;const zp=b.forwardRef(({className:t,value:e,...n},r)=>o.jsx(qL,{ref:r,className:ve("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",t),...n,children:o.jsx(ese,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));zp.displayName=qL.displayName;const tse={light:"",dark:".dark"},$L=b.createContext(null);function HL(){const t=b.useContext($L);if(!t)throw new Error("useChart must be used within a ");return t}const gh=b.forwardRef(({id:t,className:e,children:n,config:r,...s},i)=>{const a=b.useId(),l=`chart-${t||a.replace(/:/g,"")}`;return o.jsx($L.Provider,{value:{config:r},children:o.jsxs("div",{"data-chart":l,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:[o.jsx(nse,{id:l,config:r}),o.jsx(cJ,{children:n})]})})});gh.displayName="Chart";const nse=({id:t,config:e})=>{const n=Object.entries(e).filter(([,r])=>r.theme||r.color);return n.length?o.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(tse).map(([r,s])=>` +Defaulting to \`null\`.`}var WL=HL,yse=VL;const Lp=b.forwardRef(({className:t,value:e,...n},r)=>o.jsx(WL,{ref:r,className:xe("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",t),...n,children:o.jsx(yse,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));Lp.displayName=WL.displayName;const bse={light:"",dark:".dark"},GL=b.createContext(null);function XL(){const t=b.useContext(GL);if(!t)throw new Error("useChart must be used within a ");return t}const gh=b.forwardRef(({id:t,className:e,children:n,config:r,...s},i)=>{const a=b.useId(),l=`chart-${t||a.replace(/:/g,"")}`;return o.jsx(GL.Provider,{value:{config:r},children:o.jsxs("div",{"data-chart":l,ref:i,className:xe("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:[o.jsx(wse,{id:l,config:r}),o.jsx(jJ,{children:n})]})})});gh.displayName="Chart";const wse=({id:t,config:e})=>{const n=Object.entries(e).filter(([,r])=>r.theme||r.color);return n.length?o.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(bse).map(([r,s])=>` ${s} [data-chart=${t}] { ${n.map(([i,a])=>{const l=a.theme?.[r]||a.color;return l?` --color-${i}: ${l};`:null}).join(` `)} } `).join(` -`)}}):null},zm=uJ,xh=b.forwardRef(({active:t,payload:e,className:n,indicator:r="dot",hideLabel:s=!1,hideIndicator:i=!1,label:a,labelFormatter:l,labelClassName:c,formatter:d,color:h,nameKey:m,labelKey:g},x)=>{const{config:y}=HL(),w=b.useMemo(()=>{if(s||!e?.length)return null;const[k]=e,j=`${g||k?.dataKey||k?.name||"value"}`,N=ok(y,k,j),T=!g&&typeof a=="string"?y[a]?.label||a:N?.label;return l?o.jsx("div",{className:ve("font-medium",c),children:l(T,e)}):T?o.jsx("div",{className:ve("font-medium",c),children:T}):null},[a,l,e,s,c,y,g]);if(!t||!e?.length)return null;const S=e.length===1&&r!=="dot";return o.jsxs("div",{ref:x,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",n),children:[S?null:w,o.jsx("div",{className:"grid gap-1.5",children:e.filter(k=>k.type!=="none").map((k,j)=>{const N=`${m||k.name||k.dataKey||"value"}`,T=ok(y,k,N),E=h||k.payload.fill||k.color;return o.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:d&&k?.value!==void 0&&k.name?d(k.value,k.name,k,j,k.payload):o.jsxs(o.Fragment,{children:[T?.icon?o.jsx(T.icon,{}):!i&&o.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":S&&r==="dashed"}),style:{"--color-bg":E,"--color-border":E}}),o.jsxs("div",{className:ve("flex flex-1 justify-between leading-none",S?"items-end":"items-center"),children:[o.jsxs("div",{className:"grid gap-1.5",children:[S?w:null,o.jsx("span",{className:"text-muted-foreground",children:T?.label||k.name})]}),k.value&&o.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:k.value.toLocaleString()})]})]})},k.dataKey)})})]})});xh.displayName="ChartTooltip";const rse=dJ,QL=b.forwardRef(({className:t,hideIcon:e=!1,payload:n,verticalAlign:r="bottom",nameKey:s},i)=>{const{config:a}=HL();return n?.length?o.jsx("div",{ref:i,className:ve("flex items-center justify-center gap-4",r==="top"?"pb-3":"pt-3",t),children:n.filter(l=>l.type!=="none").map(l=>{const c=`${s||l.dataKey||"value"}`,d=ok(a,l,c);return o.jsxs("div",{className:ve("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[d?.icon&&!e?o.jsx(d.icon,{}):o.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:l.color}}),d?.label]},l.value)})}):null});QL.displayName="ChartLegend";function ok(t,e,n){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=n;return n in e&&typeof e[n]=="string"?s=e[n]:r&&n in r&&typeof r[n]=="string"&&(s=r[n]),s in t?t[s]:t[n]}const W9=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,G9=Rz,wf=(t,e)=>n=>{var r;if(e?.variants==null)return G9(t,n?.class,n?.className);const{variants:s,defaultVariants:i}=e,a=Object.keys(s).map(d=>{const h=n?.[d],m=i?.[d];if(h===null)return null;const g=W9(h)||W9(m);return s[d][g]}),l=n&&Object.entries(n).reduce((d,h)=>{let[m,g]=h;return g===void 0||(d[m]=g),d},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,h)=>{let{class:m,className:g,...x}=h;return Object.entries(x).every(y=>{let[w,S]=y;return Array.isArray(S)?S.includes({...i,...l}[w]):{...i,...l}[w]===S})?[...d,m,g]:d},[]);return G9(t,a,c,n?.class,n?.className)},D0=wf("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"}}),he=b.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...s},i)=>{const a=r?lee:"button";return o.jsx(a,{className:ve(D0({variant:e,size:n,className:t})),ref:i,...s})});he.displayName="Button";function sse(){const[t,e]=b.useState(null),[n,r]=b.useState(!0),[s,i]=b.useState(0),[a,l]=b.useState(24),[c,d]=b.useState(!0),[h,m]=b.useState(null),[g,x]=b.useState(!0),y=b.useCallback(async()=>{try{x(!0);const P=await Br.get("https://v1.hitokoto.cn/?c=a&c=b&c=c&c=d&c=h&c=i&c=k");m({hitokoto:P.data.hitokoto,from:P.data.from||P.data.from_who||"未知"})}catch(P){console.error("获取一言失败:",P),m({hitokoto:"人生就像一盒巧克力,你永远不知道下一颗是什么味道。",from:"阿甘正传"})}finally{x(!1)}},[]),w=b.useCallback(async()=>{try{const P=localStorage.getItem("access-token"),L=await Br.get(`/api/webui/statistics/dashboard?hours=${a}`,{headers:{Authorization:`Bearer ${P}`}});e(L.data),r(!1),i(100)}catch(P){console.error("Failed to fetch dashboard data:",P),r(!1),i(100)}},[a]);if(b.useEffect(()=>{if(!n)return;i(0);const P=setTimeout(()=>i(15),200),L=setTimeout(()=>i(30),800),H=setTimeout(()=>i(45),2e3),U=setTimeout(()=>i(60),4e3),ee=setTimeout(()=>i(75),6500),z=setTimeout(()=>i(85),9e3),Q=setTimeout(()=>i(92),11e3);return()=>{clearTimeout(P),clearTimeout(L),clearTimeout(H),clearTimeout(U),clearTimeout(ee),clearTimeout(z),clearTimeout(Q)}},[n]),b.useEffect(()=>{w(),y()},[w,y]),b.useEffect(()=>{if(!c)return;const P=setInterval(()=>{w()},3e4);return()=>clearInterval(P)},[c,w]),n||!t)return o.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:o.jsxs("div",{className:"text-center space-y-6 w-full max-w-md px-4",children:[o.jsx(Qs,{className:"h-12 w-12 animate-spin mx-auto text-primary"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-lg font-medium",children:"加载统计数据中..."}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"正在获取麦麦运行数据"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(zp,{value:s,className:"h-2"}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:[s,"%"]})]})]})});const{summary:S,model_stats:k,hourly_data:j,daily_data:N,recent_activity:T}=t,E=P=>{const L=Math.floor(P/3600),H=Math.floor(P%3600/60);return`${L}小时${H}分钟`},_=P=>new Date(P).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),M=k.slice(0,6).map(P=>({name:P.model_name,value:P.request_count,fill:`hsl(var(--chart-${k.indexOf(P)%5+1}))`})),I={requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"},tokens:{label:"Tokens",color:"hsl(var(--chart-3))"}};return o.jsx(wn,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"实时监控面板"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"麦麦运行状态和统计数据一览"})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(ja,{value:a.toString(),onValueChange:P=>l(Number(P)),children:o.jsxs(Wi,{className:"grid grid-cols-3 w-full sm:w-auto",children:[o.jsx(Lt,{value:"24",children:"24小时"}),o.jsx(Lt,{value:"168",children:"7天"}),o.jsx(Lt,{value:"720",children:"30天"})]})}),o.jsxs(he,{variant:c?"default":"outline",size:"sm",onClick:()=>d(!c),className:"gap-2",children:[o.jsx(Qs,{className:`h-4 w-4 ${c?"animate-spin":""}`}),o.jsx("span",{className:"hidden sm:inline",children:"自动刷新"})]}),o.jsx(he,{variant:"outline",size:"sm",onClick:w,children:o.jsx(Qs,{className:"h-4 w-4"})})]})]}),o.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 rounded-lg border border-dashed border-muted-foreground/30 bg-muted/20",children:[g?o.jsx(Qre,{className:"h-5 flex-1"}):h?o.jsxs("p",{className:"flex-1 text-sm text-muted-foreground italic truncate",children:['"',h.hitokoto,'" —— ',h.from]}):null,o.jsx(he,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",onClick:y,disabled:g,children:o.jsx(Qs,{className:`h-3.5 w-3.5 ${g?"animate-spin":""}`})})]}),o.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[o.jsxs(qt,{children:[o.jsxs(Fn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(qn,{className:"text-sm font-medium",children:"总请求数"}),o.jsx(wee,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Gn,{children:[o.jsx("div",{className:"text-2xl font-bold",children:S.total_requests.toLocaleString()}),o.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["最近",a<48?a+"小时":Math.floor(a/24)+"天"]})]})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(qn,{className:"text-sm font-medium",children:"总花费"}),o.jsx(See,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Gn,{children:[o.jsxs("div",{className:"text-2xl font-bold",children:["¥",S.total_cost.toFixed(2)]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:S.cost_per_hour>0?`¥${S.cost_per_hour.toFixed(2)}/小时`:"暂无数据"})]})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(qn,{className:"text-sm font-medium",children:"Token消耗"}),o.jsx(G3,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Gn,{children:[o.jsxs("div",{className:"text-2xl font-bold",children:[(S.total_tokens/1e3).toFixed(1),"K"]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:S.tokens_per_hour>0?`${(S.tokens_per_hour/1e3).toFixed(1)}K/小时`:"暂无数据"})]})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(qn,{className:"text-sm font-medium",children:"平均响应"}),o.jsx(X3,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Gn,{children:[o.jsxs("div",{className:"text-2xl font-bold",children:[S.avg_response_time.toFixed(2),"s"]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"API平均耗时"})]})]})]}),o.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-3",children:[o.jsxs(qt,{children:[o.jsxs(Fn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(qn,{className:"text-sm font-medium",children:"在线时长"}),o.jsx(_h,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsx(Gn,{children:o.jsx("div",{className:"text-xl font-bold",children:E(S.online_time)})})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(qn,{className:"text-sm font-medium",children:"消息处理"}),o.jsx(Cp,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Gn,{children:[o.jsx("div",{className:"text-xl font-bold",children:S.total_messages.toLocaleString()}),o.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["回复 ",S.total_replies.toLocaleString()," 条"]})]})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(qn,{className:"text-sm font-medium",children:"成本效率"}),o.jsx(kee,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Gn,{children:[o.jsx("div",{className:"text-xl font-bold",children:S.total_messages>0?`¥${(S.total_cost/S.total_messages*100).toFixed(2)}`:"¥0.00"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"每100条消息"})]})]})]}),o.jsxs(ja,{defaultValue:"trends",className:"space-y-4",children:[o.jsxs(Wi,{className:"grid w-full grid-cols-2 sm:grid-cols-4",children:[o.jsx(Lt,{value:"trends",children:"趋势"}),o.jsx(Lt,{value:"models",children:"模型"}),o.jsx(Lt,{value:"activity",children:"活动"}),o.jsx(Lt,{value:"daily",children:"日统计"})]}),o.jsxs(un,{value:"trends",className:"space-y-4",children:[o.jsxs(qt,{children:[o.jsxs(Fn,{children:[o.jsx(qn,{children:"请求趋势"}),o.jsxs(ts,{children:["最近",a,"小时的请求量变化"]})]}),o.jsx(Gn,{children:o.jsx(gh,{config:I,className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:o.jsxs(hJ,{data:j,children:[o.jsx(Qx,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),o.jsx(Vx,{dataKey:"timestamp",tickFormatter:P=>_(P),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Am,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(zm,{content:o.jsx(xh,{labelFormatter:P=>_(P)})}),o.jsx(fJ,{type:"monotone",dataKey:"requests",stroke:"var(--color-requests)",strokeWidth:2})]})})})]}),o.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[o.jsxs(qt,{children:[o.jsxs(Fn,{children:[o.jsx(qn,{children:"花费趋势"}),o.jsx(ts,{children:"API调用成本变化"})]}),o.jsx(Gn,{children:o.jsx(gh,{config:I,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:o.jsxs(h4,{data:j,children:[o.jsx(Qx,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),o.jsx(Vx,{dataKey:"timestamp",tickFormatter:P=>_(P),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Am,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(zm,{content:o.jsx(xh,{labelFormatter:P=>_(P)})}),o.jsx(Ux,{dataKey:"cost",fill:"var(--color-cost)"})]})})})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{children:[o.jsx(qn,{children:"Token消耗"}),o.jsx(ts,{children:"Token使用量变化"})]}),o.jsx(Gn,{children:o.jsx(gh,{config:I,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:o.jsxs(h4,{data:j,children:[o.jsx(Qx,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),o.jsx(Vx,{dataKey:"timestamp",tickFormatter:P=>_(P),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Am,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(zm,{content:o.jsx(xh,{labelFormatter:P=>_(P)})}),o.jsx(Ux,{dataKey:"tokens",fill:"var(--color-tokens)"})]})})})]})]})]}),o.jsx(un,{value:"models",className:"space-y-4",children:o.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[o.jsxs(qt,{children:[o.jsxs(Fn,{children:[o.jsx(qn,{children:"模型请求分布"}),o.jsx(ts,{children:"各模型使用占比"})]}),o.jsx(Gn,{children:o.jsx(gh,{config:Object.fromEntries(k.slice(0,6).map((P,L)=>[P.model_name,{label:P.model_name,color:`hsl(var(--chart-${L%5+1}))`}])),className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:o.jsxs(mJ,{children:[o.jsx(zm,{content:o.jsx(xh,{})}),o.jsx(pJ,{data:M,cx:"50%",cy:"50%",labelLine:!1,label:({name:P,percent:L})=>`${P} ${L?(L*100).toFixed(0):0}%`,outerRadius:100,dataKey:"value",children:M.map((P,L)=>o.jsx(gJ,{fill:P.fill},`cell-${L}`))})]})})})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{children:[o.jsx(qn,{children:"模型详细统计"}),o.jsx(ts,{children:"请求数、花费和性能"})]}),o.jsx(Gn,{children:o.jsx(wn,{className:"h-[300px] sm:h-[400px]",children:o.jsx("div",{className:"space-y-3",children:k.map((P,L)=>o.jsxs("div",{className:"p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("h4",{className:"font-semibold text-sm truncate flex-1 min-w-0",children:P.model_name}),o.jsx("div",{className:"w-3 h-3 rounded-full ml-2 flex-shrink-0",style:{backgroundColor:`hsl(var(--chart-${L%5+1}))`}})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"请求数:"}),o.jsx("span",{className:"ml-1 font-medium",children:P.request_count.toLocaleString()})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"花费:"}),o.jsxs("span",{className:"ml-1 font-medium",children:["¥",P.total_cost.toFixed(2)]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),o.jsxs("span",{className:"ml-1 font-medium",children:[(P.total_tokens/1e3).toFixed(1),"K"]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"平均耗时:"}),o.jsxs("span",{className:"ml-1 font-medium",children:[P.avg_response_time.toFixed(2),"s"]})]})]})]},L))})})})]})]})}),o.jsx(un,{value:"activity",children:o.jsxs(qt,{children:[o.jsxs(Fn,{children:[o.jsx(qn,{children:"最近活动"}),o.jsx(ts,{children:"最新的API调用记录"})]}),o.jsx(Gn,{children:o.jsx(wn,{className:"h-[400px] sm:h-[500px]",children:o.jsx("div",{className:"space-y-2",children:T.map((P,L)=>o.jsxs("div",{className:"p-3 sm:p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"font-medium text-sm truncate",children:P.model}),o.jsx("div",{className:"text-xs text-muted-foreground",children:P.request_type})]}),o.jsx("div",{className:"text-xs text-muted-foreground flex-shrink-0",children:_(P.timestamp)})]}),o.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),o.jsx("span",{className:"ml-1",children:P.tokens})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"花费:"}),o.jsxs("span",{className:"ml-1",children:["¥",P.cost.toFixed(4)]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"耗时:"}),o.jsxs("span",{className:"ml-1",children:[P.time_cost.toFixed(2),"s"]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"状态:"}),o.jsx("span",{className:`ml-1 ${P.status==="success"?"text-green-600":"text-red-600"}`,children:P.status})]})]})]},L))})})})]})}),o.jsx(un,{value:"daily",children:o.jsxs(qt,{children:[o.jsxs(Fn,{children:[o.jsx(qn,{children:"每日统计"}),o.jsx(ts,{children:"最近7天的数据汇总"})]}),o.jsx(Gn,{children:o.jsx(gh,{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:o.jsxs(h4,{data:N,children:[o.jsx(Qx,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),o.jsx(Vx,{dataKey:"timestamp",tickFormatter:P=>{const L=new Date(P);return`${L.getMonth()+1}/${L.getDate()}`},stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Am,{yAxisId:"left",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Am,{yAxisId:"right",orientation:"right",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(zm,{content:o.jsx(xh,{labelFormatter:P=>new Date(P).toLocaleDateString("zh-CN")})}),o.jsx(rse,{content:o.jsx(QL,{})}),o.jsx(Ux,{yAxisId:"left",dataKey:"requests",fill:"var(--color-requests)"}),o.jsx(Ux,{yAxisId:"right",dataKey:"cost",fill:"var(--color-cost)"})]})})})]})})]})]})})}const ise={theme:"system",setTheme:()=>null},VL=b.createContext(ise),qj=()=>{const t=b.useContext(VL);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t},ase=(t,e,n)=>{const r=document.documentElement.classList.contains("no-animations");if(!document.startViewTransition||r){e(t);return}const s=n.clientX,i=n.clientY,a=Math.hypot(Math.max(s,innerWidth-s),Math.max(i,innerHeight-i));document.startViewTransition(()=>{e(t)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${s}px ${i}px)`,`circle(${a}px at ${s}px ${i}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},UL=b.createContext(void 0),WL=()=>{const t=b.useContext(UL);if(t===void 0)throw new Error("useAnimation must be used within an AnimationProvider");return t};var Zy="Switch",[ose]=Ra(Zy),[lse,cse]=ose(Zy),GL=b.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:a,disabled:l,value:c="on",onCheckedChange:d,form:h,...m}=t,[g,x]=b.useState(null),y=Yn(e,N=>x(N)),w=b.useRef(!1),S=g?h||!!g.closest("form"):!0,[k,j]=Gl({prop:s,defaultProp:i??!1,onChange:d,caller:Zy});return o.jsxs(lse,{scope:n,checked:k,disabled:l,children:[o.jsx(gn.button,{type:"button",role:"switch","aria-checked":k,"aria-required":a,"data-state":ZL(k),"data-disabled":l?"":void 0,disabled:l,value:c,...m,ref:y,onClick:nt(t.onClick,N=>{j(T=>!T),S&&(w.current=N.isPropagationStopped(),w.current||N.stopPropagation())})}),S&&o.jsx(KL,{control:g,bubbles:!w.current,name:r,value:c,checked:k,required:a,disabled:l,form:h,style:{transform:"translateX(-100%)"}})]})});GL.displayName=Zy;var XL="SwitchThumb",YL=b.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,s=cse(XL,n);return o.jsx(gn.span,{"data-state":ZL(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e})});YL.displayName=XL;var use="SwitchBubbleInput",KL=b.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:r=!0,...s},i)=>{const a=b.useRef(null),l=Yn(a,i),c=Wz(n),d=Gz(e);return b.useEffect(()=>{const h=a.current;if(!h)return;const m=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(m,"checked").set;if(c!==n&&x){const y=new Event("click",{bubbles:r});x.call(h,n),h.dispatchEvent(y)}},[c,n,r]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:l,style:{...s.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});KL.displayName=use;function ZL(t){return t?"checked":"unchecked"}var JL=GL,dse=YL;const Bt=b.forwardRef(({className:t,...e},n)=>o.jsx(JL,{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",t),...e,ref:n,children:o.jsx(dse,{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")})}));Bt.displayName=JL.displayName;const hse=wf("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),de=b.forwardRef(({className:t,...e},n)=>o.jsx(Xz,{ref:n,className:ve(hse(),t),...e}));de.displayName=Xz.displayName;const ze=b.forwardRef(({className:t,type:e,...n},r)=>o.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",t),ref:r,...n}));ze.displayName="Input";const fse=5,mse=5e3;let k4=0;function pse(){return k4=(k4+1)%Number.MAX_SAFE_INTEGER,k4.toString()}const O4=new Map,X9=t=>{if(O4.has(t))return;const e=setTimeout(()=>{O4.delete(t),g0({type:"REMOVE_TOAST",toastId:t})},mse);O4.set(t,e)},gse=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,fse)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?X9(n):t.toasts.forEach(r=>{X9(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},tv=[];let nv={toasts:[]};function g0(t){nv=gse(nv,t),tv.forEach(e=>{e(nv)})}function xse({...t}){const e=pse(),n=s=>g0({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>g0({type:"DISMISS_TOAST",toastId:e});return g0({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function fs(){const[t,e]=b.useState(nv);return b.useEffect(()=>(tv.push(e),()=>{const n=tv.indexOf(e);n>-1&&tv.splice(n,1)}),[t]),{...t,toast:xse,dismiss:n=>g0({type:"DISMISS_TOAST",toastId:n})}}const vse=[{id:"minLength",label:"长度至少 10 位",description:"Token 长度必须大于等于 10 个字符",validate:t=>t.length>=10},{id:"hasUppercase",label:"包含大写字母",description:"至少包含一个大写字母 (A-Z)",validate:t=>/[A-Z]/.test(t)},{id:"hasLowercase",label:"包含小写字母",description:"至少包含一个小写字母 (a-z)",validate:t=>/[a-z]/.test(t)},{id:"hasSpecialChar",label:"包含特殊符号",description:"至少包含一个特殊符号 (!@#$%^&*()_+-=[]{}|;:,.<>?/)",validate:t=>/[!@#$%^&*()_+\-=[\]{}|;:,.<>?/]/.test(t)}];function yse(t){const e=vse.map(r=>({id:r.id,label:r.label,description:r.description,passed:r.validate(t)}));return{isValid:e.every(r=>r.passed),rules:e}}const $j="0.11.6 Beta",Hj="MaiBot Dashboard",bse=`${Hj} v${$j}`,wse=(t="v")=>`${t}${$j}`,Dr=Sj,Sf=Yz,Sse=yj,Qj=Iy,eB=b.forwardRef(({className:t,...e},n)=>o.jsx(Py,{ref:n,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",t),...e}));eB.displayName=Py.displayName;const Sr=b.forwardRef(({className:t,children:e,preventOutsideClose:n=!1,...r},s)=>o.jsxs(Sse,{children:[o.jsx(eB,{}),o.jsxs(zy,{ref:s,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",t),onPointerDownOutside:n?i=>i.preventDefault():void 0,onInteractOutside:n?i=>i.preventDefault():void 0,...r,children:[e,o.jsxs(Iy,{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:[o.jsx(Tp,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Sr.displayName=zy.displayName;const kr=({className:t,...e})=>o.jsx("div",{className:ve("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});kr.displayName="DialogHeader";const bs=({className:t,...e})=>o.jsx("div",{className:ve("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});bs.displayName="DialogFooter";const Or=b.forwardRef(({className:t,...e},n)=>o.jsx(bj,{ref:n,className:ve("text-lg font-semibold leading-none tracking-tight",t),...e}));Or.displayName=bj.displayName;const ss=b.forwardRef(({className:t,...e},n)=>o.jsx(wj,{ref:n,className:ve("text-sm text-muted-foreground",t),...e}));ss.displayName=wj.displayName;var kse=Symbol("radix.slottable");function Ose(t){const e=({children:n})=>o.jsx(o.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=kse,e}var tB="AlertDialog",[jse]=Ra(tB,[Kz]),Xl=Kz(),nB=t=>{const{__scopeAlertDialog:e,...n}=t,r=Xl(e);return o.jsx(Sj,{...r,...n,modal:!0})};nB.displayName=tB;var Nse="AlertDialogTrigger",rB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Xl(n);return o.jsx(Yz,{...s,...r,ref:e})});rB.displayName=Nse;var Cse="AlertDialogPortal",sB=t=>{const{__scopeAlertDialog:e,...n}=t,r=Xl(e);return o.jsx(yj,{...r,...n})};sB.displayName=Cse;var Tse="AlertDialogOverlay",iB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Xl(n);return o.jsx(Py,{...s,...r,ref:e})});iB.displayName=Tse;var Ah="AlertDialogContent",[Ese,_se]=jse(Ah),Mse=Ose("AlertDialogContent"),aB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...s}=t,i=Xl(n),a=b.useRef(null),l=Yn(e,a),c=b.useRef(null);return o.jsx(cee,{contentName:Ah,titleName:oB,docsSlug:"alert-dialog",children:o.jsx(Ese,{scope:n,cancelRef:c,children:o.jsxs(zy,{role:"alertdialog",...i,...s,ref:l,onOpenAutoFocus:nt(s.onOpenAutoFocus,d=>{d.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[o.jsx(Mse,{children:r}),o.jsx(Rse,{contentRef:a})]})})})});aB.displayName=Ah;var oB="AlertDialogTitle",lB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Xl(n);return o.jsx(bj,{...s,...r,ref:e})});lB.displayName=oB;var cB="AlertDialogDescription",uB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Xl(n);return o.jsx(wj,{...s,...r,ref:e})});uB.displayName=cB;var Ase="AlertDialogAction",dB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Xl(n);return o.jsx(Iy,{...s,...r,ref:e})});dB.displayName=Ase;var hB="AlertDialogCancel",fB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:s}=_se(hB,n),i=Xl(n),a=Yn(e,s);return o.jsx(Iy,{...i,...r,ref:a})});fB.displayName=hB;var Rse=({contentRef:t})=>{const e=`\`${Ah}\` requires a description for the component to be accessible for screen reader users. +`)}}):null},Lm=NJ,xh=b.forwardRef(({active:t,payload:e,className:n,indicator:r="dot",hideLabel:s=!1,hideIndicator:i=!1,label:a,labelFormatter:l,labelClassName:c,formatter:d,color:h,nameKey:m,labelKey:g},x)=>{const{config:y}=XL(),w=b.useMemo(()=>{if(s||!e?.length)return null;const[k]=e,j=`${g||k?.dataKey||k?.name||"value"}`,N=fk(y,k,j),T=!g&&typeof a=="string"?y[a]?.label||a:N?.label;return l?o.jsx("div",{className:xe("font-medium",c),children:l(T,e)}):T?o.jsx("div",{className:xe("font-medium",c),children:T}):null},[a,l,e,s,c,y,g]);if(!t||!e?.length)return null;const S=e.length===1&&r!=="dot";return o.jsxs("div",{ref:x,className:xe("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",n),children:[S?null:w,o.jsx("div",{className:"grid gap-1.5",children:e.filter(k=>k.type!=="none").map((k,j)=>{const N=`${m||k.name||k.dataKey||"value"}`,T=fk(y,k,N),E=h||k.payload.fill||k.color;return o.jsx("div",{className:xe("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:d&&k?.value!==void 0&&k.name?d(k.value,k.name,k,j,k.payload):o.jsxs(o.Fragment,{children:[T?.icon?o.jsx(T.icon,{}):!i&&o.jsx("div",{className:xe("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":S&&r==="dashed"}),style:{"--color-bg":E,"--color-border":E}}),o.jsxs("div",{className:xe("flex flex-1 justify-between leading-none",S?"items-end":"items-center"),children:[o.jsxs("div",{className:"grid gap-1.5",children:[S?w:null,o.jsx("span",{className:"text-muted-foreground",children:T?.label||k.name})]}),k.value&&o.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:k.value.toLocaleString()})]})]})},k.dataKey)})})]})});xh.displayName="ChartTooltip";const Sse=CJ,YL=b.forwardRef(({className:t,hideIcon:e=!1,payload:n,verticalAlign:r="bottom",nameKey:s},i)=>{const{config:a}=XL();return n?.length?o.jsx("div",{ref:i,className:xe("flex items-center justify-center gap-4",r==="top"?"pb-3":"pt-3",t),children:n.filter(l=>l.type!=="none").map(l=>{const c=`${s||l.dataKey||"value"}`,d=fk(a,l,c);return o.jsxs("div",{className:xe("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[d?.icon&&!e?o.jsx(d.icon,{}):o.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:l.color}}),d?.label]},l.value)})}):null});YL.displayName="ChartLegend";function fk(t,e,n){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=n;return n in e&&typeof e[n]=="string"?s=e[n]:r&&n in r&&typeof r[n]=="string"&&(s=r[n]),s in t?t[s]:t[n]}const J9=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,eE=Fz,kf=(t,e)=>n=>{var r;if(e?.variants==null)return eE(t,n?.class,n?.className);const{variants:s,defaultVariants:i}=e,a=Object.keys(s).map(d=>{const h=n?.[d],m=i?.[d];if(h===null)return null;const g=J9(h)||J9(m);return s[d][g]}),l=n&&Object.entries(n).reduce((d,h)=>{let[m,g]=h;return g===void 0||(d[m]=g),d},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,h)=>{let{class:m,className:g,...x}=h;return Object.entries(x).every(y=>{let[w,S]=y;return Array.isArray(S)?S.includes({...i,...l}[w]):{...i,...l}[w]===S})?[...d,m,g]:d},[]);return eE(t,a,c,n?.class,n?.className)},I0=kf("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"}}),de=b.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...s},i)=>{const a=r?Oee:"button";return o.jsx(a,{className:xe(I0({variant:e,size:n,className:t})),ref:i,...s})});de.displayName="Button";function kse(){const[t,e]=b.useState(null),[n,r]=b.useState(!0),[s,i]=b.useState(0),[a,l]=b.useState(24),[c,d]=b.useState(!0),[h,m]=b.useState(null),[g,x]=b.useState(!0),y=b.useCallback(async()=>{try{x(!0);const P=await Br.get("https://v1.hitokoto.cn/?c=a&c=b&c=c&c=d&c=h&c=i&c=k");m({hitokoto:P.data.hitokoto,from:P.data.from||P.data.from_who||"未知"})}catch(P){console.error("获取一言失败:",P),m({hitokoto:"人生就像一盒巧克力,你永远不知道下一颗是什么味道。",from:"阿甘正传"})}finally{x(!1)}},[]),w=b.useCallback(async()=>{try{const P=localStorage.getItem("access-token"),B=await Br.get(`/api/webui/statistics/dashboard?hours=${a}`,{headers:{Authorization:`Bearer ${P}`}});e(B.data),r(!1),i(100)}catch(P){console.error("Failed to fetch dashboard data:",P),r(!1),i(100)}},[a]);if(b.useEffect(()=>{if(!n)return;i(0);const P=setTimeout(()=>i(15),200),B=setTimeout(()=>i(30),800),$=setTimeout(()=>i(45),2e3),U=setTimeout(()=>i(60),4e3),te=setTimeout(()=>i(75),6500),z=setTimeout(()=>i(85),9e3),Q=setTimeout(()=>i(92),11e3);return()=>{clearTimeout(P),clearTimeout(B),clearTimeout($),clearTimeout(U),clearTimeout(te),clearTimeout(z),clearTimeout(Q)}},[n]),b.useEffect(()=>{w(),y()},[w,y]),b.useEffect(()=>{if(!c)return;const P=setInterval(()=>{w()},3e4);return()=>clearInterval(P)},[c,w]),n||!t)return o.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:o.jsxs("div",{className:"text-center space-y-6 w-full max-w-md px-4",children:[o.jsx(Ps,{className:"h-12 w-12 animate-spin mx-auto text-primary"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-lg font-medium",children:"加载统计数据中..."}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"正在获取麦麦运行数据"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Lp,{value:s,className:"h-2"}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:[s,"%"]})]})]})});const{summary:S,model_stats:k,hourly_data:j,daily_data:N,recent_activity:T}=t,E=P=>{const B=Math.floor(P/3600),$=Math.floor(P%3600/60);return`${B}小时${$}分钟`},_=P=>new Date(P).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),A=k.slice(0,6).map(P=>({name:P.model_name,value:P.request_count,fill:`hsl(var(--chart-${k.indexOf(P)%5+1}))`})),L={requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"},tokens:{label:"Tokens",color:"hsl(var(--chart-3))"}};return o.jsx(gn,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"实时监控面板"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"麦麦运行状态和统计数据一览"})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(ja,{value:a.toString(),onValueChange:P=>l(Number(P)),children:o.jsxs(Wi,{className:"grid grid-cols-3 w-full sm:w-auto",children:[o.jsx(Lt,{value:"24",children:"24小时"}),o.jsx(Lt,{value:"168",children:"7天"}),o.jsx(Lt,{value:"720",children:"30天"})]})}),o.jsxs(de,{variant:c?"default":"outline",size:"sm",onClick:()=>d(!c),className:"gap-2",children:[o.jsx(Ps,{className:`h-4 w-4 ${c?"animate-spin":""}`}),o.jsx("span",{className:"hidden sm:inline",children:"自动刷新"})]}),o.jsx(de,{variant:"outline",size:"sm",onClick:w,children:o.jsx(Ps,{className:"h-4 w-4"})})]})]}),o.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 rounded-lg border border-dashed border-muted-foreground/30 bg-muted/20",children:[g?o.jsx(cse,{className:"h-5 flex-1"}):h?o.jsxs("p",{className:"flex-1 text-sm text-muted-foreground italic truncate",children:['"',h.hitokoto,'" —— ',h.from]}):null,o.jsx(de,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",onClick:y,disabled:g,children:o.jsx(Ps,{className:`h-3.5 w-3.5 ${g?"animate-spin":""}`})})]}),o.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[o.jsxs(qt,{children:[o.jsxs(Fn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(qn,{className:"text-sm font-medium",children:"总请求数"}),o.jsx(Iee,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Gn,{children:[o.jsx("div",{className:"text-2xl font-bold",children:S.total_requests.toLocaleString()}),o.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["最近",a<48?a+"小时":Math.floor(a/24)+"天"]})]})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(qn,{className:"text-sm font-medium",children:"总花费"}),o.jsx(Lee,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Gn,{children:[o.jsxs("div",{className:"text-2xl font-bold",children:["¥",S.total_cost.toFixed(2)]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:S.cost_per_hour>0?`¥${S.cost_per_hour.toFixed(2)}/小时`:"暂无数据"})]})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(qn,{className:"text-sm font-medium",children:"Token消耗"}),o.jsx(ek,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Gn,{children:[o.jsxs("div",{className:"text-2xl font-bold",children:[(S.total_tokens/1e3).toFixed(1),"K"]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:S.tokens_per_hour>0?`${(S.tokens_per_hour/1e3).toFixed(1)}K/小时`:"暂无数据"})]})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(qn,{className:"text-sm font-medium",children:"平均响应"}),o.jsx(tk,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Gn,{children:[o.jsxs("div",{className:"text-2xl font-bold",children:[S.avg_response_time.toFixed(2),"s"]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"API平均耗时"})]})]})]}),o.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-3",children:[o.jsxs(qt,{children:[o.jsxs(Fn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(qn,{className:"text-sm font-medium",children:"在线时长"}),o.jsx(_h,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsx(Gn,{children:o.jsx("div",{className:"text-xl font-bold",children:E(S.online_time)})})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(qn,{className:"text-sm font-medium",children:"消息处理"}),o.jsx(Wh,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Gn,{children:[o.jsx("div",{className:"text-xl font-bold",children:S.total_messages.toLocaleString()}),o.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["回复 ",S.total_replies.toLocaleString()," 条"]})]})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(qn,{className:"text-sm font-medium",children:"成本效率"}),o.jsx(Bee,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Gn,{children:[o.jsx("div",{className:"text-xl font-bold",children:S.total_messages>0?`¥${(S.total_cost/S.total_messages*100).toFixed(2)}`:"¥0.00"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"每100条消息"})]})]})]}),o.jsxs(ja,{defaultValue:"trends",className:"space-y-4",children:[o.jsxs(Wi,{className:"grid w-full grid-cols-2 sm:grid-cols-4",children:[o.jsx(Lt,{value:"trends",children:"趋势"}),o.jsx(Lt,{value:"models",children:"模型"}),o.jsx(Lt,{value:"activity",children:"活动"}),o.jsx(Lt,{value:"daily",children:"日统计"})]}),o.jsxs(un,{value:"trends",className:"space-y-4",children:[o.jsxs(qt,{children:[o.jsxs(Fn,{children:[o.jsx(qn,{children:"请求趋势"}),o.jsxs(ts,{children:["最近",a,"小时的请求量变化"]})]}),o.jsx(Gn,{children:o.jsx(gh,{config:L,className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:o.jsxs(TJ,{data:j,children:[o.jsx(Ux,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),o.jsx(Wx,{dataKey:"timestamp",tickFormatter:P=>_(P),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Dm,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Lm,{content:o.jsx(xh,{labelFormatter:P=>_(P)})}),o.jsx(EJ,{type:"monotone",dataKey:"requests",stroke:"var(--color-requests)",strokeWidth:2})]})})})]}),o.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[o.jsxs(qt,{children:[o.jsxs(Fn,{children:[o.jsx(qn,{children:"花费趋势"}),o.jsx(ts,{children:"API调用成本变化"})]}),o.jsx(Gn,{children:o.jsx(gh,{config:L,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:o.jsxs(v4,{data:j,children:[o.jsx(Ux,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),o.jsx(Wx,{dataKey:"timestamp",tickFormatter:P=>_(P),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Dm,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Lm,{content:o.jsx(xh,{labelFormatter:P=>_(P)})}),o.jsx(Gx,{dataKey:"cost",fill:"var(--color-cost)"})]})})})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{children:[o.jsx(qn,{children:"Token消耗"}),o.jsx(ts,{children:"Token使用量变化"})]}),o.jsx(Gn,{children:o.jsx(gh,{config:L,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:o.jsxs(v4,{data:j,children:[o.jsx(Ux,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),o.jsx(Wx,{dataKey:"timestamp",tickFormatter:P=>_(P),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Dm,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Lm,{content:o.jsx(xh,{labelFormatter:P=>_(P)})}),o.jsx(Gx,{dataKey:"tokens",fill:"var(--color-tokens)"})]})})})]})]})]}),o.jsx(un,{value:"models",className:"space-y-4",children:o.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[o.jsxs(qt,{children:[o.jsxs(Fn,{children:[o.jsx(qn,{children:"模型请求分布"}),o.jsx(ts,{children:"各模型使用占比"})]}),o.jsx(Gn,{children:o.jsx(gh,{config:Object.fromEntries(k.slice(0,6).map((P,B)=>[P.model_name,{label:P.model_name,color:`hsl(var(--chart-${B%5+1}))`}])),className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:o.jsxs(_J,{children:[o.jsx(Lm,{content:o.jsx(xh,{})}),o.jsx(AJ,{data:A,cx:"50%",cy:"50%",labelLine:!1,label:({name:P,percent:B})=>`${P} ${B?(B*100).toFixed(0):0}%`,outerRadius:100,dataKey:"value",children:A.map((P,B)=>o.jsx(MJ,{fill:P.fill},`cell-${B}`))})]})})})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{children:[o.jsx(qn,{children:"模型详细统计"}),o.jsx(ts,{children:"请求数、花费和性能"})]}),o.jsx(Gn,{children:o.jsx(gn,{className:"h-[300px] sm:h-[400px]",children:o.jsx("div",{className:"space-y-3",children:k.map((P,B)=>o.jsxs("div",{className:"p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("h4",{className:"font-semibold text-sm truncate flex-1 min-w-0",children:P.model_name}),o.jsx("div",{className:"w-3 h-3 rounded-full ml-2 flex-shrink-0",style:{backgroundColor:`hsl(var(--chart-${B%5+1}))`}})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"请求数:"}),o.jsx("span",{className:"ml-1 font-medium",children:P.request_count.toLocaleString()})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"花费:"}),o.jsxs("span",{className:"ml-1 font-medium",children:["¥",P.total_cost.toFixed(2)]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),o.jsxs("span",{className:"ml-1 font-medium",children:[(P.total_tokens/1e3).toFixed(1),"K"]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"平均耗时:"}),o.jsxs("span",{className:"ml-1 font-medium",children:[P.avg_response_time.toFixed(2),"s"]})]})]})]},B))})})})]})]})}),o.jsx(un,{value:"activity",children:o.jsxs(qt,{children:[o.jsxs(Fn,{children:[o.jsx(qn,{children:"最近活动"}),o.jsx(ts,{children:"最新的API调用记录"})]}),o.jsx(Gn,{children:o.jsx(gn,{className:"h-[400px] sm:h-[500px]",children:o.jsx("div",{className:"space-y-2",children:T.map((P,B)=>o.jsxs("div",{className:"p-3 sm:p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"font-medium text-sm truncate",children:P.model}),o.jsx("div",{className:"text-xs text-muted-foreground",children:P.request_type})]}),o.jsx("div",{className:"text-xs text-muted-foreground flex-shrink-0",children:_(P.timestamp)})]}),o.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),o.jsx("span",{className:"ml-1",children:P.tokens})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"花费:"}),o.jsxs("span",{className:"ml-1",children:["¥",P.cost.toFixed(4)]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"耗时:"}),o.jsxs("span",{className:"ml-1",children:[P.time_cost.toFixed(2),"s"]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"状态:"}),o.jsx("span",{className:`ml-1 ${P.status==="success"?"text-green-600":"text-red-600"}`,children:P.status})]})]})]},B))})})})]})}),o.jsx(un,{value:"daily",children:o.jsxs(qt,{children:[o.jsxs(Fn,{children:[o.jsx(qn,{children:"每日统计"}),o.jsx(ts,{children:"最近7天的数据汇总"})]}),o.jsx(Gn,{children:o.jsx(gh,{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:o.jsxs(v4,{data:N,children:[o.jsx(Ux,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),o.jsx(Wx,{dataKey:"timestamp",tickFormatter:P=>{const B=new Date(P);return`${B.getMonth()+1}/${B.getDate()}`},stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Dm,{yAxisId:"left",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Dm,{yAxisId:"right",orientation:"right",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),o.jsx(Lm,{content:o.jsx(xh,{labelFormatter:P=>new Date(P).toLocaleDateString("zh-CN")})}),o.jsx(Sse,{content:o.jsx(YL,{})}),o.jsx(Gx,{yAxisId:"left",dataKey:"requests",fill:"var(--color-requests)"}),o.jsx(Gx,{yAxisId:"right",dataKey:"cost",fill:"var(--color-cost)"})]})})})]})})]})]})})}const Ose={theme:"system",setTheme:()=>null},KL=b.createContext(Ose),Vj=()=>{const t=b.useContext(KL);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t},jse=(t,e,n)=>{const r=document.documentElement.classList.contains("no-animations");if(!document.startViewTransition||r){e(t);return}const s=n.clientX,i=n.clientY,a=Math.hypot(Math.max(s,innerWidth-s),Math.max(i,innerHeight-i));document.startViewTransition(()=>{e(t)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${s}px ${i}px)`,`circle(${a}px at ${s}px ${i}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},ZL=b.createContext(void 0),JL=()=>{const t=b.useContext(ZL);if(t===void 0)throw new Error("useAnimation must be used within an AnimationProvider");return t};var sb="Switch",[Nse]=Ra(sb),[Cse,Tse]=Nse(sb),eB=b.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:a,disabled:l,value:c="on",onCheckedChange:d,form:h,...m}=t,[g,x]=b.useState(null),y=Yn(e,N=>x(N)),w=b.useRef(!1),S=g?h||!!g.closest("form"):!0,[k,j]=Xl({prop:s,defaultProp:i??!1,onChange:d,caller:sb});return o.jsxs(Cse,{scope:n,checked:k,disabled:l,children:[o.jsx(xn.button,{type:"button",role:"switch","aria-checked":k,"aria-required":a,"data-state":sB(k),"data-disabled":l?"":void 0,disabled:l,value:c,...m,ref:y,onClick:nt(t.onClick,N=>{j(T=>!T),S&&(w.current=N.isPropagationStopped(),w.current||N.stopPropagation())})}),S&&o.jsx(rB,{control:g,bubbles:!w.current,name:r,value:c,checked:k,required:a,disabled:l,form:h,style:{transform:"translateX(-100%)"}})]})});eB.displayName=sb;var tB="SwitchThumb",nB=b.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,s=Tse(tB,n);return o.jsx(xn.span,{"data-state":sB(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e})});nB.displayName=tB;var Ese="SwitchBubbleInput",rB=b.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:r=!0,...s},i)=>{const a=b.useRef(null),l=Yn(a,i),c=eI(n),d=tI(e);return b.useEffect(()=>{const h=a.current;if(!h)return;const m=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(m,"checked").set;if(c!==n&&x){const y=new Event("click",{bubbles:r});x.call(h,n),h.dispatchEvent(y)}},[c,n,r]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:l,style:{...s.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});rB.displayName=Ese;function sB(t){return t?"checked":"unchecked"}var iB=eB,_se=nB;const Bt=b.forwardRef(({className:t,...e},n)=>o.jsx(iB,{className:xe("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",t),...e,ref:n,children:o.jsx(_se,{className:xe("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")})}));Bt.displayName=iB.displayName;const Ase=kf("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),he=b.forwardRef(({className:t,...e},n)=>o.jsx(nI,{ref:n,className:xe(Ase(),t),...e}));he.displayName=nI.displayName;const ze=b.forwardRef(({className:t,type:e,...n},r)=>o.jsx("input",{type:e,className:xe("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",t),ref:r,...n}));ze.displayName="Input";const Mse=5,Rse=5e3;let E4=0;function Dse(){return E4=(E4+1)%Number.MAX_SAFE_INTEGER,E4.toString()}const _4=new Map,tE=t=>{if(_4.has(t))return;const e=setTimeout(()=>{_4.delete(t),y0({type:"REMOVE_TOAST",toastId:t})},Rse);_4.set(t,e)},Pse=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,Mse)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?tE(n):t.toasts.forEach(r=>{tE(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},rv=[];let sv={toasts:[]};function y0(t){sv=Pse(sv,t),rv.forEach(e=>{e(sv)})}function zse({...t}){const e=Dse(),n=s=>y0({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>y0({type:"DISMISS_TOAST",toastId:e});return y0({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function as(){const[t,e]=b.useState(sv);return b.useEffect(()=>(rv.push(e),()=>{const n=rv.indexOf(e);n>-1&&rv.splice(n,1)}),[t]),{...t,toast:zse,dismiss:n=>y0({type:"DISMISS_TOAST",toastId:n})}}const Ise=[{id:"minLength",label:"长度至少 10 位",description:"Token 长度必须大于等于 10 个字符",validate:t=>t.length>=10},{id:"hasUppercase",label:"包含大写字母",description:"至少包含一个大写字母 (A-Z)",validate:t=>/[A-Z]/.test(t)},{id:"hasLowercase",label:"包含小写字母",description:"至少包含一个小写字母 (a-z)",validate:t=>/[a-z]/.test(t)},{id:"hasSpecialChar",label:"包含特殊符号",description:"至少包含一个特殊符号 (!@#$%^&*()_+-=[]{}|;:,.<>?/)",validate:t=>/[!@#$%^&*()_+\-=[\]{}|;:,.<>?/]/.test(t)}];function Lse(t){const e=Ise.map(r=>({id:r.id,label:r.label,description:r.description,passed:r.validate(t)}));return{isValid:e.every(r=>r.passed),rules:e}}const Uj="0.11.6 Beta",Wj="MaiBot Dashboard",Bse=`${Wj} v${Uj}`,Fse=(t="v")=>`${t}${Uj}`,Dr=Nj,Of=rI,qse=kj,Gj=Hy,aB=b.forwardRef(({className:t,...e},n)=>o.jsx(qy,{ref:n,className:xe("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",t),...e}));aB.displayName=qy.displayName;const Sr=b.forwardRef(({className:t,children:e,preventOutsideClose:n=!1,...r},s)=>o.jsxs(qse,{children:[o.jsx(aB,{}),o.jsxs($y,{ref:s,className:xe("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",t),onPointerDownOutside:n?i=>i.preventDefault():void 0,onInteractOutside:n?i=>i.preventDefault():void 0,...r,children:[e,o.jsxs(Hy,{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:[o.jsx(_p,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Sr.displayName=$y.displayName;const kr=({className:t,...e})=>o.jsx("div",{className:xe("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});kr.displayName="DialogHeader";const ws=({className:t,...e})=>o.jsx("div",{className:xe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});ws.displayName="DialogFooter";const Or=b.forwardRef(({className:t,...e},n)=>o.jsx(Oj,{ref:n,className:xe("text-lg font-semibold leading-none tracking-tight",t),...e}));Or.displayName=Oj.displayName;const ss=b.forwardRef(({className:t,...e},n)=>o.jsx(jj,{ref:n,className:xe("text-sm text-muted-foreground",t),...e}));ss.displayName=jj.displayName;var $se=Symbol("radix.slottable");function Hse(t){const e=({children:n})=>o.jsx(o.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=$se,e}var oB="AlertDialog",[Qse]=Ra(oB,[sI]),Yl=sI(),lB=t=>{const{__scopeAlertDialog:e,...n}=t,r=Yl(e);return o.jsx(Nj,{...r,...n,modal:!0})};lB.displayName=oB;var Vse="AlertDialogTrigger",cB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Yl(n);return o.jsx(rI,{...s,...r,ref:e})});cB.displayName=Vse;var Use="AlertDialogPortal",uB=t=>{const{__scopeAlertDialog:e,...n}=t,r=Yl(e);return o.jsx(kj,{...r,...n})};uB.displayName=Use;var Wse="AlertDialogOverlay",dB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Yl(n);return o.jsx(qy,{...s,...r,ref:e})});dB.displayName=Wse;var Mh="AlertDialogContent",[Gse,Xse]=Qse(Mh),Yse=Hse("AlertDialogContent"),hB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...s}=t,i=Yl(n),a=b.useRef(null),l=Yn(e,a),c=b.useRef(null);return o.jsx(jee,{contentName:Mh,titleName:fB,docsSlug:"alert-dialog",children:o.jsx(Gse,{scope:n,cancelRef:c,children:o.jsxs($y,{role:"alertdialog",...i,...s,ref:l,onOpenAutoFocus:nt(s.onOpenAutoFocus,d=>{d.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[o.jsx(Yse,{children:r}),o.jsx(Zse,{contentRef:a})]})})})});hB.displayName=Mh;var fB="AlertDialogTitle",mB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Yl(n);return o.jsx(Oj,{...s,...r,ref:e})});mB.displayName=fB;var pB="AlertDialogDescription",gB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Yl(n);return o.jsx(jj,{...s,...r,ref:e})});gB.displayName=pB;var Kse="AlertDialogAction",xB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Yl(n);return o.jsx(Hy,{...s,...r,ref:e})});xB.displayName=Kse;var vB="AlertDialogCancel",yB=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:s}=Xse(vB,n),i=Yl(n),a=Yn(e,s);return o.jsx(Hy,{...i,...r,ref:a})});yB.displayName=vB;var Zse=({contentRef:t})=>{const e=`\`${Mh}\` requires a description for the component to be accessible for screen reader users. -You can add a description to the \`${Ah}\` by passing a \`${cB}\` component as a child, which also benefits sighted users by adding visible context to the dialog. +You can add a description to the \`${Mh}\` by passing a \`${pB}\` 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 \`${Ah}\`. 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. +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 \`${Mh}\`. 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 b.useEffect(()=>{document.getElementById(t.current?.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},Dse=nB,Pse=rB,zse=sB,mB=iB,pB=aB,gB=dB,xB=fB,vB=lB,yB=uB;const Dn=Dse,rs=Pse,Ise=zse,bB=b.forwardRef(({className:t,...e},n)=>o.jsx(mB,{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",t),...e,ref:n}));bB.displayName=mB.displayName;const Nn=b.forwardRef(({className:t,...e},n)=>o.jsxs(Ise,{children:[o.jsx(bB,{}),o.jsx(pB,{ref:n,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",t),...e})]}));Nn.displayName=pB.displayName;const Cn=({className:t,...e})=>o.jsx("div",{className:ve("flex flex-col space-y-2 text-center sm:text-left",t),...e});Cn.displayName="AlertDialogHeader";const Tn=({className:t,...e})=>o.jsx("div",{className:ve("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Tn.displayName="AlertDialogFooter";const En=b.forwardRef(({className:t,...e},n)=>o.jsx(vB,{ref:n,className:ve("text-lg font-semibold",t),...e}));En.displayName=vB.displayName;const _n=b.forwardRef(({className:t,...e},n)=>o.jsx(yB,{ref:n,className:ve("text-sm text-muted-foreground",t),...e}));_n.displayName=yB.displayName;const Mn=b.forwardRef(({className:t,...e},n)=>o.jsx(gB,{ref:n,className:ve(D0(),t),...e}));Mn.displayName=gB.displayName;const An=b.forwardRef(({className:t,...e},n)=>o.jsx(xB,{ref:n,className:ve(D0({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));An.displayName=xB.displayName;function Lse(){return o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"系统设置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理您的应用偏好设置"})]})}),o.jsxs(ja,{defaultValue:"appearance",className:"w-full",children:[o.jsxs(Wi,{className:"grid w-full grid-cols-2 sm:grid-cols-4 gap-0.5 sm:gap-1 h-auto p-1",children:[o.jsxs(Lt,{value:"appearance",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[o.jsx(hI,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),o.jsx("span",{children:"外观"})]}),o.jsxs(Lt,{value:"security",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[o.jsx(Oee,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),o.jsx("span",{children:"安全"})]}),o.jsxs(Lt,{value:"other",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[o.jsx(Xu,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),o.jsx("span",{children:"其他"})]}),o.jsxs(Lt,{value:"about",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[o.jsx(Oa,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),o.jsx("span",{children:"关于"})]})]}),o.jsxs(wn,{className:"h-[calc(100vh-240px)] sm:h-[calc(100vh-280px)] mt-4 sm:mt-6",children:[o.jsx(un,{value:"appearance",className:"mt-0",children:o.jsx(Bse,{})}),o.jsx(un,{value:"security",className:"mt-0",children:o.jsx(Fse,{})}),o.jsx(un,{value:"other",className:"mt-0",children:o.jsx(qse,{})}),o.jsx(un,{value:"about",className:"mt-0",children:o.jsx($se,{})})]})]})]})}function Y9(t){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%)"}}[t];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(t.startsWith("#")){const s=i=>{i=i.replace("#","");const a=parseInt(i.substring(0,2),16)/255,l=parseInt(i.substring(2,4),16)/255,c=parseInt(i.substring(4,6),16)/255,d=Math.max(a,l,c),h=Math.min(a,l,c);let m=0,g=0;const x=(d+h)/2;if(d!==h){const y=d-h;switch(g=x>.5?y/(2-d-h):y/(d+h),d){case a:m=((l-c)/y+(llocalStorage.getItem("accent-color")||"blue");b.useEffect(()=>{const d=localStorage.getItem("accent-color")||"blue";Y9(d)},[]);const c=d=>{l(d),localStorage.setItem("accent-color",d),Y9(d)};return o.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题模式"}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4",children:[o.jsx(j4,{value:"light",current:t,onChange:e,label:"浅色",description:"始终使用浅色主题"}),o.jsx(j4,{value:"dark",current:t,onChange:e,label:"深色",description:"始终使用深色主题"}),o.jsx(j4,{value:"system",current:t,onChange:e,label:"跟随系统",description:"根据系统设置自动切换"})]})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题色"}),o.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"单色"}),o.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[o.jsx(ua,{value:"blue",current:a,onChange:c,label:"蓝色",colorClass:"bg-blue-500"}),o.jsx(ua,{value:"purple",current:a,onChange:c,label:"紫色",colorClass:"bg-purple-500"}),o.jsx(ua,{value:"green",current:a,onChange:c,label:"绿色",colorClass:"bg-green-500"}),o.jsx(ua,{value:"orange",current:a,onChange:c,label:"橙色",colorClass:"bg-orange-500"}),o.jsx(ua,{value:"pink",current:a,onChange:c,label:"粉色",colorClass:"bg-pink-500"}),o.jsx(ua,{value:"red",current:a,onChange:c,label:"红色",colorClass:"bg-red-500"})]})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"渐变色"}),o.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[o.jsx(ua,{value:"gradient-sunset",current:a,onChange:c,label:"日落",colorClass:"bg-gradient-to-r from-orange-500 to-pink-500"}),o.jsx(ua,{value:"gradient-ocean",current:a,onChange:c,label:"海洋",colorClass:"bg-gradient-to-r from-blue-500 to-cyan-500"}),o.jsx(ua,{value:"gradient-forest",current:a,onChange:c,label:"森林",colorClass:"bg-gradient-to-r from-green-500 to-emerald-500"}),o.jsx(ua,{value:"gradient-aurora",current:a,onChange:c,label:"极光",colorClass:"bg-gradient-to-r from-purple-500 to-pink-500"}),o.jsx(ua,{value:"gradient-fire",current:a,onChange:c,label:"烈焰",colorClass:"bg-gradient-to-r from-red-500 to-orange-500"}),o.jsx(ua,{value:"gradient-twilight",current:a,onChange:c,label:"暮光",colorClass:"bg-gradient-to-r from-indigo-500 to-purple-500"})]})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"自定义颜色"}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[o.jsx("div",{className:"flex-1",children:o.jsx("input",{type:"color",value:a.startsWith("#")?a:"#3b82f6",onChange:d=>c(d.target.value),className:"h-10 sm:h-12 w-full rounded-lg border-2 border-border cursor-pointer",title:"选择自定义颜色"})}),o.jsx("div",{className:"flex-1",children:o.jsx(ze,{type:"text",value:a,onChange:d=>c(d.target.value),placeholder:"#3b82f6",className:"font-mono text-sm"})})]}),o.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground mt-2",children:"点击色块选择颜色,或手动输入 HEX 颜色代码"})]})]})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"动画效果"}),o.jsxs("div",{className:"space-y-2 sm:space-y-3",children:[o.jsx("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5 flex-1",children:[o.jsx(de,{htmlFor:"animations",className:"text-base font-medium cursor-pointer",children:"启用动画效果"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后将禁用所有过渡动画和特效,提升性能"})]}),o.jsx(Bt,{id:"animations",checked:n,onCheckedChange:r})]})}),o.jsx("div",{className:"rounded-lg border bg-card p-4",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5 flex-1",children:[o.jsx(de,{htmlFor:"waves-background",className:"text-base font-medium cursor-pointer",children:"登录页波浪背景"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后登录页将使用纯色背景,适合低性能设备"})]}),o.jsx(Bt,{id:"waves-background",checked:s,onCheckedChange:i})]})})]})]})]})}function Fse(){const t=Zi(),[e,n]=b.useState(""),[r,s]=b.useState(""),[i,a]=b.useState(!1),[l,c]=b.useState(!1),[d,h]=b.useState(!1),[m,g]=b.useState(!1),[x,y]=b.useState(!1),[w,S]=b.useState(!1),[k,j]=b.useState(""),[N,T]=b.useState(!1),{toast:E}=fs(),_=b.useMemo(()=>yse(r),[r]),M=()=>localStorage.getItem("access-token")||"",I=async z=>{try{await navigator.clipboard.writeText(z),y(!0),E({title:"复制成功",description:"Token 已复制到剪贴板"}),setTimeout(()=>y(!1),2e3)}catch{E({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},P=async()=>{if(!r.trim()){E({title:"输入错误",description:"请输入新的 Token",variant:"destructive"});return}if(!_.isValid){const z=_.rules.filter(Q=>!Q.passed).map(Q=>Q.label).join(", ");E({title:"格式错误",description:`Token 不符合要求: ${z}`,variant:"destructive"});return}h(!0);try{const z=M(),Q=await fetch("/api/webui/auth/update",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${z}`},body:JSON.stringify({new_token:r.trim()})}),B=await Q.json();Q.ok&&B.success?(localStorage.setItem("access-token",r.trim()),s(""),e&&n(r.trim()),E({title:"更新成功",description:"Access Token 已更新,即将跳转到登录页"}),setTimeout(()=>{localStorage.removeItem("access-token"),t({to:"/auth"})},1500)):E({title:"更新失败",description:B.message||"无法更新 Token",variant:"destructive"})}catch(z){console.error("更新 Token 错误:",z),E({title:"更新失败",description:"连接服务器失败",variant:"destructive"})}finally{h(!1)}},L=async()=>{g(!0);try{const z=M(),Q=await fetch("/api/webui/auth/regenerate",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${z}`}}),B=await Q.json();Q.ok&&B.success?(localStorage.setItem("access-token",B.token),n(B.token),j(B.token),S(!0),T(!1),E({title:"生成成功",description:"新的 Access Token 已生成,请及时保存"})):E({title:"生成失败",description:B.message||"无法生成新 Token",variant:"destructive"})}catch(z){console.error("生成 Token 错误:",z),E({title:"生成失败",description:"连接服务器失败",variant:"destructive"})}finally{g(!1)}},H=async()=>{try{await navigator.clipboard.writeText(k),T(!0),E({title:"复制成功",description:"Token 已复制到剪贴板"})}catch{E({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},U=()=>{S(!1),setTimeout(()=>{j(""),T(!1)},300),setTimeout(()=>{localStorage.removeItem("access-token"),t({to:"/auth"})},500)},ee=z=>{z||U()};return o.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[o.jsx(Dr,{open:w,onOpenChange:ee,children:o.jsxs(Sr,{className:"sm:max-w-md",children:[o.jsxs(kr,{children:[o.jsxs(Or,{className:"flex items-center gap-2",children:[o.jsx(Wa,{className:"h-5 w-5 text-yellow-500"}),"新的 Access Token"]}),o.jsx(ss,{children:"这是您的新 Token,请立即保存。关闭此窗口后将跳转到登录页面。"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"rounded-lg border-2 border-primary/20 bg-primary/5 p-4",children:[o.jsx(de,{className:"text-xs text-muted-foreground mb-2 block",children:"您的新 Token (64位安全令牌)"}),o.jsx("div",{className:"font-mono text-sm break-all select-all bg-background p-3 rounded border",children:k})]}),o.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Wa,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5"}),o.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[o.jsx("p",{className:"font-semibold",children:"重要提示"}),o.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[o.jsx("li",{children:"此 Token 仅显示一次,关闭后无法再查看"}),o.jsx("li",{children:"请立即复制并保存到安全的位置"}),o.jsx("li",{children:"关闭窗口后将自动跳转到登录页面"}),o.jsx("li",{children:"请使用新 Token 重新登录系统"})]})]})]})})]}),o.jsxs(bs,{className:"gap-2 sm:gap-0",children:[o.jsx(he,{variant:"outline",onClick:H,className:"gap-2",children:N?o.jsxs(o.Fragment,{children:[o.jsx(Ro,{className:"h-4 w-4 text-green-500"}),"已复制"]}):o.jsxs(o.Fragment,{children:[o.jsx(Tv,{className:"h-4 w-4"}),"复制 Token"]})}),o.jsx(he,{onClick:U,children:"我已保存,关闭"})]})]})}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"当前 Access Token"}),o.jsx("div",{className:"space-y-3 sm:space-y-4",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{htmlFor:"current-token",className:"text-sm",children:"您的访问令牌"}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[o.jsxs("div",{className:"relative flex-1",children:[o.jsx(ze,{id:"current-token",type:i?"text":"password",value:e||M(),readOnly:!0,className:"pr-10 font-mono text-sm",placeholder:"点击查看按钮显示 Token"}),o.jsx("button",{onClick:()=>{e||n(M()),a(!i)},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:i?"隐藏":"显示",children:i?o.jsx(Ev,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(Ea,{className:"h-4 w-4 text-muted-foreground"})})]}),o.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[o.jsx(he,{variant:"outline",size:"icon",onClick:()=>I(M()),title:"复制到剪贴板",className:"flex-shrink-0",children:x?o.jsx(Ro,{className:"h-4 w-4 text-green-500"}):o.jsx(Tv,{className:"h-4 w-4"})}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsxs(he,{variant:"outline",disabled:m,className:"gap-2 flex-1 sm:flex-none",children:[o.jsx(Qs,{className:ve("h-4 w-4",m&&"animate-spin")}),o.jsx("span",{className:"hidden sm:inline",children:"重新生成"}),o.jsx("span",{className:"sm:hidden",children:"生成"})]})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认重新生成 Token"}),o.jsx(_n,{children:"这将生成一个新的 64 位安全令牌,并使当前 Token 立即失效。 您需要使用新 Token 重新登录系统。此操作不可撤销,确定要继续吗?"})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:L,children:"确认生成"})]})]})]})]})]}),o.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:"请妥善保管您的 Access Token,不要泄露给他人"})]})})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"自定义 Access Token"}),o.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{htmlFor:"new-token",className:"text-sm",children:"新的访问令牌"}),o.jsxs("div",{className:"relative",children:[o.jsx(ze,{id:"new-token",type:l?"text":"password",value:r,onChange:z=>s(z.target.value),className:"pr-10 font-mono text-sm",placeholder:"输入自定义 Token"}),o.jsx("button",{onClick:()=>c(!l),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:l?"隐藏":"显示",children:l?o.jsx(Ev,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(Ea,{className:"h-4 w-4 text-muted-foreground"})})]}),r&&o.jsxs("div",{className:"mt-3 space-y-2 p-3 rounded-lg bg-muted/50",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"Token 安全要求:"}),o.jsx("div",{className:"space-y-1.5",children:_.rules.map(z=>o.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[z.passed?o.jsx(Qc,{className:"h-4 w-4 text-green-500 flex-shrink-0"}):o.jsx(jee,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),o.jsx("span",{className:ve(z.passed?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:z.label})]},z.id))}),_.isValid&&o.jsx("div",{className:"mt-2 pt-2 border-t border-border",children:o.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[o.jsx(Ro,{className:"h-4 w-4"}),o.jsx("span",{className:"font-medium",children:"Token 格式正确,可以使用"})]})})]})]}),o.jsx(he,{onClick:P,disabled:d||!_.isValid||!r,className:"w-full sm:w-auto",children:d?"更新中...":"更新自定义 Token"})]})]}),o.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:[o.jsx("h4",{className:"text-sm sm:text-base font-semibold text-yellow-900 dark:text-yellow-200 mb-2",children:"安全提示"}),o.jsxs("ul",{className:"text-xs sm:text-sm text-yellow-800 dark:text-yellow-300 space-y-1 list-disc list-inside",children:[o.jsx("li",{children:"重新生成 Token 会创建系统随机生成的 64 位安全令牌"}),o.jsx("li",{children:"自定义 Token 必须满足所有安全要求才能使用"}),o.jsx("li",{children:"更新 Token 后,旧的 Token 将立即失效"}),o.jsx("li",{children:"请在安全的环境下查看和复制 Token"}),o.jsx("li",{children:"如果怀疑 Token 泄露,请立即重新生成或更新"}),o.jsx("li",{children:"建议使用系统生成的 Token 以获得最高安全性"})]})]})]})}function qse(){const t=Zi(),{toast:e}=fs(),[n,r]=b.useState(!1),[s,i]=b.useState(!1);if(s)throw new Error("这是一个手动触发的测试错误,用于验证错误边界组件是否正常工作。");const a=async()=>{r(!0);try{const l=localStorage.getItem("access-token"),c=await fetch("/api/webui/setup/reset",{method:"POST",headers:{Authorization:`Bearer ${l}`}}),d=await c.json();c.ok&&d.success?(e({title:"重置成功",description:"即将进入初次配置向导"}),setTimeout(()=>{t({to:"/setup"})},1e3)):e({title:"重置失败",description:d.message||"无法重置配置状态",variant:"destructive"})}catch(l){console.error("重置配置状态错误:",l),e({title:"重置失败",description:"连接服务器失败",variant:"destructive"})}finally{r(!1)}};return o.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"配置向导"}),o.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[o.jsx("div",{className:"space-y-2",children:o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"重新进行初次配置向导,可以帮助您重新设置系统的基础配置。"})}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsxs(he,{variant:"outline",disabled:n,className:"gap-2",children:[o.jsx(Nee,{className:ve("h-4 w-4",n&&"animate-spin")}),"重新进行初次配置"]})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认重新配置"}),o.jsx(_n,{children:"这将带您重新进入初次配置向导。您可以重新设置系统的基础配置项。确定要继续吗?"})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:a,children:"确认重置"})]})]})]})]})]}),o.jsxs("div",{className:"rounded-lg border border-dashed border-yellow-500/50 bg-yellow-500/5 p-4 sm:p-6",children:[o.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4 flex items-center gap-2",children:[o.jsx(Wa,{className:"h-5 w-5 text-yellow-500"}),"开发者工具"]}),o.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[o.jsx("div",{className:"space-y-2",children:o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"以下功能仅供开发调试使用,可能会导致页面崩溃或异常。"})}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsxs(he,{variant:"destructive",className:"gap-2",children:[o.jsx(Wa,{className:"h-4 w-4"}),"触发测试错误"]})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认触发错误"}),o.jsx(_n,{children:"这将手动触发一个 React 错误,用于测试错误边界组件的显示效果。 页面将显示错误界面,您可以通过刷新页面或点击返回首页来恢复。"})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:()=>i(!0),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"确认触发"})]})]})]})]})]})]})}function $se(){return o.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[o.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:o.jsxs("div",{className:"flex items-start gap-3 sm:gap-4",children:[o.jsx("div",{className:"flex-shrink-0 rounded-lg bg-primary/10 p-2 sm:p-3",children:o.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:o.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"})})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("h3",{className:"text-lg sm:text-xl font-bold text-foreground mb-2",children:"开源项目"}),o.jsx("p",{className:"text-sm sm:text-base text-muted-foreground mb-3",children:"本项目在 GitHub 开源,欢迎 Star ⭐ 支持!"}),o.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:[o.jsx("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:o.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",o.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.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"})})]})]})]})}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:["关于 ",Hj]}),o.jsxs("div",{className:"space-y-2 text-xs sm:text-sm text-muted-foreground",children:[o.jsxs("p",{children:["版本: ",$j]}),o.jsx("p",{children:"麦麦(MaiBot)的现代化 Web 管理界面"})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"作者"}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-sm font-medium",children:"MaiBot 核心"}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Mai-with-u"})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-sm font-medium",children:"WebUI"}),o.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground",children:["Mai-with-u ",o.jsx("a",{href:"https://github.com/DrSmoothl",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"@MotricSeven"})]})]})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"技术栈"}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs sm:text-sm text-muted-foreground",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("p",{className:"font-medium text-foreground",children:"前端框架"}),o.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[o.jsx("li",{children:"React 19.2.0"}),o.jsx("li",{children:"TypeScript 5.7.2"}),o.jsx("li",{children:"Vite 6.0.7"}),o.jsx("li",{children:"TanStack Router 1.94.2"})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("p",{className:"font-medium text-foreground",children:"UI 组件"}),o.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[o.jsx("li",{children:"shadcn/ui"}),o.jsx("li",{children:"Radix UI"}),o.jsx("li",{children:"Tailwind CSS 3.4.17"}),o.jsx("li",{children:"Lucide Icons"})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("p",{className:"font-medium text-foreground",children:"后端"}),o.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[o.jsx("li",{children:"Python 3.12+"}),o.jsx("li",{children:"FastAPI"}),o.jsx("li",{children:"Uvicorn"}),o.jsx("li",{children:"WebSocket"})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("p",{className:"font-medium text-foreground",children:"构建工具"}),o.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[o.jsx("li",{children:"Bun / npm"}),o.jsx("li",{children:"ESLint 9.17.0"}),o.jsx("li",{children:"PostCSS"})]})]})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源库感谢"}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mb-3",children:"本项目使用了以下优秀的开源库,感谢他们的贡献:"}),o.jsx(wn,{className:"h-[300px] sm:h-[400px]",children:o.jsxs("div",{className:"space-y-4 pr-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"UI 框架与组件"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Er,{name:"React",description:"用户界面构建库",license:"MIT"}),o.jsx(Er,{name:"shadcn/ui",description:"优雅的 React 组件库",license:"MIT"}),o.jsx(Er,{name:"Radix UI",description:"无样式的可访问组件库",license:"MIT"}),o.jsx(Er,{name:"Tailwind CSS",description:"实用优先的 CSS 框架",license:"MIT"}),o.jsx(Er,{name:"Lucide React",description:"精美的图标库",license:"ISC"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"路由与状态管理"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Er,{name:"TanStack Router",description:"类型安全的路由库",license:"MIT"}),o.jsx(Er,{name:"Zustand",description:"轻量级状态管理",license:"MIT"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"表单处理"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Er,{name:"React Hook Form",description:"高性能表单库",license:"MIT"}),o.jsx(Er,{name:"Zod",description:"TypeScript 优先的 schema 验证",license:"MIT"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"工具库"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Er,{name:"clsx",description:"条件 className 构建工具",license:"MIT"}),o.jsx(Er,{name:"tailwind-merge",description:"Tailwind 类名合并工具",license:"MIT"}),o.jsx(Er,{name:"class-variance-authority",description:"组件变体管理",license:"Apache-2.0"}),o.jsx(Er,{name:"date-fns",description:"现代化日期处理库",license:"MIT"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"动画效果"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Er,{name:"Framer Motion",description:"React 动画库",license:"MIT"}),o.jsx(Er,{name:"vaul",description:"抽屉组件动画",license:"MIT"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"后端框架"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Er,{name:"FastAPI",description:"现代化 Python Web 框架",license:"MIT"}),o.jsx(Er,{name:"Uvicorn",description:"ASGI 服务器",license:"BSD-3-Clause"}),o.jsx(Er,{name:"Pydantic",description:"数据验证库",license:"MIT"}),o.jsx(Er,{name:"python-multipart",description:"文件上传支持",license:"Apache-2.0"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"开发工具"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Er,{name:"TypeScript",description:"JavaScript 的超集",license:"Apache-2.0"}),o.jsx(Er,{name:"Vite",description:"下一代前端构建工具",license:"MIT"}),o.jsx(Er,{name:"ESLint",description:"JavaScript 代码检查工具",license:"MIT"}),o.jsx(Er,{name:"PostCSS",description:"CSS 转换工具",license:"MIT"})]})]})]})})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源许可"}),o.jsxs("div",{className:"space-y-3",children:[o.jsx("div",{className:"rounded-lg bg-primary/5 border border-primary/20 p-3 sm:p-4",children:o.jsxs("div",{className:"flex items-start gap-2 sm:gap-3",children:[o.jsx("div",{className:"flex-shrink-0 mt-0.5",children:o.jsx("div",{className:"rounded-md bg-primary/10 px-2 py-1",children:o.jsx("span",{className:"text-xs sm:text-sm font-bold text-primary",children:"GPLv3"})})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm sm:text-base font-semibold text-foreground mb-1",children:"MaiBot WebUI"}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目采用 GNU General Public License v3.0 开源许可证。 您可以自由地使用、修改和分发本软件,但必须保持相同的开源许可。"})]})]})}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目依赖的所有开源库均遵循各自的开源许可证(MIT、Apache-2.0、BSD 等)。 感谢所有开源贡献者的无私奉献。"})]})]})]})}function Er({name:t,description:e,license:n}){return o.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-lg border bg-muted/30 p-2.5 sm:p-3",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"font-medium text-foreground truncate",children:t}),o.jsx("p",{className:"text-muted-foreground text-xs mt-0.5",children:e})]}),o.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:n})]})}function j4({value:t,current:e,onChange:n,label:r,description:s}){const i=e===t;return o.jsxs("button",{onClick:()=>n(t),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&&o.jsx("div",{className:"absolute top-2 right-2 sm:top-3 sm:right-3 h-2 w-2 rounded-full bg-primary"}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("div",{className:"text-sm sm:text-base font-medium",children:r}),o.jsx("div",{className:"text-[10px] sm:text-xs text-muted-foreground",children:s})]}),o.jsxs("div",{className:"mt-2 sm:mt-3 flex gap-1",children:[t==="light"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-200"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-300"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-400"})]}),t==="dark"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-700"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-800"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-900"})]}),t==="system"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-200 to-slate-700"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-300 to-slate-800"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-400 to-slate-900"})]})]})]})}function ua({value:t,current:e,onChange:n,label:r,colorClass:s}){const i=e===t;return o.jsxs("button",{onClick:()=>n(t),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&&o.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"}),o.jsxs("div",{className:"flex flex-col items-center gap-1.5 sm:gap-2",children:[o.jsx("div",{className:ve("h-8 w-8 sm:h-10 sm:w-10 rounded-full",s)}),o.jsx("div",{className:"text-[10px] sm:text-xs font-medium text-center",children:r})]})]})}class Hse{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 n=0;n<256;n++)this.p[n]=Math.floor(Math.random()*256);this.perm=[];for(let n=0;n<512;n++)this.perm[n]=this.p[n&255]}dot(e,n,r){return e[0]*n+e[1]*r}mix(e,n,r){return(1-r)*e+r*n}fade(e){return e*e*e*(e*(e*6-15)+10)}perlin2(e,n){const r=Math.floor(e)&255,s=Math.floor(n)&255;e-=Math.floor(e),n-=Math.floor(n);const i=this.fade(e),a=this.fade(n),l=this.perm[r]+s,c=this.perm[l],d=this.perm[l+1],h=this.perm[r+1]+s,m=this.perm[h],g=this.perm[h+1];return this.mix(this.mix(this.dot(this.grad3[c%12],e,n),this.dot(this.grad3[m%12],e-1,n),i),this.mix(this.dot(this.grad3[d%12],e,n-1),this.dot(this.grad3[g%12],e-1,n-1),i),a)}}function Qse(){const t=b.useRef(null),e=b.useRef(null),n=b.useRef(void 0),r=b.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 Hse(Math.random()),bounding:null});return b.useEffect(()=>{const s=e.current,i=t.current;if(!s||!i)return;const a=r.current,l=()=>{const w=s.getBoundingClientRect();a.bounding=w,i.style.width=`${w.width}px`,i.style.height=`${w.height}px`},c=()=>{if(!a.bounding)return;const{width:w,height:S}=a.bounding;a.lines=[],a.paths.forEach(P=>P.remove()),a.paths=[];const k=10,j=32,N=w+200,T=S+30,E=Math.ceil(N/k),_=Math.ceil(T/j),M=(w-k*E)/2,I=(S-j*_)/2;for(let P=0;P<=E;P++){const L=[];for(let U=0;U<=_;U++){const ee={x:M+k*P,y:I+j*U,wave:{x:0,y:0},cursor:{x:0,y:0,vx:0,vy:0}};L.push(ee)}const H=document.createElementNS("http://www.w3.org/2000/svg","path");i.appendChild(H),a.paths.push(H),a.lines.push(L)}},d=w=>{const{lines:S,mouse:k,noise:j}=a;S.forEach(N=>{N.forEach(T=>{const E=j.perlin2((T.x+w*.0125)*.002,(T.y+w*.005)*.0015)*12;T.wave.x=Math.cos(E)*32,T.wave.y=Math.sin(E)*16;const _=T.x-k.sx,M=T.y-k.sy,I=Math.hypot(_,M),P=Math.max(175,k.vs);if(I{const k={x:w.x+w.wave.x+(S?w.cursor.x:0),y:w.y+w.wave.y+(S?w.cursor.y:0)};return k.x=Math.round(k.x*10)/10,k.y=Math.round(k.y*10)/10,k},m=()=>{const{lines:w,paths:S}=a;w.forEach((k,j)=>{let N=h(k[0],!1),T=`M ${N.x} ${N.y}`;k.forEach((E,_)=>{const M=_===k.length-1;N=h(E,!M),T+=`L ${N.x} ${N.y}`}),S[j].setAttribute("d",T)})},g=w=>{const{mouse:S}=a;S.sx+=(S.x-S.sx)*.1,S.sy+=(S.y-S.sy)*.1;const k=S.x-S.lx,j=S.y-S.ly,N=Math.hypot(k,j);S.v=N,S.vs+=(N-S.vs)*.1,S.vs=Math.min(100,S.vs),S.lx=S.x,S.ly=S.y,S.a=Math.atan2(j,k),s&&(s.style.setProperty("--x",`${S.sx}px`),s.style.setProperty("--y",`${S.sy}px`)),d(w),m(),n.current=requestAnimationFrame(g)},x=w=>{if(!a.bounding)return;const{mouse:S}=a;S.x=w.pageX-a.bounding.left,S.y=w.pageY-a.bounding.top+window.scrollY,S.set||(S.sx=S.x,S.sy=S.y,S.lx=S.x,S.ly=S.y,S.set=!0)},y=()=>{l(),c()};return l(),c(),window.addEventListener("resize",y),window.addEventListener("mousemove",x),n.current=requestAnimationFrame(g),()=>{window.removeEventListener("resize",y),window.removeEventListener("mousemove",x),n.current&&cancelAnimationFrame(n.current)}},[]),o.jsxs("div",{ref:e,className:"waves-background",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",pointerEvents:"none"},children:[o.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"}}),o.jsx("svg",{ref:t,style:{display:"block",width:"100%",height:"100%"},children:o.jsx("style",{children:` +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return b.useEffect(()=>{document.getElementById(t.current?.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},Jse=lB,eie=cB,tie=uB,bB=dB,wB=hB,SB=xB,kB=yB,OB=mB,jB=gB;const Dn=Jse,rs=eie,nie=tie,NB=b.forwardRef(({className:t,...e},n)=>o.jsx(bB,{className:xe("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",t),...e,ref:n}));NB.displayName=bB.displayName;const Nn=b.forwardRef(({className:t,...e},n)=>o.jsxs(nie,{children:[o.jsx(NB,{}),o.jsx(wB,{ref:n,className:xe("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",t),...e})]}));Nn.displayName=wB.displayName;const Cn=({className:t,...e})=>o.jsx("div",{className:xe("flex flex-col space-y-2 text-center sm:text-left",t),...e});Cn.displayName="AlertDialogHeader";const Tn=({className:t,...e})=>o.jsx("div",{className:xe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Tn.displayName="AlertDialogFooter";const En=b.forwardRef(({className:t,...e},n)=>o.jsx(OB,{ref:n,className:xe("text-lg font-semibold",t),...e}));En.displayName=OB.displayName;const _n=b.forwardRef(({className:t,...e},n)=>o.jsx(jB,{ref:n,className:xe("text-sm text-muted-foreground",t),...e}));_n.displayName=jB.displayName;const An=b.forwardRef(({className:t,...e},n)=>o.jsx(SB,{ref:n,className:xe(I0(),t),...e}));An.displayName=SB.displayName;const Mn=b.forwardRef(({className:t,...e},n)=>o.jsx(kB,{ref:n,className:xe(I0({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));Mn.displayName=kB.displayName;function rie(){return o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"系统设置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理您的应用偏好设置"})]})}),o.jsxs(ja,{defaultValue:"appearance",className:"w-full",children:[o.jsxs(Wi,{className:"grid w-full grid-cols-2 sm:grid-cols-4 gap-0.5 sm:gap-1 h-auto p-1",children:[o.jsxs(Lt,{value:"appearance",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[o.jsx(yI,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),o.jsx("span",{children:"外观"})]}),o.jsxs(Lt,{value:"security",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[o.jsx(Fee,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),o.jsx("span",{children:"安全"})]}),o.jsxs(Lt,{value:"other",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[o.jsx(Xu,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),o.jsx("span",{children:"其他"})]}),o.jsxs(Lt,{value:"about",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[o.jsx(Oa,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),o.jsx("span",{children:"关于"})]})]}),o.jsxs(gn,{className:"h-[calc(100vh-240px)] sm:h-[calc(100vh-280px)] mt-4 sm:mt-6",children:[o.jsx(un,{value:"appearance",className:"mt-0",children:o.jsx(sie,{})}),o.jsx(un,{value:"security",className:"mt-0",children:o.jsx(iie,{})}),o.jsx(un,{value:"other",className:"mt-0",children:o.jsx(aie,{})}),o.jsx(un,{value:"about",className:"mt-0",children:o.jsx(oie,{})})]})]})]})}function nE(t){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%)"}}[t];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(t.startsWith("#")){const s=i=>{i=i.replace("#","");const a=parseInt(i.substring(0,2),16)/255,l=parseInt(i.substring(2,4),16)/255,c=parseInt(i.substring(4,6),16)/255,d=Math.max(a,l,c),h=Math.min(a,l,c);let m=0,g=0;const x=(d+h)/2;if(d!==h){const y=d-h;switch(g=x>.5?y/(2-d-h):y/(d+h),d){case a:m=((l-c)/y+(llocalStorage.getItem("accent-color")||"blue");b.useEffect(()=>{const d=localStorage.getItem("accent-color")||"blue";nE(d)},[]);const c=d=>{l(d),localStorage.setItem("accent-color",d),nE(d)};return o.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题模式"}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4",children:[o.jsx(A4,{value:"light",current:t,onChange:e,label:"浅色",description:"始终使用浅色主题"}),o.jsx(A4,{value:"dark",current:t,onChange:e,label:"深色",description:"始终使用深色主题"}),o.jsx(A4,{value:"system",current:t,onChange:e,label:"跟随系统",description:"根据系统设置自动切换"})]})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题色"}),o.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"单色"}),o.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[o.jsx(ua,{value:"blue",current:a,onChange:c,label:"蓝色",colorClass:"bg-blue-500"}),o.jsx(ua,{value:"purple",current:a,onChange:c,label:"紫色",colorClass:"bg-purple-500"}),o.jsx(ua,{value:"green",current:a,onChange:c,label:"绿色",colorClass:"bg-green-500"}),o.jsx(ua,{value:"orange",current:a,onChange:c,label:"橙色",colorClass:"bg-orange-500"}),o.jsx(ua,{value:"pink",current:a,onChange:c,label:"粉色",colorClass:"bg-pink-500"}),o.jsx(ua,{value:"red",current:a,onChange:c,label:"红色",colorClass:"bg-red-500"})]})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"渐变色"}),o.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[o.jsx(ua,{value:"gradient-sunset",current:a,onChange:c,label:"日落",colorClass:"bg-gradient-to-r from-orange-500 to-pink-500"}),o.jsx(ua,{value:"gradient-ocean",current:a,onChange:c,label:"海洋",colorClass:"bg-gradient-to-r from-blue-500 to-cyan-500"}),o.jsx(ua,{value:"gradient-forest",current:a,onChange:c,label:"森林",colorClass:"bg-gradient-to-r from-green-500 to-emerald-500"}),o.jsx(ua,{value:"gradient-aurora",current:a,onChange:c,label:"极光",colorClass:"bg-gradient-to-r from-purple-500 to-pink-500"}),o.jsx(ua,{value:"gradient-fire",current:a,onChange:c,label:"烈焰",colorClass:"bg-gradient-to-r from-red-500 to-orange-500"}),o.jsx(ua,{value:"gradient-twilight",current:a,onChange:c,label:"暮光",colorClass:"bg-gradient-to-r from-indigo-500 to-purple-500"})]})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"自定义颜色"}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[o.jsx("div",{className:"flex-1",children:o.jsx("input",{type:"color",value:a.startsWith("#")?a:"#3b82f6",onChange:d=>c(d.target.value),className:"h-10 sm:h-12 w-full rounded-lg border-2 border-border cursor-pointer",title:"选择自定义颜色"})}),o.jsx("div",{className:"flex-1",children:o.jsx(ze,{type:"text",value:a,onChange:d=>c(d.target.value),placeholder:"#3b82f6",className:"font-mono text-sm"})})]}),o.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground mt-2",children:"点击色块选择颜色,或手动输入 HEX 颜色代码"})]})]})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"动画效果"}),o.jsxs("div",{className:"space-y-2 sm:space-y-3",children:[o.jsx("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5 flex-1",children:[o.jsx(he,{htmlFor:"animations",className:"text-base font-medium cursor-pointer",children:"启用动画效果"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后将禁用所有过渡动画和特效,提升性能"})]}),o.jsx(Bt,{id:"animations",checked:n,onCheckedChange:r})]})}),o.jsx("div",{className:"rounded-lg border bg-card p-4",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5 flex-1",children:[o.jsx(he,{htmlFor:"waves-background",className:"text-base font-medium cursor-pointer",children:"登录页波浪背景"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后登录页将使用纯色背景,适合低性能设备"})]}),o.jsx(Bt,{id:"waves-background",checked:s,onCheckedChange:i})]})})]})]})]})}function iie(){const t=Zi(),[e,n]=b.useState(""),[r,s]=b.useState(""),[i,a]=b.useState(!1),[l,c]=b.useState(!1),[d,h]=b.useState(!1),[m,g]=b.useState(!1),[x,y]=b.useState(!1),[w,S]=b.useState(!1),[k,j]=b.useState(""),[N,T]=b.useState(!1),{toast:E}=as(),_=b.useMemo(()=>Lse(r),[r]),A=()=>localStorage.getItem("access-token")||"",L=async z=>{try{await navigator.clipboard.writeText(z),y(!0),E({title:"复制成功",description:"Token 已复制到剪贴板"}),setTimeout(()=>y(!1),2e3)}catch{E({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},P=async()=>{if(!r.trim()){E({title:"输入错误",description:"请输入新的 Token",variant:"destructive"});return}if(!_.isValid){const z=_.rules.filter(Q=>!Q.passed).map(Q=>Q.label).join(", ");E({title:"格式错误",description:`Token 不符合要求: ${z}`,variant:"destructive"});return}h(!0);try{const z=A(),Q=await fetch("/api/webui/auth/update",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${z}`},body:JSON.stringify({new_token:r.trim()})}),F=await Q.json();Q.ok&&F.success?(localStorage.setItem("access-token",r.trim()),s(""),e&&n(r.trim()),E({title:"更新成功",description:"Access Token 已更新,即将跳转到登录页"}),setTimeout(()=>{localStorage.removeItem("access-token"),t({to:"/auth"})},1500)):E({title:"更新失败",description:F.message||"无法更新 Token",variant:"destructive"})}catch(z){console.error("更新 Token 错误:",z),E({title:"更新失败",description:"连接服务器失败",variant:"destructive"})}finally{h(!1)}},B=async()=>{g(!0);try{const z=A(),Q=await fetch("/api/webui/auth/regenerate",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${z}`}}),F=await Q.json();Q.ok&&F.success?(localStorage.setItem("access-token",F.token),n(F.token),j(F.token),S(!0),T(!1),E({title:"生成成功",description:"新的 Access Token 已生成,请及时保存"})):E({title:"生成失败",description:F.message||"无法生成新 Token",variant:"destructive"})}catch(z){console.error("生成 Token 错误:",z),E({title:"生成失败",description:"连接服务器失败",variant:"destructive"})}finally{g(!1)}},$=async()=>{try{await navigator.clipboard.writeText(k),T(!0),E({title:"复制成功",description:"Token 已复制到剪贴板"})}catch{E({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},U=()=>{S(!1),setTimeout(()=>{j(""),T(!1)},300),setTimeout(()=>{localStorage.removeItem("access-token"),t({to:"/auth"})},500)},te=z=>{z||U()};return o.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[o.jsx(Dr,{open:w,onOpenChange:te,children:o.jsxs(Sr,{className:"sm:max-w-md",children:[o.jsxs(kr,{children:[o.jsxs(Or,{className:"flex items-center gap-2",children:[o.jsx(Wa,{className:"h-5 w-5 text-yellow-500"}),"新的 Access Token"]}),o.jsx(ss,{children:"这是您的新 Token,请立即保存。关闭此窗口后将跳转到登录页面。"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"rounded-lg border-2 border-primary/20 bg-primary/5 p-4",children:[o.jsx(he,{className:"text-xs text-muted-foreground mb-2 block",children:"您的新 Token (64位安全令牌)"}),o.jsx("div",{className:"font-mono text-sm break-all select-all bg-background p-3 rounded border",children:k})]}),o.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Wa,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5"}),o.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[o.jsx("p",{className:"font-semibold",children:"重要提示"}),o.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[o.jsx("li",{children:"此 Token 仅显示一次,关闭后无法再查看"}),o.jsx("li",{children:"请立即复制并保存到安全的位置"}),o.jsx("li",{children:"关闭窗口后将自动跳转到登录页面"}),o.jsx("li",{children:"请使用新 Token 重新登录系统"})]})]})]})})]}),o.jsxs(ws,{className:"gap-2 sm:gap-0",children:[o.jsx(de,{variant:"outline",onClick:$,className:"gap-2",children:N?o.jsxs(o.Fragment,{children:[o.jsx(Ro,{className:"h-4 w-4 text-green-500"}),"已复制"]}):o.jsxs(o.Fragment,{children:[o.jsx(Mv,{className:"h-4 w-4"}),"复制 Token"]})}),o.jsx(de,{onClick:U,children:"我已保存,关闭"})]})]})}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"当前 Access Token"}),o.jsx("div",{className:"space-y-3 sm:space-y-4",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"current-token",className:"text-sm",children:"您的访问令牌"}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[o.jsxs("div",{className:"relative flex-1",children:[o.jsx(ze,{id:"current-token",type:i?"text":"password",value:e||A(),readOnly:!0,className:"pr-10 font-mono text-sm",placeholder:"点击查看按钮显示 Token"}),o.jsx("button",{onClick:()=>{e||n(A()),a(!i)},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:i?"隐藏":"显示",children:i?o.jsx(Rv,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(Ea,{className:"h-4 w-4 text-muted-foreground"})})]}),o.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[o.jsx(de,{variant:"outline",size:"icon",onClick:()=>L(A()),title:"复制到剪贴板",className:"flex-shrink-0",children:x?o.jsx(Ro,{className:"h-4 w-4 text-green-500"}):o.jsx(Mv,{className:"h-4 w-4"})}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsxs(de,{variant:"outline",disabled:m,className:"gap-2 flex-1 sm:flex-none",children:[o.jsx(Ps,{className:xe("h-4 w-4",m&&"animate-spin")}),o.jsx("span",{className:"hidden sm:inline",children:"重新生成"}),o.jsx("span",{className:"sm:hidden",children:"生成"})]})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认重新生成 Token"}),o.jsx(_n,{children:"这将生成一个新的 64 位安全令牌,并使当前 Token 立即失效。 您需要使用新 Token 重新登录系统。此操作不可撤销,确定要继续吗?"})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:B,children:"确认生成"})]})]})]})]})]}),o.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:"请妥善保管您的 Access Token,不要泄露给他人"})]})})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"自定义 Access Token"}),o.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"new-token",className:"text-sm",children:"新的访问令牌"}),o.jsxs("div",{className:"relative",children:[o.jsx(ze,{id:"new-token",type:l?"text":"password",value:r,onChange:z=>s(z.target.value),className:"pr-10 font-mono text-sm",placeholder:"输入自定义 Token"}),o.jsx("button",{onClick:()=>c(!l),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:l?"隐藏":"显示",children:l?o.jsx(Rv,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(Ea,{className:"h-4 w-4 text-muted-foreground"})})]}),r&&o.jsxs("div",{className:"mt-3 space-y-2 p-3 rounded-lg bg-muted/50",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"Token 安全要求:"}),o.jsx("div",{className:"space-y-1.5",children:_.rules.map(z=>o.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[z.passed?o.jsx(Vc,{className:"h-4 w-4 text-green-500 flex-shrink-0"}):o.jsx(qee,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),o.jsx("span",{className:xe(z.passed?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:z.label})]},z.id))}),_.isValid&&o.jsx("div",{className:"mt-2 pt-2 border-t border-border",children:o.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[o.jsx(Ro,{className:"h-4 w-4"}),o.jsx("span",{className:"font-medium",children:"Token 格式正确,可以使用"})]})})]})]}),o.jsx(de,{onClick:P,disabled:d||!_.isValid||!r,className:"w-full sm:w-auto",children:d?"更新中...":"更新自定义 Token"})]})]}),o.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:[o.jsx("h4",{className:"text-sm sm:text-base font-semibold text-yellow-900 dark:text-yellow-200 mb-2",children:"安全提示"}),o.jsxs("ul",{className:"text-xs sm:text-sm text-yellow-800 dark:text-yellow-300 space-y-1 list-disc list-inside",children:[o.jsx("li",{children:"重新生成 Token 会创建系统随机生成的 64 位安全令牌"}),o.jsx("li",{children:"自定义 Token 必须满足所有安全要求才能使用"}),o.jsx("li",{children:"更新 Token 后,旧的 Token 将立即失效"}),o.jsx("li",{children:"请在安全的环境下查看和复制 Token"}),o.jsx("li",{children:"如果怀疑 Token 泄露,请立即重新生成或更新"}),o.jsx("li",{children:"建议使用系统生成的 Token 以获得最高安全性"})]})]})]})}function aie(){const t=Zi(),{toast:e}=as(),[n,r]=b.useState(!1),[s,i]=b.useState(!1);if(s)throw new Error("这是一个手动触发的测试错误,用于验证错误边界组件是否正常工作。");const a=async()=>{r(!0);try{const l=localStorage.getItem("access-token"),c=await fetch("/api/webui/setup/reset",{method:"POST",headers:{Authorization:`Bearer ${l}`}}),d=await c.json();c.ok&&d.success?(e({title:"重置成功",description:"即将进入初次配置向导"}),setTimeout(()=>{t({to:"/setup"})},1e3)):e({title:"重置失败",description:d.message||"无法重置配置状态",variant:"destructive"})}catch(l){console.error("重置配置状态错误:",l),e({title:"重置失败",description:"连接服务器失败",variant:"destructive"})}finally{r(!1)}};return o.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"配置向导"}),o.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[o.jsx("div",{className:"space-y-2",children:o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"重新进行初次配置向导,可以帮助您重新设置系统的基础配置。"})}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsxs(de,{variant:"outline",disabled:n,className:"gap-2",children:[o.jsx($ee,{className:xe("h-4 w-4",n&&"animate-spin")}),"重新进行初次配置"]})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认重新配置"}),o.jsx(_n,{children:"这将带您重新进入初次配置向导。您可以重新设置系统的基础配置项。确定要继续吗?"})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:a,children:"确认重置"})]})]})]})]})]}),o.jsxs("div",{className:"rounded-lg border border-dashed border-yellow-500/50 bg-yellow-500/5 p-4 sm:p-6",children:[o.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4 flex items-center gap-2",children:[o.jsx(Wa,{className:"h-5 w-5 text-yellow-500"}),"开发者工具"]}),o.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[o.jsx("div",{className:"space-y-2",children:o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"以下功能仅供开发调试使用,可能会导致页面崩溃或异常。"})}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsxs(de,{variant:"destructive",className:"gap-2",children:[o.jsx(Wa,{className:"h-4 w-4"}),"触发测试错误"]})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认触发错误"}),o.jsx(_n,{children:"这将手动触发一个 React 错误,用于测试错误边界组件的显示效果。 页面将显示错误界面,您可以通过刷新页面或点击返回首页来恢复。"})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:()=>i(!0),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"确认触发"})]})]})]})]})]})]})}function oie(){return o.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[o.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:o.jsxs("div",{className:"flex items-start gap-3 sm:gap-4",children:[o.jsx("div",{className:"flex-shrink-0 rounded-lg bg-primary/10 p-2 sm:p-3",children:o.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:o.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"})})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("h3",{className:"text-lg sm:text-xl font-bold text-foreground mb-2",children:"开源项目"}),o.jsx("p",{className:"text-sm sm:text-base text-muted-foreground mb-3",children:"本项目在 GitHub 开源,欢迎 Star ⭐ 支持!"}),o.jsxs("a",{href:"https://github.com/Mai-with-u/MaiBot-Dashboard",target:"_blank",rel:"noopener noreferrer",className:xe("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:[o.jsx("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:o.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",o.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.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"})})]})]})]})}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:["关于 ",Wj]}),o.jsxs("div",{className:"space-y-2 text-xs sm:text-sm text-muted-foreground",children:[o.jsxs("p",{children:["版本: ",Uj]}),o.jsx("p",{children:"麦麦(MaiBot)的现代化 Web 管理界面"})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"作者"}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-sm font-medium",children:"MaiBot 核心"}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Mai-with-u"})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-sm font-medium",children:"WebUI"}),o.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground",children:["Mai-with-u ",o.jsx("a",{href:"https://github.com/DrSmoothl",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"@MotricSeven"})]})]})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"技术栈"}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs sm:text-sm text-muted-foreground",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("p",{className:"font-medium text-foreground",children:"前端框架"}),o.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[o.jsx("li",{children:"React 19.2.0"}),o.jsx("li",{children:"TypeScript 5.7.2"}),o.jsx("li",{children:"Vite 6.0.7"}),o.jsx("li",{children:"TanStack Router 1.94.2"})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("p",{className:"font-medium text-foreground",children:"UI 组件"}),o.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[o.jsx("li",{children:"shadcn/ui"}),o.jsx("li",{children:"Radix UI"}),o.jsx("li",{children:"Tailwind CSS 3.4.17"}),o.jsx("li",{children:"Lucide Icons"})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("p",{className:"font-medium text-foreground",children:"后端"}),o.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[o.jsx("li",{children:"Python 3.12+"}),o.jsx("li",{children:"FastAPI"}),o.jsx("li",{children:"Uvicorn"}),o.jsx("li",{children:"WebSocket"})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("p",{className:"font-medium text-foreground",children:"构建工具"}),o.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[o.jsx("li",{children:"Bun / npm"}),o.jsx("li",{children:"ESLint 9.17.0"}),o.jsx("li",{children:"PostCSS"})]})]})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源库感谢"}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mb-3",children:"本项目使用了以下优秀的开源库,感谢他们的贡献:"}),o.jsx(gn,{className:"h-[300px] sm:h-[400px]",children:o.jsxs("div",{className:"space-y-4 pr-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"UI 框架与组件"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Er,{name:"React",description:"用户界面构建库",license:"MIT"}),o.jsx(Er,{name:"shadcn/ui",description:"优雅的 React 组件库",license:"MIT"}),o.jsx(Er,{name:"Radix UI",description:"无样式的可访问组件库",license:"MIT"}),o.jsx(Er,{name:"Tailwind CSS",description:"实用优先的 CSS 框架",license:"MIT"}),o.jsx(Er,{name:"Lucide React",description:"精美的图标库",license:"ISC"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"路由与状态管理"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Er,{name:"TanStack Router",description:"类型安全的路由库",license:"MIT"}),o.jsx(Er,{name:"Zustand",description:"轻量级状态管理",license:"MIT"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"表单处理"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Er,{name:"React Hook Form",description:"高性能表单库",license:"MIT"}),o.jsx(Er,{name:"Zod",description:"TypeScript 优先的 schema 验证",license:"MIT"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"工具库"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Er,{name:"clsx",description:"条件 className 构建工具",license:"MIT"}),o.jsx(Er,{name:"tailwind-merge",description:"Tailwind 类名合并工具",license:"MIT"}),o.jsx(Er,{name:"class-variance-authority",description:"组件变体管理",license:"Apache-2.0"}),o.jsx(Er,{name:"date-fns",description:"现代化日期处理库",license:"MIT"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"动画效果"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Er,{name:"Framer Motion",description:"React 动画库",license:"MIT"}),o.jsx(Er,{name:"vaul",description:"抽屉组件动画",license:"MIT"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"后端框架"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Er,{name:"FastAPI",description:"现代化 Python Web 框架",license:"MIT"}),o.jsx(Er,{name:"Uvicorn",description:"ASGI 服务器",license:"BSD-3-Clause"}),o.jsx(Er,{name:"Pydantic",description:"数据验证库",license:"MIT"}),o.jsx(Er,{name:"python-multipart",description:"文件上传支持",license:"Apache-2.0"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"开发工具"}),o.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[o.jsx(Er,{name:"TypeScript",description:"JavaScript 的超集",license:"Apache-2.0"}),o.jsx(Er,{name:"Vite",description:"下一代前端构建工具",license:"MIT"}),o.jsx(Er,{name:"ESLint",description:"JavaScript 代码检查工具",license:"MIT"}),o.jsx(Er,{name:"PostCSS",description:"CSS 转换工具",license:"MIT"})]})]})]})})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[o.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源许可"}),o.jsxs("div",{className:"space-y-3",children:[o.jsx("div",{className:"rounded-lg bg-primary/5 border border-primary/20 p-3 sm:p-4",children:o.jsxs("div",{className:"flex items-start gap-2 sm:gap-3",children:[o.jsx("div",{className:"flex-shrink-0 mt-0.5",children:o.jsx("div",{className:"rounded-md bg-primary/10 px-2 py-1",children:o.jsx("span",{className:"text-xs sm:text-sm font-bold text-primary",children:"GPLv3"})})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm sm:text-base font-semibold text-foreground mb-1",children:"MaiBot WebUI"}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目采用 GNU General Public License v3.0 开源许可证。 您可以自由地使用、修改和分发本软件,但必须保持相同的开源许可。"})]})]})}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目依赖的所有开源库均遵循各自的开源许可证(MIT、Apache-2.0、BSD 等)。 感谢所有开源贡献者的无私奉献。"})]})]})]})}function Er({name:t,description:e,license:n}){return o.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-lg border bg-muted/30 p-2.5 sm:p-3",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"font-medium text-foreground truncate",children:t}),o.jsx("p",{className:"text-muted-foreground text-xs mt-0.5",children:e})]}),o.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:n})]})}function A4({value:t,current:e,onChange:n,label:r,description:s}){const i=e===t;return o.jsxs("button",{onClick:()=>n(t),className:xe("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&&o.jsx("div",{className:"absolute top-2 right-2 sm:top-3 sm:right-3 h-2 w-2 rounded-full bg-primary"}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("div",{className:"text-sm sm:text-base font-medium",children:r}),o.jsx("div",{className:"text-[10px] sm:text-xs text-muted-foreground",children:s})]}),o.jsxs("div",{className:"mt-2 sm:mt-3 flex gap-1",children:[t==="light"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-200"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-300"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-400"})]}),t==="dark"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-700"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-800"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-900"})]}),t==="system"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-200 to-slate-700"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-300 to-slate-800"}),o.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-400 to-slate-900"})]})]})]})}function ua({value:t,current:e,onChange:n,label:r,colorClass:s}){const i=e===t;return o.jsxs("button",{onClick:()=>n(t),className:xe("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&&o.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"}),o.jsxs("div",{className:"flex flex-col items-center gap-1.5 sm:gap-2",children:[o.jsx("div",{className:xe("h-8 w-8 sm:h-10 sm:w-10 rounded-full",s)}),o.jsx("div",{className:"text-[10px] sm:text-xs font-medium text-center",children:r})]})]})}class lie{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 n=0;n<256;n++)this.p[n]=Math.floor(Math.random()*256);this.perm=[];for(let n=0;n<512;n++)this.perm[n]=this.p[n&255]}dot(e,n,r){return e[0]*n+e[1]*r}mix(e,n,r){return(1-r)*e+r*n}fade(e){return e*e*e*(e*(e*6-15)+10)}perlin2(e,n){const r=Math.floor(e)&255,s=Math.floor(n)&255;e-=Math.floor(e),n-=Math.floor(n);const i=this.fade(e),a=this.fade(n),l=this.perm[r]+s,c=this.perm[l],d=this.perm[l+1],h=this.perm[r+1]+s,m=this.perm[h],g=this.perm[h+1];return this.mix(this.mix(this.dot(this.grad3[c%12],e,n),this.dot(this.grad3[m%12],e-1,n),i),this.mix(this.dot(this.grad3[d%12],e,n-1),this.dot(this.grad3[g%12],e-1,n-1),i),a)}}function cie(){const t=b.useRef(null),e=b.useRef(null),n=b.useRef(void 0),r=b.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 lie(Math.random()),bounding:null});return b.useEffect(()=>{const s=e.current,i=t.current;if(!s||!i)return;const a=r.current,l=()=>{const w=s.getBoundingClientRect();a.bounding=w,i.style.width=`${w.width}px`,i.style.height=`${w.height}px`},c=()=>{if(!a.bounding)return;const{width:w,height:S}=a.bounding;a.lines=[],a.paths.forEach(P=>P.remove()),a.paths=[];const k=10,j=32,N=w+200,T=S+30,E=Math.ceil(N/k),_=Math.ceil(T/j),A=(w-k*E)/2,L=(S-j*_)/2;for(let P=0;P<=E;P++){const B=[];for(let U=0;U<=_;U++){const te={x:A+k*P,y:L+j*U,wave:{x:0,y:0},cursor:{x:0,y:0,vx:0,vy:0}};B.push(te)}const $=document.createElementNS("http://www.w3.org/2000/svg","path");i.appendChild($),a.paths.push($),a.lines.push(B)}},d=w=>{const{lines:S,mouse:k,noise:j}=a;S.forEach(N=>{N.forEach(T=>{const E=j.perlin2((T.x+w*.0125)*.002,(T.y+w*.005)*.0015)*12;T.wave.x=Math.cos(E)*32,T.wave.y=Math.sin(E)*16;const _=T.x-k.sx,A=T.y-k.sy,L=Math.hypot(_,A),P=Math.max(175,k.vs);if(L{const k={x:w.x+w.wave.x+(S?w.cursor.x:0),y:w.y+w.wave.y+(S?w.cursor.y:0)};return k.x=Math.round(k.x*10)/10,k.y=Math.round(k.y*10)/10,k},m=()=>{const{lines:w,paths:S}=a;w.forEach((k,j)=>{let N=h(k[0],!1),T=`M ${N.x} ${N.y}`;k.forEach((E,_)=>{const A=_===k.length-1;N=h(E,!A),T+=`L ${N.x} ${N.y}`}),S[j].setAttribute("d",T)})},g=w=>{const{mouse:S}=a;S.sx+=(S.x-S.sx)*.1,S.sy+=(S.y-S.sy)*.1;const k=S.x-S.lx,j=S.y-S.ly,N=Math.hypot(k,j);S.v=N,S.vs+=(N-S.vs)*.1,S.vs=Math.min(100,S.vs),S.lx=S.x,S.ly=S.y,S.a=Math.atan2(j,k),s&&(s.style.setProperty("--x",`${S.sx}px`),s.style.setProperty("--y",`${S.sy}px`)),d(w),m(),n.current=requestAnimationFrame(g)},x=w=>{if(!a.bounding)return;const{mouse:S}=a;S.x=w.pageX-a.bounding.left,S.y=w.pageY-a.bounding.top+window.scrollY,S.set||(S.sx=S.x,S.sy=S.y,S.lx=S.x,S.ly=S.y,S.set=!0)},y=()=>{l(),c()};return l(),c(),window.addEventListener("resize",y),window.addEventListener("mousemove",x),n.current=requestAnimationFrame(g),()=>{window.removeEventListener("resize",y),window.removeEventListener("mousemove",x),n.current&&cancelAnimationFrame(n.current)}},[]),o.jsxs("div",{ref:e,className:"waves-background",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",pointerEvents:"none"},children:[o.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"}}),o.jsx("svg",{ref:t,style:{display:"block",width:"100%",height:"100%"},children:o.jsx("style",{children:` path { fill: none; stroke: hsl(var(--primary) / 0.20); stroke-width: 1px; } - `})})]})}function Vse(){const t=Zi();b.useEffect(()=>{localStorage.getItem("access-token")||t({to:"/auth"})},[t])}function wB(){return!!localStorage.getItem("access-token")}function Use(){const[t,e]=b.useState(""),[n,r]=b.useState(!1),[s,i]=b.useState(""),a=Zi(),{enableWavesBackground:l,setEnableWavesBackground:c}=WL(),{theme:d,setTheme:h}=qj();b.useEffect(()=>{wB()&&a({to:"/"})},[a]);const g=d==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":d,x=()=>{h(g==="dark"?"light":"dark")},y=async w=>{if(w.preventDefault(),i(""),!t.trim()){i("请输入 Access Token");return}r(!0);try{const S=await fetch("/api/webui/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t.trim()})}),k=await S.json();if(S.ok&&k.valid){localStorage.setItem("access-token",t.trim());const j=await fetch("/api/webui/setup/status",{method:"GET",headers:{Authorization:`Bearer ${t.trim()}`}}),N=await j.json();j.ok&&N.is_first_setup?a({to:"/setup"}):a({to:"/"})}else i(k.message||"Token 验证失败,请检查后重试")}catch(S){console.error("Token 验证错误:",S),i("连接服务器失败,请检查网络连接")}finally{r(!1)}};return o.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[l&&o.jsx(Qse,{}),o.jsxs(qt,{className:"relative z-10 w-full max-w-md shadow-2xl backdrop-blur-xl bg-card/80 border-border/50",children:[o.jsx("button",{onClick:x,className:"absolute right-4 top-4 rounded-lg p-2 hover:bg-accent transition-colors z-10 text-foreground",title:g==="dark"?"切换到浅色模式":"切换到深色模式",children:g==="dark"?o.jsx(Y3,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"}):o.jsx(K3,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"})}),o.jsxs(Fn,{className:"space-y-4 text-center",children:[o.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10",children:o.jsx(f9,{className:"h-8 w-8 text-primary",strokeWidth:2,fill:"none"})}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(qn,{className:"text-2xl font-bold",children:"欢迎使用 MaiBot"}),o.jsx(ts,{className:"text-base",children:"请输入您的 Access Token 以继续访问系统"})]})]}),o.jsx(Gn,{children:o.jsxs("form",{onSubmit:y,className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{htmlFor:"token",className:"text-sm font-medium",children:"Access Token"}),o.jsxs("div",{className:"relative",children:[o.jsx(fI,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",strokeWidth:2,fill:"none"}),o.jsx(ze,{id:"token",type:"password",placeholder:"请输入您的 Access Token",value:t,onChange:w=>e(w.target.value),className:ve("pl-10",s&&"border-red-500 focus-visible:ring-red-500"),disabled:n,autoFocus:!0,autoComplete:"off"})]})]}),s&&o.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:[o.jsx(Vc,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2,fill:"none"}),o.jsx("span",{children:s})]}),o.jsx(he,{type:"submit",className:"w-full",disabled:n,children:n?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"验证中..."]}):"验证并进入"}),o.jsxs(Dr,{children:[o.jsx(Sf,{asChild:!0,children:o.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:[o.jsx(qy,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我没有 Token,我该去哪里获得 Token?"]})}),o.jsxs(Sr,{className:"sm:max-w-md",children:[o.jsxs(kr,{children:[o.jsxs(Or,{className:"flex items-center gap-2",children:[o.jsx(f9,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"如何获取 Access Token"]}),o.jsx(ss,{children:"Access Token 是访问 MaiBot WebUI 的唯一凭证,请按以下方式获取"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(Cee,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsx("h4",{className:"font-semibold text-sm",children:"方式一:查看启动日志"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"在 MaiBot 启动时,控制台会显示 WebUI Access Token。"}),o.jsxs("div",{className:"rounded bg-background p-2 font-mono text-xs",children:[o.jsx("p",{className:"text-muted-foreground",children:"🔑 WebUI Access Token: abc123..."}),o.jsx("p",{className:"text-muted-foreground",children:"💡 请使用此 Token 登录 WebUI"})]})]})]})}),o.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(Pl,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsx("h4",{className:"font-semibold text-sm",children:"方式二:查看配置文件"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Token 保存在项目根目录的配置文件中:"}),o.jsx("div",{className:"rounded bg-background p-2 font-mono text-xs break-all",children:o.jsx("code",{className:"text-primary",children:"data/webui.json"})}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["打开此文件,复制 ",o.jsx("code",{className:"px-1 py-0.5 bg-background rounded",children:"access_token"})," 字段的值"]})]})]})}),o.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Vc,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),o.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[o.jsx("p",{className:"font-semibold",children:"安全提示"}),o.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[o.jsx("li",{children:"请妥善保管您的 Token,不要泄露给他人"}),o.jsx("li",{children:"如需重置 Token,请在登录后前往系统设置"})]})]})]})})]})]})]}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.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:[o.jsx(X3,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我觉得这个界面很卡怎么办?"]})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsxs(En,{className:"flex items-center gap-2",children:[o.jsx(X3,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"关闭背景动画"]}),o.jsx(_n,{children:"背景动画可能会在低性能设备上造成卡顿。关闭动画可以显著提升界面流畅度。"})]}),o.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭动画后,背景将变为纯色,但不影响任何功能的使用。您可以随时在系统设置中重新开启动画。"})}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:()=>c(!1),children:"关闭动画"})]})]})]})]})})]}),o.jsx("div",{className:"absolute bottom-4 left-0 right-0 text-center text-xs text-muted-foreground",children:o.jsx("p",{children:bse})})]})}const Ar=b.forwardRef(({className:t,...e},n)=>o.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",t),ref:n,...e}));Ar.displayName="Textarea";var Wse=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Gse=Wse.reduce((t,e)=>{const n=vj(`Primitive.${e}`),r=b.forwardRef((s,i)=>{const{asChild:a,...l}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),Xse="Separator",K9="horizontal",Yse=["horizontal","vertical"],SB=b.forwardRef((t,e)=>{const{decorative:n,orientation:r=K9,...s}=t,i=Kse(r)?r:K9,l=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return o.jsx(Gse.div,{"data-orientation":i,...l,...s,ref:e})});SB.displayName=Xse;function Kse(t){return Yse.includes(t)}var kB=SB;const P0=b.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},s)=>o.jsx(kB,{ref:s,decorative:n,orientation:e,className:ve("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));P0.displayName=kB.displayName;const Zse=wf("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 Xn({className:t,variant:e,...n}){return o.jsx("div",{className:ve(Zse({variant:e}),t),...n})}function Jse({config:t,onChange:e}){const n=s=>{s.trim()&&!t.alias_names.includes(s.trim())&&e({...t,alias_names:[...t.alias_names,s.trim()]})},r=s=>{e({...t,alias_names:t.alias_names.filter((i,a)=>a!==s)})};return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx(de,{htmlFor:"qq_account",children:"QQ账号 *"}),o.jsx(ze,{id:"qq_account",type:"number",placeholder:"请输入机器人的QQ账号",value:t.qq_account||"",onChange:s=>e({...t,qq_account:Number(s.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人登录使用的QQ账号"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(de,{htmlFor:"nickname",children:"昵称 *"}),o.jsx(ze,{id:"nickname",placeholder:"请输入机器人的昵称",value:t.nickname,onChange:s=>e({...t,nickname:s.target.value})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的主要称呼名称"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(de,{children:"别名"}),o.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:t.alias_names.map((s,i)=>o.jsxs(Xn,{variant:"secondary",className:"gap-1",children:[s,o.jsx("button",{type:"button",onClick:()=>r(i),className:"ml-1 hover:text-destructive",children:o.jsx(Tp,{className:"h-3 w-3"})})]},i))}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ze,{id:"alias_input",placeholder:"输入别名后按回车添加",onKeyPress:s=>{s.key==="Enter"&&(n(s.target.value),s.target.value="")}}),o.jsx(he,{type:"button",variant:"outline",onClick:()=>{const s=document.getElementById("alias_input");s&&(n(s.value),s.value="")},children:"添加"})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的其他称呼,可以添加多个"})]})]})}function eie({config:t,onChange:e}){return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx(de,{htmlFor:"personality",children:"人格特征 *"}),o.jsx(Ar,{id:"personality",placeholder:"描述机器人的人格特质和身份特征(建议120字以内)",value:t.personality,onChange:n=>e({...t,personality:n.target.value}),rows:3}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:是一个女大学生,现在在读大二,会刷贴吧"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(de,{htmlFor:"reply_style",children:"表达风格 *"}),o.jsx(Ar,{id:"reply_style",placeholder:"描述机器人说话的表达风格、表达习惯",value:t.reply_style,onChange:n=>e({...t,reply_style:n.target.value}),rows:3}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:回复平淡一些,简短一些,说中文,参考贴吧、知乎和微博的回复风格"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(de,{htmlFor:"interest",children:"兴趣 *"}),o.jsx(Ar,{id:"interest",placeholder:"描述机器人感兴趣的话题",value:t.interest,onChange:n=>e({...t,interest:n.target.value}),rows:2}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"会影响机器人对什么话题进行回复"})]}),o.jsx(P0,{}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(de,{htmlFor:"plan_style",children:"群聊说话规则 *"}),o.jsx(Ar,{id:"plan_style",placeholder:"机器人在群聊中的行为风格和规则",value:t.plan_style,onChange:n=>e({...t,plan_style:n.target.value}),rows:4}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在群聊中如何行动,例如回复频率、条件等"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(de,{htmlFor:"private_plan_style",children:"私聊说话规则 *"}),o.jsx(Ar,{id:"private_plan_style",placeholder:"机器人在私聊中的行为风格和规则",value:t.private_plan_style,onChange:n=>e({...t,private_plan_style:n.target.value}),rows:3}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在私聊中的行为方式"})]})]})}function tie({config:t,onChange:e}){return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(de,{htmlFor:"emoji_chance",children:"表情包激活概率"}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:[(t.emoji_chance*100).toFixed(0),"%"]})]}),o.jsx(ze,{id:"emoji_chance",type:"range",min:"0",max:"1",step:"0.1",value:t.emoji_chance,onChange:n=>e({...t,emoji_chance:Number(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人发送表情包的概率"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(de,{htmlFor:"max_reg_num",children:"最大表情包数量"}),o.jsx(ze,{id:"max_reg_num",type:"number",min:"1",max:"200",value:t.max_reg_num,onChange:n=>e({...t,max_reg_num:Number(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人最多保存的表情包数量"})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(de,{htmlFor:"do_replace",children:"达到最大数量时替换"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"开启后会删除旧表情包,关闭则不再收集新表情包"})]}),o.jsx(Bt,{id:"do_replace",checked:t.do_replace,onCheckedChange:n=>e({...t,do_replace:n})})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(de,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),o.jsx(ze,{id:"check_interval",type:"number",min:"1",max:"120",value:t.check_interval,onChange:n=>e({...t,check_interval:Number(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包注册、破损、删除的时间间隔"})]}),o.jsx(P0,{}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(de,{htmlFor:"steal_emoji",children:"偷取表情包"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人将一些表情包据为己有"})]}),o.jsx(Bt,{id:"steal_emoji",checked:t.steal_emoji,onCheckedChange:n=>e({...t,steal_emoji:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(de,{htmlFor:"content_filtration",children:"启用表情包过滤"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"只保存符合要求的表情包"})]}),o.jsx(Bt,{id:"content_filtration",checked:t.content_filtration,onCheckedChange:n=>e({...t,content_filtration:n})})]}),t.content_filtration&&o.jsxs("div",{className:"space-y-3",children:[o.jsx(de,{htmlFor:"filtration_prompt",children:"过滤要求"}),o.jsx(ze,{id:"filtration_prompt",placeholder:"例如:符合公序良俗",value:t.filtration_prompt,onChange:n=>e({...t,filtration_prompt:n.target.value})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"描述表情包应该符合的要求"})]})]})}function nie({config:t,onChange:e}){return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(de,{htmlFor:"enable_tool",children:"启用工具系统"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人使用各种工具增强功能"})]}),o.jsx(Bt,{id:"enable_tool",checked:t.enable_tool,onCheckedChange:n=>e({...t,enable_tool:n})})]}),o.jsx(P0,{}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(de,{htmlFor:"enable_mood",children:"启用情绪系统"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"让机器人具有情绪变化能力"})]}),o.jsx(Bt,{id:"enable_mood",checked:t.enable_mood,onCheckedChange:n=>e({...t,enable_mood:n})})]}),t.enable_mood&&o.jsxs("div",{className:"ml-6 space-y-6 border-l-2 border-primary/20 pl-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx(de,{htmlFor:"mood_update_threshold",children:"情绪更新阈值"}),o.jsx(ze,{id:"mood_update_threshold",type:"number",min:"0.1",max:"10",step:"0.1",value:t.mood_update_threshold||1,onChange:n=>e({...t,mood_update_threshold:Number(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"值越高,情绪更新越慢"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(de,{htmlFor:"emotion_style",children:"情感特征"}),o.jsx(Ar,{id:"emotion_style",placeholder:"描述情绪的变化情况,例如:情绪较为稳定,但遭遇特定事件时起伏较大",value:t.emotion_style||"",onChange:n=>e({...t,emotion_style:n.target.value}),rows:2}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"影响机器人的情绪变化方式"})]})]}),o.jsx(P0,{}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(de,{htmlFor:"all_global",children:"启用全局黑话模式"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人学习和使用群组黑话"})]}),o.jsx(Bt,{id:"all_global",checked:t.all_global,onCheckedChange:n=>e({...t,all_global:n})})]})]})}function rie({config:t,onChange:e}){const[n,r]=b.useState(!1);return o.jsxs("div",{className:"space-y-6",children:[o.jsx("div",{className:"rounded-lg bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-4",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:"mt-0.5",children:o.jsx("svg",{className:"h-5 w-5 text-blue-600 dark:text-blue-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),o.jsxs("div",{className:"flex-1 text-sm",children:[o.jsx("p",{className:"font-medium text-blue-900 dark:text-blue-100 mb-1",children:"关于硅基流动 (SiliconFlow)"}),o.jsx("p",{className:"text-blue-700 dark:text-blue-300 mb-2",children:"硅基流动提供了完整的模型覆盖,包括 DeepSeek V3、Qwen、视觉模型、语音识别和嵌入模型。 只需一个 API Key 即可使用麦麦的所有功能!"}),o.jsxs("a",{href:"https://cloud.siliconflow.cn",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-blue-600 dark:text-blue-400 hover:underline font-medium",children:["前往硅基流动获取 API Key",o.jsx(Mh,{className:"h-3 w-3"})]})]})]})}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(de,{htmlFor:"siliconflow_api_key",children:"SiliconFlow API Key *"}),o.jsxs("div",{className:"relative",children:[o.jsx(ze,{id:"siliconflow_api_key",type:n?"text":"password",placeholder:"sk-...",value:t.api_key,onChange:s=>e({api_key:s.target.value}),className:"font-mono pr-10"}),o.jsx(he,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 hover:bg-transparent",onClick:()=>r(!n),children:n?o.jsx(Ev,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(Ea,{className:"h-4 w-4 text-muted-foreground"})})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"请输入您的硅基流动 API 密钥。获取后,麦麦将自动配置所有必需的模型。"})]}),o.jsxs("div",{className:"rounded-lg bg-muted/50 p-4 text-sm space-y-2",children:[o.jsx("p",{className:"font-medium",children:"将自动配置以下模型:"}),o.jsxs("ul",{className:"list-disc list-inside space-y-1 text-muted-foreground ml-2",children:[o.jsx("li",{children:"DeepSeek V3 - 主要对话和工具模型"}),o.jsx("li",{children:"Qwen3 30B - 高频小任务和工具调用"}),o.jsx("li",{children:"Qwen3 VL 30B - 图像识别"}),o.jsx("li",{children:"SenseVoice - 语音识别"}),o.jsx("li",{children:"BGE-M3 - 文本嵌入"}),o.jsx("li",{children:"知识库相关模型 (LPMM)"})]})]}),o.jsx("div",{className:"rounded-lg border border-amber-200 dark:border-amber-800 bg-amber-50 dark:bg-amber-950/30 p-4",children:o.jsxs("p",{className:"text-sm text-amber-900 dark:text-amber-100",children:[o.jsx("span",{className:"font-medium",children:"💡 提示:"}),'完成向导后,您可以在"系统设置 → 模型配置"中添加更多 API 提供商和模型。']})})]})}async function St(t,e){const n=await fetch(t,e);if(n.status===401)throw localStorage.removeItem("access-token"),window.location.href="/auth",new Error("认证失败,请重新登录");return n}function Dt(){return{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("access-token")}`}}async function sie(){const t=await St("/api/webui/config/bot",{method:"GET",headers:Dt()});if(!t.ok)throw new Error("读取Bot配置失败");const n=(await t.json()).config.bot||{};return{qq_account:n.qq_account||0,nickname:n.nickname||"",alias_names:n.alias_names||[]}}async function iie(){const t=await St("/api/webui/config/bot",{method:"GET",headers:Dt()});if(!t.ok)throw new Error("读取人格配置失败");const n=(await t.json()).config.personality||{};return{personality:n.personality||"",reply_style:n.reply_style||"",interest:n.interest||"",plan_style:n.plan_style||"",private_plan_style:n.private_plan_style||""}}async function aie(){const t=await St("/api/webui/config/bot",{method:"GET",headers:Dt()});if(!t.ok)throw new Error("读取表情包配置失败");const n=(await t.json()).config.emoji||{};return{emoji_chance:n.emoji_chance??.4,max_reg_num:n.max_reg_num??40,do_replace:n.do_replace??!0,check_interval:n.check_interval??10,steal_emoji:n.steal_emoji??!0,content_filtration:n.content_filtration??!1,filtration_prompt:n.filtration_prompt||""}}async function oie(){const t=await St("/api/webui/config/bot",{method:"GET",headers:Dt()});if(!t.ok)throw new Error("读取其他配置失败");const n=(await t.json()).config,r=n.tool||{},s=n.mood||{},i=n.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 lie(){const t=await St("/api/webui/config/model",{method:"GET",headers:Dt()});if(!t.ok)throw new Error("读取模型配置失败");return{api_key:((await t.json()).config.api_providers||[]).find(i=>i.name==="SiliconFlow")?.api_key||""}}async function cie(t){const e=await St("/api/webui/config/bot/section/bot",{method:"POST",headers:Dt(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"保存Bot基础配置失败")}return await e.json()}async function uie(t){const e=await St("/api/webui/config/bot/section/personality",{method:"POST",headers:Dt(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"保存人格配置失败")}return await e.json()}async function die(t){const e=await St("/api/webui/config/bot/section/emoji",{method:"POST",headers:Dt(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"保存表情包配置失败")}return await e.json()}async function hie(t){const e=[];e.push(St("/api/webui/config/bot/section/tool",{method:"POST",headers:Dt(),body:JSON.stringify({enable_tool:t.enable_tool})})),e.push(St("/api/webui/config/bot/section/jargon",{method:"POST",headers:Dt(),body:JSON.stringify({all_global:t.all_global})}));const n={enable_mood:t.enable_mood};t.enable_mood&&(n.mood_update_threshold=t.mood_update_threshold||1,n.emotion_style=t.emotion_style||""),e.push(St("/api/webui/config/bot/section/mood",{method:"POST",headers:Dt(),body:JSON.stringify(n)}));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 fie(t){const e=await St("/api/webui/config/model",{method:"GET",headers:Dt()});if(!e.ok)throw new Error("读取模型配置失败");const r=(await e.json()).config,s=r.api_providers||[],i=s.findIndex(c=>c.name==="SiliconFlow");i>=0?s[i]={...s[i],api_key:t.api_key}:s.push({name:"SiliconFlow",base_url:"https://api.siliconflow.cn/v1",api_key:t.api_key,client_type:"openai",max_retry:3,timeout:120,retry_interval:5});const a={...r,api_providers:s},l=await St("/api/webui/config/model",{method:"POST",headers:Dt(),body:JSON.stringify(a)});if(!l.ok){const c=await l.json();throw new Error(c.detail||"保存模型配置失败")}return await l.json()}async function Z9(){const t=localStorage.getItem("access-token"),e=await St("/api/webui/setup/complete",{method:"POST",headers:{Authorization:`Bearer ${t}`}});if(!e.ok){const n=await e.json();throw new Error(n.message||"标记配置完成失败")}return await e.json()}async function Jy(){const t=await St("/api/webui/system/restart",{method:"POST",headers:Dt()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"重启失败")}return await t.json()}async function mie(){const t=await St("/api/webui/system/status",{method:"GET",headers:Dt()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"获取状态失败")}return await t.json()}function pie(){const t=Zi(),{toast:e}=fs(),[n,r]=b.useState(0),[s,i]=b.useState(!1),[a,l]=b.useState(!1),[c,d]=b.useState(!0),[h,m]=b.useState({qq_account:0,nickname:"",alias_names:[]}),[g,x]=b.useState({personality:"是一个女大学生,现在在读大二,会刷贴吧。",reply_style:"请回复的平淡一些,简短一些,说中文,不要刻意突出自身学科背景。可以参考贴吧,知乎和微博的回复风格。",interest:"对技术相关话题,游戏和动漫相关话题感兴趣,也对日常话题感兴趣,不喜欢太过沉重严肃的话题",plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用 + `})})]})}function uie(){const t=Zi();b.useEffect(()=>{localStorage.getItem("access-token")||t({to:"/auth"})},[t])}function CB(){return!!localStorage.getItem("access-token")}function die(){const[t,e]=b.useState(""),[n,r]=b.useState(!1),[s,i]=b.useState(""),a=Zi(),{enableWavesBackground:l,setEnableWavesBackground:c}=JL(),{theme:d,setTheme:h}=Vj();b.useEffect(()=>{CB()&&a({to:"/"})},[a]);const g=d==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":d,x=()=>{h(g==="dark"?"light":"dark")},y=async w=>{if(w.preventDefault(),i(""),!t.trim()){i("请输入 Access Token");return}r(!0);try{const S=await fetch("/api/webui/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t.trim()})}),k=await S.json();if(S.ok&&k.valid){localStorage.setItem("access-token",t.trim());const j=await fetch("/api/webui/setup/status",{method:"GET",headers:{Authorization:`Bearer ${t.trim()}`}}),N=await j.json();j.ok&&N.is_first_setup?a({to:"/setup"}):a({to:"/"})}else i(k.message||"Token 验证失败,请检查后重试")}catch(S){console.error("Token 验证错误:",S),i("连接服务器失败,请检查网络连接")}finally{r(!1)}};return o.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[l&&o.jsx(cie,{}),o.jsxs(qt,{className:"relative z-10 w-full max-w-md shadow-2xl backdrop-blur-xl bg-card/80 border-border/50",children:[o.jsx("button",{onClick:x,className:"absolute right-4 top-4 rounded-lg p-2 hover:bg-accent transition-colors z-10 text-foreground",title:g==="dark"?"切换到浅色模式":"切换到深色模式",children:g==="dark"?o.jsx(nk,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"}):o.jsx(rk,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"})}),o.jsxs(Fn,{className:"space-y-4 text-center",children:[o.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10",children:o.jsx(y9,{className:"h-8 w-8 text-primary",strokeWidth:2,fill:"none"})}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(qn,{className:"text-2xl font-bold",children:"欢迎使用 MaiBot"}),o.jsx(ts,{className:"text-base",children:"请输入您的 Access Token 以继续访问系统"})]})]}),o.jsx(Gn,{children:o.jsxs("form",{onSubmit:y,className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"token",className:"text-sm font-medium",children:"Access Token"}),o.jsxs("div",{className:"relative",children:[o.jsx(bI,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",strokeWidth:2,fill:"none"}),o.jsx(ze,{id:"token",type:"password",placeholder:"请输入您的 Access Token",value:t,onChange:w=>e(w.target.value),className:xe("pl-10",s&&"border-red-500 focus-visible:ring-red-500"),disabled:n,autoFocus:!0,autoComplete:"off"})]})]}),s&&o.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:[o.jsx(Uc,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2,fill:"none"}),o.jsx("span",{children:s})]}),o.jsx(de,{type:"submit",className:"w-full",disabled:n,children:n?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"验证中..."]}):"验证并进入"}),o.jsxs(Dr,{children:[o.jsx(Of,{asChild:!0,children:o.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:[o.jsx(Wy,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我没有 Token,我该去哪里获得 Token?"]})}),o.jsxs(Sr,{className:"sm:max-w-md",children:[o.jsxs(kr,{children:[o.jsxs(Or,{className:"flex items-center gap-2",children:[o.jsx(y9,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"如何获取 Access Token"]}),o.jsx(ss,{children:"Access Token 是访问 MaiBot WebUI 的唯一凭证,请按以下方式获取"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(Hee,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsx("h4",{className:"font-semibold text-sm",children:"方式一:查看启动日志"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"在 MaiBot 启动时,控制台会显示 WebUI Access Token。"}),o.jsxs("div",{className:"rounded bg-background p-2 font-mono text-xs",children:[o.jsx("p",{className:"text-muted-foreground",children:"🔑 WebUI Access Token: abc123..."}),o.jsx("p",{className:"text-muted-foreground",children:"💡 请使用此 Token 登录 WebUI"})]})]})]})}),o.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(zl,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsx("h4",{className:"font-semibold text-sm",children:"方式二:查看配置文件"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Token 保存在项目根目录的配置文件中:"}),o.jsx("div",{className:"rounded bg-background p-2 font-mono text-xs break-all",children:o.jsx("code",{className:"text-primary",children:"data/webui.json"})}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["打开此文件,复制 ",o.jsx("code",{className:"px-1 py-0.5 bg-background rounded",children:"access_token"})," 字段的值"]})]})]})}),o.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Uc,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),o.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[o.jsx("p",{className:"font-semibold",children:"安全提示"}),o.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[o.jsx("li",{children:"请妥善保管您的 Token,不要泄露给他人"}),o.jsx("li",{children:"如需重置 Token,请在登录后前往系统设置"})]})]})]})})]})]})]}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.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:[o.jsx(tk,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我觉得这个界面很卡怎么办?"]})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsxs(En,{className:"flex items-center gap-2",children:[o.jsx(tk,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"关闭背景动画"]}),o.jsx(_n,{children:"背景动画可能会在低性能设备上造成卡顿。关闭动画可以显著提升界面流畅度。"})]}),o.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭动画后,背景将变为纯色,但不影响任何功能的使用。您可以随时在系统设置中重新开启动画。"})}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:()=>c(!1),children:"关闭动画"})]})]})]})]})})]}),o.jsx("div",{className:"absolute bottom-4 left-0 right-0 text-center text-xs text-muted-foreground",children:o.jsx("p",{children:Bse})})]})}const Mr=b.forwardRef(({className:t,...e},n)=>o.jsx("textarea",{className:xe("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",t),ref:n,...e}));Mr.displayName="Textarea";var hie=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],fie=hie.reduce((t,e)=>{const n=Fy(`Primitive.${e}`),r=b.forwardRef((s,i)=>{const{asChild:a,...l}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),mie="Separator",rE="horizontal",pie=["horizontal","vertical"],TB=b.forwardRef((t,e)=>{const{decorative:n,orientation:r=rE,...s}=t,i=gie(r)?r:rE,l=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return o.jsx(fie.div,{"data-orientation":i,...l,...s,ref:e})});TB.displayName=mie;function gie(t){return pie.includes(t)}var EB=TB;const L0=b.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},s)=>o.jsx(EB,{ref:s,decorative:n,orientation:e,className:xe("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));L0.displayName=EB.displayName;const xie=kf("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 Xn({className:t,variant:e,...n}){return o.jsx("div",{className:xe(xie({variant:e}),t),...n})}function vie({config:t,onChange:e}){const n=s=>{s.trim()&&!t.alias_names.includes(s.trim())&&e({...t,alias_names:[...t.alias_names,s.trim()]})},r=s=>{e({...t,alias_names:t.alias_names.filter((i,a)=>a!==s)})};return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"qq_account",children:"QQ账号 *"}),o.jsx(ze,{id:"qq_account",type:"number",placeholder:"请输入机器人的QQ账号",value:t.qq_account||"",onChange:s=>e({...t,qq_account:Number(s.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人登录使用的QQ账号"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"nickname",children:"昵称 *"}),o.jsx(ze,{id:"nickname",placeholder:"请输入机器人的昵称",value:t.nickname,onChange:s=>e({...t,nickname:s.target.value})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的主要称呼名称"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{children:"别名"}),o.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:t.alias_names.map((s,i)=>o.jsxs(Xn,{variant:"secondary",className:"gap-1",children:[s,o.jsx("button",{type:"button",onClick:()=>r(i),className:"ml-1 hover:text-destructive",children:o.jsx(_p,{className:"h-3 w-3"})})]},i))}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ze,{id:"alias_input",placeholder:"输入别名后按回车添加",onKeyPress:s=>{s.key==="Enter"&&(n(s.target.value),s.target.value="")}}),o.jsx(de,{type:"button",variant:"outline",onClick:()=>{const s=document.getElementById("alias_input");s&&(n(s.value),s.value="")},children:"添加"})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的其他称呼,可以添加多个"})]})]})}function yie({config:t,onChange:e}){return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"personality",children:"人格特征 *"}),o.jsx(Mr,{id:"personality",placeholder:"描述机器人的人格特质和身份特征(建议120字以内)",value:t.personality,onChange:n=>e({...t,personality:n.target.value}),rows:3}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:是一个女大学生,现在在读大二,会刷贴吧"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"reply_style",children:"表达风格 *"}),o.jsx(Mr,{id:"reply_style",placeholder:"描述机器人说话的表达风格、表达习惯",value:t.reply_style,onChange:n=>e({...t,reply_style:n.target.value}),rows:3}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:回复平淡一些,简短一些,说中文,参考贴吧、知乎和微博的回复风格"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"interest",children:"兴趣 *"}),o.jsx(Mr,{id:"interest",placeholder:"描述机器人感兴趣的话题",value:t.interest,onChange:n=>e({...t,interest:n.target.value}),rows:2}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"会影响机器人对什么话题进行回复"})]}),o.jsx(L0,{}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"plan_style",children:"群聊说话规则 *"}),o.jsx(Mr,{id:"plan_style",placeholder:"机器人在群聊中的行为风格和规则",value:t.plan_style,onChange:n=>e({...t,plan_style:n.target.value}),rows:4}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在群聊中如何行动,例如回复频率、条件等"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"private_plan_style",children:"私聊说话规则 *"}),o.jsx(Mr,{id:"private_plan_style",placeholder:"机器人在私聊中的行为风格和规则",value:t.private_plan_style,onChange:n=>e({...t,private_plan_style:n.target.value}),rows:3}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在私聊中的行为方式"})]})]})}function bie({config:t,onChange:e}){return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{htmlFor:"emoji_chance",children:"表情包激活概率"}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:[(t.emoji_chance*100).toFixed(0),"%"]})]}),o.jsx(ze,{id:"emoji_chance",type:"range",min:"0",max:"1",step:"0.1",value:t.emoji_chance,onChange:n=>e({...t,emoji_chance:Number(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人发送表情包的概率"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"max_reg_num",children:"最大表情包数量"}),o.jsx(ze,{id:"max_reg_num",type:"number",min:"1",max:"200",value:t.max_reg_num,onChange:n=>e({...t,max_reg_num:Number(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人最多保存的表情包数量"})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(he,{htmlFor:"do_replace",children:"达到最大数量时替换"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"开启后会删除旧表情包,关闭则不再收集新表情包"})]}),o.jsx(Bt,{id:"do_replace",checked:t.do_replace,onCheckedChange:n=>e({...t,do_replace:n})})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),o.jsx(ze,{id:"check_interval",type:"number",min:"1",max:"120",value:t.check_interval,onChange:n=>e({...t,check_interval:Number(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包注册、破损、删除的时间间隔"})]}),o.jsx(L0,{}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(he,{htmlFor:"steal_emoji",children:"偷取表情包"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人将一些表情包据为己有"})]}),o.jsx(Bt,{id:"steal_emoji",checked:t.steal_emoji,onCheckedChange:n=>e({...t,steal_emoji:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(he,{htmlFor:"content_filtration",children:"启用表情包过滤"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"只保存符合要求的表情包"})]}),o.jsx(Bt,{id:"content_filtration",checked:t.content_filtration,onCheckedChange:n=>e({...t,content_filtration:n})})]}),t.content_filtration&&o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"filtration_prompt",children:"过滤要求"}),o.jsx(ze,{id:"filtration_prompt",placeholder:"例如:符合公序良俗",value:t.filtration_prompt,onChange:n=>e({...t,filtration_prompt:n.target.value})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"描述表情包应该符合的要求"})]})]})}function wie({config:t,onChange:e}){return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(he,{htmlFor:"enable_tool",children:"启用工具系统"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人使用各种工具增强功能"})]}),o.jsx(Bt,{id:"enable_tool",checked:t.enable_tool,onCheckedChange:n=>e({...t,enable_tool:n})})]}),o.jsx(L0,{}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(he,{htmlFor:"enable_mood",children:"启用情绪系统"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"让机器人具有情绪变化能力"})]}),o.jsx(Bt,{id:"enable_mood",checked:t.enable_mood,onCheckedChange:n=>e({...t,enable_mood:n})})]}),t.enable_mood&&o.jsxs("div",{className:"ml-6 space-y-6 border-l-2 border-primary/20 pl-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"mood_update_threshold",children:"情绪更新阈值"}),o.jsx(ze,{id:"mood_update_threshold",type:"number",min:"0.1",max:"10",step:"0.1",value:t.mood_update_threshold||1,onChange:n=>e({...t,mood_update_threshold:Number(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"值越高,情绪更新越慢"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"emotion_style",children:"情感特征"}),o.jsx(Mr,{id:"emotion_style",placeholder:"描述情绪的变化情况,例如:情绪较为稳定,但遭遇特定事件时起伏较大",value:t.emotion_style||"",onChange:n=>e({...t,emotion_style:n.target.value}),rows:2}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"影响机器人的情绪变化方式"})]})]}),o.jsx(L0,{}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(he,{htmlFor:"all_global",children:"启用全局黑话模式"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人学习和使用群组黑话"})]}),o.jsx(Bt,{id:"all_global",checked:t.all_global,onCheckedChange:n=>e({...t,all_global:n})})]})]})}function Sie({config:t,onChange:e}){const[n,r]=b.useState(!1);return o.jsxs("div",{className:"space-y-6",children:[o.jsx("div",{className:"rounded-lg bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-4",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:"mt-0.5",children:o.jsx("svg",{className:"h-5 w-5 text-blue-600 dark:text-blue-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),o.jsxs("div",{className:"flex-1 text-sm",children:[o.jsx("p",{className:"font-medium text-blue-900 dark:text-blue-100 mb-1",children:"关于硅基流动 (SiliconFlow)"}),o.jsx("p",{className:"text-blue-700 dark:text-blue-300 mb-2",children:"硅基流动提供了完整的模型覆盖,包括 DeepSeek V3、Qwen、视觉模型、语音识别和嵌入模型。 只需一个 API Key 即可使用麦麦的所有功能!"}),o.jsxs("a",{href:"https://cloud.siliconflow.cn",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-blue-600 dark:text-blue-400 hover:underline font-medium",children:["前往硅基流动获取 API Key",o.jsx(Ah,{className:"h-3 w-3"})]})]})]})}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(he,{htmlFor:"siliconflow_api_key",children:"SiliconFlow API Key *"}),o.jsxs("div",{className:"relative",children:[o.jsx(ze,{id:"siliconflow_api_key",type:n?"text":"password",placeholder:"sk-...",value:t.api_key,onChange:s=>e({api_key:s.target.value}),className:"font-mono pr-10"}),o.jsx(de,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 hover:bg-transparent",onClick:()=>r(!n),children:n?o.jsx(Rv,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(Ea,{className:"h-4 w-4 text-muted-foreground"})})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"请输入您的硅基流动 API 密钥。获取后,麦麦将自动配置所有必需的模型。"})]}),o.jsxs("div",{className:"rounded-lg bg-muted/50 p-4 text-sm space-y-2",children:[o.jsx("p",{className:"font-medium",children:"将自动配置以下模型:"}),o.jsxs("ul",{className:"list-disc list-inside space-y-1 text-muted-foreground ml-2",children:[o.jsx("li",{children:"DeepSeek V3 - 主要对话和工具模型"}),o.jsx("li",{children:"Qwen3 30B - 高频小任务和工具调用"}),o.jsx("li",{children:"Qwen3 VL 30B - 图像识别"}),o.jsx("li",{children:"SenseVoice - 语音识别"}),o.jsx("li",{children:"BGE-M3 - 文本嵌入"}),o.jsx("li",{children:"知识库相关模型 (LPMM)"})]})]}),o.jsx("div",{className:"rounded-lg border border-amber-200 dark:border-amber-800 bg-amber-50 dark:bg-amber-950/30 p-4",children:o.jsxs("p",{className:"text-sm text-amber-900 dark:text-amber-100",children:[o.jsx("span",{className:"font-medium",children:"💡 提示:"}),'完成向导后,您可以在"系统设置 → 模型配置"中添加更多 API 提供商和模型。']})})]})}async function St(t,e){const n=await fetch(t,e);if(n.status===401)throw localStorage.removeItem("access-token"),window.location.href="/auth",new Error("认证失败,请重新登录");return n}function Dt(){return{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("access-token")}`}}async function kie(){const t=await St("/api/webui/config/bot",{method:"GET",headers:Dt()});if(!t.ok)throw new Error("读取Bot配置失败");const n=(await t.json()).config.bot||{};return{qq_account:n.qq_account||0,nickname:n.nickname||"",alias_names:n.alias_names||[]}}async function Oie(){const t=await St("/api/webui/config/bot",{method:"GET",headers:Dt()});if(!t.ok)throw new Error("读取人格配置失败");const n=(await t.json()).config.personality||{};return{personality:n.personality||"",reply_style:n.reply_style||"",interest:n.interest||"",plan_style:n.plan_style||"",private_plan_style:n.private_plan_style||""}}async function jie(){const t=await St("/api/webui/config/bot",{method:"GET",headers:Dt()});if(!t.ok)throw new Error("读取表情包配置失败");const n=(await t.json()).config.emoji||{};return{emoji_chance:n.emoji_chance??.4,max_reg_num:n.max_reg_num??40,do_replace:n.do_replace??!0,check_interval:n.check_interval??10,steal_emoji:n.steal_emoji??!0,content_filtration:n.content_filtration??!1,filtration_prompt:n.filtration_prompt||""}}async function Nie(){const t=await St("/api/webui/config/bot",{method:"GET",headers:Dt()});if(!t.ok)throw new Error("读取其他配置失败");const n=(await t.json()).config,r=n.tool||{},s=n.mood||{},i=n.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 Cie(){const t=await St("/api/webui/config/model",{method:"GET",headers:Dt()});if(!t.ok)throw new Error("读取模型配置失败");return{api_key:((await t.json()).config.api_providers||[]).find(i=>i.name==="SiliconFlow")?.api_key||""}}async function Tie(t){const e=await St("/api/webui/config/bot/section/bot",{method:"POST",headers:Dt(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"保存Bot基础配置失败")}return await e.json()}async function Eie(t){const e=await St("/api/webui/config/bot/section/personality",{method:"POST",headers:Dt(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"保存人格配置失败")}return await e.json()}async function _ie(t){const e=await St("/api/webui/config/bot/section/emoji",{method:"POST",headers:Dt(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"保存表情包配置失败")}return await e.json()}async function Aie(t){const e=[];e.push(St("/api/webui/config/bot/section/tool",{method:"POST",headers:Dt(),body:JSON.stringify({enable_tool:t.enable_tool})})),e.push(St("/api/webui/config/bot/section/jargon",{method:"POST",headers:Dt(),body:JSON.stringify({all_global:t.all_global})}));const n={enable_mood:t.enable_mood};t.enable_mood&&(n.mood_update_threshold=t.mood_update_threshold||1,n.emotion_style=t.emotion_style||""),e.push(St("/api/webui/config/bot/section/mood",{method:"POST",headers:Dt(),body:JSON.stringify(n)}));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 Mie(t){const e=await St("/api/webui/config/model",{method:"GET",headers:Dt()});if(!e.ok)throw new Error("读取模型配置失败");const r=(await e.json()).config,s=r.api_providers||[],i=s.findIndex(c=>c.name==="SiliconFlow");i>=0?s[i]={...s[i],api_key:t.api_key}:s.push({name:"SiliconFlow",base_url:"https://api.siliconflow.cn/v1",api_key:t.api_key,client_type:"openai",max_retry:3,timeout:120,retry_interval:5});const a={...r,api_providers:s},l=await St("/api/webui/config/model",{method:"POST",headers:Dt(),body:JSON.stringify(a)});if(!l.ok){const c=await l.json();throw new Error(c.detail||"保存模型配置失败")}return await l.json()}async function sE(){const t=localStorage.getItem("access-token"),e=await St("/api/webui/setup/complete",{method:"POST",headers:{Authorization:`Bearer ${t}`}});if(!e.ok){const n=await e.json();throw new Error(n.message||"标记配置完成失败")}return await e.json()}async function ib(){const t=await St("/api/webui/system/restart",{method:"POST",headers:Dt()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"重启失败")}return await t.json()}async function Rie(){const t=await St("/api/webui/system/status",{method:"GET",headers:Dt()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"获取状态失败")}return await t.json()}function Die(){const t=Zi(),{toast:e}=as(),[n,r]=b.useState(0),[s,i]=b.useState(!1),[a,l]=b.useState(!1),[c,d]=b.useState(!0),[h,m]=b.useState({qq_account:0,nickname:"",alias_names:[]}),[g,x]=b.useState({personality:"是一个女大学生,现在在读大二,会刷贴吧。",reply_style:"请回复的平淡一些,简短一些,说中文,不要刻意突出自身学科背景。可以参考贴吧,知乎和微博的回复风格。",interest:"对技术相关话题,游戏和动漫相关话题感兴趣,也对日常话题感兴趣,不喜欢太过沉重严肃的话题",plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用 2.如果相同的内容已经被执行,请不要重复执行 3.请控制你的发言频率,不要太过频繁的发言 4.如果有人对你感到厌烦,请减少回复 5.如果有人对你进行攻击,或者情绪激动,请你以合适的方法应对`,private_plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用 2.如果相同的内容已经被执行,请不要重复执行 -3.某句话如果已经被回复过,不要重复回复`}),[y,w]=b.useState({emoji_chance:.4,max_reg_num:40,do_replace:!0,check_interval:10,steal_emoji:!0,content_filtration:!1,filtration_prompt:"符合公序良俗"}),[S,k]=b.useState({enable_tool:!0,enable_mood:!1,mood_update_threshold:1,emotion_style:"情绪较为稳定,但遇遇特定事件的时候起伏较大",all_global:!0}),[j,N]=b.useState({api_key:""}),[T,E]=b.useState(!1),[_,M]=b.useState(""),I=[{id:"bot-basic",title:"Bot基础",description:"配置机器人的基本信息",icon:Eee},{id:"personality",title:"人格配置",description:"定义机器人的性格和说话风格",icon:mI},{id:"emoji",title:"表情包",description:"配置表情包相关设置",icon:Nj},{id:"other",title:"其他设置",description:"工具、情绪系统等配置",icon:Xu},{id:"siliconflow",title:"API配置",description:"配置硅基流动API密钥",icon:fI}],P=(n+1)/I.length*100;b.useEffect(()=>{(async()=>{try{d(!0);const[X,J,G,R,ie]=await Promise.all([sie(),iie(),aie(),oie(),lie()]);m(X),x(J),w(G),k(R),N(ie)}catch(X){e({title:"加载配置失败",description:X instanceof Error?X.message:"无法加载现有配置,将使用默认值",variant:"destructive"})}finally{d(!1)}})()},[e]);const L=async()=>{l(!0);try{switch(n){case 0:await cie(h);break;case 1:await uie(g);break;case 2:await die(y);break;case 3:await hie(S);break;case 4:await fie(j);break}return e({title:"保存成功",description:`${I[n].title}配置已保存`}),!0}catch(B){return e({title:"保存失败",description:B instanceof Error?B.message:"未知错误",variant:"destructive"}),!1}finally{l(!1)}},H=async()=>{await L()&&n{n>0&&r(n-1)},ee=async()=>{i(!0),E(!0);try{if(M("正在保存API配置..."),!await L()){i(!1),E(!1);return}M("正在完成初始化..."),await Z9(),M("正在重启麦麦..."),await Jy(),e({title:"配置完成",description:"麦麦正在重启以应用新配置..."}),M("等待麦麦重启完成...");const X=60;let J=0,G=!1;for(;JsetTimeout(R,1e3));try{(await mie()).running&&(G=!0,M("重启成功!正在跳转..."))}catch{J++}}if(!G)throw new Error("重启超时,请手动检查麦麦状态");setTimeout(()=>{t({to:"/"})},1e3)}catch(B){E(!1),e({title:"配置失败",description:B instanceof Error?B.message:"未知错误",variant:"destructive"})}finally{i(!1)}},z=async()=>{try{await Z9(),t({to:"/"})}catch(B){e({title:"跳过失败",description:B instanceof Error?B.message:"未知错误",variant:"destructive"})}},Q=()=>{switch(n){case 0:return o.jsx(Jse,{config:h,onChange:m});case 1:return o.jsx(eie,{config:g,onChange:x});case 2:return o.jsx(tie,{config:y,onChange:w});case 3:return o.jsx(nie,{config:S,onChange:k});case 4:return o.jsx(rie,{config:j,onChange:N});default:return null}};return o.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:[T&&o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:o.jsxs("div",{className:"mx-auto flex max-w-md flex-col items-center space-y-6 rounded-lg border bg-card p-8 text-center shadow-lg",children:[o.jsx("div",{className:"flex h-20 w-20 items-center justify-center rounded-full bg-primary/10",children:o.jsx(Uc,{className:"h-10 w-10 animate-spin text-primary"})}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h2",{className:"text-2xl font-bold",children:"正在重启麦麦"}),o.jsx("p",{className:"text-muted-foreground",children:_})]}),o.jsx("div",{className:"w-full",children:o.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-secondary",children:o.jsx("div",{className:"h-full w-full animate-pulse bg-primary",style:{animation:"pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite"}})})}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"请稍候,这可能需要一分钟..."})]})}),o.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[o.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"}),o.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"})]}),c?o.jsxs("div",{className:"relative z-10 text-center",children:[o.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center",children:o.jsx("div",{className:"h-12 w-12 animate-spin rounded-full border-4 border-primary border-t-transparent"})}),o.jsx("p",{className:"text-lg font-medium",children:"加载配置中..."}),o.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"正在读取现有配置"})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"relative z-10 w-full max-w-4xl",children:[o.jsxs("div",{className:"mb-6 md:mb-8 text-center",children:[o.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:o.jsx(Tee,{className:"h-6 w-6 md:h-8 md:w-8 text-primary",strokeWidth:2,fill:"none"})}),o.jsx("h1",{className:"mb-2 text-2xl md:text-3xl font-bold",children:"首次配置向导"}),o.jsxs("p",{className:"text-sm md:text-base text-muted-foreground",children:["让我们一起完成 ",Hj," 的初始配置"]})]}),o.jsxs("div",{className:"mb-6 md:mb-8",children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between text-xs md:text-sm",children:[o.jsxs("span",{className:"text-muted-foreground",children:["步骤 ",n+1," / ",I.length]}),o.jsxs("span",{className:"font-medium text-primary",children:[Math.round(P),"%"]})]}),o.jsx(zp,{value:P,className:"h-2"})]}),o.jsx("div",{className:"mb-6 md:mb-8 flex justify-between",children:I.map((B,X)=>{const J=B.icon;return o.jsxs("div",{className:ve("flex flex-1 flex-col items-center gap-1 md:gap-2",Xt({to:"/"}),className:"gap-2 w-full sm:w-auto",children:[o.jsx(M0,{className:"h-4 w-4"}),"返回首页"]}),o.jsxs(he,{size:"lg",variant:"outline",onClick:()=>window.history.back(),className:"gap-2 w-full sm:w-auto",children:[o.jsx(pI,{className:"h-4 w-4"}),"返回上一页"]})]}),o.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"如果您认为这是一个错误,请联系系统管理员"})})]})})}var jB=["PageUp","PageDown"],NB=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],CB={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},kf="Slider",[lk,gie,xie]=Dy(kf),[TB]=Ra(kf,[xie]),[vie,eb]=TB(kf),EB=b.forwardRef((t,e)=>{const{name:n,min:r=0,max:s=100,step:i=1,orientation:a="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:d=[r],value:h,onValueChange:m=()=>{},onValueCommit:g=()=>{},inverted:x=!1,form:y,...w}=t,S=b.useRef(new Set),k=b.useRef(0),N=a==="horizontal"?yie:bie,[T=[],E]=Gl({prop:h,defaultProp:d,onChange:H=>{[...S.current][k.current]?.focus(),m(H)}}),_=b.useRef(T);function M(H){const U=jie(T,H);L(H,U)}function I(H){L(H,k.current)}function P(){const H=_.current[k.current];T[k.current]!==H&&g(T)}function L(H,U,{commit:ee}={commit:!1}){const z=Eie(i),Q=_ie(Math.round((H-r)/i)*i+r,z),B=xj(Q,[r,s]);E((X=[])=>{const J=kie(X,B,U);if(Tie(J,c*i)){k.current=J.indexOf(B);const G=String(J)!==String(X);return G&&ee&&g(J),G?J:X}else return X})}return o.jsx(vie,{scope:t.__scopeSlider,name:n,disabled:l,min:r,max:s,valueIndexToChangeRef:k,thumbs:S.current,values:T,orientation:a,form:y,children:o.jsx(lk.Provider,{scope:t.__scopeSlider,children:o.jsx(lk.Slot,{scope:t.__scopeSlider,children:o.jsx(N,{"aria-disabled":l,"data-disabled":l?"":void 0,...w,ref:e,onPointerDown:nt(w.onPointerDown,()=>{l||(_.current=T)}),min:r,max:s,inverted:x,onSlideStart:l?void 0:M,onSlideMove:l?void 0:I,onSlideEnd:l?void 0:P,onHomeKeyDown:()=>!l&&L(r,0,{commit:!0}),onEndKeyDown:()=>!l&&L(s,T.length-1,{commit:!0}),onStepKeyDown:({event:H,direction:U})=>{if(!l){const Q=jB.includes(H.key)||H.shiftKey&&NB.includes(H.key)?10:1,B=k.current,X=T[B],J=i*Q*U;L(X+J,B,{commit:!0})}}})})})})});EB.displayName=kf;var[_B,MB]=TB(kf,{startEdge:"left",endEdge:"right",size:"width",direction:1}),yie=b.forwardRef((t,e)=>{const{min:n,max:r,dir:s,inverted:i,onSlideStart:a,onSlideMove:l,onSlideEnd:c,onStepKeyDown:d,...h}=t,[m,g]=b.useState(null),x=Yn(e,N=>g(N)),y=b.useRef(void 0),w=Np(s),S=w==="ltr",k=S&&!i||!S&&i;function j(N){const T=y.current||m.getBoundingClientRect(),E=[0,T.width],M=Vj(E,k?[n,r]:[r,n]);return y.current=T,M(N-T.left)}return o.jsx(_B,{scope:t.__scopeSlider,startEdge:k?"left":"right",endEdge:k?"right":"left",direction:k?1:-1,size:"width",children:o.jsx(AB,{dir:w,"data-orientation":"horizontal",...h,ref:x,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:N=>{const T=j(N.clientX);a?.(T)},onSlideMove:N=>{const T=j(N.clientX);l?.(T)},onSlideEnd:()=>{y.current=void 0,c?.()},onStepKeyDown:N=>{const E=CB[k?"from-left":"from-right"].includes(N.key);d?.({event:N,direction:E?-1:1})}})})}),bie=b.forwardRef((t,e)=>{const{min:n,max:r,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:l,onStepKeyDown:c,...d}=t,h=b.useRef(null),m=Yn(e,h),g=b.useRef(void 0),x=!s;function y(w){const S=g.current||h.current.getBoundingClientRect(),k=[0,S.height],N=Vj(k,x?[r,n]:[n,r]);return g.current=S,N(w-S.top)}return o.jsx(_B,{scope:t.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:o.jsx(AB,{"data-orientation":"vertical",...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const S=y(w.clientY);i?.(S)},onSlideMove:w=>{const S=y(w.clientY);a?.(S)},onSlideEnd:()=>{g.current=void 0,l?.()},onStepKeyDown:w=>{const k=CB[x?"from-bottom":"from-top"].includes(w.key);c?.({event:w,direction:k?-1:1})}})})}),AB=b.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:l,onStepKeyDown:c,...d}=t,h=eb(kf,n);return o.jsx(gn.span,{...d,ref:e,onKeyDown:nt(t.onKeyDown,m=>{m.key==="Home"?(a(m),m.preventDefault()):m.key==="End"?(l(m),m.preventDefault()):jB.concat(NB).includes(m.key)&&(c(m),m.preventDefault())}),onPointerDown:nt(t.onPointerDown,m=>{const g=m.target;g.setPointerCapture(m.pointerId),m.preventDefault(),h.thumbs.has(g)?g.focus():r(m)}),onPointerMove:nt(t.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&s(m)}),onPointerUp:nt(t.onPointerUp,m=>{const g=m.target;g.hasPointerCapture(m.pointerId)&&(g.releasePointerCapture(m.pointerId),i(m))})})}),RB="SliderTrack",DB=b.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=eb(RB,n);return o.jsx(gn.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:e})});DB.displayName=RB;var ck="SliderRange",PB=b.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=eb(ck,n),i=MB(ck,n),a=b.useRef(null),l=Yn(e,a),c=s.values.length,d=s.values.map(g=>LB(g,s.min,s.max)),h=c>1?Math.min(...d):0,m=100-Math.max(...d);return o.jsx(gn.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:l,style:{...t.style,[i.startEdge]:h+"%",[i.endEdge]:m+"%"}})});PB.displayName=ck;var uk="SliderThumb",zB=b.forwardRef((t,e)=>{const n=gie(t.__scopeSlider),[r,s]=b.useState(null),i=Yn(e,l=>s(l)),a=b.useMemo(()=>r?n().findIndex(l=>l.ref.current===r):-1,[n,r]);return o.jsx(wie,{...t,ref:i,index:a})}),wie=b.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:s,...i}=t,a=eb(uk,n),l=MB(uk,n),[c,d]=b.useState(null),h=Yn(e,j=>d(j)),m=c?a.form||!!c.closest("form"):!0,g=Gz(c),x=a.values[r],y=x===void 0?0:LB(x,a.min,a.max),w=Oie(r,a.values.length),S=g?.[l.size],k=S?Nie(S,y,l.direction):0;return b.useEffect(()=>{if(c)return a.thumbs.add(c),()=>{a.thumbs.delete(c)}},[c,a.thumbs]),o.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${y}% + ${k}px)`},children:[o.jsx(lk.ItemSlot,{scope:t.__scopeSlider,children:o.jsx(gn.span,{role:"slider","aria-label":t["aria-label"]||w,"aria-valuemin":a.min,"aria-valuenow":x,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...i,ref:h,style:x===void 0?{display:"none"}:t.style,onFocus:nt(t.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),m&&o.jsx(IB,{name:s??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:x},r)]})});zB.displayName=uk;var Sie="RadioBubbleInput",IB=b.forwardRef(({__scopeSlider:t,value:e,...n},r)=>{const s=b.useRef(null),i=Yn(s,r),a=Wz(e);return b.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==e&&h){const m=new Event("input",{bubbles:!0});h.call(l,e),l.dispatchEvent(m)}},[a,e]),o.jsx(gn.input,{style:{display:"none"},...n,ref:i,defaultValue:e})});IB.displayName=Sie;function kie(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}function LB(t,e,n){const i=100/(n-e)*(t-e);return xj(i,[0,100])}function Oie(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function jie(t,e){if(t.length===1)return 0;const n=t.map(s=>Math.abs(s-e)),r=Math.min(...n);return n.indexOf(r)}function Nie(t,e,n){const r=t/2,i=Vj([0,50],[0,r]);return(r-i(e)*n)*n}function Cie(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function Tie(t,e){if(e>0){const n=Cie(t);return Math.min(...n)>=e}return!0}function Vj(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function Eie(t){return(String(t).split(".")[1]||"").length}function _ie(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var BB=EB,Mie=DB,Aie=PB,Rie=zB;const Ip=b.forwardRef(({className:t,...e},n)=>o.jsxs(BB,{ref:n,className:ve("relative flex w-full touch-none select-none items-center",t),...e,children:[o.jsx(Mie,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:o.jsx(Aie,{className:"absolute h-full bg-primary"})}),o.jsx(Rie,{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"})]}));Ip.displayName=BB.displayName;const Vt=pee,Ut=gee,$t=b.forwardRef(({className:t,children:e,...n},r)=>o.jsxs(Zz,{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",t),...n,children:[e,o.jsx(uee,{asChild:!0,children:o.jsx(nd,{className:"h-4 w-4 opacity-50"})})]}));$t.displayName=Zz.displayName;const FB=b.forwardRef(({className:t,...e},n)=>o.jsx(Jz,{ref:n,className:ve("flex cursor-default items-center justify-center py-1",t),...e,children:o.jsx(A0,{className:"h-4 w-4"})}));FB.displayName=Jz.displayName;const qB=b.forwardRef(({className:t,...e},n)=>o.jsx(eI,{ref:n,className:ve("flex cursor-default items-center justify-center py-1",t),...e,children:o.jsx(nd,{className:"h-4 w-4"})}));qB.displayName=eI.displayName;const Ht=b.forwardRef(({className:t,children:e,position:n="popper",...r},s)=>o.jsx(dee,{children:o.jsxs(tI,{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]",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[o.jsx(FB,{}),o.jsx(hee,{className:ve("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),o.jsx(qB,{})]})}));Ht.displayName=tI.displayName;const Die=b.forwardRef(({className:t,...e},n)=>o.jsx(nI,{ref:n,className:ve("px-2 py-1.5 text-sm font-semibold",t),...e}));Die.displayName=nI.displayName;const De=b.forwardRef(({className:t,children:e,...n},r)=>o.jsxs(rI,{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",t),...n,children:[o.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(fee,{children:o.jsx(Ro,{className:"h-4 w-4"})})}),o.jsx(mee,{children:e})]}));De.displayName=rI.displayName;const Pie=b.forwardRef(({className:t,...e},n)=>o.jsx(sI,{ref:n,className:ve("-mx-1 my-1 h-px bg-muted",t),...e}));Pie.displayName=sI.displayName;function zie(t){const e=Iie(t),n=b.forwardRef((r,s)=>{const{children:i,...a}=r,l=b.Children.toArray(i),c=l.find(Bie);if(c){const d=c.props.children,h=l.map(m=>m===c?b.Children.count(d)>1?b.Children.only(null):b.isValidElement(d)?d.props.children:null:m);return o.jsx(e,{...a,ref:s,children:b.isValidElement(d)?b.cloneElement(d,void 0,h):null})}return o.jsx(e,{...a,ref:s,children:i})});return n.displayName=`${t}.Slot`,n}function Iie(t){const e=b.forwardRef((n,r)=>{const{children:s,...i}=n;if(b.isValidElement(s)){const a=qie(s),l=Fie(i,s.props);return s.type!==b.Fragment&&(l.ref=r?Hc(r,a):a),b.cloneElement(s,l)}return b.Children.count(s)>1?b.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Lie=Symbol("radix.slottable");function Bie(t){return b.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Lie}function Fie(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...l)=>{const c=i(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function qie(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var tb="Popover",[$B]=Ra(tb,[gf]),Lp=gf(),[$ie,iu]=$B(tb),HB=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!1}=t,l=Lp(e),c=b.useRef(null),[d,h]=b.useState(!1),[m,g]=Gl({prop:r,defaultProp:s??!1,onChange:i,caller:tb});return o.jsx(By,{...l,children:o.jsx($ie,{scope:e,contentId:Ui(),triggerRef:c,open:m,onOpenChange:g,onOpenToggle:b.useCallback(()=>g(x=>!x),[g]),hasCustomAnchor:d,onCustomAnchorAdd:b.useCallback(()=>h(!0),[]),onCustomAnchorRemove:b.useCallback(()=>h(!1),[]),modal:a,children:n})})};HB.displayName=tb;var QB="PopoverAnchor",Hie=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=iu(QB,n),i=Lp(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:l}=s;return b.useEffect(()=>(a(),()=>l()),[a,l]),o.jsx(Fy,{...i,...r,ref:e})});Hie.displayName=QB;var VB="PopoverTrigger",UB=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=iu(VB,n),i=Lp(n),a=Yn(e,s.triggerRef),l=o.jsx(gn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":KB(s.open),...r,ref:a,onClick:nt(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?l:o.jsx(Fy,{asChild:!0,...i,children:l})});UB.displayName=VB;var Uj="PopoverPortal",[Qie,Vie]=$B(Uj,{forceMount:void 0}),WB=t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=iu(Uj,e);return o.jsx(Qie,{scope:e,forceMount:n,children:o.jsx(si,{present:n||i.open,children:o.jsx(Ly,{asChild:!0,container:s,children:r})})})};WB.displayName=Uj;var Xh="PopoverContent",GB=b.forwardRef((t,e)=>{const n=Vie(Xh,t.__scopePopover),{forceMount:r=n.forceMount,...s}=t,i=iu(Xh,t.__scopePopover);return o.jsx(si,{present:r||i.open,children:i.modal?o.jsx(Wie,{...s,ref:e}):o.jsx(Gie,{...s,ref:e})})});GB.displayName=Xh;var Uie=zie("PopoverContent.RemoveScroll"),Wie=b.forwardRef((t,e)=>{const n=iu(Xh,t.__scopePopover),r=b.useRef(null),s=Yn(e,r),i=b.useRef(!1);return b.useEffect(()=>{const a=r.current;if(a)return iI(a)},[]),o.jsx(aI,{as:Uie,allowPinchZoom:!0,children:o.jsx(XB,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:nt(t.onCloseAutoFocus,a=>{a.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:nt(t.onPointerDownOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:nt(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),Gie=b.forwardRef((t,e)=>{const n=iu(Xh,t.__scopePopover),r=b.useRef(!1),s=b.useRef(!1);return o.jsx(XB,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{t.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{t.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;n.triggerRef.current?.contains(a)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),XB=b.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,...m}=t,g=iu(Xh,n),x=Lp(n);return oI(),o.jsx(lI,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:o.jsx(kj,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>g.onOpenChange(!1),children:o.jsx(Oj,{"data-state":KB(g.open),role:"dialog",id:g.contentId,...x,...m,ref:e,style:{...m.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)"}})})})}),YB="PopoverClose",Xie=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=iu(YB,n);return o.jsx(gn.button,{type:"button",...r,ref:e,onClick:nt(t.onClick,()=>s.onOpenChange(!1))})});Xie.displayName=YB;var Yie="PopoverArrow",Kie=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=Lp(n);return o.jsx(jj,{...s,...r,ref:e})});Kie.displayName=Yie;function KB(t){return t?"open":"closed"}var Zie=HB,Jie=UB,eae=WB,ZB=GB;const Po=Zie,zo=Jie,Xa=b.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},s)=>o.jsx(eae,{children:o.jsx(ZB,{ref:s,align:e,sideOffset:n,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]",t),...r})}));Xa.displayName=ZB.displayName;const au="/api/webui/config";async function J9(){const e=await(await St(`${au}/bot`)).json();if(!e.success)throw new Error("获取配置数据失败");return e.config}async function Rh(){const e=await(await St(`${au}/model`)).json();if(!e.success)throw new Error("获取模型配置数据失败");return e.config}async function eE(t){const n=await(await St(`${au}/bot`,{method:"POST",headers:Dt(),body:JSON.stringify(t)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function tae(){const e=await(await St(`${au}/bot/raw`)).json();if(!e.success)throw new Error("获取配置源代码失败");return e.content}async function nae(t){const n=await(await St(`${au}/bot/raw`,{method:"POST",headers:Dt(),body:JSON.stringify({raw_content:t})})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function zv(t){const n=await(await St(`${au}/model`,{method:"POST",headers:Dt(),body:JSON.stringify(t)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function rae(t,e){const r=await(await St(`${au}/bot/section/${t}`,{method:"POST",headers:Dt(),body:JSON.stringify(e)})).json();if(!r.success)throw new Error(r.message||`保存配置节 ${t} 失败`)}async function dk(t,e){const r=await(await St(`${au}/model/section/${t}`,{method:"POST",headers:Dt(),body:JSON.stringify(e)})).json();if(!r.success)throw new Error(r.message||`保存配置节 ${t} 失败`)}async function sae(t,e="openai",n="/models"){const r=new URLSearchParams({provider_name:t,parser:e,endpoint:n}),s=await St(`/api/webui/models/list?${r}`);if(!s.ok){const a=await s.json().catch(()=>({}));throw new Error(a.detail||`获取模型列表失败 (${s.status})`)}const i=await s.json();if(!i.success)throw new Error("获取模型列表失败");return i.models}const iae=wf("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"}}),ga=b.forwardRef(({className:t,variant:e,...n},r)=>o.jsx("div",{ref:r,role:"alert",className:ve(iae({variant:e}),t),...n}));ga.displayName="Alert";const aae=b.forwardRef(({className:t,...e},n)=>o.jsx("h5",{ref:n,className:ve("mb-1 font-medium leading-none tracking-tight",t),...e}));aae.displayName="AlertTitle";const xa=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:ve("text-sm [&_p]:leading-relaxed",t),...e}));xa.displayName="AlertDescription";function Wj({onRestartComplete:t,onRestartFailed:e}){const[n,r]=b.useState(0),[s,i]=b.useState("restarting"),[a,l]=b.useState(0),[c,d]=b.useState(0);b.useEffect(()=>{const g=setInterval(()=>{r(w=>w>=90?w:w+1)},200),x=setInterval(()=>{l(w=>w+1)},1e3),y=setTimeout(()=>{i("checking"),h()},3e3);return()=>{clearInterval(g),clearInterval(x),clearTimeout(y)}},[]);const h=()=>{const x=async()=>{try{if(d(w=>w+1),(await fetch("/api/webui/system/status",{method:"GET",headers:{"Content-Type":"application/json"},signal:AbortSignal.timeout(3e3)})).ok)r(100),i("success"),setTimeout(()=>{t?.()},1500);else throw new Error("Status check failed")}catch{c<60?setTimeout(x,2e3):(i("failed"),e?.())}};x()},m=g=>{const x=Math.floor(g/60),y=g%60;return`${x}:${y.toString().padStart(2,"0")}`};return o.jsx("div",{className:"fixed inset-0 bg-background/95 backdrop-blur-sm z-50 flex items-center justify-center",children:o.jsxs("div",{className:"max-w-md w-full mx-4 space-y-8",children:[o.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[s==="restarting"&&o.jsxs(o.Fragment,{children:[o.jsx(Uc,{className:"h-16 w-16 text-primary animate-spin"}),o.jsx("h2",{className:"text-2xl font-bold",children:"正在重启麦麦"}),o.jsx("p",{className:"text-muted-foreground text-center",children:"请稍候,麦麦正在重启中..."})]}),s==="checking"&&o.jsxs(o.Fragment,{children:[o.jsx(Uc,{className:"h-16 w-16 text-primary animate-spin"}),o.jsx("h2",{className:"text-2xl font-bold",children:"检查服务状态"}),o.jsxs("p",{className:"text-muted-foreground text-center",children:["等待服务恢复... (尝试 ",c,"/60)"]})]}),s==="success"&&o.jsxs(o.Fragment,{children:[o.jsx(Qc,{className:"h-16 w-16 text-green-500"}),o.jsx("h2",{className:"text-2xl font-bold",children:"重启成功"}),o.jsx("p",{className:"text-muted-foreground text-center",children:"正在跳转到登录页面..."})]}),s==="failed"&&o.jsxs(o.Fragment,{children:[o.jsx(Vc,{className:"h-16 w-16 text-destructive"}),o.jsx("h2",{className:"text-2xl font-bold",children:"重启超时"}),o.jsx("p",{className:"text-muted-foreground text-center",children:"服务未能在预期时间内恢复,请手动检查或刷新页面"})]})]}),s!=="failed"&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(zp,{value:n,className:"h-2"}),o.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[o.jsxs("span",{children:[n,"%"]}),o.jsxs("span",{children:["已用时: ",m(a)]})]})]}),o.jsx("div",{className:"bg-muted/50 rounded-lg p-4 space-y-2",children:o.jsxs("p",{className:"text-sm text-muted-foreground",children:[s==="restarting"&&"🔄 配置已保存,正在重启主程序...",s==="checking"&&"⏳ 正在等待服务恢复,请勿关闭页面...",s==="success"&&"✅ 配置已生效,服务运行正常",s==="failed"&&"⚠️ 如果长时间无响应,请尝试手动重启"]})}),o.jsx("div",{className:"bg-yellow-500/10 border border-yellow-500/50 rounded-lg p-4",children:o.jsxs("p",{className:"text-sm text-yellow-900 dark:text-yellow-100",children:[o.jsx("strong",{children:"⚠️ 重要提示:"})," 由于技术原因,使用重启功能后,将无法再使用 ",o.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。如需结束程序,请使用脚本目录下的进程管理脚本。"]})}),s==="failed"&&o.jsxs("div",{className:"flex gap-2",children:[o.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:"刷新页面"}),o.jsx("button",{onClick:()=>{i("checking"),d(0),h()},className:"flex-1 px-4 py-2 bg-secondary text-secondary-foreground rounded-md hover:bg-secondary/90",children:"重试检测"})]})]})})}let hk=[],JB=[];(()=>{let t="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,n=0;e>1;if(t=JB[r])e=r+1;else return!0;if(e==n)return!1}}function tE(t){return t>=127462&&t<=127487}const nE=8205;function lae(t,e,n=!0,r=!0){return(n?eF:cae)(t,e,r)}function eF(t,e,n){if(e==t.length)return e;e&&tF(t.charCodeAt(e))&&nF(t.charCodeAt(e-1))&&e--;let r=N4(t,e);for(e+=rE(r);e=0&&tE(N4(t,a));)i++,a-=2;if(i%2==0)break;e+=2}else break}return e}function cae(t,e,n){for(;e>0;){let r=eF(t,e-2,n);if(r=56320&&t<57344}function nF(t){return t>=55296&&t<56320}function rE(t){return t<65536?1:2}class jn{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,n,r){[e,n]=Yh(this,e,n);let s=[];return this.decompose(0,e,s,2),r.length&&r.decompose(0,r.length,s,3),this.decompose(n,this.length,s,1),rv.from(s,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Yh(this,e,n);let r=[];return this.decompose(e,n,r,0),rv.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),s=new x0(this),i=new x0(e);for(let a=n,l=n;;){if(s.next(a),i.next(a),a=0,s.lineBreak!=i.lineBreak||s.done!=i.done||s.value!=i.value)return!1;if(l+=s.value.length,s.done||l>=r)return!0}}iter(e=1){return new x0(this,e)}iterRange(e,n=this.length){return new rF(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let s=this.line(e).from;r=this.iterRange(s,Math.max(s,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new sF(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]?jn.empty:e.length<=32?new Hr(e):rv.from(Hr.split(e,[]))}}class Hr extends jn{constructor(e,n=uae(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,s){for(let i=0;;i++){let a=this.text[i],l=s+a.length;if((n?r:l)>=e)return new dae(s,l,r,a);s=l+1,r++}}decompose(e,n,r,s){let i=e<=0&&n>=this.length?this:new Hr(sE(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(s&1){let a=r.pop(),l=sv(i.text,a.text.slice(),0,i.length);if(l.length<=32)r.push(new Hr(l,a.length+i.length));else{let c=l.length>>1;r.push(new Hr(l.slice(0,c)),new Hr(l.slice(c)))}}else r.push(i)}replace(e,n,r){if(!(r instanceof Hr))return super.replace(e,n,r);[e,n]=Yh(this,e,n);let s=sv(this.text,sv(r.text,sE(this.text,0,e)),n),i=this.length+r.length-(n-e);return s.length<=32?new Hr(s,i):rv.from(Hr.split(s,[]),i)}sliceString(e,n=this.length,r=` -`){[e,n]=Yh(this,e,n);let s="";for(let i=0,a=0;i<=n&&ae&&a&&(s+=r),ei&&(s+=l.slice(Math.max(0,e-i),n-i)),i=c+1}return s}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],s=-1;for(let i of e)r.push(i),s+=i.length+1,r.length==32&&(n.push(new Hr(r,s)),r=[],s=-1);return s>-1&&n.push(new Hr(r,s)),n}}let rv=class vh extends jn{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,s){for(let i=0;;i++){let a=this.children[i],l=s+a.length,c=r+a.lines-1;if((n?c:l)>=e)return a.lineInner(e,n,r,s);s=l+1,r=c+1}}decompose(e,n,r,s){for(let i=0,a=0;a<=n&&i=a){let d=s&((a<=e?1:0)|(c>=n?2:0));a>=e&&c<=n&&!d?r.push(l):l.decompose(e-a,n-a,r,d)}a=c+1}}replace(e,n,r){if([e,n]=Yh(this,e,n),r.lines=i&&n<=l){let c=a.replace(e-i,n-i,r),d=this.lines-a.lines+c.lines;if(c.lines>4&&c.lines>d>>6){let h=this.children.slice();return h[s]=c,new vh(h,this.length-(n-e)+r.length)}return super.replace(i,l,c)}i=l+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=` -`){[e,n]=Yh(this,e,n);let s="";for(let i=0,a=0;ie&&i&&(s+=r),ea&&(s+=l.sliceString(e-a,n-a,r)),a=c+1}return s}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof vh))return 0;let r=0,[s,i,a,l]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=n,i+=n){if(s==a||i==l)return r;let c=this.children[s],d=e.children[i];if(c!=d)return r+c.scanIdentical(d,n);r+=c.length+1}}static from(e,n=e.reduce((r,s)=>r+s.length+1,-1)){let r=0;for(let x of e)r+=x.lines;if(r<32){let x=[];for(let y of e)y.flatten(x);return new Hr(x,n)}let s=Math.max(32,r>>5),i=s<<1,a=s>>1,l=[],c=0,d=-1,h=[];function m(x){let y;if(x.lines>i&&x instanceof vh)for(let w of x.children)m(w);else x.lines>a&&(c>a||!c)?(g(),l.push(x)):x instanceof Hr&&c&&(y=h[h.length-1])instanceof Hr&&x.lines+y.lines<=32?(c+=x.lines,d+=x.length+1,h[h.length-1]=new Hr(y.text.concat(x.text),y.length+1+x.length)):(c+x.lines>s&&g(),c+=x.lines,d+=x.length+1,h.push(x))}function g(){c!=0&&(l.push(h.length==1?h[0]:vh.from(h,d)),d=-1,c=h.length=0)}for(let x of e)m(x);return g(),l.length==1?l[0]:new vh(l,n)}};jn.empty=new Hr([""],0);function uae(t){let e=-1;for(let n of t)e+=n.length+1;return e}function sv(t,e,n=0,r=1e9){for(let s=0,i=0,a=!0;i=n&&(c>r&&(l=l.slice(0,r-s)),s0?1:(e instanceof Hr?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,s=this.nodes[r],i=this.offsets[r],a=i>>1,l=s instanceof Hr?s.text.length:s.children.length;if(a==(n>0?l:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=` -`,this;e--}else if(s instanceof Hr){let c=s.text[a+(n<0?-1:0)];if(this.offsets[r]+=n,c.length>Math.max(0,e))return this.value=e==0?c:n>0?c.slice(e):c.slice(0,c.length-e),this;e-=c.length}else{let c=s.children[a+(n<0?-1:0)];e>c.length?(e-=c.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(c),this.offsets.push(n>0?1:(c instanceof Hr?c.text.length:c.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class rF{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new x0(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<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)*n,this.value=s.length<=r?s:n<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 sF{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:s}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(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"&&(jn.prototype[Symbol.iterator]=function(){return this.iter()},x0.prototype[Symbol.iterator]=rF.prototype[Symbol.iterator]=sF.prototype[Symbol.iterator]=function(){return this});class dae{constructor(e,n,r,s){this.from=e,this.to=n,this.number=r,this.text=s}get length(){return this.to-this.from}}function Yh(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function Ds(t,e,n=!0,r=!0){return lae(t,e,n,r)}function hae(t){return t>=56320&&t<57344}function fae(t){return t>=55296&&t<56320}function gi(t,e){let n=t.charCodeAt(e);if(!fae(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return hae(r)?(n-55296<<10)+(r-56320)+65536:n}function Gj(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function wo(t){return t<65536?1:2}const fk=/\r\n?|\n/;var Rs=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Rs||(Rs={}));class Do{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;ne)return i+(e-s);i+=l}else{if(r!=Rs.Simple&&d>=e&&(r==Rs.TrackDel&&se||r==Rs.TrackBefore&&se))return null;if(d>e||d==e&&n<0&&!l)return e==s||n<0?i:i+c;i+=c}s=d}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return i}touchesRange(e,n=e){for(let r=0,s=0;r=0&&s<=n&&l>=e)return sn?"cover":!0;s=l}return!1}toString(){let e="";for(let n=0;n=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Do(e)}static create(e){return new Do(e)}}class cs extends Do{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return mk(this,(n,r,s,i,a)=>e=e.replace(s,s+(r-n),a),!1),e}mapDesc(e,n=!1){return pk(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let s=0,i=0;s=0){n[s]=l,n[s+1]=a;let c=s>>1;for(;r.length0&&Lc(r,n,i.text),i.forward(h),l+=h}let d=e[a++];for(;l>1].toJSON()))}return e}static of(e,n,r){let s=[],i=[],a=0,l=null;function c(h=!1){if(!h&&!s.length)return;ag||m<0||g>n)throw new RangeError(`Invalid change range ${m} to ${g} (in doc of length ${n})`);let y=x?typeof x=="string"?jn.of(x.split(r||fk)):x:jn.empty,w=y.length;if(m==g&&w==0)return;ma&&Fs(s,m-a,-1),Fs(s,g-m,w),Lc(i,s,y),a=g}}return d(e),c(!l),l}static empty(e){return new cs(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let s=0;sl&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(i.length==1)n.push(i[0],0);else{for(;r.length=0&&n<=0&&n==t[s+1]?t[s]+=e:s>=0&&e==0&&t[s]==0?t[s+1]+=n:r?(t[s]+=e,t[s+1]+=n):t.push(e,n)}function Lc(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r>1])),!(n||a==t.sections.length||t.sections[a+1]<0);)l=t.sections[a++],c=t.sections[a++];e(s,d,i,h,m),s=d,i=h}}}function pk(t,e,n,r=!1){let s=[],i=r?[]:null,a=new z0(t),l=new z0(e);for(let c=-1;;){if(a.done&&l.len||l.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&l.ins==-1){let d=Math.min(a.len,l.len);Fs(s,d,-1),a.forward(d),l.forward(d)}else if(l.ins>=0&&(a.ins<0||c==a.i||a.off==0&&(l.len=0&&c=0){let d=0,h=a.len;for(;h;)if(l.ins==-1){let m=Math.min(h,l.len);d+=m,h-=m,l.forward(m)}else if(l.ins==0&&l.lenc||a.ins>=0&&a.len>c)&&(l||r.length>d),i.forward2(c),a.forward(c)}}}}class z0{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return n>=e.length?jn.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?jn.empty:n[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 Hu{constructor(e,n,r){this.from=e,this.to=n,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,n=-1){let r,s;return this.empty?r=s=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),r==this.from&&s==this.to?this:new Hu(r,s,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return Ae.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Ae.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!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 Ae.range(e.anchor,e.head)}static create(e,n,r){return new Hu(e,n,r)}}class Ae{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Ae.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;re.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 Ae(e.ranges.map(n=>Hu.fromJSON(n)),e.main)}static single(e,n=e){return new Ae([Ae.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,s=0;se?8:0)|i)}static normalized(e,n=0){let r=e[n];e.sort((s,i)=>s.from-i.from),n=e.indexOf(r);for(let s=1;si.head?Ae.range(c,l):Ae.range(l,c))}}return new Ae(e,n)}}function aF(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let Xj=0;class at{constructor(e,n,r,s,i){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=s,this.id=Xj++,this.default=e([]),this.extensions=typeof i=="function"?i(this):i}get reader(){return this}static define(e={}){return new at(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:Yj),!!e.static,e.enables)}of(e){return new iv([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new iv(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new iv(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function Yj(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class iv{constructor(e,n,r,s){this.dependencies=e,this.facet=n,this.type=r,this.value=s,this.id=Xj++}dynamicSlot(e){var n;let r=this.value,s=this.facet.compareInput,i=this.id,a=e[i]>>1,l=this.type==2,c=!1,d=!1,h=[];for(let m of this.dependencies)m=="doc"?c=!0:m=="selection"?d=!0:(((n=e[m.id])!==null&&n!==void 0?n:1)&1)==0&&h.push(e[m.id]);return{create(m){return m.values[a]=r(m),1},update(m,g){if(c&&g.docChanged||d&&(g.docChanged||g.selection)||gk(m,h)){let x=r(m);if(l?!iE(x,m.values[a],s):!s(x,m.values[a]))return m.values[a]=x,1}return 0},reconfigure:(m,g)=>{let x,y=g.config.address[i];if(y!=null){let w=Lv(g,y);if(this.dependencies.every(S=>S instanceof at?g.facet(S)===m.facet(S):S instanceof Os?g.field(S,!1)==m.field(S,!1):!0)||(l?iE(x=r(m),w,s):s(x=r(m),w)))return m.values[a]=w,0}else x=r(m);return m.values[a]=x,1}}}}function iE(t,e,n){if(t.length!=e.length)return!1;for(let r=0;rt[c.id]),s=n.map(c=>c.type),i=r.filter(c=>!(c&1)),a=t[e.id]>>1;function l(c){let d=[];for(let h=0;hr===s),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Yx).find(r=>r.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,s)=>{let i=r.values[n],a=this.updateF(i,s);return this.compareF(i,a)?0:(r.values[n]=a,1)},reconfigure:(r,s)=>{let i=r.facet(Yx),a=s.facet(Yx),l;return(l=i.find(c=>c.field==this))&&l!=a.find(c=>c.field==this)?(r.values[n]=l.create(r),1):s.config.address[this.id]!=null?(r.values[n]=s.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,Yx.of({field:this,create:e})]}get extension(){return this}}const Fu={lowest:4,low:3,default:2,high:1,highest:0};function Im(t){return e=>new oF(e,t)}const ou={highest:Im(Fu.highest),high:Im(Fu.high),default:Im(Fu.default),low:Im(Fu.low),lowest:Im(Fu.lowest)};class oF{constructor(e,n){this.inner=e,this.prec=n}}class nb{of(e){return new xk(this,e)}reconfigure(e){return nb.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class xk{constructor(e,n){this.compartment=e,this.inner=n}}class Iv{constructor(e,n,r,s,i,a){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=s,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,n,r){let s=[],i=Object.create(null),a=new Map;for(let g of pae(e,n,a))g instanceof Os?s.push(g):(i[g.facet.id]||(i[g.facet.id]=[])).push(g);let l=Object.create(null),c=[],d=[];for(let g of s)l[g.id]=d.length<<1,d.push(x=>g.slot(x));let h=r?.config.facets;for(let g in i){let x=i[g],y=x[0].facet,w=h&&h[g]||[];if(x.every(S=>S.type==0))if(l[y.id]=c.length<<1|1,Yj(w,x))c.push(r.facet(y));else{let S=y.combine(x.map(k=>k.value));c.push(r&&y.compare(S,r.facet(y))?r.facet(y):S)}else{for(let S of x)S.type==0?(l[S.id]=c.length<<1|1,c.push(S.value)):(l[S.id]=d.length<<1,d.push(k=>S.dynamicSlot(k)));l[y.id]=d.length<<1,d.push(S=>mae(S,y,x))}}let m=d.map(g=>g(l));return new Iv(e,a,m,l,c,i)}}function pae(t,e,n){let r=[[],[],[],[],[]],s=new Map;function i(a,l){let c=s.get(a);if(c!=null){if(c<=l)return;let d=r[c].indexOf(a);d>-1&&r[c].splice(d,1),a instanceof xk&&n.delete(a.compartment)}if(s.set(a,l),Array.isArray(a))for(let d of a)i(d,l);else if(a instanceof xk){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let d=e.get(a.compartment)||a.inner;n.set(a.compartment,d),i(d,l)}else if(a instanceof oF)i(a.inner,a.prec);else if(a instanceof Os)r[l].push(a),a.provides&&i(a.provides,l);else if(a instanceof iv)r[l].push(a),a.facet.extensions&&i(a.facet.extensions,Fu.default);else{let d=a.extension;if(!d)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);i(d,l)}}return i(t,Fu.default),r.reduce((a,l)=>a.concat(l))}function v0(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let s=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|s}function Lv(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const lF=at.define(),vk=at.define({combine:t=>t.some(e=>e),static:!0}),cF=at.define({combine:t=>t.length?t[0]:void 0,static:!0}),uF=at.define(),dF=at.define(),hF=at.define(),fF=at.define({combine:t=>t.length?t[0]:!1});class Fo{constructor(e,n){this.type=e,this.value=n}static define(){return new gae}}class gae{of(e){return new Fo(this,e)}}class xae{constructor(e){this.map=e}of(e){return new Ft(this,e)}}class Ft{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new Ft(this.type,n)}is(e){return this.type==e}static define(e={}){return new xae(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let s of e){let i=s.map(n);i&&r.push(i)}return r}}Ft.reconfigure=Ft.define();Ft.appendConfig=Ft.define();class ns{constructor(e,n,r,s,i,a){this.startState=e,this.changes=n,this.selection=r,this.effects=s,this.annotations=i,this.scrollIntoView=a,this._doc=null,this._state=null,r&&aF(r,n.newLength),i.some(l=>l.type==ns.time)||(this.annotations=i.concat(ns.time.of(Date.now())))}static create(e,n,r,s,i,a){return new ns(e,n,r,s,i,a)}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 n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(ns.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}ns.time=Fo.define();ns.userEvent=Fo.define();ns.addToHistory=Fo.define();ns.remote=Fo.define();function vae(t,e){let n=[];for(let r=0,s=0;;){let i,a;if(r=t[r]))i=t[r++],a=t[r++];else if(s=0;s--){let i=r[s](t);i instanceof ns?t=i:Array.isArray(i)&&i.length==1&&i[0]instanceof ns?t=i[0]:t=pF(e,Dh(i),!1)}return t}function bae(t){let e=t.startState,n=e.facet(hF),r=t;for(let s=n.length-1;s>=0;s--){let i=n[s](t);i&&Object.keys(i).length&&(r=mF(r,yk(e,i,t.changes.newLength),!0))}return r==t?t:ns.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const wae=[];function Dh(t){return t==null?wae:Array.isArray(t)?t:[t]}var wr=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(wr||(wr={}));const Sae=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let bk;try{bk=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function kae(t){if(bk)return bk.test(t);for(let e=0;e"€"&&(n.toUpperCase()!=n.toLowerCase()||Sae.test(n)))return!0}return!1}function Oae(t){return e=>{if(!/\S/.test(e))return wr.Space;if(kae(e))return wr.Word;for(let n=0;n-1)return wr.Word;return wr.Other}}class bn{constructor(e,n,r,s,i,a){this.config=e,this.doc=n,this.selection=r,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let l=0;ls.set(d,c)),n=null),s.set(l.value.compartment,l.value.extension)):l.is(Ft.reconfigure)?(n=null,r=l.value):l.is(Ft.appendConfig)&&(n=null,r=Dh(r).concat(l.value));let i;n?i=e.startState.values.slice():(n=Iv.resolve(r,s,this),i=new bn(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,d)=>d.reconfigure(c,this),null).values);let a=e.startState.facet(vk)?e.newSelection:e.newSelection.asSingle();new bn(n,e.newDoc,a,i,(l,c)=>c.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:Ae.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),s=this.changes(r.changes),i=[r.range],a=Dh(r.effects);for(let l=1;la.spec.fromJSON(l,c)))}}return bn.create({doc:e.doc,selection:Ae.fromJSON(e.selection),extensions:n.extensions?s.concat([n.extensions]):s})}static create(e={}){let n=Iv.resolve(e.extensions||[],new Map),r=e.doc instanceof jn?e.doc:jn.of((e.doc||"").split(n.staticFacet(bn.lineSeparator)||fk)),s=e.selection?e.selection instanceof Ae?e.selection:Ae.single(e.selection.anchor,e.selection.head):Ae.single(0);return aF(s,r.length),n.staticFacet(vk)||(s=s.asSingle()),new bn(n,r,s,n.dynamicSlots.map(()=>null),(i,a)=>a.create(i),null)}get tabSize(){return this.facet(bn.tabSize)}get lineBreak(){return this.facet(bn.lineSeparator)||` -`}get readOnly(){return this.facet(fF)}phrase(e,...n){for(let r of this.facet(bn.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,s)=>{if(s=="$")return"$";let i=+(s||1);return!i||i>n.length?r:n[i-1]})),e}languageDataAt(e,n,r=-1){let s=[];for(let i of this.facet(lF))for(let a of i(this,n,r))Object.prototype.hasOwnProperty.call(a,e)&&s.push(a[e]);return s}charCategorizer(e){return Oae(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:n,from:r,length:s}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-r,l=e-r;for(;a>0;){let c=Ds(n,a,!1);if(i(n.slice(c,a))!=wr.Word)break;a=c}for(;lt.length?t[0]:4});bn.lineSeparator=cF;bn.readOnly=fF;bn.phrases=at.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(s=>t[s]==e[s])}});bn.languageData=lF;bn.changeFilter=uF;bn.transactionFilter=dF;bn.transactionExtender=hF;nb.reconfigure=Ft.define();function qo(t,e,n={}){let r={};for(let s of t)for(let i of Object.keys(s)){let a=s[i],l=r[i];if(l===void 0)r[i]=a;else if(!(l===a||a===void 0))if(Object.hasOwnProperty.call(n,i))r[i]=n[i](l,a);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 sd{eq(e){return this==e}range(e,n=e){return wk.create(e,n,this)}}sd.prototype.startSide=sd.prototype.endSide=0;sd.prototype.point=!1;sd.prototype.mapMode=Rs.TrackDel;let wk=class gF{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new gF(e,n,r)}};function Sk(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Kj{constructor(e,n,r,s){this.from=e,this.to=n,this.value=r,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,s=0){let i=r?this.to:this.from;for(let a=s,l=i.length;;){if(a==l)return a;let c=a+l>>1,d=i[c]-e||(r?this.value[c].endSide:this.value[c].startSide)-n;if(c==a)return d>=0?a:l;d>=0?l=c:a=c+1}}between(e,n,r,s){for(let i=this.findIndex(n,-1e9,!0),a=this.findIndex(r,1e9,!1,i);ix||g==x&&d.startSide>0&&d.endSide<=0)continue;(x-g||d.endSide-d.startSide)<0||(a<0&&(a=g),d.point&&(l=Math.max(l,x-g)),r.push(d),s.push(g-a),i.push(x-a))}return{mapped:r.length?new Kj(s,i,r,l):null,pos:a}}}class Rn{constructor(e,n,r,s){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=s}static create(e,n,r,s){return new Rn(e,n,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 n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:s=0,filterTo:i=this.length}=e,a=e.filter;if(n.length==0&&!a)return this;if(r&&(n=n.slice().sort(Sk)),this.isEmpty)return n.length?Rn.of(n):this;let l=new xF(this,null,-1).goto(0),c=0,d=[],h=new Fl;for(;l.value||c=0){let m=n[c++];h.addInner(m.from,m.to,m.value)||d.push(m)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||il.to||i=i&&e<=i+a.length&&a.between(i,e-i,n-i,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return I0.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return I0.from(e).goto(n)}static compare(e,n,r,s,i=-1){let a=e.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=i),l=n.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=i),c=aE(a,l,r),d=new Lm(a,c,i),h=new Lm(l,c,i);r.iterGaps((m,g,x)=>oE(d,m,h,g,x,s)),r.empty&&r.length==0&&oE(d,0,h,0,0,s)}static eq(e,n,r=0,s){s==null&&(s=999999999);let i=e.filter(h=>!h.isEmpty&&n.indexOf(h)<0),a=n.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let l=aE(i,a),c=new Lm(i,l,0).goto(r),d=new Lm(a,l,0).goto(r);for(;;){if(c.to!=d.to||!kk(c.active,d.active)||c.point&&(!d.point||!c.point.eq(d.point)))return!1;if(c.to>s)return!0;c.next(),d.next()}}static spans(e,n,r,s,i=-1){let a=new Lm(e,null,i).goto(n),l=n,c=a.openStart;for(;;){let d=Math.min(a.to,r);if(a.point){let h=a.activeForPoint(a.to),m=a.pointFroml&&(s.span(l,d,a.active,c),c=a.openEnd(d));if(a.to>r)return c+(a.point&&a.to>r?1:0);l=a.to,a.next()}}static of(e,n=!1){let r=new Fl;for(let s of e instanceof wk?[e]:n?jae(e):e)r.add(s.from,s.to,s.value);return r.finish()}static join(e){if(!e.length)return Rn.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let s=e[r];s!=Rn.empty;s=s.nextLayer)n=new Rn(s.chunkPos,s.chunk,n,Math.max(s.maxPoint,n.maxPoint));return n}}Rn.empty=new Rn([],[],null,-1);function jae(t){if(t.length>1)for(let e=t[0],n=1;n0)return t.slice().sort(Sk);e=r}return t}Rn.empty.nextLayer=Rn.empty;class Fl{finishChunk(e){this.chunks.push(new Kj(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,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new Fl)).add(e,n,r)}addInner(e,n,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(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(Rn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=Rn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function aE(t,e,n){let r=new Map;for(let i of t)for(let a=0;a=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=r&&s.push(new xF(a,n,r,i));return s.length==1?s[0]:new I0(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)C4(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)C4(this.heap,r);(this.to-e||this.value.endSide-n)<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(),C4(this.heap,0)}}}function C4(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let s=t[r];if(r+1=0&&(s=t[r+1],r++),n.compare(s)<0)break;t[r]=n,t[e]=s,e=r}}class Lm{constructor(e,n,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=I0.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){Kx(this.active,e),Kx(this.activeTo,e),Kx(this.activeRank,e),this.minActive=lE(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:s,rank:i}=this.cursor;for(;n0;)n++;Zx(this.active,n,r),Zx(this.activeTo,n,s),Zx(this.activeRank,n,i),e&&Zx(e,n,this.cursor.from),this.minActive=lE(this.active,this.activeTo)}next(){let e=this.to,n=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&&Kx(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(n&&this.cursor.to==this.to&&this.cursor.from=0&&r[s]=0&&!(this.activeRank[r]e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function oE(t,e,n,r,s,i){t.goto(e),n.goto(r);let a=r+s,l=r,c=r-e;for(;;){let d=t.to+c-n.to,h=d||t.endSide-n.endSide,m=h<0?t.to+c:n.to,g=Math.min(m,a);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&kk(t.activeForPoint(t.to),n.activeForPoint(n.to))||i.comparePoint(l,g,t.point,n.point):g>l&&!kk(t.active,n.active)&&i.compareRange(l,g,t.active,n.active),m>a)break;(d||t.openEnd!=n.openEnd)&&i.boundChange&&i.boundChange(m),l=m,h<=0&&t.next(),h>=0&&n.next()}}function kk(t,e){if(t.length!=e.length)return!1;for(let n=0;n=e;r--)t[r+1]=t[r];t[e]=n}function lE(t,e){let n=-1,r=1e9;for(let s=0;s=e)return s;if(s==t.length)break;i+=t.charCodeAt(s)==9?n-i%n:1,s=Ds(t,s)}return r===!0?-1:t.length}const jk="ͼ",cE=typeof Symbol>"u"?"__"+jk:Symbol.for(jk),Nk=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),uE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Wc{constructor(e,n){this.rules=[];let{finish:r}=n||{};function s(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function i(a,l,c,d){let h=[],m=/^@(\w+)\b/.exec(a[0]),g=m&&m[1]=="keyframes";if(m&&l==null)return c.push(a[0]+";");for(let x in l){let y=l[x];if(/&/.test(x))i(x.split(/,\s*/).map(w=>a.map(S=>w.replace(/&/,S))).reduce((w,S)=>w.concat(S)),y,c);else if(y&&typeof y=="object"){if(!m)throw new RangeError("The value of a property ("+x+") should be a primitive value.");i(s(x),y,h,g)}else y!=null&&h.push(x.replace(/_.*/,"").replace(/[A-Z]/g,w=>"-"+w.toLowerCase())+": "+y+";")}(h.length||g)&&c.push((r&&!m&&!d?a.map(r):a).join(", ")+" {"+h.join(" ")+"}")}for(let a in e)i(s(a),e[a],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let e=uE[cE]||1;return uE[cE]=e+1,jk+e.toString(36)}static mount(e,n,r){let s=e[Nk],i=r&&r.nonce;s?i&&s.setNonce(i):s=new Nae(e,i),s.mount(Array.isArray(n)?n:[n],e)}}let dE=new Map;class Nae{constructor(e,n){let r=e.ownerDocument||e,s=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let i=dE.get(r);if(i)return e[Nk]=i;this.sheet=new s.CSSStyleSheet,dE.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[Nk]=this}mount(e,n){let r=this.sheet,s=0,i=0;for(let a=0;a-1&&(this.modules.splice(c,1),i--,c=-1),c==-1){if(this.modules.splice(i++,0,l),r)for(let d=0;d",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Cae=typeof navigator<"u"&&/Mac/.test(navigator.platform),Tae=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var As=0;As<10;As++)Gc[48+As]=Gc[96+As]=String(As);for(var As=1;As<=24;As++)Gc[As+111]="F"+As;for(var As=65;As<=90;As++)Gc[As]=String.fromCharCode(As+32),L0[As]=String.fromCharCode(As);for(var T4 in Gc)L0.hasOwnProperty(T4)||(L0[T4]=Gc[T4]);function Eae(t){var e=Cae&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Tae&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?L0:Gc)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function sr(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var s=n[r];typeof s=="string"?t.setAttribute(r,s):s!=null&&(t[r]=s)}e++}for(;e2);var et={mac:fE||/Mac/.test(Ks.platform),windows:/Win/.test(Ks.platform),linux:/Linux|X11/.test(Ks.platform),ie:rb,ie_version:yF?Ck.documentMode||6:Ek?+Ek[1]:Tk?+Tk[1]:0,gecko:hE,gecko_version:hE?+(/Firefox\/(\d+)/.exec(Ks.userAgent)||[0,0])[1]:0,chrome:!!E4,chrome_version:E4?+E4[1]:0,ios:fE,android:/Android\b/.test(Ks.userAgent),webkit_version:_ae?+(/\bAppleWebKit\/(\d+)/.exec(Ks.userAgent)||[0,0])[1]:0,safari:_k,safari_version:_k?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Ks.userAgent)||[0,0])[1]:0,tabSize:Ck.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function B0(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Mk(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function av(t,e){if(!e.anchorNode)return!1;try{return Mk(t,e.anchorNode)}catch{return!1}}function Kh(t){return t.nodeType==3?ad(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function y0(t,e,n,r){return n?mE(t,e,n,r,-1)||mE(t,e,n,r,1):!1}function id(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Bv(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function mE(t,e,n,r,s){for(;;){if(t==n&&e==r)return!0;if(e==(s<0?0:Io(t))){if(t.nodeName=="DIV")return!1;let i=t.parentNode;if(!i||i.nodeType!=1)return!1;e=id(t)+(s<0?0:1),t=i}else if(t.nodeType==1){if(t=t.childNodes[e+(s<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=s<0?Io(t):0}else return!1}}function Io(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Bp(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function Mae(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function bF(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function Aae(t,e,n,r,s,i,a,l){let c=t.ownerDocument,d=c.defaultView||window;for(let h=t,m=!1;h&&!m;)if(h.nodeType==1){let g,x=h==c.body,y=1,w=1;if(x)g=Mae(d);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(m=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let j=h.getBoundingClientRect();({scaleX:y,scaleY:w}=bF(h,j)),g={left:j.left,right:j.left+h.clientWidth*y,top:j.top,bottom:j.top+h.clientHeight*w}}let S=0,k=0;if(s=="nearest")e.top0&&e.bottom>g.bottom+k&&(k=e.bottom-g.bottom+a)):e.bottom>g.bottom&&(k=e.bottom-g.bottom+a,n<0&&e.top-k0&&e.right>g.right+S&&(S=e.right-g.right+i)):e.right>g.right&&(S=e.right-g.right+i,n<0&&e.leftg.bottom||e.leftg.right)&&(e={left:Math.max(e.left,g.left),right:Math.min(e.right,g.right),top:Math.max(e.top,g.top),bottom:Math.min(e.bottom,g.bottom)}),h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function Rae(t){let e=t.ownerDocument,n,r;for(let s=t.parentNode;s&&!(s==e.body||n&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),!n&&s.scrollWidth>s.clientWidth&&(n=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:n,y:r}}class Dae{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:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?Io(n):0),r,Math.min(e.focusOffset,r?Io(r):0))}set(e,n,r,s){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=s}}let Iu=null;et.safari&&et.safari_version>=26&&(Iu=!1);function wF(t){if(t.setActive)return t.setActive();if(Iu)return t.focus(Iu);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(Iu==null?{get preventScroll(){return Iu={preventScroll:!0},!0}}:void 0),!Iu){Iu=!1;for(let n=0;nMath.max(1,t.scrollHeight-t.clientHeight-4)}function OF(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=Io(n)}else if(n.parentNode&&!Bv(n))r=id(n),n=n.parentNode;else return null}}function jF(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&rn)return m.domBoundsAround(e,n,d);if(g>=e&&s==-1&&(s=c,i=d),d>n&&m.dom.parentNode==this.dom){a=c,l=h;break}h=g,d=g+m.breakAfter}return{from:i,to:l<0?r+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:a=0?this.children[a].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let n=this.parent;n;n=n.parent){if(e&&(n.flags|=2),n.flags&1)return;n.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 n=e.parent;if(!n)return e;e=n}}replaceChildren(e,n,r=Zj){this.markDirty();for(let s=e;sthis.pos||e==this.pos&&(n>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 CF(t,e,n,r,s,i,a,l,c){let{children:d}=t,h=d.length?d[e]:null,m=i.length?i[i.length-1]:null,g=m?m.breakAfter:a;if(!(e==r&&h&&!a&&!g&&i.length<2&&h.merge(n,s,i.length?m:null,n==0,l,c))){if(r0&&(!a&&i.length&&h.merge(n,h.length,i[0],!1,l,0)?h.breakAfter=i.shift().breakAfter:(nIae||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(n),this.markDirty(),!0)}split(e){let n=new Ya(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),n.flags|=this.flags&8,n}localPosFromDOM(e,n){return e==this.dom?n:n?this.text.length:0}domAtPos(e){return new Hs(this.dom,e)}domBoundsAround(e,n,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,n){return Lae(this.dom,e,n)}}class ql extends er{constructor(e,n=[],r=0){super(),this.mark=e,this.children=n,this.length=r;for(let s of n)s.setParent(this)}setAttrs(e){if(SF(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let n in this.mark.attrs)e.setAttribute(n,this.mark.attrs[n]);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,n){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,n)}merge(e,n,r,s,i,a){return r&&(!(r instanceof ql&&r.mark.eq(this.mark))||e&&i<=0||ne&&n.push(r=e&&(s=i),r=c,i++}let a=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new ql(this.mark,n,a)}domAtPos(e){return EF(this,e)}coordsAt(e,n){return MF(this,e,n)}}function Lae(t,e,n){let r=t.nodeValue.length;e>r&&(e=r);let s=e,i=e,a=0;e==0&&n<0||e==r&&n>=0?et.chrome||et.gecko||(e?(s--,a=1):i=0)?0:l.length-1];return et.safari&&!a&&c.width==0&&(c=Array.prototype.find.call(l,d=>d.width)||c),a?Bp(c,a<0):c||null}class _l extends er{static create(e,n,r){return new _l(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=_l.create(this.widget,this.length-e,this.side);return this.length-=e,n}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,n,r,s,i,a){return r&&(!(r instanceof _l)||!this.widget.compare(r.widget)||e>0&&i<=0||n0)?Hs.before(this.dom):Hs.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;let s=this.dom.getClientRects(),i=null;if(!s.length)return null;let a=this.side?this.side<0:e>0;for(let l=a?s.length-1:0;i=s[l],!(e>0?l==0:l==s.length-1||i.top0?Hs.before(this.dom):Hs.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return jn.empty}get isHidden(){return!0}}Ya.prototype.children=_l.prototype.children=Zh.prototype.children=Zj;function EF(t,e){let n=t.dom,{children:r}=t,s=0;for(let i=0;si&&e0;i--){let a=r[i-1];if(a.dom.parentNode==n)return a.domAtPos(a.length)}for(let i=s;i0&&e instanceof ql&&s.length&&(r=s[s.length-1])instanceof ql&&r.mark.eq(e.mark)?_F(r,e.children[0],n-1):(s.push(e),e.setParent(t)),t.length+=e.length}function MF(t,e,n){let r=null,s=-1,i=null,a=-1;function l(d,h){for(let m=0,g=0;m=h&&(x.children.length?l(x,h-g):(!i||i.isHidden&&(n>0||Fae(i,x)))&&(y>h||g==y&&x.getSide()>0)?(i=x,a=h-g):(g-1?1:0)!=s.length-(n&&s.indexOf(n)>-1?1:0))return!1;for(let i of r)if(i!=n&&(s.indexOf(i)==-1||t[i]!==e[i]))return!1;return!0}function Rk(t,e,n){let r=!1;if(e)for(let s in e)n&&s in n||(r=!0,s=="style"?t.style.cssText="":t.removeAttribute(s));if(n)for(let s in n)e&&e[s]==n[s]||(r=!0,s=="style"?t.style.cssText=n[s]:t.setAttribute(s,n[s]));return r}function qae(t){let e=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new Xc(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,s;if(e.isBlockGap)r=-5e8,s=4e8;else{let{start:i,end:a}=AF(e,n);r=(i?n?-3e8:-1:5e8)-1,s=(a?n?2e8:1:-6e8)+1}return new Xc(e,r,s,n,e.widget||null,!0)}static line(e){return new qp(e)}static set(e,n=!1){return Rn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}kt.none=Rn.empty;class Fp extends kt{constructor(e){let{start:n,end:r}=AF(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var n,r;return this==e||e instanceof Fp&&this.tagName==e.tagName&&(this.class||((n=this.attrs)===null||n===void 0?void 0:n.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&Fv(this.attrs,e.attrs,"class")}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}Fp.prototype.point=!1;class qp extends kt{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof qp&&this.spec.class==e.spec.class&&Fv(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}qp.prototype.mapMode=Rs.TrackBefore;qp.prototype.point=!0;class Xc extends kt{constructor(e,n,r,s,i,a){super(n,r,i,e),this.block=s,this.isReplace=a,this.mapMode=s?n<=0?Rs.TrackBefore:Rs.TrackAfter:Rs.TrackDel}get type(){return this.startSide!=this.endSide?ti.WidgetRange:this.startSide<=0?ti.WidgetBefore:ti.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Xc&&$ae(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}Xc.prototype.point=!0;function AF(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function $ae(t,e){return t==e||!!(t&&e&&t.compare(e))}function ov(t,e,n,r=0){let s=n.length-1;s>=0&&n[s]+r>=t?n[s]=Math.max(n[s],e):n.push(t,e)}class es extends er{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,n,r,s,i,a){if(r){if(!(r instanceof es))return!1;this.dom||r.transferDOM(this)}return s&&this.setDeco(r?r.attrs:null),TF(this,e,n,r?r.children.slice():[],i,a),!0}split(e){let n=new es;if(n.breakAfter=this.breakAfter,this.length==0)return n;let{i:r,off:s}=this.childPos(e);s&&(n.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;i0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,n}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){Fv(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){_F(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=Ak(n,this.attrs||{})),r&&(this.attrs=Ak({class:r},this.attrs||{}))}domAtPos(e){return EF(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(SF(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&&(Rk(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,n);let s=this.dom.lastChild;for(;s&&er.get(s)instanceof ql;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((r=er.get(s))===null||r===void 0?void 0:r.isEditable)==!1&&(!et.ios||!this.children.some(i=>i instanceof Ya))){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,n;for(let r of this.children){if(!(r instanceof Ya)||/[^ -~]/.test(r.text))return null;let s=Kh(r.dom);if(s.length!=1)return null;e+=s[0].width,n=s[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:n}:null}coordsAt(e,n){let r=MF(this,e,n);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=n){if(i instanceof es)return i;if(a>n)break}s=a+i.breakAfter}return null}}class zl extends er{constructor(e,n,r){super(),this.widget=e,this.length=n,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,n,r,s,i,a){return r&&(!(r instanceof zl)||!this.widget.compare(r.widget)||e>0&&i<=0||n0}}class Dk extends $o{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 b0{constructor(e,n,r,s){this.doc=e,this.pos=n,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=n}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 zl&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new es),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Jx(new Zh(-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 zl)&&this.getLine()}buildText(e,n,r){for(;e>0;){if(this.textOff==this.text.length){let{value:a,lineBreak:l,done:c}=this.cursor.next(this.skip);if(this.skip=0,c)throw new Error("Ran out of text content when drawing inline views");if(l){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=a,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e),i=Math.min(s,512);this.flushBuffer(n.slice(n.length-r)),this.getLine().append(Jx(new Ya(this.text.slice(this.textOff,this.textOff+i)),n),r),this.atCursorPos=!0,this.textOff+=i,e-=i,r=s<=i?0:n.length}}span(e,n,r,s){this.buildText(n-e,r,s),this.pos=n,this.openStart<0&&(this.openStart=s)}point(e,n,r,s,i,a){if(this.disallowBlockEffectsFor[a]&&r instanceof Xc){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=n-e;if(r instanceof Xc)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new zl(r.widget||Jh.block,l,r));else{let c=_l.create(r.widget||Jh.inline,l,l?0:r.startSide),d=this.atCursorPos&&!c.isEditable&&i<=s.length&&(e0),h=!c.isEditable&&(es.length||r.startSide<=0),m=this.getLine();this.pendingBuffer==2&&!d&&!c.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),d&&(m.append(Jx(new Zh(1),s),i),i=s.length+Math.max(0,i-s.length)),m.append(Jx(c,s),i),this.atCursorPos=h,this.pendingBuffer=h?es.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=n),this.openStart<0&&(this.openStart=i)}static build(e,n,r,s,i){let a=new b0(e,n,r,i);return a.openEnd=Rn.spans(s,n,r,a),a.openStart<0&&(a.openStart=a.openEnd),a.finish(a.openEnd),a}}function Jx(t,e){for(let n of e)t=new ql(n,[t],t.length);return t}class Jh extends $o{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}}Jh.inline=new Jh("span");Jh.block=new Jh("div");var gr=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(gr||(gr={}));const od=gr.LTR,Jj=gr.RTL;function RF(t){let e=[];for(let n=0;n=n){if(l.level==r)return a;(i<0||(s!=0?s<0?l.fromn:e[i].level>l.level))&&(i=a)}}if(i<0)throw new RangeError("Index out of range");return i}}function PF(t,e){if(t.length!=e.length)return!1;for(let n=0;n=0;w-=3)if(ho[w+1]==-x){let S=ho[w+2],k=S&2?s:S&4?S&1?i:s:0;k&&(ir[m]=ir[ho[w]]=k),l=w;break}}else{if(ho.length==189)break;ho[l++]=m,ho[l++]=g,ho[l++]=c}else if((y=ir[m])==2||y==1){let w=y==s;c=w?0:1;for(let S=l-3;S>=0;S-=3){let k=ho[S+2];if(k&2)break;if(w)ho[S+2]|=2;else{if(k&4)break;ho[S+2]|=4}}}}}function Gae(t,e,n,r){for(let s=0,i=r;s<=n.length;s++){let a=s?n[s-1].to:t,l=sc;)y==S&&(y=n[--w].from,S=w?n[w-1].to:t),ir[--y]=x;c=h}else i=d,c++}}}function zk(t,e,n,r,s,i,a){let l=r%2?2:1;if(r%2==s%2)for(let c=e,d=0;cc&&a.push(new Bc(c,w.from,x));let S=w.direction==od!=!(x%2);Ik(t,S?r+1:r,s,w.inner,w.from,w.to,a),c=w.to}y=w.to}else{if(y==n||(h?ir[y]!=l:ir[y]==l))break;y++}g?zk(t,c,y,r+1,s,g,a):ce;){let h=!0,m=!1;if(!d||c>i[d-1].to){let w=ir[c-1];w!=l&&(h=!1,m=w==16)}let g=!h&&l==1?[]:null,x=h?r:r+1,y=c;e:for(;;)if(d&&y==i[d-1].to){if(m)break e;let w=i[--d];if(!h)for(let S=w.from,k=d;;){if(S==e)break e;if(k&&i[k-1].to==S)S=i[--k].from;else{if(ir[S-1]==l)break e;break}}if(g)g.push(w);else{w.toir.length;)ir[ir.length]=256;let r=[],s=e==od?0:1;return Ik(t,s,s,n,0,t.length,r),r}function zF(t){return[new Bc(0,t,0)]}let IF="";function Yae(t,e,n,r,s){var i;let a=r.head-t.from,l=Bc.find(e,a,(i=r.bidiLevel)!==null&&i!==void 0?i:-1,r.assoc),c=e[l],d=c.side(s,n);if(a==d){let g=l+=s?1:-1;if(g<0||g>=e.length)return null;c=e[l=g],a=c.side(!s,n),d=c.side(s,n)}let h=Ds(t.text,a,c.forward(s,n));(hc.to)&&(h=d),IF=t.text.slice(Math.min(a,h),Math.max(a,h));let m=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return m&&h==d&&m.level+(s?0:1)t.some(e=>e)}),VF=at.define({combine:t=>t.some(e=>e)}),UF=at.define();class zh{constructor(e,n="nearest",r="nearest",s=5,i=5,a=!1){this.range=e,this.y=n,this.x=r,this.yMargin=s,this.xMargin=i,this.isSnapshot=a}map(e){return e.empty?this:new zh(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 zh(Ae.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const e1=Ft.define({map:(t,e)=>t.map(e)}),WF=Ft.define();function vi(t,e,n){let r=t.facet(qF);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const Tl=at.define({combine:t=>t.length?t[0]:!0});let Zae=0;const Nh=at.define({combine(t){return t.filter((e,n)=>{for(let r=0;r{let c=[];return a&&c.push(F0.of(d=>{let h=d.plugin(l);return h?a(h):kt.none})),i&&c.push(i(l)),c})}static fromClass(e,n){return Vr.define((r,s)=>new e(r,s),n)}}class _4{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 n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(vi(n.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(n){vi(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){vi(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const GF=at.define(),n6=at.define(),F0=at.define(),XF=at.define(),$p=at.define(),YF=at.define();function vE(t,e){let n=t.state.facet(YF);if(!n.length)return n;let r=n.map(i=>i instanceof Function?i(t):i),s=[];return Rn.spans(r,e.from,e.to,{point(){},span(i,a,l,c){let d=i-e.from,h=a-e.from,m=s;for(let g=l.length-1;g>=0;g--,c--){let x=l[g].spec.bidiIsolate,y;if(x==null&&(x=Kae(e.text,d,h)),c>0&&m.length&&(y=m[m.length-1]).to==d&&y.direction==x)y.to=h,m=y.inner;else{let w={from:d,to:h,direction:x,inner:[]};m.push(w),m=w.inner}}}}),s}const KF=at.define();function r6(t){let e=0,n=0,r=0,s=0;for(let i of t.state.facet(KF)){let a=i(t);a&&(a.left!=null&&(e=Math.max(e,a.left)),a.right!=null&&(n=Math.max(n,a.right)),a.top!=null&&(r=Math.max(r,a.top)),a.bottom!=null&&(s=Math.max(s,a.bottom)))}return{left:e,right:n,top:r,bottom:s}}const s0=at.define();class Na{constructor(e,n,r,s){this.fromA=e,this.toA=n,this.fromB=r,this.toB=s}join(e){return new Na(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 n=e.length,r=this;for(;n>0;n--){let s=e[n-1];if(!(s.fromA>r.toA)){if(s.toAh)break;i+=2}if(!c)return r;new Na(c.fromA,c.toA,c.fromB,c.toB).addToSet(r),a=c.toA,l=c.toB}}}class qv{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=cs.empty(this.startState.doc.length);for(let i of r)this.changes=this.changes.compose(i.changes);let s=[];this.changes.iterChangedRanges((i,a,l,c)=>s.push(new Na(i,a,l,c))),this.changedRanges=s}static create(e,n,r){return new qv(e,n,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 yE extends er{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=kt.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 es],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Na(0,0,0,e.state.doc.length)],0,null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:d,toA:h})=>hthis.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&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?s=this.domChanged.newSel.head:!ioe(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let i=s>-1?eoe(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:d,to:h}=this.hasComposition;r=new Na(d,h,e.changes.mapPos(d,-1),e.changes.mapPos(h,1)).addToSet(r.slice())}this.hasComposition=i?{from:i.range.fromB,to:i.range.toB}:null,(et.ie||et.chrome)&&!i&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,l=this.updateDeco(),c=roe(a,l,e.changes);return r=Na.extendWithRanges(r,c),!(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,n,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,n,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 a=et.chrome||et.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,a),this.flags&=-8,a&&(a.written||s.selectionRange.focusNode!=a.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(a=>a.flags&=-9);let i=[];if(this.view.viewport.from||this.view.viewport.to=0?s[a]:null;if(!l)break;let{fromA:c,toA:d,fromB:h,toB:m}=l,g,x,y,w;if(r&&r.range.fromBh){let T=b0.build(this.view.state.doc,h,r.range.fromB,this.decorations,this.dynamicDecorationMap),E=b0.build(this.view.state.doc,r.range.toB,m,this.decorations,this.dynamicDecorationMap);x=T.breakAtStart,y=T.openStart,w=E.openEnd;let _=this.compositionView(r);E.breakAtStart?_.breakAfter=1:E.content.length&&_.merge(_.length,_.length,E.content[0],!1,E.openStart,0)&&(_.breakAfter=E.content[0].breakAfter,E.content.shift()),T.content.length&&_.merge(0,0,T.content[T.content.length-1],!0,0,T.openEnd)&&T.content.pop(),g=T.content.concat(_).concat(E.content)}else({content:g,breakAtStart:x,openStart:y,openEnd:w}=b0.build(this.view.state.doc,h,m,this.decorations,this.dynamicDecorationMap));let{i:S,off:k}=i.findPos(d,1),{i:j,off:N}=i.findPos(c,-1);CF(this,j,N,S,k,g,x,y,w)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(WF)&&(this.editContextFormatting=r.value)}compositionView(e){let n=new Ya(e.text.nodeValue);n.flags|=8;for(let{deco:s}of e.marks)n=new ql(s,[n],n.length);let r=new es;return r.append(n,0),r}fixCompositionDOM(e){let n=(i,a)=>{a.flags|=8|(a.children.some(c=>c.flags&7)?1:0),this.markedForComposition.add(a);let l=er.get(i);l&&l!=a&&(l.dom=null),a.setDOM(i)},r=this.childPos(e.range.fromB,1),s=this.children[r.i];n(e.line,s);for(let i=e.marks.length-1;i>=-1;i--)r=s.childPos(r.off,1),s=s.children[r.i],n(i>=0?e.marks[i].node:e.text,s)}updateSelection(e=!1,n=!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(Tl)||this.dom.tabIndex>-1)&&av(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(s||n||i))return;let a=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,c=this.moveToLine(this.domAtPos(l.anchor)),d=l.empty?c:this.moveToLine(this.domAtPos(l.head));if(et.gecko&&l.empty&&!this.hasComposition&&Jae(c)){let m=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(m,c.node.childNodes[c.offset]||null)),c=d=new Hs(m,0),a=!0}let h=this.view.observer.selectionRange;(a||!h.focusNode||(!y0(c.node,c.offset,h.anchorNode,h.anchorOffset)||!y0(d.node,d.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{et.android&&et.chrome&&this.dom.contains(h.focusNode)&&soe(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let m=B0(this.view.root);if(m)if(l.empty){if(et.gecko){let g=toe(c.node,c.offset);if(g&&g!=3){let x=(g==1?OF:jF)(c.node,c.offset);x&&(c=new Hs(x.node,x.offset))}}m.collapse(c.node,c.offset),l.bidiLevel!=null&&m.caretBidiLevel!==void 0&&(m.caretBidiLevel=l.bidiLevel)}else if(m.extend){m.collapse(c.node,c.offset);try{m.extend(d.node,d.offset)}catch{}}else{let g=document.createRange();l.anchor>l.head&&([c,d]=[d,c]),g.setEnd(d.node,d.offset),g.setStart(c.node,c.offset),m.removeAllRanges(),m.addRange(g)}i&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,d)),this.impreciseAnchor=c.precise?null:new Hs(h.anchorNode,h.anchorOffset),this.impreciseHead=d.precise?null:new Hs(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&y0(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=B0(e.root),{anchorNode:s,anchorOffset:i}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let a=es.find(this,n.head);if(!a)return;let l=a.posAtStart;if(n.head==l||n.head==l+a.length)return;let c=this.coordsAt(n.head,-1),d=this.coordsAt(n.head,1);if(!c||!d||c.bottom>d.top)return;let h=this.domAtPos(n.head+n.assoc);r.collapse(h.node,h.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let m=e.observer.selectionRange;e.docView.posFromDOM(m.anchorNode,m.anchorOffset)!=n.from&&r.collapse(s,i)}moveToLine(e){let n=this.dom,r;if(e.node!=n)return e;for(let s=e.offset;!r&&s=0;s--){let i=er.get(n.childNodes[s]);i instanceof es&&(r=i.domAtPos(i.length))}return r?new Hs(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=er.get(n);if(r&&r.rootView==this)return r;n=n.parentNode}return null}posFromDOM(e,n){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,n)+r.posAtStart}domAtPos(e){let{i:n,off:r}=this.childCursor().findPos(e,-1);for(;n=0;a--){let l=this.children[a],c=i-l.breakAfter,d=c-l.length;if(ce||l.covers(1))&&(!r||l instanceof es&&!(r instanceof es&&n>=0)))r=l,s=d;else if(r&&d==e&&c==e&&l instanceof zl&&Math.abs(n)<2){if(l.deco.startSide<0)break;a&&(r=null)}i=d}return r?r.coordsAt(e-s,n):null}coordsForChar(e){let{i:n,off:r}=this.childPos(e,1),s=this.children[n];if(!(s instanceof es))return null;for(;s.children.length;){let{i:l,off:c}=s.childPos(r,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}r=c}if(!(s instanceof Ya))return null;let i=Ds(s.text,r);if(i==r)return null;let a=ad(s.dom,r,i).getClientRects();for(let l=0;lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,c=this.view.textDirection==gr.LTR;for(let d=0,h=0;hs)break;if(d>=r){let x=m.dom.getBoundingClientRect();if(n.push(x.height),a){let y=m.dom.lastChild,w=y?Kh(y):[];if(w.length){let S=w[w.length-1],k=c?S.right-x.left:x.right-S.left;k>l&&(l=k,this.minWidth=i,this.minWidthFrom=d,this.minWidthTo=g)}}}d=g+m.breakAfter}return n}textDirectionAt(e){let{i:n}=this.childPos(e,1);return getComputedStyle(this.children[n].dom).direction=="rtl"?gr.RTL:gr.LTR}measureTextSize(){for(let i of this.children)if(i instanceof es){let a=i.measureTextSize();if(a)return a}let e=document.createElement("div"),n,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=Kh(e.firstChild)[0];n=e.getBoundingClientRect().height,r=i?i.width/27:7,s=i?i.height:n,e.remove()}),{lineHeight:n,charWidth:r,textHeight:s}}childCursor(e=this.length){let n=this.children.length;return n&&(e-=this.children[--n].length),new NF(this.children,e,n)}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,s=0;;s++){let i=s==n.viewports.length?null:n.viewports[s],a=i?i.from-1:this.length;if(a>r){let l=(n.lineBlockAt(a).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(kt.replace({widget:new Dk(l),block:!0,inclusive:!0,isBlockGap:!0}).range(r,a))}if(!i)break;r=i.to+1}return kt.set(e)}updateDeco(){let e=1,n=this.view.state.facet(F0).map(i=>(this.dynamicDecorationMap[e++]=typeof i=="function")?i(this.view):i),r=!1,s=this.view.state.facet(XF).map((i,a)=>{let l=typeof i=="function";return l&&(r=!0),l?i(this.view):i});for(s.length&&(this.dynamicDecorationMap[e++]=r,n.push(Rn.join(s))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];en.anchor?-1:1),s;if(!r)return;!n.empty&&(s=this.coordsAt(n.anchor,n.anchor>n.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=r6(this.view),a={left:r.left-i.left,top:r.top-i.top,right:r.right+i.right,bottom:r.bottom+i.bottom},{offsetWidth:l,offsetHeight:c}=this.view.scrollDOM;Aae(this.view.scrollDOM,a,n.heads instanceof _l||s.children.some(r);return r(this.children[n])}}function Jae(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function ZF(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=OF(n.focusNode,n.focusOffset),s=jF(n.focusNode,n.focusOffset),i=r||s;if(s&&r&&s.node!=r.node){let l=er.get(s.node);if(!l||l instanceof Ya&&l.text!=s.node.nodeValue)i=s;else if(t.docView.lastCompositionAfterCursor){let c=er.get(r.node);!c||c instanceof Ya&&c.text!=r.node.nodeValue||(i=s)}}if(t.docView.lastCompositionAfterCursor=i!=r,!i)return null;let a=e-i.offset;return{from:a,to:a+i.node.nodeValue.length,node:i.node}}function eoe(t,e,n){let r=ZF(t,n);if(!r)return null;let{node:s,from:i,to:a}=r,l=s.nodeValue;if(/[\n\r]/.test(l)||t.state.doc.sliceString(r.from,r.to)!=l)return null;let c=e.invertedDesc,d=new Na(c.mapPos(i),c.mapPos(a),i,a),h=[];for(let m=s.parentNode;;m=m.parentNode){let g=er.get(m);if(g instanceof ql)h.push({node:m,deco:g.mark});else{if(g instanceof es||m.nodeName=="DIV"&&m.parentNode==t.contentDOM)return{range:d,text:s,marks:h,line:m};if(m!=t.contentDOM)h.push({node:m,deco:new Fp({inclusive:!0,attributes:qae(m),tagName:m.tagName.toLowerCase()})});else return null}}}function toe(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e{re.from&&(n=!0)}),n}function aoe(t,e,n=1){let r=t.charCategorizer(e),s=t.doc.lineAt(e),i=e-s.from;if(s.length==0)return Ae.cursor(e);i==0?n=1:i==s.length&&(n=-1);let a=i,l=i;n<0?a=Ds(s.text,i,!1):l=Ds(s.text,i);let c=r(s.text.slice(a,l));for(;a>0;){let d=Ds(s.text,a,!1);if(r(s.text.slice(d,a))!=c)break;a=d}for(;lt?e.left-t:Math.max(0,t-e.right)}function loe(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function M4(t,e){return t.tope.top+1}function bE(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function Bk(t,e,n){let r,s,i,a,l=!1,c,d,h,m;for(let y=t.firstChild;y;y=y.nextSibling){let w=Kh(y);for(let S=0;SN||a==N&&i>j)&&(r=y,s=k,i=j,a=N,l=j?e0:Sk.bottom&&(!h||h.bottomk.top)&&(d=y,m=k):h&&M4(h,k)?h=wE(h,k.bottom):m&&M4(m,k)&&(m=bE(m,k.top))}}if(h&&h.bottom>=n?(r=c,s=h):m&&m.top<=n&&(r=d,s=m),!r)return{node:t,offset:0};let g=Math.max(s.left,Math.min(s.right,e));if(r.nodeType==3)return SE(r,g,n);if(l&&r.contentEditable!="false")return Bk(r,g,n);let x=Array.prototype.indexOf.call(t.childNodes,r)+(e>=(s.left+s.right)/2?1:0);return{node:t,offset:x}}function SE(t,e,n){let r=t.nodeValue.length,s=-1,i=1e9,a=0;for(let l=0;ln?h.top-n:n-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&m=(h.left+h.right)/2,x=g;if(et.chrome||et.gecko){let y=ad(t,l).getBoundingClientRect();Math.abs(y.left-h.right)<.1&&(x=!g)}if(m<=0)return{node:t,offset:l+(x?1:0)};s=l+(x?1:0),i=m}}}return{node:t,offset:s>-1?s:a>0?t.nodeValue.length:0}}function JF(t,e,n,r=-1){var s,i;let a=t.contentDOM.getBoundingClientRect(),l=a.top+t.viewState.paddingTop,c,{docHeight:d}=t.viewState,{x:h,y:m}=e,g=m-l;if(g<0)return 0;if(g>d)return t.state.doc.length;for(let T=t.viewState.heightOracle.textHeight/2,E=!1;c=t.elementAtHeight(g),c.type!=ti.Text;)for(;g=r>0?c.bottom+T:c.top-T,!(g>=0&&g<=d);){if(E)return n?null:0;E=!0,r=-r}m=l+g;let x=c.from;if(xt.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:kE(t,a,c,h,m);let y=t.dom.ownerDocument,w=t.root.elementFromPoint?t.root:y,S=w.elementFromPoint(h,m);S&&!t.contentDOM.contains(S)&&(S=null),S||(h=Math.max(a.left+1,Math.min(a.right-1,h)),S=w.elementFromPoint(h,m),S&&!t.contentDOM.contains(S)&&(S=null));let k,j=-1;if(S&&((s=t.docView.nearest(S))===null||s===void 0?void 0:s.isEditable)!=!1){if(y.caretPositionFromPoint){let T=y.caretPositionFromPoint(h,m);T&&({offsetNode:k,offset:j}=T)}else if(y.caretRangeFromPoint){let T=y.caretRangeFromPoint(h,m);T&&({startContainer:k,startOffset:j}=T)}k&&(!t.contentDOM.contains(k)||et.safari&&coe(k,j,h)||et.chrome&&uoe(k,j,h))&&(k=void 0),k&&(j=Math.min(Io(k),j))}if(!k||!t.docView.dom.contains(k)){let T=es.find(t.docView,x);if(!T)return g>c.top+c.height/2?c.to:c.from;({node:k,offset:j}=Bk(T.dom,h,m))}let N=t.docView.nearest(k);if(!N)return null;if(N.isWidget&&((i=N.dom)===null||i===void 0?void 0:i.nodeType)==1){let T=N.dom.getBoundingClientRect();return e.yt.defaultLineHeight*1.5){let l=t.viewState.heightOracle.textHeight,c=Math.floor((s-n.top-(t.defaultLineHeight-l)*.5)/l);i+=c*t.viewState.heightOracle.lineLength}let a=t.state.sliceDoc(n.from,n.to);return n.from+Ok(a,i,t.state.tabSize)}function eq(t,e,n){let r,s=t;if(t.nodeType!=3||e!=(r=t.nodeValue.length))return!1;for(;;){let i=s.nextSibling;if(i){if(i.nodeName=="BR")break;return!1}else{let a=s.parentNode;if(!a||a.nodeName=="DIV")break;s=a}}return ad(t,r-1,r).getBoundingClientRect().right>n}function coe(t,e,n){return eq(t,e,n)}function uoe(t,e,n){if(e!=0)return eq(t,e,n);for(let s=t;;){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=t.nodeType==1?t.getBoundingClientRect():ad(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function Fk(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let s;for(let i of r.type){if(i.from>e)break;if(!(i.toe)return i;(!s||i.type==ti.Text&&(s.type!=i.type||(n<0?i.frome)))&&(s=i)}}return s||r}return r}function doe(t,e,n,r){let s=Fk(t,e.head,e.assoc||-1),i=!r||s.type!=ti.Text||!(t.lineWrapping||s.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(i){let a=t.dom.getBoundingClientRect(),l=t.textDirectionAt(s.from),c=t.posAtCoords({x:n==(l==gr.LTR)?a.right-1:a.left+1,y:(i.top+i.bottom)/2});if(c!=null)return Ae.cursor(c,n?-1:1)}return Ae.cursor(n?s.to:s.from,n?-1:1)}function OE(t,e,n,r){let s=t.state.doc.lineAt(e.head),i=t.bidiSpans(s),a=t.textDirectionAt(s.from);for(let l=e,c=null;;){let d=Yae(s,i,a,l,n),h=IF;if(!d){if(s.number==(n?t.state.doc.lines:1))return l;h=` -`,s=t.state.doc.line(s.number+(n?1:-1)),i=t.bidiSpans(s),d=t.visualLineSide(s,!n)}if(c){if(!c(h))return l}else{if(!r)return d;c=r(h)}l=d}}function hoe(t,e,n){let r=t.state.charCategorizer(e),s=r(n);return i=>{let a=r(i);return s==wr.Space&&(s=a),s==a}}function foe(t,e,n,r){let s=e.head,i=n?1:-1;if(s==(n?t.state.doc.length:0))return Ae.cursor(s,e.assoc);let a=e.goalColumn,l,c=t.contentDOM.getBoundingClientRect(),d=t.coordsAtPos(s,e.assoc||-1),h=t.documentTop;if(d)a==null&&(a=d.left-c.left),l=i<0?d.top:d.bottom;else{let x=t.viewState.lineBlockAt(s);a==null&&(a=Math.min(c.right-c.left,t.defaultCharacterWidth*(s-x.from))),l=(i<0?x.top:x.bottom)+h}let m=c.left+a,g=r??t.viewState.heightOracle.textHeight>>1;for(let x=0;;x+=10){let y=l+(g+x)*i,w=JF(t,{x:m,y},!1,i);if(yc.bottom||(i<0?ws)){let S=t.docView.coordsForChar(w),k=!S||y{if(e>i&&es(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:Ae.cursor(r,ri)&&!goe(a,n)&&this.lineBreak(),s=a}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,a=1,l;if(this.lineSeparator?(i=n.indexOf(this.lineSeparator,r),a=this.lineSeparator.length):(l=s.exec(n))&&(i=l.index,a=l[0].length),this.append(n.slice(r,i<0?n.length:i)),i<0)break;if(this.lineBreak(),a>1)for(let c of this.points)c.node==e&&c.pos>this.text.length&&(c.pos-=a-1);r=i+a}}readNode(e){if(e.cmIgnore)return;let n=er.get(e),r=n&&n.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,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(poe(e,r.node,r.offset)?n:0))}}function poe(t,e,n){for(;;){if(!e||n-1;let{impreciseHead:i,impreciseAnchor:a}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let l=i||a?[]:yoe(e),c=new moe(l,e.state);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=boe(l,this.bounds.from)}else{let l=e.observer.selectionRange,c=i&&i.node==l.focusNode&&i.offset==l.focusOffset||!Mk(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),d=a&&a.node==l.anchorNode&&a.offset==l.anchorOffset||!Mk(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if((et.ios||et.chrome)&&e.state.selection.main.empty&&c!=d&&(h.from>0||h.to-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(Ae.range(d,c)):this.newSel=Ae.single(d,c)}}}function nq(t,e){let n,{newSel:r}=e,s=t.state.selection.main,i=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:a,to:l}=e.bounds,c=s.from,d=null;(i===8||et.android&&e.text.length=s.from&&n.to<=s.to&&(n.from!=s.from||n.to!=s.to)&&s.to-s.from-(n.to-n.from)<=4?n={from:s.from,to:s.to,insert:t.state.doc.slice(s.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,s.to))}:t.state.doc.lineAt(s.from).toDate.now()-50?n={from:s.from,to:s.to,insert:t.state.toText(t.inputState.insertingText)}:et.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==` - `&&t.lineWrapping&&(r&&(r=Ae.single(r.main.anchor-1,r.main.head-1)),n={from:s.from,to:s.to,insert:jn.of([" "])}),n)return s6(t,n,r,i);if(r&&!r.main.eq(s)){let a=!1,l="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(a=!0),l=t.inputState.lastSelectionOrigin,l=="select.pointer"&&(r=tq(t.state.facet($p).map(c=>c(t)),r))),t.dispatch({selection:r,scrollIntoView:a,userEvent:l}),!0}else return!1}function s6(t,e,n,r=-1){if(et.ios&&t.inputState.flushIOSKey(e))return!0;let s=t.state.selection.main;if(et.android&&(e.to==s.to&&(e.from==s.from||e.from==s.from-1&&t.state.sliceDoc(e.from,s.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Ph(t.contentDOM,"Enter",13)||(e.from==s.from-1&&e.to==s.to&&e.insert.length==0||r==8&&e.insert.lengths.head)&&Ph(t.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&Ph(t.contentDOM,"Delete",46)))return!0;let i=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a,l=()=>a||(a=voe(t,e,n));return t.state.facet($F).some(c=>c(t,e.from,e.to,i,l))||t.dispatch(l()),!0}function voe(t,e,n){let r,s=t.state,i=s.selection.main,a=-1;if(e.from==e.to&&e.fromi.to){let c=e.fromm(t)),d,c);e.from==h&&(a=h)}if(a>-1)r={changes:e,selection:Ae.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&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let c=i.frome.to?s.sliceDoc(e.to,i.to):"";r=s.replaceSelection(t.state.toText(c+e.insert.sliceString(0,void 0,t.state.lineBreak)+d))}else{let c=s.changes(e),d=n&&n.main.to<=c.newLength?n.main:void 0;if(s.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=i.to+10&&e.to>=i.to-10){let h=t.state.sliceDoc(e.from,e.to),m,g=n&&ZF(t,n.main.head);if(g){let y=e.insert.length-(e.to-e.from);m={from:g.from,to:g.to-y}}else m=t.state.doc.lineAt(i.head);let x=i.to-e.to;r=s.changeByRange(y=>{if(y.from==i.from&&y.to==i.to)return{changes:c,range:d||y.map(c)};let w=y.to-x,S=w-h.length;if(t.state.sliceDoc(S,w)!=h||w>=m.from&&S<=m.to)return{range:y};let k=s.changes({from:S,to:w,insert:e.insert}),j=y.to-i.to;return{changes:k,range:d?Ae.range(Math.max(0,d.anchor+j),Math.max(0,d.head+j)):y.map(k)}})}else r={changes:c,selection:d&&s.selection.replaceRange(d)}}let l="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,l+=".compose",t.inputState.compositionFirstChange&&(l+=".start",t.inputState.compositionFirstChange=!1)),s.update(r,{userEvent:l,scrollIntoView:!0})}function rq(t,e,n,r){let s=Math.min(t.length,e.length),i=0;for(;i0&&l>0&&t.charCodeAt(a-1)==e.charCodeAt(l-1);)a--,l--;if(r=="end"){let c=Math.max(0,i-Math.min(a,l));n-=a+c-i}if(a=a?i-n:0;i-=c,l=i+(l-a),a=i}else if(l=l?i-n:0;i-=c,a=i+(a-l),l=i}return{from:i,toA:a,toB:l}}function yoe(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:i}=t.observer.selectionRange;return n&&(e.push(new jE(n,r)),(s!=n||i!=r)&&e.push(new jE(s,i))),e}function boe(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?Ae.single(n+e,r+e):null}class woe{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,et.safari&&e.contentDOM.addEventListener("input",()=>null),et.gecko&&Ioe(e.contentDOM.ownerDocument)}handleEvent(e){!Eoe(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,n){let r=this.handlers[e];if(r){for(let s of r.observers)s(this.view,n);for(let s of r.handlers){if(n.defaultPrevented)break;if(s(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=Soe(e),r=this.handlers,s=this.view.contentDOM;for(let i in n)if(i!="scroll"){let a=!n[i].handlers.length,l=r[i];l&&a!=!l.handlers.length&&(s.removeEventListener(i,this.handleEvent),l=null),l||s.addEventListener(i,this.handleEvent,{passive:a})}for(let i in r)i!="scroll"&&!n[i]&&s.removeEventListener(i,this.handleEvent);this.handlers=n}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&&iq.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),et.android&&et.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return et.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=sq.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||koe.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from0?!0:et.safari&&!et.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 NE(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(s){vi(n.state,s)}}}function Soe(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let s=r.spec,i=s&&s.plugin.domEventHandlers,a=s&&s.plugin.domEventObservers;if(i)for(let l in i){let c=i[l];c&&n(l).handlers.push(NE(r.value,c))}if(a)for(let l in a){let c=a[l];c&&n(l).observers.push(NE(r.value,c))}}for(let r in Ka)n(r).handlers.push(Ka[r]);for(let r in _a)n(r).observers.push(_a[r]);return e}const sq=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],koe="dthko",iq=[16,17,18,20,91,92,224,225],t1=6;function n1(t){return Math.max(0,t)*.7+8}function Ooe(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class joe{constructor(e,n,r,s){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=Rae(e.contentDOM),this.atoms=e.state.facet($p).map(a=>a(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=n.shiftKey,this.multiple=e.state.facet(bn.allowMultipleSelections)&&Noe(e,n),this.dragging=Toe(e,n)&&lq(n)==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&&Ooe(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,s=0,i=0,a=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=r6(this.view);e.clientX-c.left<=s+t1?n=-n1(s-e.clientX):e.clientX+c.right>=a-t1&&(n=n1(e.clientX-a)),e.clientY-c.top<=i+t1?r=-n1(i-e.clientY):e.clientY+c.bottom>=l-t1&&(r=n1(e.clientY-l)),this.setScrollSpeed(n,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,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=tq(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Noe(t,e){let n=t.state.facet(LF);return n.length?n[0](e):et.mac?e.metaKey:e.ctrlKey}function Coe(t,e){let n=t.state.facet(BF);return n.length?n[0](e):et.mac?!e.altKey:!e.ctrlKey}function Toe(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=B0(t.root);if(!r||r.rangeCount==0)return!0;let s=r.getRangeAt(0).getClientRects();for(let i=0;i=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}function Eoe(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=er.get(n))&&r.ignoreEvent(e))return!1;return!0}const Ka=Object.create(null),_a=Object.create(null),aq=et.ie&&et.ie_version<15||et.ios&&et.webkit_version<604;function _oe(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),oq(t,n.value)},50)}function sb(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function oq(t,e){e=sb(t.state,e6,e);let{state:n}=t,r,s=1,i=n.toText(e),a=i.lines==n.selection.ranges.length;if(qk!=null&&n.selection.ranges.every(c=>c.empty)&&qk==i.toString()){let c=-1;r=n.changeByRange(d=>{let h=n.doc.lineAt(d.from);if(h.from==c)return{range:d};c=h.from;let m=n.toText((a?i.line(s++).text:e)+n.lineBreak);return{changes:{from:h.from,insert:m},range:Ae.cursor(d.from+m.length)}})}else a?r=n.changeByRange(c=>{let d=i.line(s++);return{changes:{from:c.from,to:c.to,insert:d.text},range:Ae.cursor(c.from+d.length)}}):r=n.replaceSelection(i);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}_a.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Ka.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);_a.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};_a.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Ka.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(FF))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=Roe(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new joe(t,e,n,r)),r&&t.observer.ignore(()=>{wF(t.contentDOM);let i=t.root.activeElement;i&&!i.contains(t.contentDOM)&&i.blur()});let s=t.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function CE(t,e,n,r){if(r==1)return Ae.cursor(e,n);if(r==2)return aoe(t.state,e,n);{let s=es.find(t.docView,e),i=t.state.doc.lineAt(s?s.posAtEnd:e),a=s?s.posAtStart:i.from,l=s?s.posAtEnd:i.to;return le>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right;function Moe(t,e,n,r){let s=es.find(t.docView,e);if(!s)return 1;let i=e-s.posAtStart;if(i==0)return 1;if(i==s.length)return-1;let a=s.coordsAt(i,-1);if(a&&TE(n,r,a))return-1;let l=s.coordsAt(i,1);return l&&TE(n,r,l)?1:a&&a.bottom>=r?-1:1}function EE(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:Moe(t,n,e.clientX,e.clientY)}}const Aoe=et.ie&&et.ie_version<=11;let _E=null,ME=0,AE=0;function lq(t){if(!Aoe)return t.detail;let e=_E,n=AE;return _E=t,AE=Date.now(),ME=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(ME+1)%3:1}function Roe(t,e){let n=EE(t,e),r=lq(e),s=t.state.selection;return{update(i){i.docChanged&&(n.pos=i.changes.mapPos(n.pos),s=s.map(i.changes))},get(i,a,l){let c=EE(t,i),d,h=CE(t,c.pos,c.bias,r);if(n.pos!=c.pos&&!a){let m=CE(t,n.pos,n.bias,r),g=Math.min(m.from,h.from),x=Math.max(m.to,h.to);h=g1&&(d=Doe(s,c.pos))?d:l?s.addRange(h):Ae.create([h])}}}function Doe(t,e){for(let n=0;n=e)return Ae.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Ka.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let s=t.docView.nearest(e.target);if(s&&s.isWidget){let i=s.posAtStart,a=i+s.length;(i>=n.to||a<=n.from)&&(n=Ae.range(i,a))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",sb(t.state,t6,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Ka.dragend=t=>(t.inputState.draggedContent=null,!1);function RE(t,e,n,r){if(n=sb(t.state,e6,n),!n)return;let s=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:i}=t.inputState,a=r&&i&&Coe(t,e)?{from:i.from,to:i.to}:null,l={from:s,insert:n},c=t.state.changes(a?[a,l]:l);t.focus(),t.dispatch({changes:c,selection:{anchor:c.mapPos(s,-1),head:c.mapPos(s,1)},userEvent:a?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Ka.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),s=0,i=()=>{++s==n.length&&RE(t,e,r.filter(a=>a!=null).join(t.state.lineBreak),!1)};for(let a=0;a{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(r[a]=l.result),i()},l.readAsText(n[a])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return RE(t,e,r,!0),!0}return!1};Ka.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=aq?null:e.clipboardData;return n?(oq(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(_oe(t),!1)};function Poe(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.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(),t.focus()},50)}function zoe(t){let e=[],n=[],r=!1;for(let s of t.selection.ranges)s.empty||(e.push(t.sliceDoc(s.from,s.to)),n.push(s));if(!e.length){let s=-1;for(let{from:i}of t.selection.ranges){let a=t.doc.lineAt(i);a.number>s&&(e.push(a.text),n.push({from:a.from,to:Math.min(t.doc.length,a.to+1)})),s=a.number}r=!0}return{text:sb(t,t6,e.join(t.lineBreak)),ranges:n,linewise:r}}let qk=null;Ka.copy=Ka.cut=(t,e)=>{let{text:n,ranges:r,linewise:s}=zoe(t.state);if(!n&&!s)return!1;qk=s?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let i=aq?null:e.clipboardData;return i?(i.clearData(),i.setData("text/plain",n),!0):(Poe(t,n),!1)};const cq=Fo.define();function uq(t,e){let n=[];for(let r of t.facet(HF)){let s=r(t,e);s&&n.push(s)}return n.length?t.update({effects:n,annotations:cq.of(!0)}):null}function dq(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=uq(t.state,e);n?t.dispatch(n):t.update([])}},10)}_a.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),dq(t)};_a.blur=t=>{t.observer.clearSelectionRange(),dq(t)};_a.compositionstart=_a.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};_a.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,et.chrome&&et.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};_a.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Ka.beforeinput=(t,e)=>{var n,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let i=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),a=e.getTargetRanges();if(i&&a.length){let l=a[0],c=t.posAtDOM(l.startContainer,l.startOffset),d=t.posAtDOM(l.endContainer,l.endOffset);return s6(t,{from:c,to:d,insert:t.state.toText(i)},null),!0}}let s;if(et.chrome&&et.android&&(s=sq.find(i=>i.inputType==e.inputType))&&(t.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 a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>i+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return et.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),et.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>_a.compositionend(t,e),20),!1};const DE=new Set;function Ioe(t){DE.has(t)||(DE.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const PE=["pre-wrap","normal","pre-line","break-spaces"];let ef=!1;function zE(){ef=!1}class Loe{constructor(e){this.lineWrapping=e,this.doc=jn.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-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 PE.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r-1,c=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=r,this.textHeight=s,this.lineLength=i,c){this.heightSamples={};for(let d=0;d0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>lv&&(ef=!0),this.height=e)}replace(e,n,r){return ni.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,s){let i=this,a=r.doc;for(let l=s.length-1;l>=0;l--){let{fromA:c,toA:d,fromB:h,toB:m}=s[l],g=i.lineAt(c,pr.ByPosNoHeight,r.setDoc(n),0,0),x=g.to>=d?g:i.lineAt(d,pr.ByPosNoHeight,r,0,0);for(m+=x.to-d,d=x.to;l>0&&g.from<=s[l-1].toA;)c=s[l-1].fromA,h=s[l-1].fromB,l--,ci*2){let l=e[n-1];l.break?e.splice(--n,1,l.left,null,l.right):e.splice(--n,1,l.left,l.right),r+=1+l.break,s-=l.size}else if(i>s*2){let l=e[r];l.break?e.splice(r,1,l.left,null,l.right):e.splice(r,1,l.left,l.right),r+=2+l.break,i-=l.size}else break;else if(s=i&&a(this.blockAt(0,r,s,i))}updateHeight(e,n=0,r=!1,s){return s&&s.from<=n&&s.more&&this.setHeight(s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class $i extends hq{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,s){return new So(s,this.length,r,this.height,this.breaks)}replace(e,n,r){let s=r[0];return r.length==1&&(s instanceof $i||s instanceof Ms&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof Ms?s=new $i(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):ni.of(r)}updateHeight(e,n=0,r=!1,s){return s&&s.from<=n&&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 Ms extends ni{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,s=e.doc.lineAt(n+this.length).number,i=s-r+1,a,l=0;if(e.lineWrapping){let c=Math.min(this.height,e.lineHeight*i);a=c/i,this.length>i+1&&(l=(this.height-c)/(this.length-i-1))}else a=this.height/i;return{firstLine:r,lastLine:s,perLine:a,perChar:l}}blockAt(e,n,r,s){let{firstLine:i,lastLine:a,perLine:l,perChar:c}=this.heightMetrics(n,s);if(n.lineWrapping){let d=s+(e0){let i=r[r.length-1];i instanceof Ms?r[r.length-1]=new Ms(i.length+s):r.push(null,new Ms(s-1))}if(e>0){let i=r[0];i instanceof Ms?r[0]=new Ms(e+i.length):r.unshift(new Ms(e-1),null)}return ni.of(r)}decomposeLeft(e,n){n.push(new Ms(e-1),null)}decomposeRight(e,n){n.push(null,new Ms(this.length-e-1))}updateHeight(e,n=0,r=!1,s){let i=n+this.length;if(s&&s.from<=n+this.length&&s.more){let a=[],l=Math.max(n,s.from),c=-1;for(s.from>n&&a.push(new Ms(s.from-n-1).updateHeight(e,n));l<=i&&s.more;){let h=e.doc.lineAt(l).length;a.length&&a.push(null);let m=s.heights[s.index++];c==-1?c=m:Math.abs(m-c)>=lv&&(c=-2);let g=new $i(h,m);g.outdated=!1,a.push(g),l+=h+1}l<=i&&a.push(null,new Ms(i-l).updateHeight(e,l));let d=ni.of(a);return(c<0||Math.abs(d.height-this.height)>=lv||Math.abs(c-this.heightMetrics(e,n).perLine)>=lv)&&(ef=!0),$v(this,d)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Foe extends ni{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(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,n,r,s){let i=r+this.left.height;return el))return d;let h=n==pr.ByPosNoHeight?pr.ByPosNoHeight:pr.ByPos;return c?d.join(this.right.lineAt(l,h,r,a,l)):this.left.lineAt(l,h,r,s,i).join(d)}forEachLine(e,n,r,s,i,a){let l=s+this.left.height,c=i+this.left.length+this.break;if(this.break)e=c&&this.right.forEachLine(e,n,r,l,c,a);else{let d=this.lineAt(c,pr.ByPos,r,s,i);e=e&&d.from<=n&&a(d),n>d.to&&this.right.forEachLine(d.to+1,n,r,l,c,a)}}replace(e,n,r){let s=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(e-s,n-s,r));let i=[];e>0&&this.decomposeLeft(e,i);let a=i.length;for(let l of r)i.push(l);if(e>0&&IE(i,a-1),n=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,s=r+this.break;if(e>=s)return this.right.decomposeRight(e-s,n);e2*n.size||n.size>2*e.size?ni.of(this.break?[e,null,n]:[e,n]):(this.left=$v(this.left,e),this.right=$v(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,s){let{left:i,right:a}=this,l=n+i.length+this.break,c=null;return s&&s.from<=n+i.length&&s.more?c=i=i.updateHeight(e,n,r,s):i.updateHeight(e,n,r),s&&s.from<=l+a.length&&s.more?c=a=a.updateHeight(e,l,r,s):a.updateHeight(e,l,r),c?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function IE(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof Ms&&(r=t[e+1])instanceof Ms&&t.splice(e-1,3,new Ms(n.length+1+r.length))}const qoe=5;class i6{constructor(e,n){this.pos=e,this.oracle=n,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,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof $i?s.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new $i(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e=qoe)&&this.addLineDeco(s,i,a)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenToe&&this.nodes.push(new $i(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new Ms(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof $i)return e;let n=new $i(0,-1);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let s=this.ensureLine();s.length+=r,s.collapsed+=r,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof $i)&&!this.isCovered?this.nodes.push(new $i(0,-1)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&m.overflow!="visible"){let g=h.getBoundingClientRect();i=Math.max(i,g.left),a=Math.min(a,g.right),l=Math.max(l,g.top),c=Math.min(d==t.parentNode?s.innerHeight:c,g.bottom)}d=m.position=="absolute"||m.position=="fixed"?h.offsetParent:h.parentNode}else if(d.nodeType==11)d=d.host;else break;return{left:i-n.left,right:Math.max(i,a)-n.left,top:l-(n.top+e),bottom:Math.max(l,c)-(n.top+e)}}function Voe(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left0&&e.top0}function Uoe(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class R4{constructor(e,n,r,s){this.from=e,this.to=n,this.size=r,this.displaySize=s}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;rtypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new Loe(n),this.stateDeco=e.facet(F0).filter(r=>typeof r!="function"),this.heightMap=ni.empty().applyChanges(this.stateDeco,jn.empty,this.heightOracle.setDoc(e.doc),[new Na(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=kt.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let s=r?n.head:n.anchor;if(!e.some(({from:i,to:a})=>s>=i&&s<=a)){let{from:i,to:a}=this.lineBlockAt(s);e.push(new r1(i,a))}}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?BE:new a6(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(a0(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(F0).filter(h=>typeof h!="function");let s=e.changedRanges,i=Na.extendWithRanges(s,$oe(r,this.stateDeco,e?e.changes:cs.empty(this.state.doc.length))),a=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);zE(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=a||ef)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let c=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.headc.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,n));let d=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,e.flags|=this.updateForViewport(),(d||!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),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(VF)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),s=this.heightOracle,i=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?gr.RTL:gr.LTR;let a=this.heightOracle.mustRefreshForWrapping(i),l=n.getBoundingClientRect(),c=a||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let d=0,h=0;if(l.width&&l.height){let{scaleX:T,scaleY:E}=bF(n,l);(T>.005&&Math.abs(this.scaleX-T)>.005||E>.005&&Math.abs(this.scaleY-E)>.005)&&(this.scaleX=T,this.scaleY=E,d|=16,a=c=!0)}let m=(parseInt(r.paddingTop)||0)*this.scaleY,g=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=m||this.paddingBottom!=g)&&(this.paddingTop=m,this.paddingBottom=g,d|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(c=!0),this.editorWidth=e.scrollDOM.clientWidth,d|=16);let x=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=x&&(this.scrollAnchorHeight=-1,this.scrollTop=x),this.scrolledToBottom=kF(e.scrollDOM);let y=(this.printing?Uoe:Qoe)(n,this.paddingTop),w=y.top-this.pixelViewport.top,S=y.bottom-this.pixelViewport.bottom;this.pixelViewport=y;let k=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(k!=this.inView&&(this.inView=k,k&&(c=!0)),!this.inView&&!this.scrollTarget&&!Voe(e.dom))return 0;let j=l.width;if((this.contentDOMWidth!=j||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,d|=16),c){let T=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(T)&&(a=!0),a||s.lineWrapping&&Math.abs(j-this.contentDOMWidth)>s.charWidth){let{lineHeight:E,charWidth:_,textHeight:M}=e.docView.measureTextSize();a=E>0&&s.refresh(i,E,_,M,Math.max(5,j/_),T),a&&(e.docView.minWidth=0,d|=16)}w>0&&S>0?h=Math.max(w,S):w<0&&S<0&&(h=Math.min(w,S)),zE();for(let E of this.viewports){let _=E.from==this.viewport.from?T:e.docView.measureVisibleLineHeights(E);this.heightMap=(a?ni.empty().applyChanges(this.stateDeco,jn.empty,this.heightOracle,[new Na(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,a,new Boe(E.from,_))}ef&&(d|=2)}let N=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return N&&(d&2&&(d|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),d|=this.updateForViewport()),(d&2||N)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),d|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),d}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,i=this.heightOracle,{visibleTop:a,visibleBottom:l}=this,c=new r1(s.lineAt(a-r*1e3,pr.ByHeight,i,0,0).from,s.lineAt(l+(1-r)*1e3,pr.ByHeight,i,0,0).to);if(n){let{head:d}=n.range;if(dc.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),m=s.lineAt(d,pr.ByPos,i,0,0),g;n.y=="center"?g=(m.top+m.bottom)/2-h/2:n.y=="start"||n.y=="nearest"&&d=l+Math.max(10,Math.min(r,250)))&&s>a-2*1e3&&i>1,a=s<<1;if(this.defaultTextDirection!=gr.LTR&&!r)return[];let l=[],c=(h,m,g,x)=>{if(m-hh&&kk.from>=g.from&&k.to<=g.to&&Math.abs(k.from-h)k.fromj));if(!S){if(mN.from<=m&&N.to>=m)){let N=n.moveToLineBoundary(Ae.cursor(m),!1,!0).head;N>h&&(m=N)}let k=this.gapSize(g,h,m,x),j=r||k<2e6?k:2e6;S=new R4(h,m,k,j)}l.push(S)},d=h=>{if(h.length2e6)for(let _ of e)_.from>=h.from&&_.fromh.from&&c(h.from,x,h,m),yn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];Rn.spans(n,this.viewport.from,this.viewport.to,{span(i,a){r.push({from:i,to:a})},point(){}},20);let s=0;if(r.length!=this.visibleRanges.length)s=12;else for(let i=0;i=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||a0(this.heightMap.lineAt(e,pr.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(n=>n.top<=e&&n.bottom>=e)||a0(this.heightMap.lineAt(this.scaler.fromDOM(e),pr.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return a0(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 r1=class{constructor(e,n){this.from=e,this.to=n}};function Goe(t,e,n){let r=[],s=t,i=0;return Rn.spans(n,t,e,{span(){},point(a,l){a>s&&(r.push({from:s,to:a}),i+=a-s),s=l}},20),s=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let s=0;;s++){let{from:i,to:a}=e[s],l=a-i;if(r<=l)return i+r;r-=l}}function i1(t,e){let n=0;for(let{from:r,to:s}of t.ranges){if(e<=s){n+=e-r;break}n+=s-r}return n/t.total}function Xoe(t,e){for(let n of t)if(e(n))return n}const BE={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};class a6{constructor(e,n,r){let s=0,i=0,a=0;this.viewports=r.map(({from:l,to:c})=>{let d=n.lineAt(l,pr.ByPos,e,0,0).top,h=n.lineAt(c,pr.ByPos,e,0,0).bottom;return s+=h-d,{from:l,to:c,top:d,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(n.height-s);for(let l of this.viewports)l.domTop=a+(l.top-i)*this.scale,a=l.domBottom=l.domTop+(l.bottom-l.top),i=l.bottom}toDOM(e){for(let n=0,r=0,s=0;;n++){let i=nn.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function a0(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new So(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(s=>a0(s,e)):t._content)}const a1=at.define({combine:t=>t.join(" ")}),$k=at.define({combine:t=>t.indexOf(!0)>-1}),Hk=Wc.newName(),fq=Wc.newName(),mq=Wc.newName(),pq={"&light":"."+fq,"&dark":"."+mq};function Qk(t,e,n){return new Wc(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,s=>{if(s=="&")return t;if(!n||!n[s])throw new RangeError(`Unsupported selector: ${s}`);return n[s]}):t+" "+r}})}const Yoe=Qk("."+Hk,{"&":{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,')`,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"}},pq),Koe={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},D4=et.ie&&et.ie_version<=11;class Zoe{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Dae,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(n=>{for(let r of n)this.queue.push(r);(et.ie&&et.ie_version<=11||et.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&et.android&&e.constructor.EDIT_CONTEXT!==!1&&!(et.chrome&&et.chrome_version<126)&&(this.editContext=new ele(e),e.state.facet(Tl)&&(e.contentDOM.editContext=this.editContext.editContext)),D4&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.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 n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.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(n=>{n.length>0&&n[n.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((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,s=this.selectionRange;if(r.state.facet(Tl)?r.root.activeElement!=this.dom:!av(this.dom,s))return;let i=s.anchorNode&&r.docView.nearest(s.anchorNode);if(i&&i.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(et.ie&&et.ie_version<=11||et.android&&et.chrome)&&!r.state.selection.main.empty&&s.focusNode&&y0(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=B0(e.root);if(!n)return!1;let r=et.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Joe(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let s=av(this.dom,r);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let i=this.delayedAndroidKey;i&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=i.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&i.force&&Ph(this.dom,i.key,i.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange{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 n=-1,r=-1,s=!1;for(let i of e){let a=this.readMutation(i);a&&(a.typeOver&&(s=!0),n==-1?{from:n,to:r}=a:(n=Math.min(a.from,n),r=Math.max(a.to,r)))}return{from:n,to:r,typeOver:s}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),s=this.selectionChanged&&av(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 xoe(this.view,e,n,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 n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,s=nq(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!n.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),s}readMutation(e){let n=this.view.docView.nearest(e.target);if(!n||n.ignoreMutation(e))return null;if(n.markDirty(e.type=="attributes"),e.type=="attributes"&&(n.flags|=4),e.type=="childList"){let r=FE(n,e.previousSibling||e.target.previousSibling,-1),s=FE(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:s?n.posBefore(s):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.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(Tl)!=e.state.facet(Tl)&&(e.view.contentDOM.editContext=e.state.facet(Tl)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.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 FE(t,e,n){for(;e;){let r=er.get(e);if(r&&r.parent==t)return r;let s=e.parentNode;e=s!=t.dom?s:n>0?e.nextSibling:e.previousSibling}return null}function qE(t,e){let n=e.startContainer,r=e.startOffset,s=e.endContainer,i=e.endOffset,a=t.docView.domAtPos(t.state.selection.main.anchor);return y0(a.node,a.offset,s,i)&&([n,r,s,i]=[s,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:i}}function Joe(t,e){if(e.getComposedRanges){let s=e.getComposedRanges(t.root)[0];if(s)return qE(t,s)}let n=null;function r(s){s.preventDefault(),s.stopImmediatePropagation(),n=s.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?qE(t,n):null}class ele{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=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:a}=s,l=this.toEditorPos(r.updateRangeStart),c=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:l,drifted:!1});let d=c-l>r.text.length;l==this.from&&ithis.to&&(c=i);let h=rq(e.state.sliceDoc(l,c),r.text,(d?s.from:s.to)-l,d?"end":null);if(!h){let g=Ae.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));g.main.eq(s)||e.dispatch({selection:g,userEvent:"select"});return}let m={from:h.from+l,to:h.toA+l,insert:jn.of(r.text.slice(h.from,h.toB).split(` -`))};if((et.mac||et.android)&&m.from==a-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(m={from:l,to:c,insert:jn.of([r.text.replace("."," ")])}),this.pendingContextChange=m,!e.state.readOnly){let g=this.to-this.from+(m.to-m.from+m.insert.length);s6(e,m,Ae.single(this.toEditorPos(r.selectionStart,g),this.toEditorPos(r.selectionEnd,g)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),m.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let s=[],i=null;for(let a=this.toEditorPos(r.rangeStart),l=this.toEditorPos(r.rangeEnd);a{let s=[];for(let i of r.getTextFormats()){let a=i.underlineStyle,l=i.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(l)){let c=this.toEditorPos(i.rangeStart),d=this.toEditorPos(i.rangeEnd);if(c{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)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let s=B0(r.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,s=this.pendingContextChange;return e.changes.iterChanges((i,a,l,c,d)=>{if(r)return;let h=d.length-(a-i);if(s&&a>=s.to)if(s.from==i&&s.to==a&&s.insert.eq(d)){s=this.pendingContextChange=null,n+=h,this.to+=h;return}else s=null,this.revertPending(e.state);if(i+=n,a+=n,a<=this.from)this.from+=h,this.to+=h;else if(ithis.to||this.to-this.from+d.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),d.toString()),this.to+=h}n+=h}),s&&!r&&this.revertPending(e.state),!r}update(e){let n=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||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+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 n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),s=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(r,s)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Ze{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 n;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||Pae(e.parent)||document,this.viewState=new LE(e.state||bn.create(e)),e.scrollTo&&e.scrollTo.is(e1)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Nh).map(s=>new _4(s));for(let s of this.plugins)s.update(this);this.observer=new Zoe(this),this.inputState=new woe(this),this.inputState.ensureHandlers(this.plugins),this.docView=new yE(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let n=e.length==1&&e[0]instanceof ns?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,s,i=this.state;for(let g of e){if(g.startState!=i)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");i=g.state}if(this.destroyed){this.viewState.state=i;return}let a=this.hasFocus,l=0,c=null;e.some(g=>g.annotation(cq))?(this.inputState.notifiedFocused=a,l=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,c=uq(i,a),c||(l=1));let d=this.observer.delayedAndroidKey,h=null;if(d?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(h=null)):this.observer.clear(),i.facet(bn.phrases)!=this.state.facet(bn.phrases))return this.setState(i);s=qv.create(this,i,e),s.flags|=l;let m=this.viewState.scrollTarget;try{this.updateState=2;for(let g of e){if(m&&(m=m.map(g.changes)),g.scrollIntoView){let{main:x}=g.state.selection;m=new zh(x.empty?x:Ae.cursor(x.head,x.head>x.anchor?-1:1))}for(let x of g.effects)x.is(e1)&&(m=x.value.clip(this.state))}this.viewState.update(s,m),this.bidiCache=Hv.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),n=this.docView.update(s),this.state.facet(s0)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(g=>g.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(a1)!=s.state.facet(a1)&&(this.viewState.mustMeasureContent=!0),(n||r||m||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!s.empty)for(let g of this.state.facet(Lk))try{g(s)}catch(x){vi(this.state,x,"update listener")}(c||h)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),h&&!nq(this,h)&&d.force&&Ph(this.contentDOM,d.key,d.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 n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new LE(e),this.plugins=e.facet(Nh).map(r=>new _4(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new yE(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(Nh),r=e.state.facet(Nh);if(n!=r){let s=[];for(let i of r){let a=n.indexOf(i);if(a<0)s.push(new _4(i));else{let l=this.plugins[a];l.mustUpdate=e,s.push(l)}}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-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.scrollDOM,s=r.scrollTop*this.scaleY,{scrollAnchorPos:i,scrollAnchorHeight:a}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(a<0)if(kF(r))i=-1,a=this.viewState.heightMap.height;else{let x=this.viewState.scrollAnchorAt(s);i=x.from,a=x.top}this.updateState=1;let c=this.viewState.measure(this);if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let d=[];c&4||([this.measureRequests,d]=[d,this.measureRequests]);let h=d.map(x=>{try{return x.read(this)}catch(y){return vi(this.state,y),$E}}),m=qv.create(this,this.state,[]),g=!1;m.flags|=c,n?n.flags|=c:n=m,this.updateState=2,m.empty||(this.updatePlugins(m),this.inputState.update(m),this.updateAttrs(),g=this.docView.update(m),g&&this.docViewUpdate());for(let x=0;x1||y<-1){s=s+y,r.scrollTop=s/this.scaleY,a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(Lk))l(n)}get themeClasses(){return Hk+" "+(this.state.facet($k)?mq:fq)+" "+this.state.facet(a1)}updateAttrs(){let e=HE(this,GF,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Tl)?"true":"false",class:"cm-content",style:`${et.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),HE(this,n6,n);let r=this.observer.ignore(()=>{let s=Rk(this.contentDOM,this.contentAttrs,n),i=Rk(this.dom,this.editorAttrs,e);return s||i});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let s of r.effects)if(s.is(Ze.announce)){n&&(this.announceDOM.textContent=""),n=!1;let i=this.announceDOM.appendChild(document.createElement("div"));i.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(s0);let e=this.state.facet(Ze.cspNonce);Wc.mount(this.root,this.styleModules.concat(Yoe).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 n=0;nr.plugin==e)||null),n&&n.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,n,r){return A4(this,e,OE(this,e,n,r))}moveByGroup(e,n){return A4(this,e,OE(this,e,n,r=>hoe(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),s=this.textDirectionAt(e.from),i=r[n?r.length-1:0];return Ae.cursor(i.side(n,s)+e.from,i.forward(!n,s)?1:-1)}moveToLineBoundary(e,n,r=!0){return doe(this,e,n,r)}moveVertically(e,n,r){return A4(this,e,foe(this,e,n,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){return this.readMeasured(),JF(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let s=this.state.doc.lineAt(e),i=this.bidiSpans(s),a=i[Bc.find(i,e-s.from,-1,n)];return Bp(r,a.dir==gr.LTR==n>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(QF)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>tle)return zF(e.length);let n=this.textDirectionAt(e.from),r;for(let i of this.bidiCache)if(i.from==e.from&&i.dir==n&&(i.fresh||PF(i.isolates,r=vE(this,e))))return i.order;r||(r=vE(this,e));let s=Xae(e.text,n,r);return this.bidiCache.push(new Hv(e.from,e.to,n,r,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||et.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{wF(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,n={}){return e1.of(new zh(typeof e=="number"?Ae.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return e1.of(new zh(Ae.cursor(r.from),"start","start",r.top-e,n,!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 Vr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Vr.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=Wc.newName(),s=[a1.of(r),s0.of(Qk(`.${r}`,e))];return n&&n.dark&&s.push($k.of(!0)),s}static baseTheme(e){return ou.lowest(s0.of(Qk("."+Hk,e,pq)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),s=r&&er.get(r)||er.get(e);return((n=s?.rootView)===null||n===void 0?void 0:n.view)||null}}Ze.styleModule=s0;Ze.inputHandler=$F;Ze.clipboardInputFilter=e6;Ze.clipboardOutputFilter=t6;Ze.scrollHandler=UF;Ze.focusChangeEffect=HF;Ze.perLineTextDirection=QF;Ze.exceptionSink=qF;Ze.updateListener=Lk;Ze.editable=Tl;Ze.mouseSelectionStyle=FF;Ze.dragMovesSelection=BF;Ze.clickAddsSelectionRange=LF;Ze.decorations=F0;Ze.outerDecorations=XF;Ze.atomicRanges=$p;Ze.bidiIsolatedRanges=YF;Ze.scrollMargins=KF;Ze.darkTheme=$k;Ze.cspNonce=at.define({combine:t=>t.length?t[0]:""});Ze.contentAttributes=n6;Ze.editorAttributes=GF;Ze.lineWrapping=Ze.contentAttributes.of({class:"cm-lineWrapping"});Ze.announce=Ft.define();const tle=4096,$E={};class Hv{constructor(e,n,r,s,i,a){this.from=e,this.to=n,this.dir=r,this.isolates=s,this.fresh=i,this.order=a}static update(e,n){if(n.empty&&!e.some(i=>i.fresh))return e;let r=[],s=e.length?e[e.length-1].dir:gr.LTR;for(let i=Math.max(0,e.length-10);i=0;s--){let i=r[s],a=typeof i=="function"?i(t):i;a&&Ak(a,n)}return n}const nle=et.mac?"mac":et.windows?"win":et.linux?"linux":"key";function rle(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let s,i,a,l;for(let c=0;cr.concat(s),[]))),n}function ile(t,e,n){return xq(gq(t.state),e,t,n)}let Pc=null;const ale=4e3;function ole(t,e=nle){let n=Object.create(null),r=Object.create(null),s=(a,l)=>{let c=r[a];if(c==null)r[a]=l;else if(c!=l)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},i=(a,l,c,d,h)=>{var m,g;let x=n[a]||(n[a]=Object.create(null)),y=l.split(/ (?!$)/).map(k=>rle(k,e));for(let k=1;k{let T=Pc={view:N,prefix:j,scope:a};return setTimeout(()=>{Pc==T&&(Pc=null)},ale),!0}]})}let w=y.join(" ");s(w,!1);let S=x[w]||(x[w]={preventDefault:!1,stopPropagation:!1,run:((g=(m=x._any)===null||m===void 0?void 0:m.run)===null||g===void 0?void 0:g.slice())||[]});c&&S.run.push(c),d&&(S.preventDefault=!0),h&&(S.stopPropagation=!0)};for(let a of t){let l=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let d of l){let h=n[d]||(n[d]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:m}=a;for(let g in h)h[g].run.push(x=>m(x,Vk))}let c=a[e]||a.key;if(c)for(let d of l)i(d,c,a.run,a.preventDefault,a.stopPropagation),a.shift&&i(d,"Shift-"+c,a.shift,a.preventDefault,a.stopPropagation)}return n}let Vk=null;function xq(t,e,n,r){Vk=e;let s=Eae(e),i=gi(s,0),a=wo(i)==s.length&&s!=" ",l="",c=!1,d=!1,h=!1;Pc&&Pc.view==n&&Pc.scope==r&&(l=Pc.prefix+" ",iq.indexOf(e.keyCode)<0&&(d=!0,Pc=null));let m=new Set,g=S=>{if(S){for(let k of S.run)if(!m.has(k)&&(m.add(k),k(n)))return S.stopPropagation&&(h=!0),!0;S.preventDefault&&(S.stopPropagation&&(h=!0),d=!0)}return!1},x=t[r],y,w;return x&&(g(x[l+o1(s,e,!a)])?c=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(et.windows&&e.ctrlKey&&e.altKey)&&!(et.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(y=Gc[e.keyCode])&&y!=s?(g(x[l+o1(y,e,!0)])||e.shiftKey&&(w=L0[e.keyCode])!=s&&w!=y&&g(x[l+o1(w,e,!1)]))&&(c=!0):a&&e.shiftKey&&g(x[l+o1(s,e,!0)])&&(c=!0),!c&&g(x._any)&&(c=!0)),d&&(c=!0),c&&h&&e.stopPropagation(),Vk=null,c}class Qp{constructor(e,n,r,s,i){this.className=e,this.left=n,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,n){return n.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,n,r){if(r.empty){let s=e.coordsAtPos(r.head,r.assoc||1);if(!s)return[];let i=vq(e);return[new Qp(n,s.left-i.left,s.top-i.top,null,s.bottom-s.top)]}else return lle(e,n,r)}}function vq(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==gr.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function VE(t,e,n,r){let s=t.coordsAtPos(e,n*2);if(!s)return r;let i=t.dom.getBoundingClientRect(),a=(s.top+s.bottom)/2,l=t.posAtCoords({x:i.left+1,y:a}),c=t.posAtCoords({x:i.right-1,y:a});return l==null||c==null?r:{from:Math.max(r.from,Math.min(l,c)),to:Math.min(r.to,Math.max(l,c))}}function lle(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),s=Math.min(n.to,t.viewport.to),i=t.textDirection==gr.LTR,a=t.contentDOM,l=a.getBoundingClientRect(),c=vq(t),d=a.querySelector(".cm-line"),h=d&&window.getComputedStyle(d),m=l.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),g=l.right-(h?parseInt(h.paddingRight):0),x=Fk(t,r,1),y=Fk(t,s,-1),w=x.type==ti.Text?x:null,S=y.type==ti.Text?y:null;if(w&&(t.lineWrapping||x.widgetLineBreaks)&&(w=VE(t,r,1,w)),S&&(t.lineWrapping||y.widgetLineBreaks)&&(S=VE(t,s,-1,S)),w&&S&&w.from==S.from&&w.to==S.to)return j(N(n.from,n.to,w));{let E=w?N(n.from,null,w):T(x,!1),_=S?N(null,n.to,S):T(y,!0),M=[];return(w||x).to<(S||y).from-(w&&S?1:0)||x.widgetLineBreaks>1&&E.bottom+t.defaultLineHeight/2<_.top?M.push(k(m,E.bottom,g,_.top)):E.bottom<_.top&&t.elementAtHeight((E.bottom+_.top)/2).type==ti.Text&&(E.bottom=_.top=(E.bottom+_.top)/2),j(E).concat(M).concat(j(_))}function k(E,_,M,I){return new Qp(e,E-c.left,_-c.top,M-E,I-_)}function j({top:E,bottom:_,horizontal:M}){let I=[];for(let P=0;PU&&z.from=B)break;R>Q&&H(Math.max(G,Q),E==null&&G<=U,Math.min(R,B),_==null&&R>=ee,J.dir)}if(Q=X.to+1,Q>=B)break}return L.length==0&&H(U,E==null,ee,_==null,t.textDirection),{top:I,bottom:P,horizontal:L}}function T(E,_){let M=l.top+(_?E.top:E.bottom);return{top:M,bottom:M,horizontal:[]}}}function cle(t,e){return t.constructor==e.constructor&&t.eq(e)}class ule{constructor(e,n){this.view=e,this.layer=n,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"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(cv)!=e.state.facet(cv)&&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 n=0,r=e.facet(cv);for(;n!cle(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let s of e)s.update&&n&&s.constructor&&this.drawn[r].constructor&&s.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(s.draw(),n);for(;n;){let s=n.nextSibling;n.remove(),n=s}this.drawn=e,et.safari&&et.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 cv=at.define();function yq(t){return[Vr.define(e=>new ule(e,t)),cv.of(t)]}const q0=at.define({combine(t){return qo(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function dle(t={}){return[q0.of(t),hle,fle,mle,VF.of(!0)]}function bq(t){return t.startState.facet(q0)!=t.state.facet(q0)}const hle=yq({above:!0,markers(t){let{state:e}=t,n=e.facet(q0),r=[];for(let s of e.selection.ranges){let i=s==e.selection.main;if(s.empty||n.drawRangeCursor){let a=i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:Ae.cursor(s.head,s.head>s.anchor?-1:1);for(let c of Qp.forRange(t,a,l))r.push(c)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=bq(t);return n&&UE(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){UE(e.state,t)},class:"cm-cursorLayer"});function UE(t,e){e.style.animationDuration=t.facet(q0).cursorBlinkRate+"ms"}const fle=yq({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:Qp.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||bq(t)},class:"cm-selectionLayer"}),mle=ou.highest(Ze.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"}}}})),wq=Ft.define({map(t,e){return t==null?null:e.mapPos(t)}}),o0=Os.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(wq)?r.value:n,t)}}),ple=Vr.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let n=t.state.field(o0);n==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"),(t.startState.field(o0)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(o0),n=e!=null&&t.coordsAtPos(e);if(!n)return null;let r=t.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-r.top+t.scrollDOM.scrollTop*t.scaleY,height:n.bottom-n.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:n}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/n+"px",this.cursor.style.height=t.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(o0)!=t&&this.view.dispatch({effects:wq.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function gle(){return[o0,ple]}function WE(t,e,n,r,s){e.lastIndex=0;for(let i=t.iterRange(n,r),a=n,l;!i.next().done;a+=i.value.length)if(!i.lineBreak)for(;l=e.exec(i.value);)s(a+l.index,l)}function xle(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:s,to:i}of n)s=Math.max(t.state.doc.lineAt(s).from,s-e),i=Math.min(t.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 vle{constructor(e){const{regexp:n,decoration:r,decorate:s,boundary:i,maxLength:a=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,s)this.addMatch=(l,c,d,h)=>s(h,d,d+l[0].length,l,c);else if(typeof r=="function")this.addMatch=(l,c,d,h)=>{let m=r(l,c,d);m&&h(d,d+l[0].length,m)};else if(r)this.addMatch=(l,c,d,h)=>h(d,d+l[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=i,this.maxLength=a}createDeco(e){let n=new Fl,r=n.add.bind(n);for(let{from:s,to:i}of xle(e,this.maxLength))WE(e.state.doc,this.regexp,s,i,(a,l)=>this.addMatch(l,e,a,r));return n.finish()}updateDeco(e,n){let r=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((i,a,l,c)=>{c>=e.view.viewport.from&&l<=e.view.viewport.to&&(r=Math.min(l,r),s=Math.max(c,s))}),e.viewportMoved||s-r>1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,n.map(e.changes),r,s):n}updateRange(e,n,r,s){for(let i of e.visibleRanges){let a=Math.max(i.from,r),l=Math.min(i.to,s);if(l>=a){let c=e.state.doc.lineAt(a),d=c.toc.from;a--)if(this.boundary.test(c.text[a-1-c.from])){h=a;break}for(;lg.push(k.range(w,S));if(c==d)for(this.regexp.lastIndex=h-c.from;(x=this.regexp.exec(c.text))&&x.indexthis.addMatch(S,e,w,y));n=n.update({filterFrom:h,filterTo:m,filter:(w,S)=>wm,add:g})}}return n}}const Uk=/x/.unicode!=null?"gu":"g",yle=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Uk),ble={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 P4=null;function wle(){var t;if(P4==null&&typeof document<"u"&&document.body){let e=document.body.style;P4=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return P4||!1}const uv=at.define({combine(t){let e=qo(t,{render:null,specialChars:yle,addSpecialChars:null});return(e.replaceTabs=!wle())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Uk)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Uk)),e}});function Sle(t={}){return[uv.of(t),kle()]}let GE=null;function kle(){return GE||(GE=Vr.fromClass(class{constructor(t){this.view=t,this.decorations=kt.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(uv)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new vle({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:s}=n.state,i=gi(e[0],0);if(i==9){let a=s.lineAt(r),l=n.state.tabSize,c=Of(a.text,l,r-a.from);return kt.replace({widget:new Cle((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[i]||(this.decorationCache[i]=kt.replace({widget:new Nle(t,i)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(uv);t.startState.facet(uv)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const Ole="•";function jle(t){return t>=32?Ole:t==10?"␤":String.fromCharCode(9216+t)}class Nle extends $o{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=jle(this.code),r=e.state.phrase("Control character")+" "+(ble[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,r,n);if(s)return s;let i=document.createElement("span");return i.textContent=n,i.title=r,i.setAttribute("aria-label",r),i.className="cm-specialChar",i}ignoreEvent(){return!1}}class Cle extends $o{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 Tle(){return _le}const Ele=kt.line({class:"cm-activeLine"}),_le=Vr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let s=t.lineBlockAt(r.head);s.from>e&&(n.push(Ele.range(s.from)),e=s.from)}return kt.set(n)}},{decorations:t=>t.decorations});class Mle extends $o{constructor(e){super(),this.content=e}toDOM(e){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?Kh(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),s=Bp(n[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 Ale(t){let e=Vr.fromClass(class{constructor(n){this.view=n,this.placeholder=t?kt.set([kt.widget({widget:new Mle(t),side:1}).range(0)]):kt.none}get decorations(){return this.view.state.doc.length?kt.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,Ze.contentAttributes.of({"aria-placeholder":t})]:e}const Wk=2e3;function Rle(t,e,n){let r=Math.min(e.line,n.line),s=Math.max(e.line,n.line),i=[];if(e.off>Wk||n.off>Wk||e.col<0||n.col<0){let a=Math.min(e.off,n.off),l=Math.max(e.off,n.off);for(let c=r;c<=s;c++){let d=t.doc.line(c);d.length<=l&&i.push(Ae.range(d.from+a,d.to+l))}}else{let a=Math.min(e.col,n.col),l=Math.max(e.col,n.col);for(let c=r;c<=s;c++){let d=t.doc.line(c),h=Ok(d.text,a,t.tabSize,!0);if(h<0)i.push(Ae.cursor(d.to));else{let m=Ok(d.text,l,t.tabSize);i.push(Ae.range(d.from+h,d.from+m))}}}return i}function Dle(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function XE(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),s=n-r.from,i=s>Wk?-1:s==r.length?Dle(t,e.clientX):Of(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:i,off:s}}function Ple(t,e){let n=XE(t,e),r=t.state.selection;return n?{update(s){if(s.docChanged){let i=s.changes.mapPos(s.startState.doc.line(n.line).from),a=s.state.doc.lineAt(i);n={line:a.number,col:n.col,off:Math.min(n.off,a.length)},r=r.map(s.changes)}},get(s,i,a){let l=XE(t,s);if(!l)return r;let c=Rle(t.state,n,l);return c.length?a?Ae.create(c.concat(r.ranges)):Ae.create(c):r}}:null}function zle(t){let e=(n=>n.altKey&&n.button==0);return Ze.mouseSelectionStyle.of((n,r)=>e(r)?Ple(n,r):null)}const Ile={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},Lle={style:"cursor: crosshair"};function Ble(t={}){let[e,n]=Ile[t.key||"Alt"],r=Vr.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||n(s))},keyup(s){(s.keyCode==e||!n(s))&&this.set(!1)},mousemove(s){this.set(n(s))}}});return[r,Ze.contentAttributes.of(s=>{var i;return!((i=s.plugin(r))===null||i===void 0)&&i.isDown?Lle:null})]}const l1="-10000px";class Sq{constructor(e,n,r,s){this.facet=n,this.createTooltipView=r,this.removeTooltipView=s,this.input=e.state.facet(n),this.tooltips=this.input.filter(a=>a);let i=null;this.tooltipViews=this.tooltips.map(a=>i=r(a,i))}update(e,n){var r;let s=e.state.facet(this.facet),i=s.filter(c=>c);if(s===this.input){for(let c of this.tooltipViews)c.update&&c.update(e);return!1}let a=[],l=n?[]:null;for(let c=0;cn[d]=c),n.length=l.length),this.input=s,this.tooltips=i,this.tooltipViews=a,!0}}function Fle(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const z4=at.define({combine:t=>{var e,n,r;return{position:et.ios?"absolute":((e=t.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(s=>s.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(s=>s.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||Fle}}}),YE=new WeakMap,o6=Vr.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(z4);this.position=e.position,this.parent=e.parent,this.classes=t.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 Sq(t,l6,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.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 t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet(z4);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;n=!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);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let s=document.createElement("div");s.className="cm-tooltip-arrow",n.dom.appendChild(s)}return n.dom.style.position=this.position,n.dom.style.top=l1,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(et.safari){let a=i.getBoundingClientRect();n=Math.abs(a.top+1e4)>1||Math.abs(a.left)>1}else n=!!i.offsetParent&&i.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(t=i.width/this.parent.offsetWidth,e=i.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),s=r6(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,a)=>{let l=this.manager.tooltipViews[a];return l.getCoords?l.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(z4).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:n,space:r,scaleX:s,scaleY:i}=t,a=[];for(let l=0;l=Math.min(n.bottom,r.bottom)||m.rightMath.min(n.right,r.right)+.1)){h.style.top=l1;continue}let x=c.arrow?d.dom.querySelector(".cm-tooltip-arrow"):null,y=x?7:0,w=g.right-g.left,S=(e=YE.get(d))!==null&&e!==void 0?e:g.bottom-g.top,k=d.offset||$le,j=this.view.textDirection==gr.LTR,N=g.width>r.right-r.left?j?r.left:r.right-g.width:j?Math.max(r.left,Math.min(m.left-(x?14:0)+k.x,r.right-w)):Math.min(Math.max(r.left,m.left-w+(x?14:0)-k.x),r.right-w),T=this.above[l];!c.strictSide&&(T?m.top-S-y-k.yr.bottom)&&T==r.bottom-m.bottom>m.top-r.top&&(T=this.above[l]=!T);let E=(T?m.top-r.top:r.bottom-m.bottom)-y;if(EN&&I.top<_+S&&I.bottom>_&&(_=T?I.top-S-2-y:I.bottom+y+2);if(this.position=="absolute"?(h.style.top=(_-t.parent.top)/i+"px",KE(h,(N-t.parent.left)/s)):(h.style.top=_/i+"px",KE(h,N/s)),x){let I=m.left+(j?k.x:-k.x)-(N+14-7);x.style.left=I/s+"px"}d.overlap!==!0&&a.push({left:N,top:_,right:M,bottom:_+S}),h.classList.toggle("cm-tooltip-above",T),h.classList.toggle("cm-tooltip-below",!T),d.positioned&&d.positioned(t.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 t of this.manager.tooltipViews)t.dom.style.top=l1}},{eventObservers:{scroll(){this.maybeMeasure()}}});function KE(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}const qle=Ze.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"}}}),$le={x:0,y:0},l6=at.define({enables:[o6,qle]}),Qv=at.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class ib{static create(e){return new ib(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Sq(e,Qv,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(e,n){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let r of this.manager.tooltipViews){let s=r[e];if(s!==void 0){if(n===void 0)n=s;else if(n!==s)return}}return n}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 Hle=l6.compute([Qv],t=>{let e=t.facet(Qv);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:ib.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class Qle{constructor(e,n,r,s,i){this.view=e,this.source=n,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;el.bottom||n.xl.right+e.defaultCharacterWidth)return;let c=e.bidiSpans(e.state.doc.lineAt(s)).find(h=>h.from<=s&&h.to>=s),d=c&&c.dir==gr.RTL?-1:1;i=n.x{this.pending==l&&(this.pending=null,c&&!(Array.isArray(c)&&!c.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(c)?c:[c])}))},c=>vi(e.state,c,"hover tooltip"))}else a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])})}get tooltip(){let e=this.view.plugin(o6),n=e?e.manager.tooltips.findIndex(r=>r.create==ib.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,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&&!Vle(i.dom,e)||this.pending){let{pos:a}=s[0]||this.pending,l=(r=(n=s[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:a;(a==l?this.view.posAtCoords(this.lastMove)!=a:!Ule(this.view,a,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.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 n=r=>{e.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const c1=4;function Vle(t,e){let{left:n,right:r,top:s,bottom:i}=t.getBoundingClientRect(),a;if(a=t.querySelector(".cm-tooltip-arrow")){let l=a.getBoundingClientRect();s=Math.min(l.top,s),i=Math.max(l.bottom,i)}return e.clientX>=n-c1&&e.clientX<=r+c1&&e.clientY>=s-c1&&e.clientY<=i+c1}function Ule(t,e,n,r,s,i){let a=t.scrollDOM.getBoundingClientRect(),l=t.documentTop+t.documentPadding.top+t.contentHeight;if(a.left>r||a.rights||Math.min(a.bottom,l)=e&&c<=n}function Wle(t,e={}){let n=Ft.define(),r=Os.define({create(){return[]},update(s,i){if(s.length&&(e.hideOnChange&&(i.docChanged||i.selection)?s=[]:e.hideOn&&(s=s.filter(a=>!e.hideOn(i,a))),i.docChanged)){let a=[];for(let l of s){let c=i.changes.mapPos(l.pos,-1,Rs.TrackDel);if(c!=null){let d=Object.assign(Object.create(null),l);d.pos=c,d.end!=null&&(d.end=i.changes.mapPos(d.end)),a.push(d)}}s=a}for(let a of i.effects)a.is(n)&&(s=a.value),a.is(Gle)&&(s=[]);return s},provide:s=>Qv.from(s)});return{active:r,extension:[r,Vr.define(s=>new Qle(s,t,r,n,e.hoverTime||300)),Hle]}}function kq(t,e){let n=t.plugin(o6);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const Gle=Ft.define(),ZE=at.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function $0(t,e){let n=t.plugin(Oq),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const Oq=Vr.fromClass(class{constructor(t){this.input=t.state.facet(H0),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(ZE);this.top=new u1(t,!0,e.topContainer),this.bottom=new u1(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(ZE);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new u1(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new u1(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(H0);if(n!=this.input){let r=n.filter(c=>c),s=[],i=[],a=[],l=[];for(let c of r){let d=this.specs.indexOf(c),h;d<0?(h=c(t.view),l.push(h)):(h=this.panels[d],h.update&&h.update(t)),s.push(h),(h.top?i:a).push(h)}this.specs=r,this.panels=s,this.top.sync(i),this.bottom.sync(a);for(let c of l)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>Ze.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class u1{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.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 n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=JE(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=JE(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 JE(t){let e=t.nextSibling;return t.remove(),e}const H0=at.define({enables:Oq});class $l extends sd{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}$l.prototype.elementClass="";$l.prototype.toDOM=void 0;$l.prototype.mapMode=Rs.TrackBefore;$l.prototype.startSide=$l.prototype.endSide=-1;$l.prototype.point=!0;const dv=at.define(),Xle=at.define(),Yle={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Rn.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},S0=at.define();function Kle(t){return[jq(),S0.of({...Yle,...t})]}const e_=at.define({combine:t=>t.some(e=>e)});function jq(t){return[Zle]}const Zle=Vr.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.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=t.state.facet(S0).map(e=>new n_(t,e)),this.fixed=!t.state.facet(e_);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),t.scrollDOM.insertBefore(this.dom,t.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(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.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(e_)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Rn.iter(this.view.state.facet(dv),this.view.viewport.from),r=[],s=this.gutters.map(i=>new Jle(i,this.view.viewport,-this.view.documentPadding.top));for(let i of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(i.type)){let a=!0;for(let l of i.type)if(l.type==ti.Text&&a){Gk(n,r,l.from);for(let c of s)c.line(this.view,l,r);a=!1}else if(l.widget)for(let c of s)c.widget(this.view,l)}else if(i.type==ti.Text){Gk(n,r,i.from);for(let a of s)a.line(this.view,i,r)}else if(i.widget)for(let a of s)a.widget(this.view,i);for(let i of s)i.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(S0),n=t.state.facet(S0),r=t.docChanged||t.heightChanged||t.viewportChanged||!Rn.eq(t.startState.facet(dv),t.state.facet(dv),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let s of this.gutters)s.update(t)&&(r=!0);else{r=!0;let s=[];for(let i of n){let a=e.indexOf(i);a<0?s.push(new n_(this.view,i)):(this.gutters[a].update(t),s.push(this.gutters[a]))}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 t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>Ze.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,s=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==gr.LTR?{left:r,right:s}:{right:r,left:s}})});function t_(t){return Array.isArray(t)?t:[t]}function Gk(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class Jle{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Rn.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:s}=this,i=(n.top-this.height)/e.scaleY,a=n.height/e.scaleY;if(this.i==s.elements.length){let l=new Nq(e,a,i,r);s.elements.push(l),s.dom.appendChild(l.dom)}else s.elements[this.i].update(e,a,i,r);this.height=n.bottom,this.i++}line(e,n,r){let s=[];Gk(this.cursor,s,n.from),r.length&&(s=s.concat(r));let i=this.gutter.config.lineMarker(e,n,s);i&&s.unshift(i);let a=this.gutter;s.length==0&&!a.config.renderEmptyElements||this.addElement(e,n,s)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),s=r?[r]:null;for(let i of e.state.facet(Xle)){let a=i(e,n.widget,n);a&&(s||(s=[])).push(a)}s&&this.addElement(e,n,s)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class n_{constructor(e,n){this.view=e,this.config=n,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 n.domEventHandlers)this.dom.addEventListener(r,s=>{let i=s.target,a;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let c=i.getBoundingClientRect();a=(c.top+c.bottom)/2}else a=s.clientY;let l=e.lineBlockAtHeight(a-e.documentTop);n.domEventHandlers[r](e,l,s)&&s.preventDefault()});this.markers=t_(n.markers(e)),n.initialSpacer&&(this.spacer=new Nq(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=t_(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!Rn.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class Nq{constructor(e,n,r,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,s)}update(e,n,r,s){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),ece(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,n){let r="cm-gutterElement",s=this.dom.firstChild;for(let i=0,a=0;;){let l=a,c=ii(l,c,d)||a(l,c,d):a}return r}})}});class I4 extends $l{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function L4(t,e){return t.state.facet(Ch).formatNumber(e,t.state)}const rce=S0.compute([Ch],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(tce)},lineMarker(e,n,r){return r.some(s=>s.toDOM)?null:new I4(L4(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let s of e.state.facet(nce)){let i=s(e,n,r);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(Ch)!=e.state.facet(Ch),initialSpacer(e){return new I4(L4(e,r_(e.state.doc.lines)))},updateSpacer(e,n){let r=L4(n.view,r_(n.view.state.doc.lines));return r==e.number?e:new I4(r)},domEventHandlers:t.facet(Ch).domEventHandlers,side:"before"}));function sce(t={}){return[Ch.of(t),jq(),rce]}function r_(t){let e=9;for(;e{let e=[],n=-1;for(let r of t.selection.ranges){let s=t.doc.lineAt(r.head).from;s>n&&(n=s,e.push(ice.range(s)))}return Rn.of(e)});function oce(){return ace}const Cq=1024;let lce=0;class B4{constructor(e,n){this.from=e,this.to=n}}class sn{constructor(e={}){this.id=lce++,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=ri.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}sn.closedBy=new sn({deserialize:t=>t.split(" ")});sn.openedBy=new sn({deserialize:t=>t.split(" ")});sn.group=new sn({deserialize:t=>t.split(" ")});sn.isolate=new sn({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});sn.contextHash=new sn({perNode:!0});sn.lookAhead=new sn({perNode:!0});sn.mounted=new sn({perNode:!0});class Vv{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[sn.mounted.id]}}const cce=Object.create(null);class ri{constructor(e,n,r,s=0){this.name=e,this.props=n,this.id=r,this.flags=s}static define(e){let n=e.props&&e.props.length?Object.create(null):cce,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new ri(e.name||"",n,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");n[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 n=this.prop(sn.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let s of r.split(" "))n[s]=e[r];return r=>{for(let s=r.prop(sn.group),i=-1;i<(s?s.length:0);i++){let a=n[i<0?r.name:s[i]];if(a)return a}}}}ri.none=new ri("",Object.create(null),0,8);class ab{constructor(e){this.types=e;for(let n=0;n0;for(let c=this.cursor(a|ds.IncludeAnonymous);;){let d=!1;if(c.from<=i&&c.to>=s&&(!l&&c.type.isAnonymous||n(c)!==!1)){if(c.firstChild())continue;d=!0}for(;d&&r&&(l||!c.type.isAnonymous)&&r(c),!c.nextSibling();){if(!c.parent())return;d=!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 n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:d6(ri.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,s)=>new ar(this.type,n,r,s,this.propValues),e.makeTree||((n,r,s)=>new ar(ri.none,n,r,s)))}static build(e){return fce(e)}}ar.empty=new ar(ri.none,[],[],0);class c6{constructor(e,n){this.buffer=e,this.index=n}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 c6(this.buffer,this.index)}}class Yc{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return ri.none}toString(){let e=[];for(let n=0;n0));c=a[c+3]);return l}slice(e,n,r){let s=this.buffer,i=new Uint16Array(n-e),a=0;for(let l=e,c=0;l=e&&ne;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function Q0(t,e,n,r){for(var s;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to0?l.length:-1;e!=d;e+=n){let h=l[e],m=c[e]+a.from;if(Tq(s,r,m,m+h.length)){if(h instanceof Yc){if(i&ds.ExcludeBuffers)continue;let g=h.findChild(0,h.buffer.length,n,r-m,s);if(g>-1)return new jo(new uce(a,h,e,m),null,g)}else if(i&ds.IncludeAnonymous||!h.type.isAnonymous||u6(h)){let g;if(!(i&ds.IgnoreMounts)&&(g=Vv.get(h))&&!g.overlay)return new ki(g.tree,m,e,a);let x=new ki(h,m,e,a);return i&ds.IncludeAnonymous||!x.type.isAnonymous?x:x.nextChild(n<0?h.children.length-1:0,n,r,s)}}}if(i&ds.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+n:e=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))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,n,r=0){let s;if(!(r&ds.IgnoreOverlays)&&(s=Vv.get(this._tree))&&s.overlay){let i=e-this.from;for(let{from:a,to:l}of s.overlay)if((n>0?a<=i:a=i:l>i))return new ki(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,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 i_(t,e,n,r){let s=t.cursor(),i=[];if(!s.firstChild())return i;if(n!=null){for(let a=!1;!a;)if(a=s.type.is(n),!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 Xk(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class uce{constructor(e,n,r,s){this.parent=e,this.buffer=n,this.index=r,this.start=s}}class jo extends Eq{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,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:s}=this.context,i=s.findChild(this.index+4,s.buffer[this.index+3],e,n-this.context.start,r);return i<0?null:new jo(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,n,r=0){if(r&ds.ExcludeBuffers)return null;let{buffer:s}=this.context,i=s.findChild(this.index+4,s.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return i<0?null:new jo(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,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new jo(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new jo(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,s=this.index+4,i=r.buffer[this.index+3];if(i>s){let a=r.buffer[this.index+1];e.push(r.slice(s,i,a)),n.push(0)}return new ar(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function _q(t){if(!t.length)return null;let e=0,n=t[0];for(let i=1;in.from||a.to=e){let l=new ki(a.tree,a.overlay[0].from+i.from,-1,i);(s||(s=[r])).push(Q0(l,e,n,!1))}}return s?_q(s):r}class Yk{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof ki)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,n){this.index=e;let{start:r,buffer:s}=this.buffer;return this.type=n||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 ki?(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,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:s}=this.buffer,i=s.findChild(this.index+4,s.buffer[this.index+3],e,n-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,n,r=this.mode){return this.buffer?r&ds.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ds.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&ds.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:n}=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(n.findChild(s,this.index,-1,0,4))}else{let s=n.buffer[this.index+3];if(s<(r<0?n.buffer.length:n.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 n,r,{buffer:s}=this;if(s){if(e>0){if(this.index-1)for(let i=n+e,a=e<0?-1:r._tree.children.length;i!=a;i+=e){let l=r._tree.children[i];if(this.mode&ds.IncludeAnonymous||l instanceof Yc||!l.type.isAnonymous||u6(l))return!1}return!0}move(e,n){if(n&&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,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to=0;){for(let a=e;a;a=a._parent)if(a.index==s){if(s==this.index)return a;n=a,r=i+1;break e}s=this.stack[--i]}for(let s=r;s=0;i--){if(i<0)return Xk(this._tree,e,s);let a=r[n.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[s]&&e[s]!=a.name)return!1;s--}}return!0}}function u6(t){return t.children.some(e=>e instanceof Yc||!e.type.isAnonymous||u6(e))}function fce(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:s=Cq,reused:i=[],minRepeatType:a=r.types.length}=t,l=Array.isArray(n)?new c6(n,n.length):n,c=r.types,d=0,h=0;function m(E,_,M,I,P,L){let{id:H,start:U,end:ee,size:z}=l,Q=h,B=d;if(z<0)if(l.next(),z==-1){let ie=i[H];M.push(ie),I.push(U-E);return}else if(z==-3){d=H;return}else if(z==-4){h=H;return}else throw new RangeError(`Unrecognized record size: ${z}`);let X=c[H],J,G,R=U-E;if(ee-U<=s&&(G=S(l.pos-_,P))){let ie=new Uint16Array(G.size-G.skip),W=l.pos-G.size,q=ie.length;for(;l.pos>W;)q=k(G.start,ie,q);J=new Yc(ie,ee-G.start,r),R=G.start-E}else{let ie=l.pos-z;l.next();let W=[],q=[],V=H>=a?H:-1,te=0,ne=ee;for(;l.pos>ie;)V>=0&&l.id==V&&l.size>=0?(l.end<=ne-s&&(y(W,q,U,te,l.end,ne,V,Q,B),te=W.length,ne=l.end),l.next()):L>2500?g(U,ie,W,q):m(U,ie,W,q,V,L+1);if(V>=0&&te>0&&te-1&&te>0){let K=x(X,B);J=d6(X,W,q,0,W.length,0,ee-U,K,K)}else J=w(X,W,q,ee-U,Q-ee,B)}M.push(J),I.push(R)}function g(E,_,M,I){let P=[],L=0,H=-1;for(;l.pos>_;){let{id:U,start:ee,end:z,size:Q}=l;if(Q>4)l.next();else{if(H>-1&&ee=0;z-=3)U[Q++]=P[z],U[Q++]=P[z+1]-ee,U[Q++]=P[z+2]-ee,U[Q++]=Q;M.push(new Yc(U,P[2]-ee,r)),I.push(ee-E)}}function x(E,_){return(M,I,P)=>{let L=0,H=M.length-1,U,ee;if(H>=0&&(U=M[H])instanceof ar){if(!H&&U.type==E&&U.length==P)return U;(ee=U.prop(sn.lookAhead))&&(L=I[H]+U.length+ee)}return w(E,M,I,P,L,_)}}function y(E,_,M,I,P,L,H,U,ee){let z=[],Q=[];for(;E.length>I;)z.push(E.pop()),Q.push(_.pop()+M-P);E.push(w(r.types[H],z,Q,L-P,U-L,ee)),_.push(P-M)}function w(E,_,M,I,P,L,H){if(L){let U=[sn.contextHash,L];H=H?[U].concat(H):[U]}if(P>25){let U=[sn.lookAhead,P];H=H?[U].concat(H):[U]}return new ar(E,_,M,I,H)}function S(E,_){let M=l.fork(),I=0,P=0,L=0,H=M.end-s,U={size:0,start:0,skip:0};e:for(let ee=M.pos-E;M.pos>ee;){let z=M.size;if(M.id==_&&z>=0){U.size=I,U.start=P,U.skip=L,L+=4,I+=4,M.next();continue}let Q=M.pos-z;if(z<0||Q=a?4:0,X=M.start;for(M.next();M.pos>Q;){if(M.size<0)if(M.size==-3)B+=4;else break e;else M.id>=a&&(B+=4);M.next()}P=X,I+=z,L+=B}return(_<0||I==E)&&(U.size=I,U.start=P,U.skip=L),U.size>4?U:void 0}function k(E,_,M){let{id:I,start:P,end:L,size:H}=l;if(l.next(),H>=0&&I4){let ee=l.pos-(H-4);for(;l.pos>ee;)M=k(E,_,M)}_[--M]=U,_[--M]=L-E,_[--M]=P-E,_[--M]=I}else H==-3?d=I:H==-4&&(h=I);return M}let j=[],N=[];for(;l.pos>0;)m(t.start||0,t.bufferStart||0,j,N,-1,0);let T=(e=t.length)!==null&&e!==void 0?e:j.length?N[0]+j[0].length:0;return new ar(c[t.topID],j.reverse(),N.reverse(),T)}const a_=new WeakMap;function hv(t,e){if(!t.isAnonymous||e instanceof Yc||e.type!=t)return 1;let n=a_.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof ar)){n=1;break}n+=hv(t,r)}a_.set(e,n)}return n}function d6(t,e,n,r,s,i,a,l,c){let d=0;for(let y=r;y=h)break;_+=M}if(N==T+1){if(_>h){let M=y[T];x(M.children,M.positions,0,M.children.length,w[T]+j);continue}m.push(y[T])}else{let M=w[N-1]+y[N-1].length-E;m.push(d6(t,y,w,T,N,E,M,null,c))}g.push(E+j-i)}}return x(e,n,r,s,0),(l||c)(m,g,a)}class mce{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof jo?this.setBuffer(e.context.buffer,e.index,n):e instanceof ki&&this.map.set(e.tree,n)}get(e){return e instanceof jo?this.getBuffer(e.context.buffer,e.index):e instanceof ki?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Ju{constructor(e,n,r,s,i=!1,a=!1){this.from=e,this.to=n,this.tree=r,this.offset=s,this.open=(i?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let s=[new Ju(0,e.length,e,0,!1,r)];for(let i of n)i.to>e.length&&s.push(i);return s}static applyChanges(e,n,r=128){if(!n.length)return e;let s=[],i=1,a=e.length?e[0]:null;for(let l=0,c=0,d=0;;l++){let h=l=r)for(;a&&a.from=g.from||m<=g.to||d){let x=Math.max(g.from,c)-d,y=Math.min(g.to,m)-d;g=x>=y?null:new Ju(x,y,g.tree,g.offset+d,l>0,!!h)}if(g&&s.push(g),a.to>m)break;a=inew B4(s.from,s.to)):[new B4(0,0)]:[new B4(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let s=this.startParse(e,n,r);for(;;){let i=s.advance();if(i)return i}}};class pce{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new sn({perNode:!0});let gce=0;class ha{constructor(e,n,r,s){this.name=e,this.set=n,this.base=r,this.modified=s,this.id=gce++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof ha&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let s=new ha(r,[],null,[]);if(s.set.push(s),n)for(let i of n.set)s.set.push(i);return s}static defineModifier(e){let n=new Uv(e);return r=>r.modified.indexOf(n)>-1?r:Uv.get(r.base||r,r.modified.concat(n).sort((s,i)=>s.id-i.id))}}let xce=0;class Uv{constructor(e){this.name=e,this.instances=[],this.id=xce++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(l=>l.base==e&&vce(n,l.modified));if(r)return r;let s=[],i=new ha(e.name,s,e,n);for(let l of n)l.instances.push(i);let a=yce(n);for(let l of e.set)if(!l.modified.length)for(let c of a)s.push(Uv.get(l,c));return i}}function vce(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function yce(t){let e=[[]];for(let n=0;nr.length-n.length)}function f6(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let s of n.split(" "))if(s){let i=[],a=2,l=s;for(let m=0;;){if(l=="..."&&m>0&&m+3==s.length){a=1;break}let g=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!g)throw new RangeError("Invalid path: "+s);if(i.push(g[0]=="*"?"":g[0][0]=='"'?JSON.parse(g[0]):g[0]),m+=g[0].length,m==s.length)break;let x=s[m++];if(m==s.length&&x=="!"){a=0;break}if(x!="/")throw new RangeError("Invalid path: "+s);l=s.slice(m)}let c=i.length-1,d=i[c];if(!d)throw new RangeError("Invalid path: "+s);let h=new V0(r,a,c>0?i.slice(0,c):null);e[d]=h.sort(e[d])}}return Mq.add(e)}const Mq=new sn({combine(t,e){let n,r,s;for(;t||e;){if(!t||e&&t.depth>=e.depth?(s=e,e=e.next):(s=t,t=t.next),n&&n.mode==s.mode&&!s.context&&!n.context)continue;let i=new V0(s.tags,s.mode,s.context);n?n.next=i:r=i,n=i}return r}});class V0{constructor(e,n,r,s){this.tags=e,this.mode=n,this.context=r,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let a=s;for(let l of i)for(let c of l.set){let d=n[c.id];if(d){a=a?a+" "+d:d;break}}return a},scope:r}}function bce(t,e){let n=null;for(let r of t){let s=r.style(e);s&&(n=n?n+" "+s:s)}return n}function wce(t,e,n,r=0,s=t.length){let i=new Sce(r,Array.isArray(e)?e:[e],n);i.highlightRange(t.cursor(),r,s,"",i.highlighters),i.flush(s)}class Sce{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,s,i){let{type:a,from:l,to:c}=e;if(l>=r||c<=n)return;a.isTop&&(i=this.highlighters.filter(x=>!x.scope||x.scope(a)));let d=s,h=kce(e)||V0.empty,m=bce(i,h.tags);if(m&&(d&&(d+=" "),d+=m,h.mode==1&&(s+=(s?" ":"")+m)),this.startSpan(Math.max(n,l),d),h.opaque)return;let g=e.tree&&e.tree.prop(sn.mounted);if(g&&g.overlay){let x=e.node.enter(g.overlay[0].from+l,1),y=this.highlighters.filter(S=>!S.scope||S.scope(g.tree.type)),w=e.firstChild();for(let S=0,k=l;;S++){let j=S=N||!e.nextSibling())););if(!j||N>r)break;k=j.to+l,k>n&&(this.highlightRange(x.cursor(),Math.max(n,j.from+l),Math.min(r,k),"",y),this.startSpan(Math.min(r,k),d))}w&&e.parent()}else if(e.firstChild()){g&&(s="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,s,i),this.startSpan(Math.min(r,e.to),d)}while(e.nextSibling());e.parent()}}}function kce(t){let e=t.type.prop(Mq);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Ke=ha.define,h1=Ke(),Mc=Ke(),o_=Ke(Mc),l_=Ke(Mc),Ac=Ke(),f1=Ke(Ac),F4=Ke(Ac),po=Ke(),Ru=Ke(po),fo=Ke(),mo=Ke(),Kk=Ke(),Bm=Ke(Kk),m1=Ke(),xe={comment:h1,lineComment:Ke(h1),blockComment:Ke(h1),docComment:Ke(h1),name:Mc,variableName:Ke(Mc),typeName:o_,tagName:Ke(o_),propertyName:l_,attributeName:Ke(l_),className:Ke(Mc),labelName:Ke(Mc),namespace:Ke(Mc),macroName:Ke(Mc),literal:Ac,string:f1,docString:Ke(f1),character:Ke(f1),attributeValue:Ke(f1),number:F4,integer:Ke(F4),float:Ke(F4),bool:Ke(Ac),regexp:Ke(Ac),escape:Ke(Ac),color:Ke(Ac),url:Ke(Ac),keyword:fo,self:Ke(fo),null:Ke(fo),atom:Ke(fo),unit:Ke(fo),modifier:Ke(fo),operatorKeyword:Ke(fo),controlKeyword:Ke(fo),definitionKeyword:Ke(fo),moduleKeyword:Ke(fo),operator:mo,derefOperator:Ke(mo),arithmeticOperator:Ke(mo),logicOperator:Ke(mo),bitwiseOperator:Ke(mo),compareOperator:Ke(mo),updateOperator:Ke(mo),definitionOperator:Ke(mo),typeOperator:Ke(mo),controlOperator:Ke(mo),punctuation:Kk,separator:Ke(Kk),bracket:Bm,angleBracket:Ke(Bm),squareBracket:Ke(Bm),paren:Ke(Bm),brace:Ke(Bm),content:po,heading:Ru,heading1:Ke(Ru),heading2:Ke(Ru),heading3:Ke(Ru),heading4:Ke(Ru),heading5:Ke(Ru),heading6:Ke(Ru),contentSeparator:Ke(po),list:Ke(po),quote:Ke(po),emphasis:Ke(po),strong:Ke(po),link:Ke(po),monospace:Ke(po),strikethrough:Ke(po),inserted:Ke(),deleted:Ke(),changed:Ke(),invalid:Ke(),meta:m1,documentMeta:Ke(m1),annotation:Ke(m1),processingInstruction:Ke(m1),definition:ha.defineModifier("definition"),constant:ha.defineModifier("constant"),function:ha.defineModifier("function"),standard:ha.defineModifier("standard"),local:ha.defineModifier("local"),special:ha.defineModifier("special")};for(let t in xe){let e=xe[t];e instanceof ha&&(e.name=t)}Aq([{tag:xe.link,class:"tok-link"},{tag:xe.heading,class:"tok-heading"},{tag:xe.emphasis,class:"tok-emphasis"},{tag:xe.strong,class:"tok-strong"},{tag:xe.keyword,class:"tok-keyword"},{tag:xe.atom,class:"tok-atom"},{tag:xe.bool,class:"tok-bool"},{tag:xe.url,class:"tok-url"},{tag:xe.labelName,class:"tok-labelName"},{tag:xe.inserted,class:"tok-inserted"},{tag:xe.deleted,class:"tok-deleted"},{tag:xe.literal,class:"tok-literal"},{tag:xe.string,class:"tok-string"},{tag:xe.number,class:"tok-number"},{tag:[xe.regexp,xe.escape,xe.special(xe.string)],class:"tok-string2"},{tag:xe.variableName,class:"tok-variableName"},{tag:xe.local(xe.variableName),class:"tok-variableName tok-local"},{tag:xe.definition(xe.variableName),class:"tok-variableName tok-definition"},{tag:xe.special(xe.variableName),class:"tok-variableName2"},{tag:xe.definition(xe.propertyName),class:"tok-propertyName tok-definition"},{tag:xe.typeName,class:"tok-typeName"},{tag:xe.namespace,class:"tok-namespace"},{tag:xe.className,class:"tok-className"},{tag:xe.macroName,class:"tok-macroName"},{tag:xe.propertyName,class:"tok-propertyName"},{tag:xe.operator,class:"tok-operator"},{tag:xe.comment,class:"tok-comment"},{tag:xe.meta,class:"tok-meta"},{tag:xe.invalid,class:"tok-invalid"},{tag:xe.punctuation,class:"tok-punctuation"}]);var q4;const Qu=new sn;function Rq(t){return at.define({combine:t?e=>e.concat(t):void 0})}const Oce=new sn;class va{constructor(e,n,r=[],s=""){this.data=e,this.name=s,bn.prototype.hasOwnProperty("tree")||Object.defineProperty(bn.prototype,"tree",{get(){return ws(this)}}),this.parser=n,this.extension=[Kc.of(this),bn.languageData.of((i,a,l)=>{let c=c_(i,a,l),d=c.type.prop(Qu);if(!d)return[];let h=i.facet(d),m=c.type.prop(Oce);if(m){let g=c.resolve(a-c.from,l);for(let x of m)if(x.test(g,i)){let y=i.facet(x.facet);return x.type=="replace"?y:y.concat(h)}}return h})].concat(r)}isActiveAt(e,n,r=-1){return c_(e,n,r).type.prop(Qu)==this.data}findRegions(e){let n=e.facet(Kc);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],s=(i,a)=>{if(i.prop(Qu)==this.data){r.push({from:a,to:a+i.length});return}let l=i.prop(sn.mounted);if(l){if(l.tree.prop(Qu)==this.data){if(l.overlay)for(let c of l.overlay)r.push({from:c.from+a,to:c.to+a});else r.push({from:a,to:a+i.length});return}else if(l.overlay){let c=r.length;if(s(l.tree,l.overlay[0].from+a),r.length>c)return}}for(let c=0;cr.isTop?n:void 0)]}),e.name)}configure(e,n){return new U0(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ws(t){let e=t.field(va.state,!1);return e?e.tree:ar.empty}class jce{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,n){let r=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let Fm=null;class tf{constructor(e,n,r=[],s,i,a,l,c){this.parser=e,this.state=n,this.fragments=r,this.tree=s,this.treeLen=i,this.viewport=a,this.skipped=l,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new tf(e,n,[],ar.empty,0,r,[],null)}startParse(){return this.parser.startParse(new jce(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=ar.empty&&this.isDone(n??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()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Ju.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=Fm;Fm=this;try{return e()}finally{Fm=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=u_(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:s,treeLen:i,viewport:a,skipped:l}=this;if(this.takeTree(),!e.empty){let c=[];if(e.iterChangedRanges((d,h,m,g)=>c.push({fromA:d,toA:h,fromB:m,toB:g})),r=Ju.applyChanges(r,c),s=ar.empty,i=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){l=[];for(let d of this.skipped){let h=e.mapPos(d.from,1),m=e.mapPos(d.to,-1);he.from&&(this.fragments=u_(this.fragments,s,i),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends h6{createParse(n,r,s){let i=s[0].from,a=s[s.length-1].to;return{parsedPos:i,advance(){let c=Fm;if(c){for(let d of s)c.tempSkipped.push(d);e&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,e]):e)}return this.parsedPos=a,new ar(ri.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return Fm}}function u_(t,e,n){return Ju.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class nf{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=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),n.viewport.to);return n.work(20,r)||n.takeTree(),new nf(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=tf.create(e.facet(Kc).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new nf(r)}}va.state=Os.define({create:nf.init,update(t,e){for(let n of e.effects)if(n.is(va.setState))return n.value;return e.startState.facet(Kc)!=e.state.facet(Kc)?nf.init(e.state):t.apply(e)}});let Dq=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Dq=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const $4=typeof navigator<"u"&&(!((q4=navigator.scheduling)===null||q4===void 0)&&q4.isInputPending)?()=>navigator.scheduling.isInputPending():null,Nce=Vr.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 n=this.view.state.field(va.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(va.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=Dq(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnds+1e3,c=i.context.work(()=>$4&&$4()||Date.now()>a,s+(l?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:va.setState.of(new nf(i.context))})),this.chunkBudget>0&&!(c&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>vi(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Kc=at.define({combine(t){return t.length?t[0]:null},enables:t=>[va.state,Nce,Ze.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class Pq{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const Cce=at.define(),Vp=at.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function ld(t){let e=t.facet(Vp);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function W0(t,e){let n="",r=t.tabSize,s=t.facet(Vp)[0];if(s==" "){for(;e>=r;)n+=" ",e-=r;s=" "}for(let i=0;i=e?Tce(t,n,e):null}class ob{constructor(e,n={}){this.state=e,this.options=n,this.unit=ld(e)}lineAt(e,n=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}:(n<0?s-1&&(i+=a-this.countColumn(r,r.search(/\S|$/))),i}countColumn(e,n=e.length){return Of(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:s}=this.lineAt(e,n),i=this.options.overrideIndentation;if(i){let a=i(s);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const lb=new sn;function Tce(t,e,n){let r=e.resolveStack(n),s=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(s!=r.node){let i=[];for(let a=s;a&&!(a.fromr.node.to||a.from==r.node.from&&a.type==r.node.type);a=a.parent)i.push(a);for(let a=i.length-1;a>=0;a--)r={node:i[a],next:r}}return zq(r,t,n)}function zq(t,e,n){for(let r=t;r;r=r.next){let s=_ce(r.node);if(s)return s(p6.create(e,n,r))}return 0}function Ece(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function _ce(t){let e=t.type.prop(lb);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(sn.closedBy))){let s=t.lastChild,i=s&&r.indexOf(s.name)>-1;return a=>Iq(a,!0,1,void 0,i&&!Ece(a)?s.from:void 0)}return t.parent==null?Mce:null}function Mce(){return 0}class p6 extends ob{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new p6(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(Ace(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return zq(this.context.next,this.base,this.pos)}}function Ace(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function Rce(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let s=t.options.simulateBreak,i=t.state.doc.lineAt(n.from),a=s==null||s<=i.from?i.to:Math.min(i.to,s);for(let l=n.to;;){let c=e.childAfter(l);if(!c||c==r)return null;if(!c.type.isSkipped){if(c.from>=a)return null;let d=/^ */.exec(i.text.slice(n.to-i.from))[0].length;return{from:n.from,to:n.to+d}}l=c.to}}function H4({closing:t,align:e=!0,units:n=1}){return r=>Iq(r,e,n,t)}function Iq(t,e,n,r,s){let i=t.textAfter,a=i.match(/^\s*/)[0].length,l=r&&i.slice(a,a+r.length)==r||s==t.pos+a,c=e?Rce(t):null;return c?l?t.column(c.from):t.column(c.to):t.baseIndent+(l?0:t.unit*n)}function d_({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const Dce=200;function Pce(){return bn.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,s=n.lineAt(r);if(r>s.from+Dce)return t;let i=n.sliceString(s.from,r);if(!e.some(d=>d.test(i)))return t;let{state:a}=t,l=-1,c=[];for(let{head:d}of a.selection.ranges){let h=a.doc.lineAt(d);if(h.from==l)continue;l=h.from;let m=m6(a,h.from);if(m==null)continue;let g=/^\s*/.exec(h.text)[0],x=W0(a,m);g!=x&&c.push({from:h.from,to:h.from+g.length,insert:x})}return c.length?[t,{changes:c,sequential:!0}]:t})}const zce=at.define(),g6=new sn;function Lq(t){let e=t.firstChild,n=t.lastChild;return e&&e.ton)continue;if(i&&l.from=e&&d.to>n&&(i=d)}}return i}function Lce(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function Wv(t,e,n){for(let r of t.facet(zce)){let s=r(t,e,n);if(s)return s}return Ice(t,e,n)}function Bq(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const cb=Ft.define({map:Bq}),Up=Ft.define({map:Bq});function Fq(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const cd=Os.define({create(){return kt.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,r)=>t=h_(t,n,r)),t=t.map(e.changes);for(let n of e.effects)if(n.is(cb)&&!Bce(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(Hq),s=r?kt.replace({widget:new Uce(r(e.state,n.value))}):f_;t=t.update({add:[s.range(n.value.from,n.value.to)]})}else n.is(Up)&&(t=t.update({filter:(r,s)=>n.value.from!=r||n.value.to!=s,filterFrom:n.value.from,filterTo:n.value.to}));return e.selection&&(t=h_(t,e.selection.main.head)),t},provide:t=>Ze.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,s)=>{n.push(r,s)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n{se&&(r=!0)}),r?t.update({filterFrom:e,filterTo:n,filter:(s,i)=>s>=n||i<=e}):t}function Gv(t,e,n){var r;let s=null;return(r=t.field(cd,!1))===null||r===void 0||r.between(e,n,(i,a)=>{(!s||s.from>i)&&(s={from:i,to:a})}),s}function Bce(t,e,n){let r=!1;return t.between(e,e,(s,i)=>{s==e&&i==n&&(r=!0)}),r}function qq(t,e){return t.field(cd,!1)?e:e.concat(Ft.appendConfig.of(Qq()))}const Fce=t=>{for(let e of Fq(t)){let n=Wv(t.state,e.from,e.to);if(n)return t.dispatch({effects:qq(t.state,[cb.of(n),$q(t,n)])}),!0}return!1},qce=t=>{if(!t.state.field(cd,!1))return!1;let e=[];for(let n of Fq(t)){let r=Gv(t.state,n.from,n.to);r&&e.push(Up.of(r),$q(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function $q(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,s=t.state.doc.lineAt(e.to).number;return Ze.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${s}.`)}const $ce=t=>{let{state:e}=t,n=[];for(let r=0;r{let e=t.state.field(cd,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,s)=>{n.push(Up.of({from:r,to:s}))}),t.dispatch({effects:n}),!0},Qce=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Fce},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:qce},{key:"Ctrl-Alt-[",run:$ce},{key:"Ctrl-Alt-]",run:Hce}],Vce={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Hq=at.define({combine(t){return qo(t,Vce)}});function Qq(t){return[cd,Xce]}function Vq(t,e){let{state:n}=t,r=n.facet(Hq),s=a=>{let l=t.lineBlockAt(t.posAtDOM(a.target)),c=Gv(t.state,l.from,l.to);c&&t.dispatch({effects:Up.of(c)}),a.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,s,e);let i=document.createElement("span");return i.textContent=r.placeholderText,i.setAttribute("aria-label",n.phrase("folded code")),i.title=n.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=s,i}const f_=kt.replace({widget:new class extends $o{toDOM(t){return Vq(t,null)}}});class Uce extends $o{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Vq(e,this.value)}}const Wce={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Q4 extends $l{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function Gce(t={}){let e={...Wce,...t},n=new Q4(e,!0),r=new Q4(e,!1),s=Vr.fromClass(class{constructor(a){this.from=a.viewport.from,this.markers=this.buildMarkers(a)}update(a){(a.docChanged||a.viewportChanged||a.startState.facet(Kc)!=a.state.facet(Kc)||a.startState.field(cd,!1)!=a.state.field(cd,!1)||ws(a.startState)!=ws(a.state)||e.foldingChanged(a))&&(this.markers=this.buildMarkers(a.view))}buildMarkers(a){let l=new Fl;for(let c of a.viewportLineBlocks){let d=Gv(a.state,c.from,c.to)?r:Wv(a.state,c.from,c.to)?n:null;d&&l.add(c.from,c.from,d)}return l.finish()}}),{domEventHandlers:i}=e;return[s,Kle({class:"cm-foldGutter",markers(a){var l;return((l=a.plugin(s))===null||l===void 0?void 0:l.markers)||Rn.empty},initialSpacer(){return new Q4(e,!1)},domEventHandlers:{...i,click:(a,l,c)=>{if(i.click&&i.click(a,l,c))return!0;let d=Gv(a.state,l.from,l.to);if(d)return a.dispatch({effects:Up.of(d)}),!0;let h=Wv(a.state,l.from,l.to);return h?(a.dispatch({effects:cb.of(h)}),!0):!1}}}),Qq()]}const Xce=Ze.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 Wp{constructor(e,n){this.specs=e;let r;function s(l){let c=Wc.newName();return(r||(r=Object.create(null)))["."+c]=l,c}const i=typeof n.all=="string"?n.all:n.all?s(n.all):void 0,a=n.scope;this.scope=a instanceof va?l=>l.prop(Qu)==a.data:a?l=>l==a:void 0,this.style=Aq(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:i}).style,this.module=r?new Wc(r):null,this.themeType=n.themeType}static define(e,n){return new Wp(e,n||{})}}const Zk=at.define(),Uq=at.define({combine(t){return t.length?[t[0]]:null}});function V4(t){let e=t.facet(Zk);return e.length?e:t.facet(Uq)}function Wq(t,e){let n=[Kce],r;return t instanceof Wp&&(t.module&&n.push(Ze.styleModule.of(t.module)),r=t.themeType),e?.fallback?n.push(Uq.of(t)):r?n.push(Zk.computeN([Ze.darkTheme],s=>s.facet(Ze.darkTheme)==(r=="dark")?[t]:[])):n.push(Zk.of(t)),n}class Yce{constructor(e){this.markCache=Object.create(null),this.tree=ws(e.state),this.decorations=this.buildDeco(e,V4(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=ws(e.state),r=V4(e.state),s=r!=V4(e.startState),{viewport:i}=e.view,a=e.changes.mapPos(this.decoratedTo,1);n.length=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(n!=this.tree||e.viewportChanged||s)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=i.to)}buildDeco(e,n){if(!n||!this.tree.length)return kt.none;let r=new Fl;for(let{from:s,to:i}of e.visibleRanges)wce(this.tree,n,(a,l,c)=>{r.add(a,l,this.markCache[c]||(this.markCache[c]=kt.mark({class:c})))},s,i);return r.finish()}}const Kce=ou.high(Vr.fromClass(Yce,{decorations:t=>t.decorations})),Zce=Wp.define([{tag:xe.meta,color:"#404740"},{tag:xe.link,textDecoration:"underline"},{tag:xe.heading,textDecoration:"underline",fontWeight:"bold"},{tag:xe.emphasis,fontStyle:"italic"},{tag:xe.strong,fontWeight:"bold"},{tag:xe.strikethrough,textDecoration:"line-through"},{tag:xe.keyword,color:"#708"},{tag:[xe.atom,xe.bool,xe.url,xe.contentSeparator,xe.labelName],color:"#219"},{tag:[xe.literal,xe.inserted],color:"#164"},{tag:[xe.string,xe.deleted],color:"#a11"},{tag:[xe.regexp,xe.escape,xe.special(xe.string)],color:"#e40"},{tag:xe.definition(xe.variableName),color:"#00f"},{tag:xe.local(xe.variableName),color:"#30a"},{tag:[xe.typeName,xe.namespace],color:"#085"},{tag:xe.className,color:"#167"},{tag:[xe.special(xe.variableName),xe.macroName],color:"#256"},{tag:xe.definition(xe.propertyName),color:"#00c"},{tag:xe.comment,color:"#940"},{tag:xe.invalid,color:"#f00"}]),Jce=Ze.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Gq=1e4,Xq="()[]{}",Yq=at.define({combine(t){return qo(t,{afterCursor:!0,brackets:Xq,maxScanDistance:Gq,renderMatch:nue})}}),eue=kt.mark({class:"cm-matchingBracket"}),tue=kt.mark({class:"cm-nonmatchingBracket"});function nue(t){let e=[],n=t.matched?eue:tue;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const rue=Os.define({create(){return kt.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(Yq);for(let s of e.state.selection.ranges){if(!s.empty)continue;let i=No(e.state,s.head,-1,r)||s.head>0&&No(e.state,s.head-1,1,r)||r.afterCursor&&(No(e.state,s.head,1,r)||s.headZe.decorations.from(t)}),sue=[rue,Jce];function iue(t={}){return[Yq.of(t),sue]}const aue=new sn;function Jk(t,e,n){let r=t.prop(e<0?sn.openedBy:sn.closedBy);if(r)return r;if(t.name.length==1){let s=n.indexOf(t.name);if(s>-1&&s%2==(e<0?1:0))return[n[s+e]]}return null}function eO(t){let e=t.type.prop(aue);return e?e(t.node):t}function No(t,e,n,r={}){let s=r.maxScanDistance||Gq,i=r.brackets||Xq,a=ws(t),l=a.resolveInner(e,n);for(let c=l;c;c=c.parent){let d=Jk(c.type,n,i);if(d&&c.from0?e>=h.from&&eh.from&&e<=h.to))return oue(t,e,n,c,h,d,i)}}return lue(t,e,n,a,l.type,s,i)}function oue(t,e,n,r,s,i,a){let l=r.parent,c={from:s.from,to:s.to},d=0,h=l?.cursor();if(h&&(n<0?h.childBefore(r.from):h.childAfter(r.to)))do if(n<0?h.to<=r.from:h.from>=r.to){if(d==0&&i.indexOf(h.type.name)>-1&&h.from0)return null;let d={from:n<0?e-1:e,to:n>0?e+1:e},h=t.doc.iterRange(e,n>0?t.doc.length:0),m=0;for(let g=0;!h.next().done&&g<=i;){let x=h.value;n<0&&(g+=x.length);let y=e+g*n;for(let w=n>0?0:x.length-1,S=n>0?x.length:-1;w!=S;w+=n){let k=a.indexOf(x[w]);if(!(k<0||r.resolveInner(y+w,1).type!=s))if(k%2==0==n>0)m++;else{if(m==1)return{start:d,end:{from:y+w,to:y+w+1},matched:k>>1==c>>1};m--}}n>0&&(g+=x.length)}return h.done?{start:d,matched:!1}:null}function m_(t,e,n,r=0,s=0){e==null&&(e=t.search(/[^\s\u00a0]/),e==-1&&(e=t.length));let i=s;for(let a=r;a=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.posn}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 n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosr?a.toLowerCase():a,i=this.string.substr(this.pos,e.length);return s(i)==s(e)?(n!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&n!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function cue(t){return{name:t.name||"",token:t.token,blankLine:t.blankLine||(()=>{}),startState:t.startState||(()=>!0),copyState:t.copyState||uue,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||y6,mergeTokens:t.mergeTokens!==!1}}function uue(t){if(typeof t!="object")return t;let e={};for(let n in t){let r=t[n];e[n]=r instanceof Array?r.slice():r}return e}const p_=new WeakMap;class x6 extends va{constructor(e){let n=Rq(e.languageData),r=cue(e),s,i=new class extends h6{createParse(a,l,c){return new hue(s,a,l,c)}};super(n,i,[],e.name),this.topNode=pue(n,this),s=this,this.streamParser=r,this.stateAfter=new sn({perNode:!0}),this.tokenTable=e.tokenTable?new t$(r.tokenTable):mue}static define(e){return new x6(e)}getIndent(e){let n,{overrideIndentation:r}=e.options;r&&(n=p_.get(e.state),n!=null&&n1e4)return null;for(;i=r&&n+e.length<=s&&e.prop(t.stateAfter);if(i)return{state:t.streamParser.copyState(i),pos:n+e.length};for(let a=e.children.length-1;a>=0;a--){let l=e.children[a],c=n+e.positions[a],d=l instanceof ar&&c=e.length)return e;!s&&n==0&&e.type==t.topNode&&(s=!0);for(let i=e.children.length-1;i>=0;i--){let a=e.positions[i],l=e.children[i],c;if(an&&v6(t,i.tree,0-i.offset,n,l),d;if(c&&c.pos<=r&&(d=Zq(t,i.tree,n+i.offset,c.pos+i.offset,!1)))return{state:c.state,tree:d}}return{state:t.streamParser.startState(s?ld(s):4),tree:ar.empty}}let hue=class{constructor(e,n,r,s){this.lang=e,this.input=n,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=tf.get(),a=s[0].from,{state:l,tree:c}=due(e,r,a,this.to,i?.state);this.state=l,this.parsedPos=this.chunkStart=a+c.length;for(let d=0;dd.from<=i.viewport.from&&d.to>=i.viewport.from)&&(this.state=this.lang.streamParser.startState(ld(i.state)),i.skipUntilInView(this.parsedPos,i.viewport.from),this.parsedPos=i.viewport.from),this.moveRangeIndex()}advance(){let e=tf.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),r=Math.min(n,this.chunkStart+512);for(e&&(r=Math.min(r,e.viewport.to));this.parsedPos=n?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let n=this.input.chunk(e);if(this.input.lineChunks)n==` +3.某句话如果已经被回复过,不要重复回复`}),[y,w]=b.useState({emoji_chance:.4,max_reg_num:40,do_replace:!0,check_interval:10,steal_emoji:!0,content_filtration:!1,filtration_prompt:"符合公序良俗"}),[S,k]=b.useState({enable_tool:!0,enable_mood:!1,mood_update_threshold:1,emotion_style:"情绪较为稳定,但遇遇特定事件的时候起伏较大",all_global:!0}),[j,N]=b.useState({api_key:""}),[T,E]=b.useState(!1),[_,A]=b.useState(""),L=[{id:"bot-basic",title:"Bot基础",description:"配置机器人的基本信息",icon:a0},{id:"personality",title:"人格配置",description:"定义机器人的性格和说话风格",icon:Dv},{id:"emoji",title:"表情包",description:"配置表情包相关设置",icon:_j},{id:"other",title:"其他设置",description:"工具、情绪系统等配置",icon:Xu},{id:"siliconflow",title:"API配置",description:"配置硅基流动API密钥",icon:bI}],P=(n+1)/L.length*100;b.useEffect(()=>{(async()=>{try{d(!0);const[Y,J,X,R,ie]=await Promise.all([kie(),Oie(),jie(),Nie(),Cie()]);m(Y),x(J),w(X),k(R),N(ie)}catch(Y){e({title:"加载配置失败",description:Y instanceof Error?Y.message:"无法加载现有配置,将使用默认值",variant:"destructive"})}finally{d(!1)}})()},[e]);const B=async()=>{l(!0);try{switch(n){case 0:await Tie(h);break;case 1:await Eie(g);break;case 2:await _ie(y);break;case 3:await Aie(S);break;case 4:await Mie(j);break}return e({title:"保存成功",description:`${L[n].title}配置已保存`}),!0}catch(F){return e({title:"保存失败",description:F instanceof Error?F.message:"未知错误",variant:"destructive"}),!1}finally{l(!1)}},$=async()=>{await B()&&n{n>0&&r(n-1)},te=async()=>{i(!0),E(!0);try{if(A("正在保存API配置..."),!await B()){i(!1),E(!1);return}A("正在完成初始化..."),await sE(),A("正在重启麦麦..."),await ib(),e({title:"配置完成",description:"麦麦正在重启以应用新配置..."}),A("等待麦麦重启完成...");const Y=60;let J=0,X=!1;for(;JsetTimeout(R,1e3));try{(await Rie()).running&&(X=!0,A("重启成功!正在跳转..."))}catch{J++}}if(!X)throw new Error("重启超时,请手动检查麦麦状态");setTimeout(()=>{t({to:"/"})},1e3)}catch(F){E(!1),e({title:"配置失败",description:F instanceof Error?F.message:"未知错误",variant:"destructive"})}finally{i(!1)}},z=async()=>{try{await sE(),t({to:"/"})}catch(F){e({title:"跳过失败",description:F instanceof Error?F.message:"未知错误",variant:"destructive"})}},Q=()=>{switch(n){case 0:return o.jsx(vie,{config:h,onChange:m});case 1:return o.jsx(yie,{config:g,onChange:x});case 2:return o.jsx(bie,{config:y,onChange:w});case 3:return o.jsx(wie,{config:S,onChange:k});case 4:return o.jsx(Sie,{config:j,onChange:N});default:return null}};return o.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:[T&&o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:o.jsxs("div",{className:"mx-auto flex max-w-md flex-col items-center space-y-6 rounded-lg border bg-card p-8 text-center shadow-lg",children:[o.jsx("div",{className:"flex h-20 w-20 items-center justify-center rounded-full bg-primary/10",children:o.jsx(Po,{className:"h-10 w-10 animate-spin text-primary"})}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h2",{className:"text-2xl font-bold",children:"正在重启麦麦"}),o.jsx("p",{className:"text-muted-foreground",children:_})]}),o.jsx("div",{className:"w-full",children:o.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-secondary",children:o.jsx("div",{className:"h-full w-full animate-pulse bg-primary",style:{animation:"pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite"}})})}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"请稍候,这可能需要一分钟..."})]})}),o.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[o.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"}),o.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"})]}),c?o.jsxs("div",{className:"relative z-10 text-center",children:[o.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center",children:o.jsx("div",{className:"h-12 w-12 animate-spin rounded-full border-4 border-primary border-t-transparent"})}),o.jsx("p",{className:"text-lg font-medium",children:"加载配置中..."}),o.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"正在读取现有配置"})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"relative z-10 w-full max-w-4xl",children:[o.jsxs("div",{className:"mb-6 md:mb-8 text-center",children:[o.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:o.jsx(Qee,{className:"h-6 w-6 md:h-8 md:w-8 text-primary",strokeWidth:2,fill:"none"})}),o.jsx("h1",{className:"mb-2 text-2xl md:text-3xl font-bold",children:"首次配置向导"}),o.jsxs("p",{className:"text-sm md:text-base text-muted-foreground",children:["让我们一起完成 ",Wj," 的初始配置"]})]}),o.jsxs("div",{className:"mb-6 md:mb-8",children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between text-xs md:text-sm",children:[o.jsxs("span",{className:"text-muted-foreground",children:["步骤 ",n+1," / ",L.length]}),o.jsxs("span",{className:"font-medium text-primary",children:[Math.round(P),"%"]})]}),o.jsx(Lp,{value:P,className:"h-2"})]}),o.jsx("div",{className:"mb-6 md:mb-8 flex justify-between",children:L.map((F,Y)=>{const J=F.icon;return o.jsxs("div",{className:xe("flex flex-1 flex-col items-center gap-1 md:gap-2",Yt({to:"/"}),className:"gap-2 w-full sm:w-auto",children:[o.jsx(D0,{className:"h-4 w-4"}),"返回首页"]}),o.jsxs(de,{size:"lg",variant:"outline",onClick:()=>window.history.back(),className:"gap-2 w-full sm:w-auto",children:[o.jsx(wI,{className:"h-4 w-4"}),"返回上一页"]})]}),o.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"如果您认为这是一个错误,请联系系统管理员"})})]})})}var AB=["PageUp","PageDown"],MB=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],RB={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},jf="Slider",[mk,Pie,zie]=By(jf),[DB]=Ra(jf,[zie]),[Iie,ab]=DB(jf),PB=b.forwardRef((t,e)=>{const{name:n,min:r=0,max:s=100,step:i=1,orientation:a="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:d=[r],value:h,onValueChange:m=()=>{},onValueCommit:g=()=>{},inverted:x=!1,form:y,...w}=t,S=b.useRef(new Set),k=b.useRef(0),N=a==="horizontal"?Lie:Bie,[T=[],E]=Xl({prop:h,defaultProp:d,onChange:$=>{[...S.current][k.current]?.focus(),m($)}}),_=b.useRef(T);function A($){const U=Qie(T,$);B($,U)}function L($){B($,k.current)}function P(){const $=_.current[k.current];T[k.current]!==$&&g(T)}function B($,U,{commit:te}={commit:!1}){const z=Gie(i),Q=Xie(Math.round(($-r)/i)*i+r,z),F=Sj(Q,[r,s]);E((Y=[])=>{const J=$ie(Y,F,U);if(Wie(J,c*i)){k.current=J.indexOf(F);const X=String(J)!==String(Y);return X&&te&&g(J),X?J:Y}else return Y})}return o.jsx(Iie,{scope:t.__scopeSlider,name:n,disabled:l,min:r,max:s,valueIndexToChangeRef:k,thumbs:S.current,values:T,orientation:a,form:y,children:o.jsx(mk.Provider,{scope:t.__scopeSlider,children:o.jsx(mk.Slot,{scope:t.__scopeSlider,children:o.jsx(N,{"aria-disabled":l,"data-disabled":l?"":void 0,...w,ref:e,onPointerDown:nt(w.onPointerDown,()=>{l||(_.current=T)}),min:r,max:s,inverted:x,onSlideStart:l?void 0:A,onSlideMove:l?void 0:L,onSlideEnd:l?void 0:P,onHomeKeyDown:()=>!l&&B(r,0,{commit:!0}),onEndKeyDown:()=>!l&&B(s,T.length-1,{commit:!0}),onStepKeyDown:({event:$,direction:U})=>{if(!l){const Q=AB.includes($.key)||$.shiftKey&&MB.includes($.key)?10:1,F=k.current,Y=T[F],J=i*Q*U;B(Y+J,F,{commit:!0})}}})})})})});PB.displayName=jf;var[zB,IB]=DB(jf,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Lie=b.forwardRef((t,e)=>{const{min:n,max:r,dir:s,inverted:i,onSlideStart:a,onSlideMove:l,onSlideEnd:c,onStepKeyDown:d,...h}=t,[m,g]=b.useState(null),x=Yn(e,N=>g(N)),y=b.useRef(void 0),w=Ep(s),S=w==="ltr",k=S&&!i||!S&&i;function j(N){const T=y.current||m.getBoundingClientRect(),E=[0,T.width],A=Xj(E,k?[n,r]:[r,n]);return y.current=T,A(N-T.left)}return o.jsx(zB,{scope:t.__scopeSlider,startEdge:k?"left":"right",endEdge:k?"right":"left",direction:k?1:-1,size:"width",children:o.jsx(LB,{dir:w,"data-orientation":"horizontal",...h,ref:x,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:N=>{const T=j(N.clientX);a?.(T)},onSlideMove:N=>{const T=j(N.clientX);l?.(T)},onSlideEnd:()=>{y.current=void 0,c?.()},onStepKeyDown:N=>{const E=RB[k?"from-left":"from-right"].includes(N.key);d?.({event:N,direction:E?-1:1})}})})}),Bie=b.forwardRef((t,e)=>{const{min:n,max:r,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:l,onStepKeyDown:c,...d}=t,h=b.useRef(null),m=Yn(e,h),g=b.useRef(void 0),x=!s;function y(w){const S=g.current||h.current.getBoundingClientRect(),k=[0,S.height],N=Xj(k,x?[r,n]:[n,r]);return g.current=S,N(w-S.top)}return o.jsx(zB,{scope:t.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:o.jsx(LB,{"data-orientation":"vertical",...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const S=y(w.clientY);i?.(S)},onSlideMove:w=>{const S=y(w.clientY);a?.(S)},onSlideEnd:()=>{g.current=void 0,l?.()},onStepKeyDown:w=>{const k=RB[x?"from-bottom":"from-top"].includes(w.key);c?.({event:w,direction:k?-1:1})}})})}),LB=b.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:l,onStepKeyDown:c,...d}=t,h=ab(jf,n);return o.jsx(xn.span,{...d,ref:e,onKeyDown:nt(t.onKeyDown,m=>{m.key==="Home"?(a(m),m.preventDefault()):m.key==="End"?(l(m),m.preventDefault()):AB.concat(MB).includes(m.key)&&(c(m),m.preventDefault())}),onPointerDown:nt(t.onPointerDown,m=>{const g=m.target;g.setPointerCapture(m.pointerId),m.preventDefault(),h.thumbs.has(g)?g.focus():r(m)}),onPointerMove:nt(t.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&s(m)}),onPointerUp:nt(t.onPointerUp,m=>{const g=m.target;g.hasPointerCapture(m.pointerId)&&(g.releasePointerCapture(m.pointerId),i(m))})})}),BB="SliderTrack",FB=b.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=ab(BB,n);return o.jsx(xn.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:e})});FB.displayName=BB;var pk="SliderRange",qB=b.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=ab(pk,n),i=IB(pk,n),a=b.useRef(null),l=Yn(e,a),c=s.values.length,d=s.values.map(g=>QB(g,s.min,s.max)),h=c>1?Math.min(...d):0,m=100-Math.max(...d);return o.jsx(xn.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:l,style:{...t.style,[i.startEdge]:h+"%",[i.endEdge]:m+"%"}})});qB.displayName=pk;var gk="SliderThumb",$B=b.forwardRef((t,e)=>{const n=Pie(t.__scopeSlider),[r,s]=b.useState(null),i=Yn(e,l=>s(l)),a=b.useMemo(()=>r?n().findIndex(l=>l.ref.current===r):-1,[n,r]);return o.jsx(Fie,{...t,ref:i,index:a})}),Fie=b.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:s,...i}=t,a=ab(gk,n),l=IB(gk,n),[c,d]=b.useState(null),h=Yn(e,j=>d(j)),m=c?a.form||!!c.closest("form"):!0,g=tI(c),x=a.values[r],y=x===void 0?0:QB(x,a.min,a.max),w=Hie(r,a.values.length),S=g?.[l.size],k=S?Vie(S,y,l.direction):0;return b.useEffect(()=>{if(c)return a.thumbs.add(c),()=>{a.thumbs.delete(c)}},[c,a.thumbs]),o.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${y}% + ${k}px)`},children:[o.jsx(mk.ItemSlot,{scope:t.__scopeSlider,children:o.jsx(xn.span,{role:"slider","aria-label":t["aria-label"]||w,"aria-valuemin":a.min,"aria-valuenow":x,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...i,ref:h,style:x===void 0?{display:"none"}:t.style,onFocus:nt(t.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),m&&o.jsx(HB,{name:s??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:x},r)]})});$B.displayName=gk;var qie="RadioBubbleInput",HB=b.forwardRef(({__scopeSlider:t,value:e,...n},r)=>{const s=b.useRef(null),i=Yn(s,r),a=eI(e);return b.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==e&&h){const m=new Event("input",{bubbles:!0});h.call(l,e),l.dispatchEvent(m)}},[a,e]),o.jsx(xn.input,{style:{display:"none"},...n,ref:i,defaultValue:e})});HB.displayName=qie;function $ie(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}function QB(t,e,n){const i=100/(n-e)*(t-e);return Sj(i,[0,100])}function Hie(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function Qie(t,e){if(t.length===1)return 0;const n=t.map(s=>Math.abs(s-e)),r=Math.min(...n);return n.indexOf(r)}function Vie(t,e,n){const r=t/2,i=Xj([0,50],[0,r]);return(r-i(e)*n)*n}function Uie(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function Wie(t,e){if(e>0){const n=Uie(t);return Math.min(...n)>=e}return!0}function Xj(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function Gie(t){return(String(t).split(".")[1]||"").length}function Xie(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var VB=PB,Yie=FB,Kie=qB,Zie=$B;const Bp=b.forwardRef(({className:t,...e},n)=>o.jsxs(VB,{ref:n,className:xe("relative flex w-full touch-none select-none items-center",t),...e,children:[o.jsx(Yie,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:o.jsx(Kie,{className:"absolute h-full bg-primary"})}),o.jsx(Zie,{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"})]}));Bp.displayName=VB.displayName;const Vt=Aee,Ut=Mee,$t=b.forwardRef(({className:t,children:e,...n},r)=>o.jsxs(iI,{ref:r,className:xe("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",t),...n,children:[e,o.jsx(Nee,{asChild:!0,children:o.jsx(nd,{className:"h-4 w-4 opacity-50"})})]}));$t.displayName=iI.displayName;const UB=b.forwardRef(({className:t,...e},n)=>o.jsx(aI,{ref:n,className:xe("flex cursor-default items-center justify-center py-1",t),...e,children:o.jsx(P0,{className:"h-4 w-4"})}));UB.displayName=aI.displayName;const WB=b.forwardRef(({className:t,...e},n)=>o.jsx(oI,{ref:n,className:xe("flex cursor-default items-center justify-center py-1",t),...e,children:o.jsx(nd,{className:"h-4 w-4"})}));WB.displayName=oI.displayName;const Ht=b.forwardRef(({className:t,children:e,position:n="popper",...r},s)=>o.jsx(Cee,{children:o.jsxs(lI,{ref:s,className:xe("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]",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[o.jsx(UB,{}),o.jsx(Tee,{className:xe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),o.jsx(WB,{})]})}));Ht.displayName=lI.displayName;const Jie=b.forwardRef(({className:t,...e},n)=>o.jsx(cI,{ref:n,className:xe("px-2 py-1.5 text-sm font-semibold",t),...e}));Jie.displayName=cI.displayName;const De=b.forwardRef(({className:t,children:e,...n},r)=>o.jsxs(uI,{ref:r,className:xe("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",t),...n,children:[o.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(Eee,{children:o.jsx(Ro,{className:"h-4 w-4"})})}),o.jsx(_ee,{children:e})]}));De.displayName=uI.displayName;const eae=b.forwardRef(({className:t,...e},n)=>o.jsx(dI,{ref:n,className:xe("-mx-1 my-1 h-px bg-muted",t),...e}));eae.displayName=dI.displayName;function tae(t){const e=nae(t),n=b.forwardRef((r,s)=>{const{children:i,...a}=r,l=b.Children.toArray(i),c=l.find(sae);if(c){const d=c.props.children,h=l.map(m=>m===c?b.Children.count(d)>1?b.Children.only(null):b.isValidElement(d)?d.props.children:null:m);return o.jsx(e,{...a,ref:s,children:b.isValidElement(d)?b.cloneElement(d,void 0,h):null})}return o.jsx(e,{...a,ref:s,children:i})});return n.displayName=`${t}.Slot`,n}function nae(t){const e=b.forwardRef((n,r)=>{const{children:s,...i}=n;if(b.isValidElement(s)){const a=aae(s),l=iae(i,s.props);return s.type!==b.Fragment&&(l.ref=r?Qc(r,a):a),b.cloneElement(s,l)}return b.Children.count(s)>1?b.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var rae=Symbol("radix.slottable");function sae(t){return b.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===rae}function iae(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...l)=>{const c=i(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function aae(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var ob="Popover",[GB]=Ra(ob,[vf]),Fp=vf(),[oae,iu]=GB(ob),XB=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!1}=t,l=Fp(e),c=b.useRef(null),[d,h]=b.useState(!1),[m,g]=Xl({prop:r,defaultProp:s??!1,onChange:i,caller:ob});return o.jsx(Vy,{...l,children:o.jsx(oae,{scope:e,contentId:Ui(),triggerRef:c,open:m,onOpenChange:g,onOpenToggle:b.useCallback(()=>g(x=>!x),[g]),hasCustomAnchor:d,onCustomAnchorAdd:b.useCallback(()=>h(!0),[]),onCustomAnchorRemove:b.useCallback(()=>h(!1),[]),modal:a,children:n})})};XB.displayName=ob;var YB="PopoverAnchor",lae=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=iu(YB,n),i=Fp(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:l}=s;return b.useEffect(()=>(a(),()=>l()),[a,l]),o.jsx(Uy,{...i,...r,ref:e})});lae.displayName=YB;var KB="PopoverTrigger",ZB=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=iu(KB,n),i=Fp(n),a=Yn(e,s.triggerRef),l=o.jsx(xn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":rF(s.open),...r,ref:a,onClick:nt(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?l:o.jsx(Uy,{asChild:!0,...i,children:l})});ZB.displayName=KB;var Yj="PopoverPortal",[cae,uae]=GB(Yj,{forceMount:void 0}),JB=t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=iu(Yj,e);return o.jsx(cae,{scope:e,forceMount:n,children:o.jsx(ii,{present:n||i.open,children:o.jsx(Qy,{asChild:!0,container:s,children:r})})})};JB.displayName=Yj;var Kh="PopoverContent",eF=b.forwardRef((t,e)=>{const n=uae(Kh,t.__scopePopover),{forceMount:r=n.forceMount,...s}=t,i=iu(Kh,t.__scopePopover);return o.jsx(ii,{present:r||i.open,children:i.modal?o.jsx(hae,{...s,ref:e}):o.jsx(fae,{...s,ref:e})})});eF.displayName=Kh;var dae=tae("PopoverContent.RemoveScroll"),hae=b.forwardRef((t,e)=>{const n=iu(Kh,t.__scopePopover),r=b.useRef(null),s=Yn(e,r),i=b.useRef(!1);return b.useEffect(()=>{const a=r.current;if(a)return hI(a)},[]),o.jsx(fI,{as:dae,allowPinchZoom:!0,children:o.jsx(tF,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:nt(t.onCloseAutoFocus,a=>{a.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:nt(t.onPointerDownOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:nt(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),fae=b.forwardRef((t,e)=>{const n=iu(Kh,t.__scopePopover),r=b.useRef(!1),s=b.useRef(!1);return o.jsx(tF,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{t.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{t.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;n.triggerRef.current?.contains(a)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),tF=b.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,...m}=t,g=iu(Kh,n),x=Fp(n);return mI(),o.jsx(pI,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:o.jsx(Cj,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>g.onOpenChange(!1),children:o.jsx(Tj,{"data-state":rF(g.open),role:"dialog",id:g.contentId,...x,...m,ref:e,style:{...m.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)"}})})})}),nF="PopoverClose",mae=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=iu(nF,n);return o.jsx(xn.button,{type:"button",...r,ref:e,onClick:nt(t.onClick,()=>s.onOpenChange(!1))})});mae.displayName=nF;var pae="PopoverArrow",gae=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=Fp(n);return o.jsx(Ej,{...s,...r,ref:e})});gae.displayName=pae;function rF(t){return t?"open":"closed"}var xae=XB,vae=ZB,yae=JB,sF=eF;const zo=xae,Io=vae,Xa=b.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},s)=>o.jsx(yae,{children:o.jsx(sF,{ref:s,align:e,sideOffset:n,className:xe("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]",t),...r})}));Xa.displayName=sF.displayName;const au="/api/webui/config";async function iE(){const e=await(await St(`${au}/bot`)).json();if(!e.success)throw new Error("获取配置数据失败");return e.config}async function Rh(){const e=await(await St(`${au}/model`)).json();if(!e.success)throw new Error("获取模型配置数据失败");return e.config}async function aE(t){const n=await(await St(`${au}/bot`,{method:"POST",headers:Dt(),body:JSON.stringify(t)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function bae(){const e=await(await St(`${au}/bot/raw`)).json();if(!e.success)throw new Error("获取配置源代码失败");return e.content}async function wae(t){const n=await(await St(`${au}/bot/raw`,{method:"POST",headers:Dt(),body:JSON.stringify({raw_content:t})})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function qv(t){const n=await(await St(`${au}/model`,{method:"POST",headers:Dt(),body:JSON.stringify(t)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function Sae(t,e){const r=await(await St(`${au}/bot/section/${t}`,{method:"POST",headers:Dt(),body:JSON.stringify(e)})).json();if(!r.success)throw new Error(r.message||`保存配置节 ${t} 失败`)}async function xk(t,e){const r=await(await St(`${au}/model/section/${t}`,{method:"POST",headers:Dt(),body:JSON.stringify(e)})).json();if(!r.success)throw new Error(r.message||`保存配置节 ${t} 失败`)}async function kae(t,e="openai",n="/models"){const r=new URLSearchParams({provider_name:t,parser:e,endpoint:n}),s=await St(`/api/webui/models/list?${r}`);if(!s.ok){const a=await s.json().catch(()=>({}));throw new Error(a.detail||`获取模型列表失败 (${s.status})`)}const i=await s.json();if(!i.success)throw new Error("获取模型列表失败");return i.models}const Oae=kf("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"}}),ga=b.forwardRef(({className:t,variant:e,...n},r)=>o.jsx("div",{ref:r,role:"alert",className:xe(Oae({variant:e}),t),...n}));ga.displayName="Alert";const jae=b.forwardRef(({className:t,...e},n)=>o.jsx("h5",{ref:n,className:xe("mb-1 font-medium leading-none tracking-tight",t),...e}));jae.displayName="AlertTitle";const xa=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{ref:n,className:xe("text-sm [&_p]:leading-relaxed",t),...e}));xa.displayName="AlertDescription";function Kj({onRestartComplete:t,onRestartFailed:e}){const[n,r]=b.useState(0),[s,i]=b.useState("restarting"),[a,l]=b.useState(0),[c,d]=b.useState(0);b.useEffect(()=>{const g=setInterval(()=>{r(w=>w>=90?w:w+1)},200),x=setInterval(()=>{l(w=>w+1)},1e3),y=setTimeout(()=>{i("checking"),h()},3e3);return()=>{clearInterval(g),clearInterval(x),clearTimeout(y)}},[]);const h=()=>{const x=async()=>{try{if(d(w=>w+1),(await fetch("/api/webui/system/status",{method:"GET",headers:{"Content-Type":"application/json"},signal:AbortSignal.timeout(3e3)})).ok)r(100),i("success"),setTimeout(()=>{t?.()},1500);else throw new Error("Status check failed")}catch{c<60?setTimeout(x,2e3):(i("failed"),e?.())}};x()},m=g=>{const x=Math.floor(g/60),y=g%60;return`${x}:${y.toString().padStart(2,"0")}`};return o.jsx("div",{className:"fixed inset-0 bg-background/95 backdrop-blur-sm z-50 flex items-center justify-center",children:o.jsxs("div",{className:"max-w-md w-full mx-4 space-y-8",children:[o.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[s==="restarting"&&o.jsxs(o.Fragment,{children:[o.jsx(Po,{className:"h-16 w-16 text-primary animate-spin"}),o.jsx("h2",{className:"text-2xl font-bold",children:"正在重启麦麦"}),o.jsx("p",{className:"text-muted-foreground text-center",children:"请稍候,麦麦正在重启中..."})]}),s==="checking"&&o.jsxs(o.Fragment,{children:[o.jsx(Po,{className:"h-16 w-16 text-primary animate-spin"}),o.jsx("h2",{className:"text-2xl font-bold",children:"检查服务状态"}),o.jsxs("p",{className:"text-muted-foreground text-center",children:["等待服务恢复... (尝试 ",c,"/60)"]})]}),s==="success"&&o.jsxs(o.Fragment,{children:[o.jsx(Vc,{className:"h-16 w-16 text-green-500"}),o.jsx("h2",{className:"text-2xl font-bold",children:"重启成功"}),o.jsx("p",{className:"text-muted-foreground text-center",children:"正在跳转到登录页面..."})]}),s==="failed"&&o.jsxs(o.Fragment,{children:[o.jsx(Uc,{className:"h-16 w-16 text-destructive"}),o.jsx("h2",{className:"text-2xl font-bold",children:"重启超时"}),o.jsx("p",{className:"text-muted-foreground text-center",children:"服务未能在预期时间内恢复,请手动检查或刷新页面"})]})]}),s!=="failed"&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(Lp,{value:n,className:"h-2"}),o.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[o.jsxs("span",{children:[n,"%"]}),o.jsxs("span",{children:["已用时: ",m(a)]})]})]}),o.jsx("div",{className:"bg-muted/50 rounded-lg p-4 space-y-2",children:o.jsxs("p",{className:"text-sm text-muted-foreground",children:[s==="restarting"&&"🔄 配置已保存,正在重启主程序...",s==="checking"&&"⏳ 正在等待服务恢复,请勿关闭页面...",s==="success"&&"✅ 配置已生效,服务运行正常",s==="failed"&&"⚠️ 如果长时间无响应,请尝试手动重启"]})}),o.jsx("div",{className:"bg-yellow-500/10 border border-yellow-500/50 rounded-lg p-4",children:o.jsxs("p",{className:"text-sm text-yellow-900 dark:text-yellow-100",children:[o.jsx("strong",{children:"⚠️ 重要提示:"})," 由于技术原因,使用重启功能后,将无法再使用 ",o.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。如需结束程序,请使用脚本目录下的进程管理脚本。"]})}),s==="failed"&&o.jsxs("div",{className:"flex gap-2",children:[o.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:"刷新页面"}),o.jsx("button",{onClick:()=>{i("checking"),d(0),h()},className:"flex-1 px-4 py-2 bg-secondary text-secondary-foreground rounded-md hover:bg-secondary/90",children:"重试检测"})]})]})})}let vk=[],iF=[];(()=>{let t="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,n=0;e>1;if(t=iF[r])e=r+1;else return!0;if(e==n)return!1}}function oE(t){return t>=127462&&t<=127487}const lE=8205;function Cae(t,e,n=!0,r=!0){return(n?aF:Tae)(t,e,r)}function aF(t,e,n){if(e==t.length)return e;e&&oF(t.charCodeAt(e))&&lF(t.charCodeAt(e-1))&&e--;let r=M4(t,e);for(e+=cE(r);e=0&&oE(M4(t,a));)i++,a-=2;if(i%2==0)break;e+=2}else break}return e}function Tae(t,e,n){for(;e>0;){let r=aF(t,e-2,n);if(r=56320&&t<57344}function lF(t){return t>=55296&&t<56320}function cE(t){return t<65536?1:2}class jn{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,n,r){[e,n]=Zh(this,e,n);let s=[];return this.decompose(0,e,s,2),r.length&&r.decompose(0,r.length,s,3),this.decompose(n,this.length,s,1),iv.from(s,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Zh(this,e,n);let r=[];return this.decompose(e,n,r,0),iv.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),s=new b0(this),i=new b0(e);for(let a=n,l=n;;){if(s.next(a),i.next(a),a=0,s.lineBreak!=i.lineBreak||s.done!=i.done||s.value!=i.value)return!1;if(l+=s.value.length,s.done||l>=r)return!0}}iter(e=1){return new b0(this,e)}iterRange(e,n=this.length){return new cF(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let s=this.line(e).from;r=this.iterRange(s,Math.max(s,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new uF(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]?jn.empty:e.length<=32?new Hr(e):iv.from(Hr.split(e,[]))}}class Hr extends jn{constructor(e,n=Eae(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,s){for(let i=0;;i++){let a=this.text[i],l=s+a.length;if((n?r:l)>=e)return new _ae(s,l,r,a);s=l+1,r++}}decompose(e,n,r,s){let i=e<=0&&n>=this.length?this:new Hr(uE(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(s&1){let a=r.pop(),l=av(i.text,a.text.slice(),0,i.length);if(l.length<=32)r.push(new Hr(l,a.length+i.length));else{let c=l.length>>1;r.push(new Hr(l.slice(0,c)),new Hr(l.slice(c)))}}else r.push(i)}replace(e,n,r){if(!(r instanceof Hr))return super.replace(e,n,r);[e,n]=Zh(this,e,n);let s=av(this.text,av(r.text,uE(this.text,0,e)),n),i=this.length+r.length-(n-e);return s.length<=32?new Hr(s,i):iv.from(Hr.split(s,[]),i)}sliceString(e,n=this.length,r=` +`){[e,n]=Zh(this,e,n);let s="";for(let i=0,a=0;i<=n&&ae&&a&&(s+=r),ei&&(s+=l.slice(Math.max(0,e-i),n-i)),i=c+1}return s}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],s=-1;for(let i of e)r.push(i),s+=i.length+1,r.length==32&&(n.push(new Hr(r,s)),r=[],s=-1);return s>-1&&n.push(new Hr(r,s)),n}}let iv=class vh extends jn{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,s){for(let i=0;;i++){let a=this.children[i],l=s+a.length,c=r+a.lines-1;if((n?c:l)>=e)return a.lineInner(e,n,r,s);s=l+1,r=c+1}}decompose(e,n,r,s){for(let i=0,a=0;a<=n&&i=a){let d=s&((a<=e?1:0)|(c>=n?2:0));a>=e&&c<=n&&!d?r.push(l):l.decompose(e-a,n-a,r,d)}a=c+1}}replace(e,n,r){if([e,n]=Zh(this,e,n),r.lines=i&&n<=l){let c=a.replace(e-i,n-i,r),d=this.lines-a.lines+c.lines;if(c.lines>4&&c.lines>d>>6){let h=this.children.slice();return h[s]=c,new vh(h,this.length-(n-e)+r.length)}return super.replace(i,l,c)}i=l+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=` +`){[e,n]=Zh(this,e,n);let s="";for(let i=0,a=0;ie&&i&&(s+=r),ea&&(s+=l.sliceString(e-a,n-a,r)),a=c+1}return s}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof vh))return 0;let r=0,[s,i,a,l]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=n,i+=n){if(s==a||i==l)return r;let c=this.children[s],d=e.children[i];if(c!=d)return r+c.scanIdentical(d,n);r+=c.length+1}}static from(e,n=e.reduce((r,s)=>r+s.length+1,-1)){let r=0;for(let x of e)r+=x.lines;if(r<32){let x=[];for(let y of e)y.flatten(x);return new Hr(x,n)}let s=Math.max(32,r>>5),i=s<<1,a=s>>1,l=[],c=0,d=-1,h=[];function m(x){let y;if(x.lines>i&&x instanceof vh)for(let w of x.children)m(w);else x.lines>a&&(c>a||!c)?(g(),l.push(x)):x instanceof Hr&&c&&(y=h[h.length-1])instanceof Hr&&x.lines+y.lines<=32?(c+=x.lines,d+=x.length+1,h[h.length-1]=new Hr(y.text.concat(x.text),y.length+1+x.length)):(c+x.lines>s&&g(),c+=x.lines,d+=x.length+1,h.push(x))}function g(){c!=0&&(l.push(h.length==1?h[0]:vh.from(h,d)),d=-1,c=h.length=0)}for(let x of e)m(x);return g(),l.length==1?l[0]:new vh(l,n)}};jn.empty=new Hr([""],0);function Eae(t){let e=-1;for(let n of t)e+=n.length+1;return e}function av(t,e,n=0,r=1e9){for(let s=0,i=0,a=!0;i=n&&(c>r&&(l=l.slice(0,r-s)),s0?1:(e instanceof Hr?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,s=this.nodes[r],i=this.offsets[r],a=i>>1,l=s instanceof Hr?s.text.length:s.children.length;if(a==(n>0?l:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=` +`,this;e--}else if(s instanceof Hr){let c=s.text[a+(n<0?-1:0)];if(this.offsets[r]+=n,c.length>Math.max(0,e))return this.value=e==0?c:n>0?c.slice(e):c.slice(0,c.length-e),this;e-=c.length}else{let c=s.children[a+(n<0?-1:0)];e>c.length?(e-=c.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(c),this.offsets.push(n>0?1:(c instanceof Hr?c.text.length:c.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class cF{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new b0(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<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)*n,this.value=s.length<=r?s:n<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 uF{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:s}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(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"&&(jn.prototype[Symbol.iterator]=function(){return this.iter()},b0.prototype[Symbol.iterator]=cF.prototype[Symbol.iterator]=uF.prototype[Symbol.iterator]=function(){return this});class _ae{constructor(e,n,r,s){this.from=e,this.to=n,this.number=r,this.text=s}get length(){return this.to-this.from}}function Zh(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function zs(t,e,n=!0,r=!0){return Cae(t,e,n,r)}function Aae(t){return t>=56320&&t<57344}function Mae(t){return t>=55296&&t<56320}function gi(t,e){let n=t.charCodeAt(e);if(!Mae(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return Aae(r)?(n-55296<<10)+(r-56320)+65536:n}function Zj(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function wo(t){return t<65536?1:2}const yk=/\r\n?|\n/;var Ds=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Ds||(Ds={}));class Do{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;ne)return i+(e-s);i+=l}else{if(r!=Ds.Simple&&d>=e&&(r==Ds.TrackDel&&se||r==Ds.TrackBefore&&se))return null;if(d>e||d==e&&n<0&&!l)return e==s||n<0?i:i+c;i+=c}s=d}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return i}touchesRange(e,n=e){for(let r=0,s=0;r=0&&s<=n&&l>=e)return sn?"cover":!0;s=l}return!1}toString(){let e="";for(let n=0;n=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Do(e)}static create(e){return new Do(e)}}class us extends Do{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return bk(this,(n,r,s,i,a)=>e=e.replace(s,s+(r-n),a),!1),e}mapDesc(e,n=!1){return wk(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let s=0,i=0;s=0){n[s]=l,n[s+1]=a;let c=s>>1;for(;r.length0&&Bc(r,n,i.text),i.forward(h),l+=h}let d=e[a++];for(;l>1].toJSON()))}return e}static of(e,n,r){let s=[],i=[],a=0,l=null;function c(h=!1){if(!h&&!s.length)return;ag||m<0||g>n)throw new RangeError(`Invalid change range ${m} to ${g} (in doc of length ${n})`);let y=x?typeof x=="string"?jn.of(x.split(r||yk)):x:jn.empty,w=y.length;if(m==g&&w==0)return;ma&&$s(s,m-a,-1),$s(s,g-m,w),Bc(i,s,y),a=g}}return d(e),c(!l),l}static empty(e){return new us(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let s=0;sl&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(i.length==1)n.push(i[0],0);else{for(;r.length=0&&n<=0&&n==t[s+1]?t[s]+=e:s>=0&&e==0&&t[s]==0?t[s+1]+=n:r?(t[s]+=e,t[s+1]+=n):t.push(e,n)}function Bc(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r>1])),!(n||a==t.sections.length||t.sections[a+1]<0);)l=t.sections[a++],c=t.sections[a++];e(s,d,i,h,m),s=d,i=h}}}function wk(t,e,n,r=!1){let s=[],i=r?[]:null,a=new B0(t),l=new B0(e);for(let c=-1;;){if(a.done&&l.len||l.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&l.ins==-1){let d=Math.min(a.len,l.len);$s(s,d,-1),a.forward(d),l.forward(d)}else if(l.ins>=0&&(a.ins<0||c==a.i||a.off==0&&(l.len=0&&c=0){let d=0,h=a.len;for(;h;)if(l.ins==-1){let m=Math.min(h,l.len);d+=m,h-=m,l.forward(m)}else if(l.ins==0&&l.lenc||a.ins>=0&&a.len>c)&&(l||r.length>d),i.forward2(c),a.forward(c)}}}}class B0{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return n>=e.length?jn.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?jn.empty:n[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 Hu{constructor(e,n,r){this.from=e,this.to=n,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,n=-1){let r,s;return this.empty?r=s=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),r==this.from&&s==this.to?this:new Hu(r,s,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return Me.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Me.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!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 Me.range(e.anchor,e.head)}static create(e,n,r){return new Hu(e,n,r)}}class Me{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Me.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;re.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 Me(e.ranges.map(n=>Hu.fromJSON(n)),e.main)}static single(e,n=e){return new Me([Me.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,s=0;se?8:0)|i)}static normalized(e,n=0){let r=e[n];e.sort((s,i)=>s.from-i.from),n=e.indexOf(r);for(let s=1;si.head?Me.range(c,l):Me.range(l,c))}}return new Me(e,n)}}function hF(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let Jj=0;class at{constructor(e,n,r,s,i){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=s,this.id=Jj++,this.default=e([]),this.extensions=typeof i=="function"?i(this):i}get reader(){return this}static define(e={}){return new at(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:e6),!!e.static,e.enables)}of(e){return new ov([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new ov(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new ov(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function e6(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class ov{constructor(e,n,r,s){this.dependencies=e,this.facet=n,this.type=r,this.value=s,this.id=Jj++}dynamicSlot(e){var n;let r=this.value,s=this.facet.compareInput,i=this.id,a=e[i]>>1,l=this.type==2,c=!1,d=!1,h=[];for(let m of this.dependencies)m=="doc"?c=!0:m=="selection"?d=!0:(((n=e[m.id])!==null&&n!==void 0?n:1)&1)==0&&h.push(e[m.id]);return{create(m){return m.values[a]=r(m),1},update(m,g){if(c&&g.docChanged||d&&(g.docChanged||g.selection)||Sk(m,h)){let x=r(m);if(l?!dE(x,m.values[a],s):!s(x,m.values[a]))return m.values[a]=x,1}return 0},reconfigure:(m,g)=>{let x,y=g.config.address[i];if(y!=null){let w=Hv(g,y);if(this.dependencies.every(S=>S instanceof at?g.facet(S)===m.facet(S):S instanceof Os?g.field(S,!1)==m.field(S,!1):!0)||(l?dE(x=r(m),w,s):s(x=r(m),w)))return m.values[a]=w,0}else x=r(m);return m.values[a]=x,1}}}}function dE(t,e,n){if(t.length!=e.length)return!1;for(let r=0;rt[c.id]),s=n.map(c=>c.type),i=r.filter(c=>!(c&1)),a=t[e.id]>>1;function l(c){let d=[];for(let h=0;hr===s),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Zx).find(r=>r.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,s)=>{let i=r.values[n],a=this.updateF(i,s);return this.compareF(i,a)?0:(r.values[n]=a,1)},reconfigure:(r,s)=>{let i=r.facet(Zx),a=s.facet(Zx),l;return(l=i.find(c=>c.field==this))&&l!=a.find(c=>c.field==this)?(r.values[n]=l.create(r),1):s.config.address[this.id]!=null?(r.values[n]=s.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,Zx.of({field:this,create:e})]}get extension(){return this}}const Fu={lowest:4,low:3,default:2,high:1,highest:0};function Bm(t){return e=>new fF(e,t)}const ou={highest:Bm(Fu.highest),high:Bm(Fu.high),default:Bm(Fu.default),low:Bm(Fu.low),lowest:Bm(Fu.lowest)};class fF{constructor(e,n){this.inner=e,this.prec=n}}class lb{of(e){return new kk(this,e)}reconfigure(e){return lb.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class kk{constructor(e,n){this.compartment=e,this.inner=n}}class $v{constructor(e,n,r,s,i,a){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=s,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,n,r){let s=[],i=Object.create(null),a=new Map;for(let g of Dae(e,n,a))g instanceof Os?s.push(g):(i[g.facet.id]||(i[g.facet.id]=[])).push(g);let l=Object.create(null),c=[],d=[];for(let g of s)l[g.id]=d.length<<1,d.push(x=>g.slot(x));let h=r?.config.facets;for(let g in i){let x=i[g],y=x[0].facet,w=h&&h[g]||[];if(x.every(S=>S.type==0))if(l[y.id]=c.length<<1|1,e6(w,x))c.push(r.facet(y));else{let S=y.combine(x.map(k=>k.value));c.push(r&&y.compare(S,r.facet(y))?r.facet(y):S)}else{for(let S of x)S.type==0?(l[S.id]=c.length<<1|1,c.push(S.value)):(l[S.id]=d.length<<1,d.push(k=>S.dynamicSlot(k)));l[y.id]=d.length<<1,d.push(S=>Rae(S,y,x))}}let m=d.map(g=>g(l));return new $v(e,a,m,l,c,i)}}function Dae(t,e,n){let r=[[],[],[],[],[]],s=new Map;function i(a,l){let c=s.get(a);if(c!=null){if(c<=l)return;let d=r[c].indexOf(a);d>-1&&r[c].splice(d,1),a instanceof kk&&n.delete(a.compartment)}if(s.set(a,l),Array.isArray(a))for(let d of a)i(d,l);else if(a instanceof kk){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let d=e.get(a.compartment)||a.inner;n.set(a.compartment,d),i(d,l)}else if(a instanceof fF)i(a.inner,a.prec);else if(a instanceof Os)r[l].push(a),a.provides&&i(a.provides,l);else if(a instanceof ov)r[l].push(a),a.facet.extensions&&i(a.facet.extensions,Fu.default);else{let d=a.extension;if(!d)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);i(d,l)}}return i(t,Fu.default),r.reduce((a,l)=>a.concat(l))}function w0(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let s=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|s}function Hv(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const mF=at.define(),Ok=at.define({combine:t=>t.some(e=>e),static:!0}),pF=at.define({combine:t=>t.length?t[0]:void 0,static:!0}),gF=at.define(),xF=at.define(),vF=at.define(),yF=at.define({combine:t=>t.length?t[0]:!1});class qo{constructor(e,n){this.type=e,this.value=n}static define(){return new Pae}}class Pae{of(e){return new qo(this,e)}}class zae{constructor(e){this.map=e}of(e){return new Ft(this,e)}}class Ft{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new Ft(this.type,n)}is(e){return this.type==e}static define(e={}){return new zae(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let s of e){let i=s.map(n);i&&r.push(i)}return r}}Ft.reconfigure=Ft.define();Ft.appendConfig=Ft.define();class ns{constructor(e,n,r,s,i,a){this.startState=e,this.changes=n,this.selection=r,this.effects=s,this.annotations=i,this.scrollIntoView=a,this._doc=null,this._state=null,r&&hF(r,n.newLength),i.some(l=>l.type==ns.time)||(this.annotations=i.concat(ns.time.of(Date.now())))}static create(e,n,r,s,i,a){return new ns(e,n,r,s,i,a)}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 n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(ns.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}ns.time=qo.define();ns.userEvent=qo.define();ns.addToHistory=qo.define();ns.remote=qo.define();function Iae(t,e){let n=[];for(let r=0,s=0;;){let i,a;if(r=t[r]))i=t[r++],a=t[r++];else if(s=0;s--){let i=r[s](t);i instanceof ns?t=i:Array.isArray(i)&&i.length==1&&i[0]instanceof ns?t=i[0]:t=wF(e,Dh(i),!1)}return t}function Bae(t){let e=t.startState,n=e.facet(vF),r=t;for(let s=n.length-1;s>=0;s--){let i=n[s](t);i&&Object.keys(i).length&&(r=bF(r,jk(e,i,t.changes.newLength),!0))}return r==t?t:ns.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const Fae=[];function Dh(t){return t==null?Fae:Array.isArray(t)?t:[t]}var wr=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(wr||(wr={}));const qae=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Nk;try{Nk=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function $ae(t){if(Nk)return Nk.test(t);for(let e=0;e"€"&&(n.toUpperCase()!=n.toLowerCase()||qae.test(n)))return!0}return!1}function Hae(t){return e=>{if(!/\S/.test(e))return wr.Space;if($ae(e))return wr.Word;for(let n=0;n-1)return wr.Word;return wr.Other}}class wn{constructor(e,n,r,s,i,a){this.config=e,this.doc=n,this.selection=r,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let l=0;ls.set(d,c)),n=null),s.set(l.value.compartment,l.value.extension)):l.is(Ft.reconfigure)?(n=null,r=l.value):l.is(Ft.appendConfig)&&(n=null,r=Dh(r).concat(l.value));let i;n?i=e.startState.values.slice():(n=$v.resolve(r,s,this),i=new wn(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,d)=>d.reconfigure(c,this),null).values);let a=e.startState.facet(Ok)?e.newSelection:e.newSelection.asSingle();new wn(n,e.newDoc,a,i,(l,c)=>c.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:Me.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),s=this.changes(r.changes),i=[r.range],a=Dh(r.effects);for(let l=1;la.spec.fromJSON(l,c)))}}return wn.create({doc:e.doc,selection:Me.fromJSON(e.selection),extensions:n.extensions?s.concat([n.extensions]):s})}static create(e={}){let n=$v.resolve(e.extensions||[],new Map),r=e.doc instanceof jn?e.doc:jn.of((e.doc||"").split(n.staticFacet(wn.lineSeparator)||yk)),s=e.selection?e.selection instanceof Me?e.selection:Me.single(e.selection.anchor,e.selection.head):Me.single(0);return hF(s,r.length),n.staticFacet(Ok)||(s=s.asSingle()),new wn(n,r,s,n.dynamicSlots.map(()=>null),(i,a)=>a.create(i),null)}get tabSize(){return this.facet(wn.tabSize)}get lineBreak(){return this.facet(wn.lineSeparator)||` +`}get readOnly(){return this.facet(yF)}phrase(e,...n){for(let r of this.facet(wn.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,s)=>{if(s=="$")return"$";let i=+(s||1);return!i||i>n.length?r:n[i-1]})),e}languageDataAt(e,n,r=-1){let s=[];for(let i of this.facet(mF))for(let a of i(this,n,r))Object.prototype.hasOwnProperty.call(a,e)&&s.push(a[e]);return s}charCategorizer(e){return Hae(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:n,from:r,length:s}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-r,l=e-r;for(;a>0;){let c=zs(n,a,!1);if(i(n.slice(c,a))!=wr.Word)break;a=c}for(;lt.length?t[0]:4});wn.lineSeparator=pF;wn.readOnly=yF;wn.phrases=at.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(s=>t[s]==e[s])}});wn.languageData=mF;wn.changeFilter=gF;wn.transactionFilter=xF;wn.transactionExtender=vF;lb.reconfigure=Ft.define();function $o(t,e,n={}){let r={};for(let s of t)for(let i of Object.keys(s)){let a=s[i],l=r[i];if(l===void 0)r[i]=a;else if(!(l===a||a===void 0))if(Object.hasOwnProperty.call(n,i))r[i]=n[i](l,a);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 sd{eq(e){return this==e}range(e,n=e){return Ck.create(e,n,this)}}sd.prototype.startSide=sd.prototype.endSide=0;sd.prototype.point=!1;sd.prototype.mapMode=Ds.TrackDel;let Ck=class SF{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new SF(e,n,r)}};function Tk(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class t6{constructor(e,n,r,s){this.from=e,this.to=n,this.value=r,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,s=0){let i=r?this.to:this.from;for(let a=s,l=i.length;;){if(a==l)return a;let c=a+l>>1,d=i[c]-e||(r?this.value[c].endSide:this.value[c].startSide)-n;if(c==a)return d>=0?a:l;d>=0?l=c:a=c+1}}between(e,n,r,s){for(let i=this.findIndex(n,-1e9,!0),a=this.findIndex(r,1e9,!1,i);ix||g==x&&d.startSide>0&&d.endSide<=0)continue;(x-g||d.endSide-d.startSide)<0||(a<0&&(a=g),d.point&&(l=Math.max(l,x-g)),r.push(d),s.push(g-a),i.push(x-a))}return{mapped:r.length?new t6(s,i,r,l):null,pos:a}}}class Rn{constructor(e,n,r,s){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=s}static create(e,n,r,s){return new Rn(e,n,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 n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:s=0,filterTo:i=this.length}=e,a=e.filter;if(n.length==0&&!a)return this;if(r&&(n=n.slice().sort(Tk)),this.isEmpty)return n.length?Rn.of(n):this;let l=new kF(this,null,-1).goto(0),c=0,d=[],h=new ql;for(;l.value||c=0){let m=n[c++];h.addInner(m.from,m.to,m.value)||d.push(m)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||il.to||i=i&&e<=i+a.length&&a.between(i,e-i,n-i,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return F0.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return F0.from(e).goto(n)}static compare(e,n,r,s,i=-1){let a=e.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=i),l=n.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=i),c=hE(a,l,r),d=new Fm(a,c,i),h=new Fm(l,c,i);r.iterGaps((m,g,x)=>fE(d,m,h,g,x,s)),r.empty&&r.length==0&&fE(d,0,h,0,0,s)}static eq(e,n,r=0,s){s==null&&(s=999999999);let i=e.filter(h=>!h.isEmpty&&n.indexOf(h)<0),a=n.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let l=hE(i,a),c=new Fm(i,l,0).goto(r),d=new Fm(a,l,0).goto(r);for(;;){if(c.to!=d.to||!Ek(c.active,d.active)||c.point&&(!d.point||!c.point.eq(d.point)))return!1;if(c.to>s)return!0;c.next(),d.next()}}static spans(e,n,r,s,i=-1){let a=new Fm(e,null,i).goto(n),l=n,c=a.openStart;for(;;){let d=Math.min(a.to,r);if(a.point){let h=a.activeForPoint(a.to),m=a.pointFroml&&(s.span(l,d,a.active,c),c=a.openEnd(d));if(a.to>r)return c+(a.point&&a.to>r?1:0);l=a.to,a.next()}}static of(e,n=!1){let r=new ql;for(let s of e instanceof Ck?[e]:n?Qae(e):e)r.add(s.from,s.to,s.value);return r.finish()}static join(e){if(!e.length)return Rn.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let s=e[r];s!=Rn.empty;s=s.nextLayer)n=new Rn(s.chunkPos,s.chunk,n,Math.max(s.maxPoint,n.maxPoint));return n}}Rn.empty=new Rn([],[],null,-1);function Qae(t){if(t.length>1)for(let e=t[0],n=1;n0)return t.slice().sort(Tk);e=r}return t}Rn.empty.nextLayer=Rn.empty;class ql{finishChunk(e){this.chunks.push(new t6(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,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new ql)).add(e,n,r)}addInner(e,n,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(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(Rn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=Rn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function hE(t,e,n){let r=new Map;for(let i of t)for(let a=0;a=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=r&&s.push(new kF(a,n,r,i));return s.length==1?s[0]:new F0(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)R4(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)R4(this.heap,r);(this.to-e||this.value.endSide-n)<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(),R4(this.heap,0)}}}function R4(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let s=t[r];if(r+1=0&&(s=t[r+1],r++),n.compare(s)<0)break;t[r]=n,t[e]=s,e=r}}class Fm{constructor(e,n,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=F0.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){Jx(this.active,e),Jx(this.activeTo,e),Jx(this.activeRank,e),this.minActive=mE(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:s,rank:i}=this.cursor;for(;n0;)n++;e1(this.active,n,r),e1(this.activeTo,n,s),e1(this.activeRank,n,i),e&&e1(e,n,this.cursor.from),this.minActive=mE(this.active,this.activeTo)}next(){let e=this.to,n=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&&Jx(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(n&&this.cursor.to==this.to&&this.cursor.from=0&&r[s]=0&&!(this.activeRank[r]e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function fE(t,e,n,r,s,i){t.goto(e),n.goto(r);let a=r+s,l=r,c=r-e;for(;;){let d=t.to+c-n.to,h=d||t.endSide-n.endSide,m=h<0?t.to+c:n.to,g=Math.min(m,a);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&Ek(t.activeForPoint(t.to),n.activeForPoint(n.to))||i.comparePoint(l,g,t.point,n.point):g>l&&!Ek(t.active,n.active)&&i.compareRange(l,g,t.active,n.active),m>a)break;(d||t.openEnd!=n.openEnd)&&i.boundChange&&i.boundChange(m),l=m,h<=0&&t.next(),h>=0&&n.next()}}function Ek(t,e){if(t.length!=e.length)return!1;for(let n=0;n=e;r--)t[r+1]=t[r];t[e]=n}function mE(t,e){let n=-1,r=1e9;for(let s=0;s=e)return s;if(s==t.length)break;i+=t.charCodeAt(s)==9?n-i%n:1,s=zs(t,s)}return r===!0?-1:t.length}const Ak="ͼ",pE=typeof Symbol>"u"?"__"+Ak:Symbol.for(Ak),Mk=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),gE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Wc{constructor(e,n){this.rules=[];let{finish:r}=n||{};function s(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function i(a,l,c,d){let h=[],m=/^@(\w+)\b/.exec(a[0]),g=m&&m[1]=="keyframes";if(m&&l==null)return c.push(a[0]+";");for(let x in l){let y=l[x];if(/&/.test(x))i(x.split(/,\s*/).map(w=>a.map(S=>w.replace(/&/,S))).reduce((w,S)=>w.concat(S)),y,c);else if(y&&typeof y=="object"){if(!m)throw new RangeError("The value of a property ("+x+") should be a primitive value.");i(s(x),y,h,g)}else y!=null&&h.push(x.replace(/_.*/,"").replace(/[A-Z]/g,w=>"-"+w.toLowerCase())+": "+y+";")}(h.length||g)&&c.push((r&&!m&&!d?a.map(r):a).join(", ")+" {"+h.join(" ")+"}")}for(let a in e)i(s(a),e[a],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=gE[pE]||1;return gE[pE]=e+1,Ak+e.toString(36)}static mount(e,n,r){let s=e[Mk],i=r&&r.nonce;s?i&&s.setNonce(i):s=new Vae(e,i),s.mount(Array.isArray(n)?n:[n],e)}}let xE=new Map;class Vae{constructor(e,n){let r=e.ownerDocument||e,s=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let i=xE.get(r);if(i)return e[Mk]=i;this.sheet=new s.CSSStyleSheet,xE.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[Mk]=this}mount(e,n){let r=this.sheet,s=0,i=0;for(let a=0;a-1&&(this.modules.splice(c,1),i--,c=-1),c==-1){if(this.modules.splice(i++,0,l),r)for(let d=0;d",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Uae=typeof navigator<"u"&&/Mac/.test(navigator.platform),Wae=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ms=0;Ms<10;Ms++)Gc[48+Ms]=Gc[96+Ms]=String(Ms);for(var Ms=1;Ms<=24;Ms++)Gc[Ms+111]="F"+Ms;for(var Ms=65;Ms<=90;Ms++)Gc[Ms]=String.fromCharCode(Ms+32),q0[Ms]=String.fromCharCode(Ms);for(var D4 in Gc)q0.hasOwnProperty(D4)||(q0[D4]=Gc[D4]);function Gae(t){var e=Uae&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Wae&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?q0:Gc)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function sr(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var s=n[r];typeof s=="string"?t.setAttribute(r,s):s!=null&&(t[r]=s)}e++}for(;e2);var et={mac:yE||/Mac/.test(Zs.platform),windows:/Win/.test(Zs.platform),linux:/Linux|X11/.test(Zs.platform),ie:cb,ie_version:jF?Rk.documentMode||6:Pk?+Pk[1]:Dk?+Dk[1]:0,gecko:vE,gecko_version:vE?+(/Firefox\/(\d+)/.exec(Zs.userAgent)||[0,0])[1]:0,chrome:!!P4,chrome_version:P4?+P4[1]:0,ios:yE,android:/Android\b/.test(Zs.userAgent),webkit_version:Xae?+(/\bAppleWebKit\/(\d+)/.exec(Zs.userAgent)||[0,0])[1]:0,safari:zk,safari_version:zk?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Zs.userAgent)||[0,0])[1]:0,tabSize:Rk.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function $0(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Ik(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function lv(t,e){if(!e.anchorNode)return!1;try{return Ik(t,e.anchorNode)}catch{return!1}}function Jh(t){return t.nodeType==3?ad(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function S0(t,e,n,r){return n?bE(t,e,n,r,-1)||bE(t,e,n,r,1):!1}function id(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Qv(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function bE(t,e,n,r,s){for(;;){if(t==n&&e==r)return!0;if(e==(s<0?0:Lo(t))){if(t.nodeName=="DIV")return!1;let i=t.parentNode;if(!i||i.nodeType!=1)return!1;e=id(t)+(s<0?0:1),t=i}else if(t.nodeType==1){if(t=t.childNodes[e+(s<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=s<0?Lo(t):0}else return!1}}function Lo(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function qp(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function Yae(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function NF(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function Kae(t,e,n,r,s,i,a,l){let c=t.ownerDocument,d=c.defaultView||window;for(let h=t,m=!1;h&&!m;)if(h.nodeType==1){let g,x=h==c.body,y=1,w=1;if(x)g=Yae(d);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(m=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let j=h.getBoundingClientRect();({scaleX:y,scaleY:w}=NF(h,j)),g={left:j.left,right:j.left+h.clientWidth*y,top:j.top,bottom:j.top+h.clientHeight*w}}let S=0,k=0;if(s=="nearest")e.top0&&e.bottom>g.bottom+k&&(k=e.bottom-g.bottom+a)):e.bottom>g.bottom&&(k=e.bottom-g.bottom+a,n<0&&e.top-k0&&e.right>g.right+S&&(S=e.right-g.right+i)):e.right>g.right&&(S=e.right-g.right+i,n<0&&e.leftg.bottom||e.leftg.right)&&(e={left:Math.max(e.left,g.left),right:Math.min(e.right,g.right),top:Math.max(e.top,g.top),bottom:Math.min(e.bottom,g.bottom)}),h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function Zae(t){let e=t.ownerDocument,n,r;for(let s=t.parentNode;s&&!(s==e.body||n&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),!n&&s.scrollWidth>s.clientWidth&&(n=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:n,y:r}}class Jae{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:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?Lo(n):0),r,Math.min(e.focusOffset,r?Lo(r):0))}set(e,n,r,s){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=s}}let Iu=null;et.safari&&et.safari_version>=26&&(Iu=!1);function CF(t){if(t.setActive)return t.setActive();if(Iu)return t.focus(Iu);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(Iu==null?{get preventScroll(){return Iu={preventScroll:!0},!0}}:void 0),!Iu){Iu=!1;for(let n=0;nMath.max(1,t.scrollHeight-t.clientHeight-4)}function _F(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=Lo(n)}else if(n.parentNode&&!Qv(n))r=id(n),n=n.parentNode;else return null}}function AF(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&rn)return m.domBoundsAround(e,n,d);if(g>=e&&s==-1&&(s=c,i=d),d>n&&m.dom.parentNode==this.dom){a=c,l=h;break}h=g,d=g+m.breakAfter}return{from:i,to:l<0?r+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:a=0?this.children[a].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let n=this.parent;n;n=n.parent){if(e&&(n.flags|=2),n.flags&1)return;n.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 n=e.parent;if(!n)return e;e=n}}replaceChildren(e,n,r=n6){this.markDirty();for(let s=e;sthis.pos||e==this.pos&&(n>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 RF(t,e,n,r,s,i,a,l,c){let{children:d}=t,h=d.length?d[e]:null,m=i.length?i[i.length-1]:null,g=m?m.breakAfter:a;if(!(e==r&&h&&!a&&!g&&i.length<2&&h.merge(n,s,i.length?m:null,n==0,l,c))){if(r0&&(!a&&i.length&&h.merge(n,h.length,i[0],!1,l,0)?h.breakAfter=i.shift().breakAfter:(nnoe||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(n),this.markDirty(),!0)}split(e){let n=new Ya(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),n.flags|=this.flags&8,n}localPosFromDOM(e,n){return e==this.dom?n:n?this.text.length:0}domAtPos(e){return new Qs(this.dom,e)}domBoundsAround(e,n,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,n){return roe(this.dom,e,n)}}class $l extends er{constructor(e,n=[],r=0){super(),this.mark=e,this.children=n,this.length=r;for(let s of n)s.setParent(this)}setAttrs(e){if(TF(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let n in this.mark.attrs)e.setAttribute(n,this.mark.attrs[n]);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,n){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,n)}merge(e,n,r,s,i,a){return r&&(!(r instanceof $l&&r.mark.eq(this.mark))||e&&i<=0||ne&&n.push(r=e&&(s=i),r=c,i++}let a=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new $l(this.mark,n,a)}domAtPos(e){return PF(this,e)}coordsAt(e,n){return IF(this,e,n)}}function roe(t,e,n){let r=t.nodeValue.length;e>r&&(e=r);let s=e,i=e,a=0;e==0&&n<0||e==r&&n>=0?et.chrome||et.gecko||(e?(s--,a=1):i=0)?0:l.length-1];return et.safari&&!a&&c.width==0&&(c=Array.prototype.find.call(l,d=>d.width)||c),a?qp(c,a<0):c||null}class Al extends er{static create(e,n,r){return new Al(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=Al.create(this.widget,this.length-e,this.side);return this.length-=e,n}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,n,r,s,i,a){return r&&(!(r instanceof Al)||!this.widget.compare(r.widget)||e>0&&i<=0||n0)?Qs.before(this.dom):Qs.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;let s=this.dom.getClientRects(),i=null;if(!s.length)return null;let a=this.side?this.side<0:e>0;for(let l=a?s.length-1:0;i=s[l],!(e>0?l==0:l==s.length-1||i.top0?Qs.before(this.dom):Qs.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return jn.empty}get isHidden(){return!0}}Ya.prototype.children=Al.prototype.children=ef.prototype.children=n6;function PF(t,e){let n=t.dom,{children:r}=t,s=0;for(let i=0;si&&e0;i--){let a=r[i-1];if(a.dom.parentNode==n)return a.domAtPos(a.length)}for(let i=s;i0&&e instanceof $l&&s.length&&(r=s[s.length-1])instanceof $l&&r.mark.eq(e.mark)?zF(r,e.children[0],n-1):(s.push(e),e.setParent(t)),t.length+=e.length}function IF(t,e,n){let r=null,s=-1,i=null,a=-1;function l(d,h){for(let m=0,g=0;m=h&&(x.children.length?l(x,h-g):(!i||i.isHidden&&(n>0||ioe(i,x)))&&(y>h||g==y&&x.getSide()>0)?(i=x,a=h-g):(g-1?1:0)!=s.length-(n&&s.indexOf(n)>-1?1:0))return!1;for(let i of r)if(i!=n&&(s.indexOf(i)==-1||t[i]!==e[i]))return!1;return!0}function Bk(t,e,n){let r=!1;if(e)for(let s in e)n&&s in n||(r=!0,s=="style"?t.style.cssText="":t.removeAttribute(s));if(n)for(let s in n)e&&e[s]==n[s]||(r=!0,s=="style"?t.style.cssText=n[s]:t.setAttribute(s,n[s]));return r}function aoe(t){let e=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new Xc(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,s;if(e.isBlockGap)r=-5e8,s=4e8;else{let{start:i,end:a}=LF(e,n);r=(i?n?-3e8:-1:5e8)-1,s=(a?n?2e8:1:-6e8)+1}return new Xc(e,r,s,n,e.widget||null,!0)}static line(e){return new Hp(e)}static set(e,n=!1){return Rn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}kt.none=Rn.empty;class $p extends kt{constructor(e){let{start:n,end:r}=LF(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var n,r;return this==e||e instanceof $p&&this.tagName==e.tagName&&(this.class||((n=this.attrs)===null||n===void 0?void 0:n.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&Vv(this.attrs,e.attrs,"class")}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}$p.prototype.point=!1;class Hp extends kt{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Hp&&this.spec.class==e.spec.class&&Vv(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}Hp.prototype.mapMode=Ds.TrackBefore;Hp.prototype.point=!0;class Xc extends kt{constructor(e,n,r,s,i,a){super(n,r,i,e),this.block=s,this.isReplace=a,this.mapMode=s?n<=0?Ds.TrackBefore:Ds.TrackAfter:Ds.TrackDel}get type(){return this.startSide!=this.endSide?ni.WidgetRange:this.startSide<=0?ni.WidgetBefore:ni.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Xc&&ooe(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}Xc.prototype.point=!0;function LF(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function ooe(t,e){return t==e||!!(t&&e&&t.compare(e))}function cv(t,e,n,r=0){let s=n.length-1;s>=0&&n[s]+r>=t?n[s]=Math.max(n[s],e):n.push(t,e)}class es extends er{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,n,r,s,i,a){if(r){if(!(r instanceof es))return!1;this.dom||r.transferDOM(this)}return s&&this.setDeco(r?r.attrs:null),DF(this,e,n,r?r.children.slice():[],i,a),!0}split(e){let n=new es;if(n.breakAfter=this.breakAfter,this.length==0)return n;let{i:r,off:s}=this.childPos(e);s&&(n.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;i0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,n}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){Vv(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){zF(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=Lk(n,this.attrs||{})),r&&(this.attrs=Lk({class:r},this.attrs||{}))}domAtPos(e){return PF(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(TF(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&&(Bk(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,n);let s=this.dom.lastChild;for(;s&&er.get(s)instanceof $l;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((r=er.get(s))===null||r===void 0?void 0:r.isEditable)==!1&&(!et.ios||!this.children.some(i=>i instanceof Ya))){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,n;for(let r of this.children){if(!(r instanceof Ya)||/[^ -~]/.test(r.text))return null;let s=Jh(r.dom);if(s.length!=1)return null;e+=s[0].width,n=s[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:n}:null}coordsAt(e,n){let r=IF(this,e,n);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=n){if(i instanceof es)return i;if(a>n)break}s=a+i.breakAfter}return null}}class Il extends er{constructor(e,n,r){super(),this.widget=e,this.length=n,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,n,r,s,i,a){return r&&(!(r instanceof Il)||!this.widget.compare(r.widget)||e>0&&i<=0||n0}}class Fk extends Ho{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 k0{constructor(e,n,r,s){this.doc=e,this.pos=n,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=n}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 Il&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new es),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(t1(new ef(-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 Il)&&this.getLine()}buildText(e,n,r){for(;e>0;){if(this.textOff==this.text.length){let{value:a,lineBreak:l,done:c}=this.cursor.next(this.skip);if(this.skip=0,c)throw new Error("Ran out of text content when drawing inline views");if(l){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=a,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e),i=Math.min(s,512);this.flushBuffer(n.slice(n.length-r)),this.getLine().append(t1(new Ya(this.text.slice(this.textOff,this.textOff+i)),n),r),this.atCursorPos=!0,this.textOff+=i,e-=i,r=s<=i?0:n.length}}span(e,n,r,s){this.buildText(n-e,r,s),this.pos=n,this.openStart<0&&(this.openStart=s)}point(e,n,r,s,i,a){if(this.disallowBlockEffectsFor[a]&&r instanceof Xc){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=n-e;if(r instanceof Xc)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Il(r.widget||tf.block,l,r));else{let c=Al.create(r.widget||tf.inline,l,l?0:r.startSide),d=this.atCursorPos&&!c.isEditable&&i<=s.length&&(e0),h=!c.isEditable&&(es.length||r.startSide<=0),m=this.getLine();this.pendingBuffer==2&&!d&&!c.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),d&&(m.append(t1(new ef(1),s),i),i=s.length+Math.max(0,i-s.length)),m.append(t1(c,s),i),this.atCursorPos=h,this.pendingBuffer=h?es.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=n),this.openStart<0&&(this.openStart=i)}static build(e,n,r,s,i){let a=new k0(e,n,r,i);return a.openEnd=Rn.spans(s,n,r,a),a.openStart<0&&(a.openStart=a.openEnd),a.finish(a.openEnd),a}}function t1(t,e){for(let n of e)t=new $l(n,[t],t.length);return t}class tf extends Ho{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}}tf.inline=new tf("span");tf.block=new tf("div");var gr=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(gr||(gr={}));const od=gr.LTR,r6=gr.RTL;function BF(t){let e=[];for(let n=0;n=n){if(l.level==r)return a;(i<0||(s!=0?s<0?l.fromn:e[i].level>l.level))&&(i=a)}}if(i<0)throw new RangeError("Index out of range");return i}}function qF(t,e){if(t.length!=e.length)return!1;for(let n=0;n=0;w-=3)if(ho[w+1]==-x){let S=ho[w+2],k=S&2?s:S&4?S&1?i:s:0;k&&(ir[m]=ir[ho[w]]=k),l=w;break}}else{if(ho.length==189)break;ho[l++]=m,ho[l++]=g,ho[l++]=c}else if((y=ir[m])==2||y==1){let w=y==s;c=w?0:1;for(let S=l-3;S>=0;S-=3){let k=ho[S+2];if(k&2)break;if(w)ho[S+2]|=2;else{if(k&4)break;ho[S+2]|=4}}}}}function foe(t,e,n,r){for(let s=0,i=r;s<=n.length;s++){let a=s?n[s-1].to:t,l=sc;)y==S&&(y=n[--w].from,S=w?n[w-1].to:t),ir[--y]=x;c=h}else i=d,c++}}}function $k(t,e,n,r,s,i,a){let l=r%2?2:1;if(r%2==s%2)for(let c=e,d=0;cc&&a.push(new Fc(c,w.from,x));let S=w.direction==od!=!(x%2);Hk(t,S?r+1:r,s,w.inner,w.from,w.to,a),c=w.to}y=w.to}else{if(y==n||(h?ir[y]!=l:ir[y]==l))break;y++}g?$k(t,c,y,r+1,s,g,a):ce;){let h=!0,m=!1;if(!d||c>i[d-1].to){let w=ir[c-1];w!=l&&(h=!1,m=w==16)}let g=!h&&l==1?[]:null,x=h?r:r+1,y=c;e:for(;;)if(d&&y==i[d-1].to){if(m)break e;let w=i[--d];if(!h)for(let S=w.from,k=d;;){if(S==e)break e;if(k&&i[k-1].to==S)S=i[--k].from;else{if(ir[S-1]==l)break e;break}}if(g)g.push(w);else{w.toir.length;)ir[ir.length]=256;let r=[],s=e==od?0:1;return Hk(t,s,s,n,0,t.length,r),r}function $F(t){return[new Fc(0,t,0)]}let HF="";function poe(t,e,n,r,s){var i;let a=r.head-t.from,l=Fc.find(e,a,(i=r.bidiLevel)!==null&&i!==void 0?i:-1,r.assoc),c=e[l],d=c.side(s,n);if(a==d){let g=l+=s?1:-1;if(g<0||g>=e.length)return null;c=e[l=g],a=c.side(!s,n),d=c.side(s,n)}let h=zs(t.text,a,c.forward(s,n));(hc.to)&&(h=d),HF=t.text.slice(Math.min(a,h),Math.max(a,h));let m=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return m&&h==d&&m.level+(s?0:1)t.some(e=>e)}),KF=at.define({combine:t=>t.some(e=>e)}),ZF=at.define();class zh{constructor(e,n="nearest",r="nearest",s=5,i=5,a=!1){this.range=e,this.y=n,this.x=r,this.yMargin=s,this.xMargin=i,this.isSnapshot=a}map(e){return e.empty?this:new zh(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 zh(Me.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const n1=Ft.define({map:(t,e)=>t.map(e)}),JF=Ft.define();function vi(t,e,n){let r=t.facet(WF);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const El=at.define({combine:t=>t.length?t[0]:!0});let xoe=0;const Nh=at.define({combine(t){return t.filter((e,n)=>{for(let r=0;r{let c=[];return a&&c.push(H0.of(d=>{let h=d.plugin(l);return h?a(h):kt.none})),i&&c.push(i(l)),c})}static fromClass(e,n){return Vr.define((r,s)=>new e(r,s),n)}}class z4{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 n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(vi(n.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(n){vi(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){vi(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const eq=at.define(),a6=at.define(),H0=at.define(),tq=at.define(),Qp=at.define(),nq=at.define();function OE(t,e){let n=t.state.facet(nq);if(!n.length)return n;let r=n.map(i=>i instanceof Function?i(t):i),s=[];return Rn.spans(r,e.from,e.to,{point(){},span(i,a,l,c){let d=i-e.from,h=a-e.from,m=s;for(let g=l.length-1;g>=0;g--,c--){let x=l[g].spec.bidiIsolate,y;if(x==null&&(x=goe(e.text,d,h)),c>0&&m.length&&(y=m[m.length-1]).to==d&&y.direction==x)y.to=h,m=y.inner;else{let w={from:d,to:h,direction:x,inner:[]};m.push(w),m=w.inner}}}}),s}const rq=at.define();function o6(t){let e=0,n=0,r=0,s=0;for(let i of t.state.facet(rq)){let a=i(t);a&&(a.left!=null&&(e=Math.max(e,a.left)),a.right!=null&&(n=Math.max(n,a.right)),a.top!=null&&(r=Math.max(r,a.top)),a.bottom!=null&&(s=Math.max(s,a.bottom)))}return{left:e,right:n,top:r,bottom:s}}const o0=at.define();class Na{constructor(e,n,r,s){this.fromA=e,this.toA=n,this.fromB=r,this.toB=s}join(e){return new Na(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 n=e.length,r=this;for(;n>0;n--){let s=e[n-1];if(!(s.fromA>r.toA)){if(s.toAh)break;i+=2}if(!c)return r;new Na(c.fromA,c.toA,c.fromB,c.toB).addToSet(r),a=c.toA,l=c.toB}}}class Uv{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=us.empty(this.startState.doc.length);for(let i of r)this.changes=this.changes.compose(i.changes);let s=[];this.changes.iterChangedRanges((i,a,l,c)=>s.push(new Na(i,a,l,c))),this.changedRanges=s}static create(e,n,r){return new Uv(e,n,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 jE extends er{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=kt.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 es],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Na(0,0,0,e.state.doc.length)],0,null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:d,toA:h})=>hthis.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&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?s=this.domChanged.newSel.head:!Ooe(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let i=s>-1?yoe(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:d,to:h}=this.hasComposition;r=new Na(d,h,e.changes.mapPos(d,-1),e.changes.mapPos(h,1)).addToSet(r.slice())}this.hasComposition=i?{from:i.range.fromB,to:i.range.toB}:null,(et.ie||et.chrome)&&!i&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,l=this.updateDeco(),c=Soe(a,l,e.changes);return r=Na.extendWithRanges(r,c),!(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,n,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,n,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 a=et.chrome||et.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,a),this.flags&=-8,a&&(a.written||s.selectionRange.focusNode!=a.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(a=>a.flags&=-9);let i=[];if(this.view.viewport.from||this.view.viewport.to=0?s[a]:null;if(!l)break;let{fromA:c,toA:d,fromB:h,toB:m}=l,g,x,y,w;if(r&&r.range.fromBh){let T=k0.build(this.view.state.doc,h,r.range.fromB,this.decorations,this.dynamicDecorationMap),E=k0.build(this.view.state.doc,r.range.toB,m,this.decorations,this.dynamicDecorationMap);x=T.breakAtStart,y=T.openStart,w=E.openEnd;let _=this.compositionView(r);E.breakAtStart?_.breakAfter=1:E.content.length&&_.merge(_.length,_.length,E.content[0],!1,E.openStart,0)&&(_.breakAfter=E.content[0].breakAfter,E.content.shift()),T.content.length&&_.merge(0,0,T.content[T.content.length-1],!0,0,T.openEnd)&&T.content.pop(),g=T.content.concat(_).concat(E.content)}else({content:g,breakAtStart:x,openStart:y,openEnd:w}=k0.build(this.view.state.doc,h,m,this.decorations,this.dynamicDecorationMap));let{i:S,off:k}=i.findPos(d,1),{i:j,off:N}=i.findPos(c,-1);RF(this,j,N,S,k,g,x,y,w)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(JF)&&(this.editContextFormatting=r.value)}compositionView(e){let n=new Ya(e.text.nodeValue);n.flags|=8;for(let{deco:s}of e.marks)n=new $l(s,[n],n.length);let r=new es;return r.append(n,0),r}fixCompositionDOM(e){let n=(i,a)=>{a.flags|=8|(a.children.some(c=>c.flags&7)?1:0),this.markedForComposition.add(a);let l=er.get(i);l&&l!=a&&(l.dom=null),a.setDOM(i)},r=this.childPos(e.range.fromB,1),s=this.children[r.i];n(e.line,s);for(let i=e.marks.length-1;i>=-1;i--)r=s.childPos(r.off,1),s=s.children[r.i],n(i>=0?e.marks[i].node:e.text,s)}updateSelection(e=!1,n=!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(El)||this.dom.tabIndex>-1)&&lv(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(s||n||i))return;let a=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,c=this.moveToLine(this.domAtPos(l.anchor)),d=l.empty?c:this.moveToLine(this.domAtPos(l.head));if(et.gecko&&l.empty&&!this.hasComposition&&voe(c)){let m=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(m,c.node.childNodes[c.offset]||null)),c=d=new Qs(m,0),a=!0}let h=this.view.observer.selectionRange;(a||!h.focusNode||(!S0(c.node,c.offset,h.anchorNode,h.anchorOffset)||!S0(d.node,d.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{et.android&&et.chrome&&this.dom.contains(h.focusNode)&&koe(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let m=$0(this.view.root);if(m)if(l.empty){if(et.gecko){let g=boe(c.node,c.offset);if(g&&g!=3){let x=(g==1?_F:AF)(c.node,c.offset);x&&(c=new Qs(x.node,x.offset))}}m.collapse(c.node,c.offset),l.bidiLevel!=null&&m.caretBidiLevel!==void 0&&(m.caretBidiLevel=l.bidiLevel)}else if(m.extend){m.collapse(c.node,c.offset);try{m.extend(d.node,d.offset)}catch{}}else{let g=document.createRange();l.anchor>l.head&&([c,d]=[d,c]),g.setEnd(d.node,d.offset),g.setStart(c.node,c.offset),m.removeAllRanges(),m.addRange(g)}i&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,d)),this.impreciseAnchor=c.precise?null:new Qs(h.anchorNode,h.anchorOffset),this.impreciseHead=d.precise?null:new Qs(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&S0(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=$0(e.root),{anchorNode:s,anchorOffset:i}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let a=es.find(this,n.head);if(!a)return;let l=a.posAtStart;if(n.head==l||n.head==l+a.length)return;let c=this.coordsAt(n.head,-1),d=this.coordsAt(n.head,1);if(!c||!d||c.bottom>d.top)return;let h=this.domAtPos(n.head+n.assoc);r.collapse(h.node,h.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let m=e.observer.selectionRange;e.docView.posFromDOM(m.anchorNode,m.anchorOffset)!=n.from&&r.collapse(s,i)}moveToLine(e){let n=this.dom,r;if(e.node!=n)return e;for(let s=e.offset;!r&&s=0;s--){let i=er.get(n.childNodes[s]);i instanceof es&&(r=i.domAtPos(i.length))}return r?new Qs(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=er.get(n);if(r&&r.rootView==this)return r;n=n.parentNode}return null}posFromDOM(e,n){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,n)+r.posAtStart}domAtPos(e){let{i:n,off:r}=this.childCursor().findPos(e,-1);for(;n=0;a--){let l=this.children[a],c=i-l.breakAfter,d=c-l.length;if(ce||l.covers(1))&&(!r||l instanceof es&&!(r instanceof es&&n>=0)))r=l,s=d;else if(r&&d==e&&c==e&&l instanceof Il&&Math.abs(n)<2){if(l.deco.startSide<0)break;a&&(r=null)}i=d}return r?r.coordsAt(e-s,n):null}coordsForChar(e){let{i:n,off:r}=this.childPos(e,1),s=this.children[n];if(!(s instanceof es))return null;for(;s.children.length;){let{i:l,off:c}=s.childPos(r,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}r=c}if(!(s instanceof Ya))return null;let i=zs(s.text,r);if(i==r)return null;let a=ad(s.dom,r,i).getClientRects();for(let l=0;lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,c=this.view.textDirection==gr.LTR;for(let d=0,h=0;hs)break;if(d>=r){let x=m.dom.getBoundingClientRect();if(n.push(x.height),a){let y=m.dom.lastChild,w=y?Jh(y):[];if(w.length){let S=w[w.length-1],k=c?S.right-x.left:x.right-S.left;k>l&&(l=k,this.minWidth=i,this.minWidthFrom=d,this.minWidthTo=g)}}}d=g+m.breakAfter}return n}textDirectionAt(e){let{i:n}=this.childPos(e,1);return getComputedStyle(this.children[n].dom).direction=="rtl"?gr.RTL:gr.LTR}measureTextSize(){for(let i of this.children)if(i instanceof es){let a=i.measureTextSize();if(a)return a}let e=document.createElement("div"),n,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=Jh(e.firstChild)[0];n=e.getBoundingClientRect().height,r=i?i.width/27:7,s=i?i.height:n,e.remove()}),{lineHeight:n,charWidth:r,textHeight:s}}childCursor(e=this.length){let n=this.children.length;return n&&(e-=this.children[--n].length),new MF(this.children,e,n)}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,s=0;;s++){let i=s==n.viewports.length?null:n.viewports[s],a=i?i.from-1:this.length;if(a>r){let l=(n.lineBlockAt(a).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(kt.replace({widget:new Fk(l),block:!0,inclusive:!0,isBlockGap:!0}).range(r,a))}if(!i)break;r=i.to+1}return kt.set(e)}updateDeco(){let e=1,n=this.view.state.facet(H0).map(i=>(this.dynamicDecorationMap[e++]=typeof i=="function")?i(this.view):i),r=!1,s=this.view.state.facet(tq).map((i,a)=>{let l=typeof i=="function";return l&&(r=!0),l?i(this.view):i});for(s.length&&(this.dynamicDecorationMap[e++]=r,n.push(Rn.join(s))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];en.anchor?-1:1),s;if(!r)return;!n.empty&&(s=this.coordsAt(n.anchor,n.anchor>n.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=o6(this.view),a={left:r.left-i.left,top:r.top-i.top,right:r.right+i.right,bottom:r.bottom+i.bottom},{offsetWidth:l,offsetHeight:c}=this.view.scrollDOM;Kae(this.view.scrollDOM,a,n.heads instanceof Al||s.children.some(r);return r(this.children[n])}}function voe(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function sq(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=_F(n.focusNode,n.focusOffset),s=AF(n.focusNode,n.focusOffset),i=r||s;if(s&&r&&s.node!=r.node){let l=er.get(s.node);if(!l||l instanceof Ya&&l.text!=s.node.nodeValue)i=s;else if(t.docView.lastCompositionAfterCursor){let c=er.get(r.node);!c||c instanceof Ya&&c.text!=r.node.nodeValue||(i=s)}}if(t.docView.lastCompositionAfterCursor=i!=r,!i)return null;let a=e-i.offset;return{from:a,to:a+i.node.nodeValue.length,node:i.node}}function yoe(t,e,n){let r=sq(t,n);if(!r)return null;let{node:s,from:i,to:a}=r,l=s.nodeValue;if(/[\n\r]/.test(l)||t.state.doc.sliceString(r.from,r.to)!=l)return null;let c=e.invertedDesc,d=new Na(c.mapPos(i),c.mapPos(a),i,a),h=[];for(let m=s.parentNode;;m=m.parentNode){let g=er.get(m);if(g instanceof $l)h.push({node:m,deco:g.mark});else{if(g instanceof es||m.nodeName=="DIV"&&m.parentNode==t.contentDOM)return{range:d,text:s,marks:h,line:m};if(m!=t.contentDOM)h.push({node:m,deco:new $p({inclusive:!0,attributes:aoe(m),tagName:m.tagName.toLowerCase()})});else return null}}}function boe(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e{re.from&&(n=!0)}),n}function joe(t,e,n=1){let r=t.charCategorizer(e),s=t.doc.lineAt(e),i=e-s.from;if(s.length==0)return Me.cursor(e);i==0?n=1:i==s.length&&(n=-1);let a=i,l=i;n<0?a=zs(s.text,i,!1):l=zs(s.text,i);let c=r(s.text.slice(a,l));for(;a>0;){let d=zs(s.text,a,!1);if(r(s.text.slice(d,a))!=c)break;a=d}for(;lt?e.left-t:Math.max(0,t-e.right)}function Coe(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function I4(t,e){return t.tope.top+1}function NE(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function Vk(t,e,n){let r,s,i,a,l=!1,c,d,h,m;for(let y=t.firstChild;y;y=y.nextSibling){let w=Jh(y);for(let S=0;SN||a==N&&i>j)&&(r=y,s=k,i=j,a=N,l=j?e0:Sk.bottom&&(!h||h.bottomk.top)&&(d=y,m=k):h&&I4(h,k)?h=CE(h,k.bottom):m&&I4(m,k)&&(m=NE(m,k.top))}}if(h&&h.bottom>=n?(r=c,s=h):m&&m.top<=n&&(r=d,s=m),!r)return{node:t,offset:0};let g=Math.max(s.left,Math.min(s.right,e));if(r.nodeType==3)return TE(r,g,n);if(l&&r.contentEditable!="false")return Vk(r,g,n);let x=Array.prototype.indexOf.call(t.childNodes,r)+(e>=(s.left+s.right)/2?1:0);return{node:t,offset:x}}function TE(t,e,n){let r=t.nodeValue.length,s=-1,i=1e9,a=0;for(let l=0;ln?h.top-n:n-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&m=(h.left+h.right)/2,x=g;if(et.chrome||et.gecko){let y=ad(t,l).getBoundingClientRect();Math.abs(y.left-h.right)<.1&&(x=!g)}if(m<=0)return{node:t,offset:l+(x?1:0)};s=l+(x?1:0),i=m}}}return{node:t,offset:s>-1?s:a>0?t.nodeValue.length:0}}function iq(t,e,n,r=-1){var s,i;let a=t.contentDOM.getBoundingClientRect(),l=a.top+t.viewState.paddingTop,c,{docHeight:d}=t.viewState,{x:h,y:m}=e,g=m-l;if(g<0)return 0;if(g>d)return t.state.doc.length;for(let T=t.viewState.heightOracle.textHeight/2,E=!1;c=t.elementAtHeight(g),c.type!=ni.Text;)for(;g=r>0?c.bottom+T:c.top-T,!(g>=0&&g<=d);){if(E)return n?null:0;E=!0,r=-r}m=l+g;let x=c.from;if(xt.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:EE(t,a,c,h,m);let y=t.dom.ownerDocument,w=t.root.elementFromPoint?t.root:y,S=w.elementFromPoint(h,m);S&&!t.contentDOM.contains(S)&&(S=null),S||(h=Math.max(a.left+1,Math.min(a.right-1,h)),S=w.elementFromPoint(h,m),S&&!t.contentDOM.contains(S)&&(S=null));let k,j=-1;if(S&&((s=t.docView.nearest(S))===null||s===void 0?void 0:s.isEditable)!=!1){if(y.caretPositionFromPoint){let T=y.caretPositionFromPoint(h,m);T&&({offsetNode:k,offset:j}=T)}else if(y.caretRangeFromPoint){let T=y.caretRangeFromPoint(h,m);T&&({startContainer:k,startOffset:j}=T)}k&&(!t.contentDOM.contains(k)||et.safari&&Toe(k,j,h)||et.chrome&&Eoe(k,j,h))&&(k=void 0),k&&(j=Math.min(Lo(k),j))}if(!k||!t.docView.dom.contains(k)){let T=es.find(t.docView,x);if(!T)return g>c.top+c.height/2?c.to:c.from;({node:k,offset:j}=Vk(T.dom,h,m))}let N=t.docView.nearest(k);if(!N)return null;if(N.isWidget&&((i=N.dom)===null||i===void 0?void 0:i.nodeType)==1){let T=N.dom.getBoundingClientRect();return e.yt.defaultLineHeight*1.5){let l=t.viewState.heightOracle.textHeight,c=Math.floor((s-n.top-(t.defaultLineHeight-l)*.5)/l);i+=c*t.viewState.heightOracle.lineLength}let a=t.state.sliceDoc(n.from,n.to);return n.from+_k(a,i,t.state.tabSize)}function aq(t,e,n){let r,s=t;if(t.nodeType!=3||e!=(r=t.nodeValue.length))return!1;for(;;){let i=s.nextSibling;if(i){if(i.nodeName=="BR")break;return!1}else{let a=s.parentNode;if(!a||a.nodeName=="DIV")break;s=a}}return ad(t,r-1,r).getBoundingClientRect().right>n}function Toe(t,e,n){return aq(t,e,n)}function Eoe(t,e,n){if(e!=0)return aq(t,e,n);for(let s=t;;){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=t.nodeType==1?t.getBoundingClientRect():ad(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function Uk(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let s;for(let i of r.type){if(i.from>e)break;if(!(i.toe)return i;(!s||i.type==ni.Text&&(s.type!=i.type||(n<0?i.frome)))&&(s=i)}}return s||r}return r}function _oe(t,e,n,r){let s=Uk(t,e.head,e.assoc||-1),i=!r||s.type!=ni.Text||!(t.lineWrapping||s.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(i){let a=t.dom.getBoundingClientRect(),l=t.textDirectionAt(s.from),c=t.posAtCoords({x:n==(l==gr.LTR)?a.right-1:a.left+1,y:(i.top+i.bottom)/2});if(c!=null)return Me.cursor(c,n?-1:1)}return Me.cursor(n?s.to:s.from,n?-1:1)}function _E(t,e,n,r){let s=t.state.doc.lineAt(e.head),i=t.bidiSpans(s),a=t.textDirectionAt(s.from);for(let l=e,c=null;;){let d=poe(s,i,a,l,n),h=HF;if(!d){if(s.number==(n?t.state.doc.lines:1))return l;h=` +`,s=t.state.doc.line(s.number+(n?1:-1)),i=t.bidiSpans(s),d=t.visualLineSide(s,!n)}if(c){if(!c(h))return l}else{if(!r)return d;c=r(h)}l=d}}function Aoe(t,e,n){let r=t.state.charCategorizer(e),s=r(n);return i=>{let a=r(i);return s==wr.Space&&(s=a),s==a}}function Moe(t,e,n,r){let s=e.head,i=n?1:-1;if(s==(n?t.state.doc.length:0))return Me.cursor(s,e.assoc);let a=e.goalColumn,l,c=t.contentDOM.getBoundingClientRect(),d=t.coordsAtPos(s,e.assoc||-1),h=t.documentTop;if(d)a==null&&(a=d.left-c.left),l=i<0?d.top:d.bottom;else{let x=t.viewState.lineBlockAt(s);a==null&&(a=Math.min(c.right-c.left,t.defaultCharacterWidth*(s-x.from))),l=(i<0?x.top:x.bottom)+h}let m=c.left+a,g=r??t.viewState.heightOracle.textHeight>>1;for(let x=0;;x+=10){let y=l+(g+x)*i,w=iq(t,{x:m,y},!1,i);if(yc.bottom||(i<0?ws)){let S=t.docView.coordsForChar(w),k=!S||y{if(e>i&&es(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:Me.cursor(r,ri)&&!Poe(a,n)&&this.lineBreak(),s=a}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,a=1,l;if(this.lineSeparator?(i=n.indexOf(this.lineSeparator,r),a=this.lineSeparator.length):(l=s.exec(n))&&(i=l.index,a=l[0].length),this.append(n.slice(r,i<0?n.length:i)),i<0)break;if(this.lineBreak(),a>1)for(let c of this.points)c.node==e&&c.pos>this.text.length&&(c.pos-=a-1);r=i+a}}readNode(e){if(e.cmIgnore)return;let n=er.get(e),r=n&&n.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,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(Doe(e,r.node,r.offset)?n:0))}}function Doe(t,e,n){for(;;){if(!e||n-1;let{impreciseHead:i,impreciseAnchor:a}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let l=i||a?[]:Loe(e),c=new Roe(l,e.state);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=Boe(l,this.bounds.from)}else{let l=e.observer.selectionRange,c=i&&i.node==l.focusNode&&i.offset==l.focusOffset||!Ik(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),d=a&&a.node==l.anchorNode&&a.offset==l.anchorOffset||!Ik(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if((et.ios||et.chrome)&&e.state.selection.main.empty&&c!=d&&(h.from>0||h.to-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(Me.range(d,c)):this.newSel=Me.single(d,c)}}}function lq(t,e){let n,{newSel:r}=e,s=t.state.selection.main,i=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:a,to:l}=e.bounds,c=s.from,d=null;(i===8||et.android&&e.text.length=s.from&&n.to<=s.to&&(n.from!=s.from||n.to!=s.to)&&s.to-s.from-(n.to-n.from)<=4?n={from:s.from,to:s.to,insert:t.state.doc.slice(s.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,s.to))}:t.state.doc.lineAt(s.from).toDate.now()-50?n={from:s.from,to:s.to,insert:t.state.toText(t.inputState.insertingText)}:et.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==` + `&&t.lineWrapping&&(r&&(r=Me.single(r.main.anchor-1,r.main.head-1)),n={from:s.from,to:s.to,insert:jn.of([" "])}),n)return l6(t,n,r,i);if(r&&!r.main.eq(s)){let a=!1,l="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(a=!0),l=t.inputState.lastSelectionOrigin,l=="select.pointer"&&(r=oq(t.state.facet(Qp).map(c=>c(t)),r))),t.dispatch({selection:r,scrollIntoView:a,userEvent:l}),!0}else return!1}function l6(t,e,n,r=-1){if(et.ios&&t.inputState.flushIOSKey(e))return!0;let s=t.state.selection.main;if(et.android&&(e.to==s.to&&(e.from==s.from||e.from==s.from-1&&t.state.sliceDoc(e.from,s.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Ph(t.contentDOM,"Enter",13)||(e.from==s.from-1&&e.to==s.to&&e.insert.length==0||r==8&&e.insert.lengths.head)&&Ph(t.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&Ph(t.contentDOM,"Delete",46)))return!0;let i=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a,l=()=>a||(a=Ioe(t,e,n));return t.state.facet(GF).some(c=>c(t,e.from,e.to,i,l))||t.dispatch(l()),!0}function Ioe(t,e,n){let r,s=t.state,i=s.selection.main,a=-1;if(e.from==e.to&&e.fromi.to){let c=e.fromm(t)),d,c);e.from==h&&(a=h)}if(a>-1)r={changes:e,selection:Me.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&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let c=i.frome.to?s.sliceDoc(e.to,i.to):"";r=s.replaceSelection(t.state.toText(c+e.insert.sliceString(0,void 0,t.state.lineBreak)+d))}else{let c=s.changes(e),d=n&&n.main.to<=c.newLength?n.main:void 0;if(s.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=i.to+10&&e.to>=i.to-10){let h=t.state.sliceDoc(e.from,e.to),m,g=n&&sq(t,n.main.head);if(g){let y=e.insert.length-(e.to-e.from);m={from:g.from,to:g.to-y}}else m=t.state.doc.lineAt(i.head);let x=i.to-e.to;r=s.changeByRange(y=>{if(y.from==i.from&&y.to==i.to)return{changes:c,range:d||y.map(c)};let w=y.to-x,S=w-h.length;if(t.state.sliceDoc(S,w)!=h||w>=m.from&&S<=m.to)return{range:y};let k=s.changes({from:S,to:w,insert:e.insert}),j=y.to-i.to;return{changes:k,range:d?Me.range(Math.max(0,d.anchor+j),Math.max(0,d.head+j)):y.map(k)}})}else r={changes:c,selection:d&&s.selection.replaceRange(d)}}let l="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,l+=".compose",t.inputState.compositionFirstChange&&(l+=".start",t.inputState.compositionFirstChange=!1)),s.update(r,{userEvent:l,scrollIntoView:!0})}function cq(t,e,n,r){let s=Math.min(t.length,e.length),i=0;for(;i0&&l>0&&t.charCodeAt(a-1)==e.charCodeAt(l-1);)a--,l--;if(r=="end"){let c=Math.max(0,i-Math.min(a,l));n-=a+c-i}if(a=a?i-n:0;i-=c,l=i+(l-a),a=i}else if(l=l?i-n:0;i-=c,a=i+(a-l),l=i}return{from:i,toA:a,toB:l}}function Loe(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:i}=t.observer.selectionRange;return n&&(e.push(new AE(n,r)),(s!=n||i!=r)&&e.push(new AE(s,i))),e}function Boe(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?Me.single(n+e,r+e):null}class Foe{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,et.safari&&e.contentDOM.addEventListener("input",()=>null),et.gecko&&nle(e.contentDOM.ownerDocument)}handleEvent(e){!Goe(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,n){let r=this.handlers[e];if(r){for(let s of r.observers)s(this.view,n);for(let s of r.handlers){if(n.defaultPrevented)break;if(s(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=qoe(e),r=this.handlers,s=this.view.contentDOM;for(let i in n)if(i!="scroll"){let a=!n[i].handlers.length,l=r[i];l&&a!=!l.handlers.length&&(s.removeEventListener(i,this.handleEvent),l=null),l||s.addEventListener(i,this.handleEvent,{passive:a})}for(let i in r)i!="scroll"&&!n[i]&&s.removeEventListener(i,this.handleEvent);this.handlers=n}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&&dq.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),et.android&&et.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return et.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=uq.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||$oe.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from0?!0:et.safari&&!et.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 ME(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(s){vi(n.state,s)}}}function qoe(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let s=r.spec,i=s&&s.plugin.domEventHandlers,a=s&&s.plugin.domEventObservers;if(i)for(let l in i){let c=i[l];c&&n(l).handlers.push(ME(r.value,c))}if(a)for(let l in a){let c=a[l];c&&n(l).observers.push(ME(r.value,c))}}for(let r in Ka)n(r).handlers.push(Ka[r]);for(let r in _a)n(r).observers.push(_a[r]);return e}const uq=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],$oe="dthko",dq=[16,17,18,20,91,92,224,225],r1=6;function s1(t){return Math.max(0,t)*.7+8}function Hoe(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class Qoe{constructor(e,n,r,s){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=Zae(e.contentDOM),this.atoms=e.state.facet(Qp).map(a=>a(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=n.shiftKey,this.multiple=e.state.facet(wn.allowMultipleSelections)&&Voe(e,n),this.dragging=Woe(e,n)&&mq(n)==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&&Hoe(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,s=0,i=0,a=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=o6(this.view);e.clientX-c.left<=s+r1?n=-s1(s-e.clientX):e.clientX+c.right>=a-r1&&(n=s1(e.clientX-a)),e.clientY-c.top<=i+r1?r=-s1(i-e.clientY):e.clientY+c.bottom>=l-r1&&(r=s1(e.clientY-l)),this.setScrollSpeed(n,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,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=oq(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Voe(t,e){let n=t.state.facet(QF);return n.length?n[0](e):et.mac?e.metaKey:e.ctrlKey}function Uoe(t,e){let n=t.state.facet(VF);return n.length?n[0](e):et.mac?!e.altKey:!e.ctrlKey}function Woe(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=$0(t.root);if(!r||r.rangeCount==0)return!0;let s=r.getRangeAt(0).getClientRects();for(let i=0;i=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}function Goe(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=er.get(n))&&r.ignoreEvent(e))return!1;return!0}const Ka=Object.create(null),_a=Object.create(null),hq=et.ie&&et.ie_version<15||et.ios&&et.webkit_version<604;function Xoe(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),fq(t,n.value)},50)}function ub(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function fq(t,e){e=ub(t.state,s6,e);let{state:n}=t,r,s=1,i=n.toText(e),a=i.lines==n.selection.ranges.length;if(Wk!=null&&n.selection.ranges.every(c=>c.empty)&&Wk==i.toString()){let c=-1;r=n.changeByRange(d=>{let h=n.doc.lineAt(d.from);if(h.from==c)return{range:d};c=h.from;let m=n.toText((a?i.line(s++).text:e)+n.lineBreak);return{changes:{from:h.from,insert:m},range:Me.cursor(d.from+m.length)}})}else a?r=n.changeByRange(c=>{let d=i.line(s++);return{changes:{from:c.from,to:c.to,insert:d.text},range:Me.cursor(c.from+d.length)}}):r=n.replaceSelection(i);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}_a.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Ka.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);_a.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};_a.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Ka.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(UF))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=Zoe(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new Qoe(t,e,n,r)),r&&t.observer.ignore(()=>{CF(t.contentDOM);let i=t.root.activeElement;i&&!i.contains(t.contentDOM)&&i.blur()});let s=t.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function RE(t,e,n,r){if(r==1)return Me.cursor(e,n);if(r==2)return joe(t.state,e,n);{let s=es.find(t.docView,e),i=t.state.doc.lineAt(s?s.posAtEnd:e),a=s?s.posAtStart:i.from,l=s?s.posAtEnd:i.to;return le>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right;function Yoe(t,e,n,r){let s=es.find(t.docView,e);if(!s)return 1;let i=e-s.posAtStart;if(i==0)return 1;if(i==s.length)return-1;let a=s.coordsAt(i,-1);if(a&&DE(n,r,a))return-1;let l=s.coordsAt(i,1);return l&&DE(n,r,l)?1:a&&a.bottom>=r?-1:1}function PE(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:Yoe(t,n,e.clientX,e.clientY)}}const Koe=et.ie&&et.ie_version<=11;let zE=null,IE=0,LE=0;function mq(t){if(!Koe)return t.detail;let e=zE,n=LE;return zE=t,LE=Date.now(),IE=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(IE+1)%3:1}function Zoe(t,e){let n=PE(t,e),r=mq(e),s=t.state.selection;return{update(i){i.docChanged&&(n.pos=i.changes.mapPos(n.pos),s=s.map(i.changes))},get(i,a,l){let c=PE(t,i),d,h=RE(t,c.pos,c.bias,r);if(n.pos!=c.pos&&!a){let m=RE(t,n.pos,n.bias,r),g=Math.min(m.from,h.from),x=Math.max(m.to,h.to);h=g1&&(d=Joe(s,c.pos))?d:l?s.addRange(h):Me.create([h])}}}function Joe(t,e){for(let n=0;n=e)return Me.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Ka.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let s=t.docView.nearest(e.target);if(s&&s.isWidget){let i=s.posAtStart,a=i+s.length;(i>=n.to||a<=n.from)&&(n=Me.range(i,a))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",ub(t.state,i6,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Ka.dragend=t=>(t.inputState.draggedContent=null,!1);function BE(t,e,n,r){if(n=ub(t.state,s6,n),!n)return;let s=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:i}=t.inputState,a=r&&i&&Uoe(t,e)?{from:i.from,to:i.to}:null,l={from:s,insert:n},c=t.state.changes(a?[a,l]:l);t.focus(),t.dispatch({changes:c,selection:{anchor:c.mapPos(s,-1),head:c.mapPos(s,1)},userEvent:a?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Ka.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),s=0,i=()=>{++s==n.length&&BE(t,e,r.filter(a=>a!=null).join(t.state.lineBreak),!1)};for(let a=0;a{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(r[a]=l.result),i()},l.readAsText(n[a])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return BE(t,e,r,!0),!0}return!1};Ka.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=hq?null:e.clipboardData;return n?(fq(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(Xoe(t),!1)};function ele(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.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(),t.focus()},50)}function tle(t){let e=[],n=[],r=!1;for(let s of t.selection.ranges)s.empty||(e.push(t.sliceDoc(s.from,s.to)),n.push(s));if(!e.length){let s=-1;for(let{from:i}of t.selection.ranges){let a=t.doc.lineAt(i);a.number>s&&(e.push(a.text),n.push({from:a.from,to:Math.min(t.doc.length,a.to+1)})),s=a.number}r=!0}return{text:ub(t,i6,e.join(t.lineBreak)),ranges:n,linewise:r}}let Wk=null;Ka.copy=Ka.cut=(t,e)=>{let{text:n,ranges:r,linewise:s}=tle(t.state);if(!n&&!s)return!1;Wk=s?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let i=hq?null:e.clipboardData;return i?(i.clearData(),i.setData("text/plain",n),!0):(ele(t,n),!1)};const pq=qo.define();function gq(t,e){let n=[];for(let r of t.facet(XF)){let s=r(t,e);s&&n.push(s)}return n.length?t.update({effects:n,annotations:pq.of(!0)}):null}function xq(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=gq(t.state,e);n?t.dispatch(n):t.update([])}},10)}_a.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),xq(t)};_a.blur=t=>{t.observer.clearSelectionRange(),xq(t)};_a.compositionstart=_a.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};_a.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,et.chrome&&et.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};_a.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Ka.beforeinput=(t,e)=>{var n,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let i=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),a=e.getTargetRanges();if(i&&a.length){let l=a[0],c=t.posAtDOM(l.startContainer,l.startOffset),d=t.posAtDOM(l.endContainer,l.endOffset);return l6(t,{from:c,to:d,insert:t.state.toText(i)},null),!0}}let s;if(et.chrome&&et.android&&(s=uq.find(i=>i.inputType==e.inputType))&&(t.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 a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>i+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return et.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),et.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>_a.compositionend(t,e),20),!1};const FE=new Set;function nle(t){FE.has(t)||(FE.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const qE=["pre-wrap","normal","pre-line","break-spaces"];let nf=!1;function $E(){nf=!1}class rle{constructor(e){this.lineWrapping=e,this.doc=jn.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-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 qE.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r-1,c=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=r,this.textHeight=s,this.lineLength=i,c){this.heightSamples={};for(let d=0;d0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>uv&&(nf=!0),this.height=e)}replace(e,n,r){return ri.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,s){let i=this,a=r.doc;for(let l=s.length-1;l>=0;l--){let{fromA:c,toA:d,fromB:h,toB:m}=s[l],g=i.lineAt(c,pr.ByPosNoHeight,r.setDoc(n),0,0),x=g.to>=d?g:i.lineAt(d,pr.ByPosNoHeight,r,0,0);for(m+=x.to-d,d=x.to;l>0&&g.from<=s[l-1].toA;)c=s[l-1].fromA,h=s[l-1].fromB,l--,ci*2){let l=e[n-1];l.break?e.splice(--n,1,l.left,null,l.right):e.splice(--n,1,l.left,l.right),r+=1+l.break,s-=l.size}else if(i>s*2){let l=e[r];l.break?e.splice(r,1,l.left,null,l.right):e.splice(r,1,l.left,l.right),r+=2+l.break,i-=l.size}else break;else if(s=i&&a(this.blockAt(0,r,s,i))}updateHeight(e,n=0,r=!1,s){return s&&s.from<=n&&s.more&&this.setHeight(s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class $i extends vq{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,s){return new So(s,this.length,r,this.height,this.breaks)}replace(e,n,r){let s=r[0];return r.length==1&&(s instanceof $i||s instanceof As&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof As?s=new $i(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):ri.of(r)}updateHeight(e,n=0,r=!1,s){return s&&s.from<=n&&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 As extends ri{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,s=e.doc.lineAt(n+this.length).number,i=s-r+1,a,l=0;if(e.lineWrapping){let c=Math.min(this.height,e.lineHeight*i);a=c/i,this.length>i+1&&(l=(this.height-c)/(this.length-i-1))}else a=this.height/i;return{firstLine:r,lastLine:s,perLine:a,perChar:l}}blockAt(e,n,r,s){let{firstLine:i,lastLine:a,perLine:l,perChar:c}=this.heightMetrics(n,s);if(n.lineWrapping){let d=s+(e0){let i=r[r.length-1];i instanceof As?r[r.length-1]=new As(i.length+s):r.push(null,new As(s-1))}if(e>0){let i=r[0];i instanceof As?r[0]=new As(e+i.length):r.unshift(new As(e-1),null)}return ri.of(r)}decomposeLeft(e,n){n.push(new As(e-1),null)}decomposeRight(e,n){n.push(null,new As(this.length-e-1))}updateHeight(e,n=0,r=!1,s){let i=n+this.length;if(s&&s.from<=n+this.length&&s.more){let a=[],l=Math.max(n,s.from),c=-1;for(s.from>n&&a.push(new As(s.from-n-1).updateHeight(e,n));l<=i&&s.more;){let h=e.doc.lineAt(l).length;a.length&&a.push(null);let m=s.heights[s.index++];c==-1?c=m:Math.abs(m-c)>=uv&&(c=-2);let g=new $i(h,m);g.outdated=!1,a.push(g),l+=h+1}l<=i&&a.push(null,new As(i-l).updateHeight(e,l));let d=ri.of(a);return(c<0||Math.abs(d.height-this.height)>=uv||Math.abs(c-this.heightMetrics(e,n).perLine)>=uv)&&(nf=!0),Wv(this,d)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class ile extends ri{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(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,n,r,s){let i=r+this.left.height;return el))return d;let h=n==pr.ByPosNoHeight?pr.ByPosNoHeight:pr.ByPos;return c?d.join(this.right.lineAt(l,h,r,a,l)):this.left.lineAt(l,h,r,s,i).join(d)}forEachLine(e,n,r,s,i,a){let l=s+this.left.height,c=i+this.left.length+this.break;if(this.break)e=c&&this.right.forEachLine(e,n,r,l,c,a);else{let d=this.lineAt(c,pr.ByPos,r,s,i);e=e&&d.from<=n&&a(d),n>d.to&&this.right.forEachLine(d.to+1,n,r,l,c,a)}}replace(e,n,r){let s=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(e-s,n-s,r));let i=[];e>0&&this.decomposeLeft(e,i);let a=i.length;for(let l of r)i.push(l);if(e>0&&HE(i,a-1),n=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,s=r+this.break;if(e>=s)return this.right.decomposeRight(e-s,n);e2*n.size||n.size>2*e.size?ri.of(this.break?[e,null,n]:[e,n]):(this.left=Wv(this.left,e),this.right=Wv(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,s){let{left:i,right:a}=this,l=n+i.length+this.break,c=null;return s&&s.from<=n+i.length&&s.more?c=i=i.updateHeight(e,n,r,s):i.updateHeight(e,n,r),s&&s.from<=l+a.length&&s.more?c=a=a.updateHeight(e,l,r,s):a.updateHeight(e,l,r),c?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function HE(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof As&&(r=t[e+1])instanceof As&&t.splice(e-1,3,new As(n.length+1+r.length))}const ale=5;class c6{constructor(e,n){this.pos=e,this.oracle=n,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,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof $i?s.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new $i(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e=ale)&&this.addLineDeco(s,i,a)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenToe&&this.nodes.push(new $i(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new As(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof $i)return e;let n=new $i(0,-1);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let s=this.ensureLine();s.length+=r,s.collapsed+=r,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof $i)&&!this.isCovered?this.nodes.push(new $i(0,-1)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&m.overflow!="visible"){let g=h.getBoundingClientRect();i=Math.max(i,g.left),a=Math.min(a,g.right),l=Math.max(l,g.top),c=Math.min(d==t.parentNode?s.innerHeight:c,g.bottom)}d=m.position=="absolute"||m.position=="fixed"?h.offsetParent:h.parentNode}else if(d.nodeType==11)d=d.host;else break;return{left:i-n.left,right:Math.max(i,a)-n.left,top:l-(n.top+e),bottom:Math.max(l,c)-(n.top+e)}}function ule(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left0&&e.top0}function dle(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class B4{constructor(e,n,r,s){this.from=e,this.to=n,this.size=r,this.displaySize=s}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;rtypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new rle(n),this.stateDeco=e.facet(H0).filter(r=>typeof r!="function"),this.heightMap=ri.empty().applyChanges(this.stateDeco,jn.empty,this.heightOracle.setDoc(e.doc),[new Na(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=kt.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let s=r?n.head:n.anchor;if(!e.some(({from:i,to:a})=>s>=i&&s<=a)){let{from:i,to:a}=this.lineBlockAt(s);e.push(new i1(i,a))}}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?VE:new u6(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(c0(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(H0).filter(h=>typeof h!="function");let s=e.changedRanges,i=Na.extendWithRanges(s,ole(r,this.stateDeco,e?e.changes:us.empty(this.state.doc.length))),a=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);$E(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=a||nf)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let c=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.headc.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,n));let d=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,e.flags|=this.updateForViewport(),(d||!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),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(KF)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),s=this.heightOracle,i=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?gr.RTL:gr.LTR;let a=this.heightOracle.mustRefreshForWrapping(i),l=n.getBoundingClientRect(),c=a||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let d=0,h=0;if(l.width&&l.height){let{scaleX:T,scaleY:E}=NF(n,l);(T>.005&&Math.abs(this.scaleX-T)>.005||E>.005&&Math.abs(this.scaleY-E)>.005)&&(this.scaleX=T,this.scaleY=E,d|=16,a=c=!0)}let m=(parseInt(r.paddingTop)||0)*this.scaleY,g=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=m||this.paddingBottom!=g)&&(this.paddingTop=m,this.paddingBottom=g,d|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(c=!0),this.editorWidth=e.scrollDOM.clientWidth,d|=16);let x=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=x&&(this.scrollAnchorHeight=-1,this.scrollTop=x),this.scrolledToBottom=EF(e.scrollDOM);let y=(this.printing?dle:cle)(n,this.paddingTop),w=y.top-this.pixelViewport.top,S=y.bottom-this.pixelViewport.bottom;this.pixelViewport=y;let k=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(k!=this.inView&&(this.inView=k,k&&(c=!0)),!this.inView&&!this.scrollTarget&&!ule(e.dom))return 0;let j=l.width;if((this.contentDOMWidth!=j||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,d|=16),c){let T=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(T)&&(a=!0),a||s.lineWrapping&&Math.abs(j-this.contentDOMWidth)>s.charWidth){let{lineHeight:E,charWidth:_,textHeight:A}=e.docView.measureTextSize();a=E>0&&s.refresh(i,E,_,A,Math.max(5,j/_),T),a&&(e.docView.minWidth=0,d|=16)}w>0&&S>0?h=Math.max(w,S):w<0&&S<0&&(h=Math.min(w,S)),$E();for(let E of this.viewports){let _=E.from==this.viewport.from?T:e.docView.measureVisibleLineHeights(E);this.heightMap=(a?ri.empty().applyChanges(this.stateDeco,jn.empty,this.heightOracle,[new Na(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,a,new sle(E.from,_))}nf&&(d|=2)}let N=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return N&&(d&2&&(d|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),d|=this.updateForViewport()),(d&2||N)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),d|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),d}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,i=this.heightOracle,{visibleTop:a,visibleBottom:l}=this,c=new i1(s.lineAt(a-r*1e3,pr.ByHeight,i,0,0).from,s.lineAt(l+(1-r)*1e3,pr.ByHeight,i,0,0).to);if(n){let{head:d}=n.range;if(dc.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),m=s.lineAt(d,pr.ByPos,i,0,0),g;n.y=="center"?g=(m.top+m.bottom)/2-h/2:n.y=="start"||n.y=="nearest"&&d=l+Math.max(10,Math.min(r,250)))&&s>a-2*1e3&&i>1,a=s<<1;if(this.defaultTextDirection!=gr.LTR&&!r)return[];let l=[],c=(h,m,g,x)=>{if(m-hh&&kk.from>=g.from&&k.to<=g.to&&Math.abs(k.from-h)k.fromj));if(!S){if(mN.from<=m&&N.to>=m)){let N=n.moveToLineBoundary(Me.cursor(m),!1,!0).head;N>h&&(m=N)}let k=this.gapSize(g,h,m,x),j=r||k<2e6?k:2e6;S=new B4(h,m,k,j)}l.push(S)},d=h=>{if(h.length2e6)for(let _ of e)_.from>=h.from&&_.fromh.from&&c(h.from,x,h,m),yn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];Rn.spans(n,this.viewport.from,this.viewport.to,{span(i,a){r.push({from:i,to:a})},point(){}},20);let s=0;if(r.length!=this.visibleRanges.length)s=12;else for(let i=0;i=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||c0(this.heightMap.lineAt(e,pr.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(n=>n.top<=e&&n.bottom>=e)||c0(this.heightMap.lineAt(this.scaler.fromDOM(e),pr.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return c0(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 i1=class{constructor(e,n){this.from=e,this.to=n}};function fle(t,e,n){let r=[],s=t,i=0;return Rn.spans(n,t,e,{span(){},point(a,l){a>s&&(r.push({from:s,to:a}),i+=a-s),s=l}},20),s=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let s=0;;s++){let{from:i,to:a}=e[s],l=a-i;if(r<=l)return i+r;r-=l}}function o1(t,e){let n=0;for(let{from:r,to:s}of t.ranges){if(e<=s){n+=e-r;break}n+=s-r}return n/t.total}function mle(t,e){for(let n of t)if(e(n))return n}const VE={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};class u6{constructor(e,n,r){let s=0,i=0,a=0;this.viewports=r.map(({from:l,to:c})=>{let d=n.lineAt(l,pr.ByPos,e,0,0).top,h=n.lineAt(c,pr.ByPos,e,0,0).bottom;return s+=h-d,{from:l,to:c,top:d,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(n.height-s);for(let l of this.viewports)l.domTop=a+(l.top-i)*this.scale,a=l.domBottom=l.domTop+(l.bottom-l.top),i=l.bottom}toDOM(e){for(let n=0,r=0,s=0;;n++){let i=nn.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function c0(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new So(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(s=>c0(s,e)):t._content)}const l1=at.define({combine:t=>t.join(" ")}),Gk=at.define({combine:t=>t.indexOf(!0)>-1}),Xk=Wc.newName(),yq=Wc.newName(),bq=Wc.newName(),wq={"&light":"."+yq,"&dark":"."+bq};function Yk(t,e,n){return new Wc(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,s=>{if(s=="&")return t;if(!n||!n[s])throw new RangeError(`Unsupported selector: ${s}`);return n[s]}):t+" "+r}})}const ple=Yk("."+Xk,{"&":{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,')`,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"}},wq),gle={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},F4=et.ie&&et.ie_version<=11;class xle{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Jae,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(n=>{for(let r of n)this.queue.push(r);(et.ie&&et.ie_version<=11||et.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&et.android&&e.constructor.EDIT_CONTEXT!==!1&&!(et.chrome&&et.chrome_version<126)&&(this.editContext=new yle(e),e.state.facet(El)&&(e.contentDOM.editContext=this.editContext.editContext)),F4&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.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 n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.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(n=>{n.length>0&&n[n.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((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,s=this.selectionRange;if(r.state.facet(El)?r.root.activeElement!=this.dom:!lv(this.dom,s))return;let i=s.anchorNode&&r.docView.nearest(s.anchorNode);if(i&&i.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(et.ie&&et.ie_version<=11||et.android&&et.chrome)&&!r.state.selection.main.empty&&s.focusNode&&S0(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=$0(e.root);if(!n)return!1;let r=et.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&vle(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let s=lv(this.dom,r);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let i=this.delayedAndroidKey;i&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=i.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&i.force&&Ph(this.dom,i.key,i.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange{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 n=-1,r=-1,s=!1;for(let i of e){let a=this.readMutation(i);a&&(a.typeOver&&(s=!0),n==-1?{from:n,to:r}=a:(n=Math.min(a.from,n),r=Math.max(a.to,r)))}return{from:n,to:r,typeOver:s}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),s=this.selectionChanged&&lv(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 zoe(this.view,e,n,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 n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,s=lq(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!n.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),s}readMutation(e){let n=this.view.docView.nearest(e.target);if(!n||n.ignoreMutation(e))return null;if(n.markDirty(e.type=="attributes"),e.type=="attributes"&&(n.flags|=4),e.type=="childList"){let r=UE(n,e.previousSibling||e.target.previousSibling,-1),s=UE(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:s?n.posBefore(s):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.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(El)!=e.state.facet(El)&&(e.view.contentDOM.editContext=e.state.facet(El)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.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 UE(t,e,n){for(;e;){let r=er.get(e);if(r&&r.parent==t)return r;let s=e.parentNode;e=s!=t.dom?s:n>0?e.nextSibling:e.previousSibling}return null}function WE(t,e){let n=e.startContainer,r=e.startOffset,s=e.endContainer,i=e.endOffset,a=t.docView.domAtPos(t.state.selection.main.anchor);return S0(a.node,a.offset,s,i)&&([n,r,s,i]=[s,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:i}}function vle(t,e){if(e.getComposedRanges){let s=e.getComposedRanges(t.root)[0];if(s)return WE(t,s)}let n=null;function r(s){s.preventDefault(),s.stopImmediatePropagation(),n=s.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?WE(t,n):null}class yle{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=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:a}=s,l=this.toEditorPos(r.updateRangeStart),c=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:l,drifted:!1});let d=c-l>r.text.length;l==this.from&&ithis.to&&(c=i);let h=cq(e.state.sliceDoc(l,c),r.text,(d?s.from:s.to)-l,d?"end":null);if(!h){let g=Me.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));g.main.eq(s)||e.dispatch({selection:g,userEvent:"select"});return}let m={from:h.from+l,to:h.toA+l,insert:jn.of(r.text.slice(h.from,h.toB).split(` +`))};if((et.mac||et.android)&&m.from==a-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(m={from:l,to:c,insert:jn.of([r.text.replace("."," ")])}),this.pendingContextChange=m,!e.state.readOnly){let g=this.to-this.from+(m.to-m.from+m.insert.length);l6(e,m,Me.single(this.toEditorPos(r.selectionStart,g),this.toEditorPos(r.selectionEnd,g)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),m.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let s=[],i=null;for(let a=this.toEditorPos(r.rangeStart),l=this.toEditorPos(r.rangeEnd);a{let s=[];for(let i of r.getTextFormats()){let a=i.underlineStyle,l=i.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(l)){let c=this.toEditorPos(i.rangeStart),d=this.toEditorPos(i.rangeEnd);if(c{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)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let s=$0(r.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,s=this.pendingContextChange;return e.changes.iterChanges((i,a,l,c,d)=>{if(r)return;let h=d.length-(a-i);if(s&&a>=s.to)if(s.from==i&&s.to==a&&s.insert.eq(d)){s=this.pendingContextChange=null,n+=h,this.to+=h;return}else s=null,this.revertPending(e.state);if(i+=n,a+=n,a<=this.from)this.from+=h,this.to+=h;else if(ithis.to||this.to-this.from+d.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),d.toString()),this.to+=h}n+=h}),s&&!r&&this.revertPending(e.state),!r}update(e){let n=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||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+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 n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),s=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(r,s)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Ze{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 n;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||eoe(e.parent)||document,this.viewState=new QE(e.state||wn.create(e)),e.scrollTo&&e.scrollTo.is(n1)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Nh).map(s=>new z4(s));for(let s of this.plugins)s.update(this);this.observer=new xle(this),this.inputState=new Foe(this),this.inputState.ensureHandlers(this.plugins),this.docView=new jE(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let n=e.length==1&&e[0]instanceof ns?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,s,i=this.state;for(let g of e){if(g.startState!=i)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");i=g.state}if(this.destroyed){this.viewState.state=i;return}let a=this.hasFocus,l=0,c=null;e.some(g=>g.annotation(pq))?(this.inputState.notifiedFocused=a,l=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,c=gq(i,a),c||(l=1));let d=this.observer.delayedAndroidKey,h=null;if(d?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(h=null)):this.observer.clear(),i.facet(wn.phrases)!=this.state.facet(wn.phrases))return this.setState(i);s=Uv.create(this,i,e),s.flags|=l;let m=this.viewState.scrollTarget;try{this.updateState=2;for(let g of e){if(m&&(m=m.map(g.changes)),g.scrollIntoView){let{main:x}=g.state.selection;m=new zh(x.empty?x:Me.cursor(x.head,x.head>x.anchor?-1:1))}for(let x of g.effects)x.is(n1)&&(m=x.value.clip(this.state))}this.viewState.update(s,m),this.bidiCache=Gv.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),n=this.docView.update(s),this.state.facet(o0)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(g=>g.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(l1)!=s.state.facet(l1)&&(this.viewState.mustMeasureContent=!0),(n||r||m||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!s.empty)for(let g of this.state.facet(Qk))try{g(s)}catch(x){vi(this.state,x,"update listener")}(c||h)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),h&&!lq(this,h)&&d.force&&Ph(this.contentDOM,d.key,d.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 n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new QE(e),this.plugins=e.facet(Nh).map(r=>new z4(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new jE(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(Nh),r=e.state.facet(Nh);if(n!=r){let s=[];for(let i of r){let a=n.indexOf(i);if(a<0)s.push(new z4(i));else{let l=this.plugins[a];l.mustUpdate=e,s.push(l)}}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-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.scrollDOM,s=r.scrollTop*this.scaleY,{scrollAnchorPos:i,scrollAnchorHeight:a}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(a<0)if(EF(r))i=-1,a=this.viewState.heightMap.height;else{let x=this.viewState.scrollAnchorAt(s);i=x.from,a=x.top}this.updateState=1;let c=this.viewState.measure(this);if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let d=[];c&4||([this.measureRequests,d]=[d,this.measureRequests]);let h=d.map(x=>{try{return x.read(this)}catch(y){return vi(this.state,y),GE}}),m=Uv.create(this,this.state,[]),g=!1;m.flags|=c,n?n.flags|=c:n=m,this.updateState=2,m.empty||(this.updatePlugins(m),this.inputState.update(m),this.updateAttrs(),g=this.docView.update(m),g&&this.docViewUpdate());for(let x=0;x1||y<-1){s=s+y,r.scrollTop=s/this.scaleY,a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(Qk))l(n)}get themeClasses(){return Xk+" "+(this.state.facet(Gk)?bq:yq)+" "+this.state.facet(l1)}updateAttrs(){let e=XE(this,eq,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(El)?"true":"false",class:"cm-content",style:`${et.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),XE(this,a6,n);let r=this.observer.ignore(()=>{let s=Bk(this.contentDOM,this.contentAttrs,n),i=Bk(this.dom,this.editorAttrs,e);return s||i});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let s of r.effects)if(s.is(Ze.announce)){n&&(this.announceDOM.textContent=""),n=!1;let i=this.announceDOM.appendChild(document.createElement("div"));i.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(o0);let e=this.state.facet(Ze.cspNonce);Wc.mount(this.root,this.styleModules.concat(ple).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 n=0;nr.plugin==e)||null),n&&n.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,n,r){return L4(this,e,_E(this,e,n,r))}moveByGroup(e,n){return L4(this,e,_E(this,e,n,r=>Aoe(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),s=this.textDirectionAt(e.from),i=r[n?r.length-1:0];return Me.cursor(i.side(n,s)+e.from,i.forward(!n,s)?1:-1)}moveToLineBoundary(e,n,r=!0){return _oe(this,e,n,r)}moveVertically(e,n,r){return L4(this,e,Moe(this,e,n,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){return this.readMeasured(),iq(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let s=this.state.doc.lineAt(e),i=this.bidiSpans(s),a=i[Fc.find(i,e-s.from,-1,n)];return qp(r,a.dir==gr.LTR==n>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(YF)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>ble)return $F(e.length);let n=this.textDirectionAt(e.from),r;for(let i of this.bidiCache)if(i.from==e.from&&i.dir==n&&(i.fresh||qF(i.isolates,r=OE(this,e))))return i.order;r||(r=OE(this,e));let s=moe(e.text,n,r);return this.bidiCache.push(new Gv(e.from,e.to,n,r,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||et.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{CF(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,n={}){return n1.of(new zh(typeof e=="number"?Me.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return n1.of(new zh(Me.cursor(r.from),"start","start",r.top-e,n,!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 Vr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Vr.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=Wc.newName(),s=[l1.of(r),o0.of(Yk(`.${r}`,e))];return n&&n.dark&&s.push(Gk.of(!0)),s}static baseTheme(e){return ou.lowest(o0.of(Yk("."+Xk,e,wq)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),s=r&&er.get(r)||er.get(e);return((n=s?.rootView)===null||n===void 0?void 0:n.view)||null}}Ze.styleModule=o0;Ze.inputHandler=GF;Ze.clipboardInputFilter=s6;Ze.clipboardOutputFilter=i6;Ze.scrollHandler=ZF;Ze.focusChangeEffect=XF;Ze.perLineTextDirection=YF;Ze.exceptionSink=WF;Ze.updateListener=Qk;Ze.editable=El;Ze.mouseSelectionStyle=UF;Ze.dragMovesSelection=VF;Ze.clickAddsSelectionRange=QF;Ze.decorations=H0;Ze.outerDecorations=tq;Ze.atomicRanges=Qp;Ze.bidiIsolatedRanges=nq;Ze.scrollMargins=rq;Ze.darkTheme=Gk;Ze.cspNonce=at.define({combine:t=>t.length?t[0]:""});Ze.contentAttributes=a6;Ze.editorAttributes=eq;Ze.lineWrapping=Ze.contentAttributes.of({class:"cm-lineWrapping"});Ze.announce=Ft.define();const ble=4096,GE={};class Gv{constructor(e,n,r,s,i,a){this.from=e,this.to=n,this.dir=r,this.isolates=s,this.fresh=i,this.order=a}static update(e,n){if(n.empty&&!e.some(i=>i.fresh))return e;let r=[],s=e.length?e[e.length-1].dir:gr.LTR;for(let i=Math.max(0,e.length-10);i=0;s--){let i=r[s],a=typeof i=="function"?i(t):i;a&&Lk(a,n)}return n}const wle=et.mac?"mac":et.windows?"win":et.linux?"linux":"key";function Sle(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let s,i,a,l;for(let c=0;cr.concat(s),[]))),n}function Ole(t,e,n){return kq(Sq(t.state),e,t,n)}let zc=null;const jle=4e3;function Nle(t,e=wle){let n=Object.create(null),r=Object.create(null),s=(a,l)=>{let c=r[a];if(c==null)r[a]=l;else if(c!=l)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},i=(a,l,c,d,h)=>{var m,g;let x=n[a]||(n[a]=Object.create(null)),y=l.split(/ (?!$)/).map(k=>Sle(k,e));for(let k=1;k{let T=zc={view:N,prefix:j,scope:a};return setTimeout(()=>{zc==T&&(zc=null)},jle),!0}]})}let w=y.join(" ");s(w,!1);let S=x[w]||(x[w]={preventDefault:!1,stopPropagation:!1,run:((g=(m=x._any)===null||m===void 0?void 0:m.run)===null||g===void 0?void 0:g.slice())||[]});c&&S.run.push(c),d&&(S.preventDefault=!0),h&&(S.stopPropagation=!0)};for(let a of t){let l=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let d of l){let h=n[d]||(n[d]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:m}=a;for(let g in h)h[g].run.push(x=>m(x,Kk))}let c=a[e]||a.key;if(c)for(let d of l)i(d,c,a.run,a.preventDefault,a.stopPropagation),a.shift&&i(d,"Shift-"+c,a.shift,a.preventDefault,a.stopPropagation)}return n}let Kk=null;function kq(t,e,n,r){Kk=e;let s=Gae(e),i=gi(s,0),a=wo(i)==s.length&&s!=" ",l="",c=!1,d=!1,h=!1;zc&&zc.view==n&&zc.scope==r&&(l=zc.prefix+" ",dq.indexOf(e.keyCode)<0&&(d=!0,zc=null));let m=new Set,g=S=>{if(S){for(let k of S.run)if(!m.has(k)&&(m.add(k),k(n)))return S.stopPropagation&&(h=!0),!0;S.preventDefault&&(S.stopPropagation&&(h=!0),d=!0)}return!1},x=t[r],y,w;return x&&(g(x[l+c1(s,e,!a)])?c=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(et.windows&&e.ctrlKey&&e.altKey)&&!(et.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(y=Gc[e.keyCode])&&y!=s?(g(x[l+c1(y,e,!0)])||e.shiftKey&&(w=q0[e.keyCode])!=s&&w!=y&&g(x[l+c1(w,e,!1)]))&&(c=!0):a&&e.shiftKey&&g(x[l+c1(s,e,!0)])&&(c=!0),!c&&g(x._any)&&(c=!0)),d&&(c=!0),c&&h&&e.stopPropagation(),Kk=null,c}class Up{constructor(e,n,r,s,i){this.className=e,this.left=n,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,n){return n.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,n,r){if(r.empty){let s=e.coordsAtPos(r.head,r.assoc||1);if(!s)return[];let i=Oq(e);return[new Up(n,s.left-i.left,s.top-i.top,null,s.bottom-s.top)]}else return Cle(e,n,r)}}function Oq(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==gr.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function KE(t,e,n,r){let s=t.coordsAtPos(e,n*2);if(!s)return r;let i=t.dom.getBoundingClientRect(),a=(s.top+s.bottom)/2,l=t.posAtCoords({x:i.left+1,y:a}),c=t.posAtCoords({x:i.right-1,y:a});return l==null||c==null?r:{from:Math.max(r.from,Math.min(l,c)),to:Math.min(r.to,Math.max(l,c))}}function Cle(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),s=Math.min(n.to,t.viewport.to),i=t.textDirection==gr.LTR,a=t.contentDOM,l=a.getBoundingClientRect(),c=Oq(t),d=a.querySelector(".cm-line"),h=d&&window.getComputedStyle(d),m=l.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),g=l.right-(h?parseInt(h.paddingRight):0),x=Uk(t,r,1),y=Uk(t,s,-1),w=x.type==ni.Text?x:null,S=y.type==ni.Text?y:null;if(w&&(t.lineWrapping||x.widgetLineBreaks)&&(w=KE(t,r,1,w)),S&&(t.lineWrapping||y.widgetLineBreaks)&&(S=KE(t,s,-1,S)),w&&S&&w.from==S.from&&w.to==S.to)return j(N(n.from,n.to,w));{let E=w?N(n.from,null,w):T(x,!1),_=S?N(null,n.to,S):T(y,!0),A=[];return(w||x).to<(S||y).from-(w&&S?1:0)||x.widgetLineBreaks>1&&E.bottom+t.defaultLineHeight/2<_.top?A.push(k(m,E.bottom,g,_.top)):E.bottom<_.top&&t.elementAtHeight((E.bottom+_.top)/2).type==ni.Text&&(E.bottom=_.top=(E.bottom+_.top)/2),j(E).concat(A).concat(j(_))}function k(E,_,A,L){return new Up(e,E-c.left,_-c.top,A-E,L-_)}function j({top:E,bottom:_,horizontal:A}){let L=[];for(let P=0;PU&&z.from=F)break;R>Q&&$(Math.max(X,Q),E==null&&X<=U,Math.min(R,F),_==null&&R>=te,J.dir)}if(Q=Y.to+1,Q>=F)break}return B.length==0&&$(U,E==null,te,_==null,t.textDirection),{top:L,bottom:P,horizontal:B}}function T(E,_){let A=l.top+(_?E.top:E.bottom);return{top:A,bottom:A,horizontal:[]}}}function Tle(t,e){return t.constructor==e.constructor&&t.eq(e)}class Ele{constructor(e,n){this.view=e,this.layer=n,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"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(dv)!=e.state.facet(dv)&&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 n=0,r=e.facet(dv);for(;n!Tle(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let s of e)s.update&&n&&s.constructor&&this.drawn[r].constructor&&s.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(s.draw(),n);for(;n;){let s=n.nextSibling;n.remove(),n=s}this.drawn=e,et.safari&&et.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 dv=at.define();function jq(t){return[Vr.define(e=>new Ele(e,t)),dv.of(t)]}const Q0=at.define({combine(t){return $o(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function _le(t={}){return[Q0.of(t),Ale,Mle,Rle,KF.of(!0)]}function Nq(t){return t.startState.facet(Q0)!=t.state.facet(Q0)}const Ale=jq({above:!0,markers(t){let{state:e}=t,n=e.facet(Q0),r=[];for(let s of e.selection.ranges){let i=s==e.selection.main;if(s.empty||n.drawRangeCursor){let a=i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:Me.cursor(s.head,s.head>s.anchor?-1:1);for(let c of Up.forRange(t,a,l))r.push(c)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=Nq(t);return n&&ZE(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){ZE(e.state,t)},class:"cm-cursorLayer"});function ZE(t,e){e.style.animationDuration=t.facet(Q0).cursorBlinkRate+"ms"}const Mle=jq({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:Up.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||Nq(t)},class:"cm-selectionLayer"}),Rle=ou.highest(Ze.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"}}}})),Cq=Ft.define({map(t,e){return t==null?null:e.mapPos(t)}}),u0=Os.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(Cq)?r.value:n,t)}}),Dle=Vr.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let n=t.state.field(u0);n==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"),(t.startState.field(u0)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(u0),n=e!=null&&t.coordsAtPos(e);if(!n)return null;let r=t.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-r.top+t.scrollDOM.scrollTop*t.scaleY,height:n.bottom-n.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:n}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/n+"px",this.cursor.style.height=t.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(u0)!=t&&this.view.dispatch({effects:Cq.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Ple(){return[u0,Dle]}function JE(t,e,n,r,s){e.lastIndex=0;for(let i=t.iterRange(n,r),a=n,l;!i.next().done;a+=i.value.length)if(!i.lineBreak)for(;l=e.exec(i.value);)s(a+l.index,l)}function zle(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:s,to:i}of n)s=Math.max(t.state.doc.lineAt(s).from,s-e),i=Math.min(t.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 Ile{constructor(e){const{regexp:n,decoration:r,decorate:s,boundary:i,maxLength:a=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,s)this.addMatch=(l,c,d,h)=>s(h,d,d+l[0].length,l,c);else if(typeof r=="function")this.addMatch=(l,c,d,h)=>{let m=r(l,c,d);m&&h(d,d+l[0].length,m)};else if(r)this.addMatch=(l,c,d,h)=>h(d,d+l[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=i,this.maxLength=a}createDeco(e){let n=new ql,r=n.add.bind(n);for(let{from:s,to:i}of zle(e,this.maxLength))JE(e.state.doc,this.regexp,s,i,(a,l)=>this.addMatch(l,e,a,r));return n.finish()}updateDeco(e,n){let r=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((i,a,l,c)=>{c>=e.view.viewport.from&&l<=e.view.viewport.to&&(r=Math.min(l,r),s=Math.max(c,s))}),e.viewportMoved||s-r>1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,n.map(e.changes),r,s):n}updateRange(e,n,r,s){for(let i of e.visibleRanges){let a=Math.max(i.from,r),l=Math.min(i.to,s);if(l>=a){let c=e.state.doc.lineAt(a),d=c.toc.from;a--)if(this.boundary.test(c.text[a-1-c.from])){h=a;break}for(;lg.push(k.range(w,S));if(c==d)for(this.regexp.lastIndex=h-c.from;(x=this.regexp.exec(c.text))&&x.indexthis.addMatch(S,e,w,y));n=n.update({filterFrom:h,filterTo:m,filter:(w,S)=>wm,add:g})}}return n}}const Zk=/x/.unicode!=null?"gu":"g",Lle=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Zk),Ble={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 q4=null;function Fle(){var t;if(q4==null&&typeof document<"u"&&document.body){let e=document.body.style;q4=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return q4||!1}const hv=at.define({combine(t){let e=$o(t,{render:null,specialChars:Lle,addSpecialChars:null});return(e.replaceTabs=!Fle())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Zk)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Zk)),e}});function qle(t={}){return[hv.of(t),$le()]}let e_=null;function $le(){return e_||(e_=Vr.fromClass(class{constructor(t){this.view=t,this.decorations=kt.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(hv)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Ile({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:s}=n.state,i=gi(e[0],0);if(i==9){let a=s.lineAt(r),l=n.state.tabSize,c=Nf(a.text,l,r-a.from);return kt.replace({widget:new Ule((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[i]||(this.decorationCache[i]=kt.replace({widget:new Vle(t,i)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(hv);t.startState.facet(hv)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const Hle="•";function Qle(t){return t>=32?Hle:t==10?"␤":String.fromCharCode(9216+t)}class Vle extends Ho{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=Qle(this.code),r=e.state.phrase("Control character")+" "+(Ble[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,r,n);if(s)return s;let i=document.createElement("span");return i.textContent=n,i.title=r,i.setAttribute("aria-label",r),i.className="cm-specialChar",i}ignoreEvent(){return!1}}class Ule extends Ho{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 Wle(){return Xle}const Gle=kt.line({class:"cm-activeLine"}),Xle=Vr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let s=t.lineBlockAt(r.head);s.from>e&&(n.push(Gle.range(s.from)),e=s.from)}return kt.set(n)}},{decorations:t=>t.decorations});class Yle extends Ho{constructor(e){super(),this.content=e}toDOM(e){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?Jh(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),s=qp(n[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 Kle(t){let e=Vr.fromClass(class{constructor(n){this.view=n,this.placeholder=t?kt.set([kt.widget({widget:new Yle(t),side:1}).range(0)]):kt.none}get decorations(){return this.view.state.doc.length?kt.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,Ze.contentAttributes.of({"aria-placeholder":t})]:e}const Jk=2e3;function Zle(t,e,n){let r=Math.min(e.line,n.line),s=Math.max(e.line,n.line),i=[];if(e.off>Jk||n.off>Jk||e.col<0||n.col<0){let a=Math.min(e.off,n.off),l=Math.max(e.off,n.off);for(let c=r;c<=s;c++){let d=t.doc.line(c);d.length<=l&&i.push(Me.range(d.from+a,d.to+l))}}else{let a=Math.min(e.col,n.col),l=Math.max(e.col,n.col);for(let c=r;c<=s;c++){let d=t.doc.line(c),h=_k(d.text,a,t.tabSize,!0);if(h<0)i.push(Me.cursor(d.to));else{let m=_k(d.text,l,t.tabSize);i.push(Me.range(d.from+h,d.from+m))}}}return i}function Jle(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function t_(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),s=n-r.from,i=s>Jk?-1:s==r.length?Jle(t,e.clientX):Nf(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:i,off:s}}function ece(t,e){let n=t_(t,e),r=t.state.selection;return n?{update(s){if(s.docChanged){let i=s.changes.mapPos(s.startState.doc.line(n.line).from),a=s.state.doc.lineAt(i);n={line:a.number,col:n.col,off:Math.min(n.off,a.length)},r=r.map(s.changes)}},get(s,i,a){let l=t_(t,s);if(!l)return r;let c=Zle(t.state,n,l);return c.length?a?Me.create(c.concat(r.ranges)):Me.create(c):r}}:null}function tce(t){let e=(n=>n.altKey&&n.button==0);return Ze.mouseSelectionStyle.of((n,r)=>e(r)?ece(n,r):null)}const nce={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},rce={style:"cursor: crosshair"};function sce(t={}){let[e,n]=nce[t.key||"Alt"],r=Vr.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||n(s))},keyup(s){(s.keyCode==e||!n(s))&&this.set(!1)},mousemove(s){this.set(n(s))}}});return[r,Ze.contentAttributes.of(s=>{var i;return!((i=s.plugin(r))===null||i===void 0)&&i.isDown?rce:null})]}const u1="-10000px";class Tq{constructor(e,n,r,s){this.facet=n,this.createTooltipView=r,this.removeTooltipView=s,this.input=e.state.facet(n),this.tooltips=this.input.filter(a=>a);let i=null;this.tooltipViews=this.tooltips.map(a=>i=r(a,i))}update(e,n){var r;let s=e.state.facet(this.facet),i=s.filter(c=>c);if(s===this.input){for(let c of this.tooltipViews)c.update&&c.update(e);return!1}let a=[],l=n?[]:null;for(let c=0;cn[d]=c),n.length=l.length),this.input=s,this.tooltips=i,this.tooltipViews=a,!0}}function ice(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const $4=at.define({combine:t=>{var e,n,r;return{position:et.ios?"absolute":((e=t.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(s=>s.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(s=>s.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||ice}}}),n_=new WeakMap,d6=Vr.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet($4);this.position=e.position,this.parent=e.parent,this.classes=t.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 Tq(t,h6,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.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 t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet($4);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;n=!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);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let s=document.createElement("div");s.className="cm-tooltip-arrow",n.dom.appendChild(s)}return n.dom.style.position=this.position,n.dom.style.top=u1,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(et.safari){let a=i.getBoundingClientRect();n=Math.abs(a.top+1e4)>1||Math.abs(a.left)>1}else n=!!i.offsetParent&&i.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(t=i.width/this.parent.offsetWidth,e=i.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),s=o6(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,a)=>{let l=this.manager.tooltipViews[a];return l.getCoords?l.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet($4).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:n,space:r,scaleX:s,scaleY:i}=t,a=[];for(let l=0;l=Math.min(n.bottom,r.bottom)||m.rightMath.min(n.right,r.right)+.1)){h.style.top=u1;continue}let x=c.arrow?d.dom.querySelector(".cm-tooltip-arrow"):null,y=x?7:0,w=g.right-g.left,S=(e=n_.get(d))!==null&&e!==void 0?e:g.bottom-g.top,k=d.offset||oce,j=this.view.textDirection==gr.LTR,N=g.width>r.right-r.left?j?r.left:r.right-g.width:j?Math.max(r.left,Math.min(m.left-(x?14:0)+k.x,r.right-w)):Math.min(Math.max(r.left,m.left-w+(x?14:0)-k.x),r.right-w),T=this.above[l];!c.strictSide&&(T?m.top-S-y-k.yr.bottom)&&T==r.bottom-m.bottom>m.top-r.top&&(T=this.above[l]=!T);let E=(T?m.top-r.top:r.bottom-m.bottom)-y;if(EN&&L.top<_+S&&L.bottom>_&&(_=T?L.top-S-2-y:L.bottom+y+2);if(this.position=="absolute"?(h.style.top=(_-t.parent.top)/i+"px",r_(h,(N-t.parent.left)/s)):(h.style.top=_/i+"px",r_(h,N/s)),x){let L=m.left+(j?k.x:-k.x)-(N+14-7);x.style.left=L/s+"px"}d.overlap!==!0&&a.push({left:N,top:_,right:A,bottom:_+S}),h.classList.toggle("cm-tooltip-above",T),h.classList.toggle("cm-tooltip-below",!T),d.positioned&&d.positioned(t.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 t of this.manager.tooltipViews)t.dom.style.top=u1}},{eventObservers:{scroll(){this.maybeMeasure()}}});function r_(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}const ace=Ze.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"}}}),oce={x:0,y:0},h6=at.define({enables:[d6,ace]}),Xv=at.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class db{static create(e){return new db(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Tq(e,Xv,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(e,n){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let r of this.manager.tooltipViews){let s=r[e];if(s!==void 0){if(n===void 0)n=s;else if(n!==s)return}}return n}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 lce=h6.compute([Xv],t=>{let e=t.facet(Xv);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:db.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class cce{constructor(e,n,r,s,i){this.view=e,this.source=n,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;el.bottom||n.xl.right+e.defaultCharacterWidth)return;let c=e.bidiSpans(e.state.doc.lineAt(s)).find(h=>h.from<=s&&h.to>=s),d=c&&c.dir==gr.RTL?-1:1;i=n.x{this.pending==l&&(this.pending=null,c&&!(Array.isArray(c)&&!c.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(c)?c:[c])}))},c=>vi(e.state,c,"hover tooltip"))}else a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])})}get tooltip(){let e=this.view.plugin(d6),n=e?e.manager.tooltips.findIndex(r=>r.create==db.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,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&&!uce(i.dom,e)||this.pending){let{pos:a}=s[0]||this.pending,l=(r=(n=s[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:a;(a==l?this.view.posAtCoords(this.lastMove)!=a:!dce(this.view,a,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.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 n=r=>{e.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const d1=4;function uce(t,e){let{left:n,right:r,top:s,bottom:i}=t.getBoundingClientRect(),a;if(a=t.querySelector(".cm-tooltip-arrow")){let l=a.getBoundingClientRect();s=Math.min(l.top,s),i=Math.max(l.bottom,i)}return e.clientX>=n-d1&&e.clientX<=r+d1&&e.clientY>=s-d1&&e.clientY<=i+d1}function dce(t,e,n,r,s,i){let a=t.scrollDOM.getBoundingClientRect(),l=t.documentTop+t.documentPadding.top+t.contentHeight;if(a.left>r||a.rights||Math.min(a.bottom,l)=e&&c<=n}function hce(t,e={}){let n=Ft.define(),r=Os.define({create(){return[]},update(s,i){if(s.length&&(e.hideOnChange&&(i.docChanged||i.selection)?s=[]:e.hideOn&&(s=s.filter(a=>!e.hideOn(i,a))),i.docChanged)){let a=[];for(let l of s){let c=i.changes.mapPos(l.pos,-1,Ds.TrackDel);if(c!=null){let d=Object.assign(Object.create(null),l);d.pos=c,d.end!=null&&(d.end=i.changes.mapPos(d.end)),a.push(d)}}s=a}for(let a of i.effects)a.is(n)&&(s=a.value),a.is(fce)&&(s=[]);return s},provide:s=>Xv.from(s)});return{active:r,extension:[r,Vr.define(s=>new cce(s,t,r,n,e.hoverTime||300)),lce]}}function Eq(t,e){let n=t.plugin(d6);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const fce=Ft.define(),s_=at.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function V0(t,e){let n=t.plugin(_q),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const _q=Vr.fromClass(class{constructor(t){this.input=t.state.facet(U0),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(s_);this.top=new h1(t,!0,e.topContainer),this.bottom=new h1(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(s_);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new h1(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new h1(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(U0);if(n!=this.input){let r=n.filter(c=>c),s=[],i=[],a=[],l=[];for(let c of r){let d=this.specs.indexOf(c),h;d<0?(h=c(t.view),l.push(h)):(h=this.panels[d],h.update&&h.update(t)),s.push(h),(h.top?i:a).push(h)}this.specs=r,this.panels=s,this.top.sync(i),this.bottom.sync(a);for(let c of l)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>Ze.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class h1{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.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 n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=i_(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=i_(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 i_(t){let e=t.nextSibling;return t.remove(),e}const U0=at.define({enables:_q});class Hl extends sd{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Hl.prototype.elementClass="";Hl.prototype.toDOM=void 0;Hl.prototype.mapMode=Ds.TrackBefore;Hl.prototype.startSide=Hl.prototype.endSide=-1;Hl.prototype.point=!0;const fv=at.define(),mce=at.define(),pce={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Rn.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},j0=at.define();function gce(t){return[Aq(),j0.of({...pce,...t})]}const a_=at.define({combine:t=>t.some(e=>e)});function Aq(t){return[xce]}const xce=Vr.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.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=t.state.facet(j0).map(e=>new l_(t,e)),this.fixed=!t.state.facet(a_);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),t.scrollDOM.insertBefore(this.dom,t.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(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.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(a_)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Rn.iter(this.view.state.facet(fv),this.view.viewport.from),r=[],s=this.gutters.map(i=>new vce(i,this.view.viewport,-this.view.documentPadding.top));for(let i of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(i.type)){let a=!0;for(let l of i.type)if(l.type==ni.Text&&a){eO(n,r,l.from);for(let c of s)c.line(this.view,l,r);a=!1}else if(l.widget)for(let c of s)c.widget(this.view,l)}else if(i.type==ni.Text){eO(n,r,i.from);for(let a of s)a.line(this.view,i,r)}else if(i.widget)for(let a of s)a.widget(this.view,i);for(let i of s)i.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(j0),n=t.state.facet(j0),r=t.docChanged||t.heightChanged||t.viewportChanged||!Rn.eq(t.startState.facet(fv),t.state.facet(fv),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let s of this.gutters)s.update(t)&&(r=!0);else{r=!0;let s=[];for(let i of n){let a=e.indexOf(i);a<0?s.push(new l_(this.view,i)):(this.gutters[a].update(t),s.push(this.gutters[a]))}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 t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>Ze.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,s=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==gr.LTR?{left:r,right:s}:{right:r,left:s}})});function o_(t){return Array.isArray(t)?t:[t]}function eO(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class vce{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Rn.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:s}=this,i=(n.top-this.height)/e.scaleY,a=n.height/e.scaleY;if(this.i==s.elements.length){let l=new Mq(e,a,i,r);s.elements.push(l),s.dom.appendChild(l.dom)}else s.elements[this.i].update(e,a,i,r);this.height=n.bottom,this.i++}line(e,n,r){let s=[];eO(this.cursor,s,n.from),r.length&&(s=s.concat(r));let i=this.gutter.config.lineMarker(e,n,s);i&&s.unshift(i);let a=this.gutter;s.length==0&&!a.config.renderEmptyElements||this.addElement(e,n,s)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),s=r?[r]:null;for(let i of e.state.facet(mce)){let a=i(e,n.widget,n);a&&(s||(s=[])).push(a)}s&&this.addElement(e,n,s)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class l_{constructor(e,n){this.view=e,this.config=n,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 n.domEventHandlers)this.dom.addEventListener(r,s=>{let i=s.target,a;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let c=i.getBoundingClientRect();a=(c.top+c.bottom)/2}else a=s.clientY;let l=e.lineBlockAtHeight(a-e.documentTop);n.domEventHandlers[r](e,l,s)&&s.preventDefault()});this.markers=o_(n.markers(e)),n.initialSpacer&&(this.spacer=new Mq(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=o_(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!Rn.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class Mq{constructor(e,n,r,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,s)}update(e,n,r,s){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),yce(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,n){let r="cm-gutterElement",s=this.dom.firstChild;for(let i=0,a=0;;){let l=a,c=ii(l,c,d)||a(l,c,d):a}return r}})}});class H4 extends Hl{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Q4(t,e){return t.state.facet(Ch).formatNumber(e,t.state)}const Sce=j0.compute([Ch],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(bce)},lineMarker(e,n,r){return r.some(s=>s.toDOM)?null:new H4(Q4(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let s of e.state.facet(wce)){let i=s(e,n,r);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(Ch)!=e.state.facet(Ch),initialSpacer(e){return new H4(Q4(e,c_(e.state.doc.lines)))},updateSpacer(e,n){let r=Q4(n.view,c_(n.view.state.doc.lines));return r==e.number?e:new H4(r)},domEventHandlers:t.facet(Ch).domEventHandlers,side:"before"}));function kce(t={}){return[Ch.of(t),Aq(),Sce]}function c_(t){let e=9;for(;e{let e=[],n=-1;for(let r of t.selection.ranges){let s=t.doc.lineAt(r.head).from;s>n&&(n=s,e.push(Oce.range(s)))}return Rn.of(e)});function Nce(){return jce}const Rq=1024;let Cce=0;class V4{constructor(e,n){this.from=e,this.to=n}}class sn{constructor(e={}){this.id=Cce++,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=si.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}sn.closedBy=new sn({deserialize:t=>t.split(" ")});sn.openedBy=new sn({deserialize:t=>t.split(" ")});sn.group=new sn({deserialize:t=>t.split(" ")});sn.isolate=new sn({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});sn.contextHash=new sn({perNode:!0});sn.lookAhead=new sn({perNode:!0});sn.mounted=new sn({perNode:!0});class Yv{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[sn.mounted.id]}}const Tce=Object.create(null);class si{constructor(e,n,r,s=0){this.name=e,this.props=n,this.id=r,this.flags=s}static define(e){let n=e.props&&e.props.length?Object.create(null):Tce,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new si(e.name||"",n,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");n[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 n=this.prop(sn.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let s of r.split(" "))n[s]=e[r];return r=>{for(let s=r.prop(sn.group),i=-1;i<(s?s.length:0);i++){let a=n[i<0?r.name:s[i]];if(a)return a}}}}si.none=new si("",Object.create(null),0,8);class hb{constructor(e){this.types=e;for(let n=0;n0;for(let c=this.cursor(a|hs.IncludeAnonymous);;){let d=!1;if(c.from<=i&&c.to>=s&&(!l&&c.type.isAnonymous||n(c)!==!1)){if(c.firstChild())continue;d=!0}for(;d&&r&&(l||!c.type.isAnonymous)&&r(c),!c.nextSibling();){if(!c.parent())return;d=!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 n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:p6(si.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,s)=>new ar(this.type,n,r,s,this.propValues),e.makeTree||((n,r,s)=>new ar(si.none,n,r,s)))}static build(e){return Mce(e)}}ar.empty=new ar(si.none,[],[],0);class f6{constructor(e,n){this.buffer=e,this.index=n}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 f6(this.buffer,this.index)}}class Yc{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return si.none}toString(){let e=[];for(let n=0;n0));c=a[c+3]);return l}slice(e,n,r){let s=this.buffer,i=new Uint16Array(n-e),a=0;for(let l=e,c=0;l=e&&ne;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function W0(t,e,n,r){for(var s;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to0?l.length:-1;e!=d;e+=n){let h=l[e],m=c[e]+a.from;if(Dq(s,r,m,m+h.length)){if(h instanceof Yc){if(i&hs.ExcludeBuffers)continue;let g=h.findChild(0,h.buffer.length,n,r-m,s);if(g>-1)return new jo(new Ece(a,h,e,m),null,g)}else if(i&hs.IncludeAnonymous||!h.type.isAnonymous||m6(h)){let g;if(!(i&hs.IgnoreMounts)&&(g=Yv.get(h))&&!g.overlay)return new ki(g.tree,m,e,a);let x=new ki(h,m,e,a);return i&hs.IncludeAnonymous||!x.type.isAnonymous?x:x.nextChild(n<0?h.children.length-1:0,n,r,s)}}}if(i&hs.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+n:e=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))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,n,r=0){let s;if(!(r&hs.IgnoreOverlays)&&(s=Yv.get(this._tree))&&s.overlay){let i=e-this.from;for(let{from:a,to:l}of s.overlay)if((n>0?a<=i:a=i:l>i))return new ki(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,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 d_(t,e,n,r){let s=t.cursor(),i=[];if(!s.firstChild())return i;if(n!=null){for(let a=!1;!a;)if(a=s.type.is(n),!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 tO(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class Ece{constructor(e,n,r,s){this.parent=e,this.buffer=n,this.index=r,this.start=s}}class jo extends Pq{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,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:s}=this.context,i=s.findChild(this.index+4,s.buffer[this.index+3],e,n-this.context.start,r);return i<0?null:new jo(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,n,r=0){if(r&hs.ExcludeBuffers)return null;let{buffer:s}=this.context,i=s.findChild(this.index+4,s.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return i<0?null:new jo(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,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new jo(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new jo(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,s=this.index+4,i=r.buffer[this.index+3];if(i>s){let a=r.buffer[this.index+1];e.push(r.slice(s,i,a)),n.push(0)}return new ar(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function zq(t){if(!t.length)return null;let e=0,n=t[0];for(let i=1;in.from||a.to=e){let l=new ki(a.tree,a.overlay[0].from+i.from,-1,i);(s||(s=[r])).push(W0(l,e,n,!1))}}return s?zq(s):r}class nO{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof ki)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,n){this.index=e;let{start:r,buffer:s}=this.buffer;return this.type=n||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 ki?(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,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:s}=this.buffer,i=s.findChild(this.index+4,s.buffer[this.index+3],e,n-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,n,r=this.mode){return this.buffer?r&hs.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&hs.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&hs.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:n}=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(n.findChild(s,this.index,-1,0,4))}else{let s=n.buffer[this.index+3];if(s<(r<0?n.buffer.length:n.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 n,r,{buffer:s}=this;if(s){if(e>0){if(this.index-1)for(let i=n+e,a=e<0?-1:r._tree.children.length;i!=a;i+=e){let l=r._tree.children[i];if(this.mode&hs.IncludeAnonymous||l instanceof Yc||!l.type.isAnonymous||m6(l))return!1}return!0}move(e,n){if(n&&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,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to=0;){for(let a=e;a;a=a._parent)if(a.index==s){if(s==this.index)return a;n=a,r=i+1;break e}s=this.stack[--i]}for(let s=r;s=0;i--){if(i<0)return tO(this._tree,e,s);let a=r[n.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[s]&&e[s]!=a.name)return!1;s--}}return!0}}function m6(t){return t.children.some(e=>e instanceof Yc||!e.type.isAnonymous||m6(e))}function Mce(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:s=Rq,reused:i=[],minRepeatType:a=r.types.length}=t,l=Array.isArray(n)?new f6(n,n.length):n,c=r.types,d=0,h=0;function m(E,_,A,L,P,B){let{id:$,start:U,end:te,size:z}=l,Q=h,F=d;if(z<0)if(l.next(),z==-1){let ie=i[$];A.push(ie),L.push(U-E);return}else if(z==-3){d=$;return}else if(z==-4){h=$;return}else throw new RangeError(`Unrecognized record size: ${z}`);let Y=c[$],J,X,R=U-E;if(te-U<=s&&(X=S(l.pos-_,P))){let ie=new Uint16Array(X.size-X.skip),G=l.pos-X.size,I=ie.length;for(;l.pos>G;)I=k(X.start,ie,I);J=new Yc(ie,te-X.start,r),R=X.start-E}else{let ie=l.pos-z;l.next();let G=[],I=[],V=$>=a?$:-1,ee=0,ne=te;for(;l.pos>ie;)V>=0&&l.id==V&&l.size>=0?(l.end<=ne-s&&(y(G,I,U,ee,l.end,ne,V,Q,F),ee=G.length,ne=l.end),l.next()):B>2500?g(U,ie,G,I):m(U,ie,G,I,V,B+1);if(V>=0&&ee>0&&ee-1&&ee>0){let W=x(Y,F);J=p6(Y,G,I,0,G.length,0,te-U,W,W)}else J=w(Y,G,I,te-U,Q-te,F)}A.push(J),L.push(R)}function g(E,_,A,L){let P=[],B=0,$=-1;for(;l.pos>_;){let{id:U,start:te,end:z,size:Q}=l;if(Q>4)l.next();else{if($>-1&&te<$)break;$<0&&($=z-s),P.push(U,te,z),B++,l.next()}}if(B){let U=new Uint16Array(B*4),te=P[P.length-2];for(let z=P.length-3,Q=0;z>=0;z-=3)U[Q++]=P[z],U[Q++]=P[z+1]-te,U[Q++]=P[z+2]-te,U[Q++]=Q;A.push(new Yc(U,P[2]-te,r)),L.push(te-E)}}function x(E,_){return(A,L,P)=>{let B=0,$=A.length-1,U,te;if($>=0&&(U=A[$])instanceof ar){if(!$&&U.type==E&&U.length==P)return U;(te=U.prop(sn.lookAhead))&&(B=L[$]+U.length+te)}return w(E,A,L,P,B,_)}}function y(E,_,A,L,P,B,$,U,te){let z=[],Q=[];for(;E.length>L;)z.push(E.pop()),Q.push(_.pop()+A-P);E.push(w(r.types[$],z,Q,B-P,U-B,te)),_.push(P-A)}function w(E,_,A,L,P,B,$){if(B){let U=[sn.contextHash,B];$=$?[U].concat($):[U]}if(P>25){let U=[sn.lookAhead,P];$=$?[U].concat($):[U]}return new ar(E,_,A,L,$)}function S(E,_){let A=l.fork(),L=0,P=0,B=0,$=A.end-s,U={size:0,start:0,skip:0};e:for(let te=A.pos-E;A.pos>te;){let z=A.size;if(A.id==_&&z>=0){U.size=L,U.start=P,U.skip=B,B+=4,L+=4,A.next();continue}let Q=A.pos-z;if(z<0||Q=a?4:0,Y=A.start;for(A.next();A.pos>Q;){if(A.size<0)if(A.size==-3)F+=4;else break e;else A.id>=a&&(F+=4);A.next()}P=Y,L+=z,B+=F}return(_<0||L==E)&&(U.size=L,U.start=P,U.skip=B),U.size>4?U:void 0}function k(E,_,A){let{id:L,start:P,end:B,size:$}=l;if(l.next(),$>=0&&L4){let te=l.pos-($-4);for(;l.pos>te;)A=k(E,_,A)}_[--A]=U,_[--A]=B-E,_[--A]=P-E,_[--A]=L}else $==-3?d=L:$==-4&&(h=L);return A}let j=[],N=[];for(;l.pos>0;)m(t.start||0,t.bufferStart||0,j,N,-1,0);let T=(e=t.length)!==null&&e!==void 0?e:j.length?N[0]+j[0].length:0;return new ar(c[t.topID],j.reverse(),N.reverse(),T)}const h_=new WeakMap;function mv(t,e){if(!t.isAnonymous||e instanceof Yc||e.type!=t)return 1;let n=h_.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof ar)){n=1;break}n+=mv(t,r)}h_.set(e,n)}return n}function p6(t,e,n,r,s,i,a,l,c){let d=0;for(let y=r;y=h)break;_+=A}if(N==T+1){if(_>h){let A=y[T];x(A.children,A.positions,0,A.children.length,w[T]+j);continue}m.push(y[T])}else{let A=w[N-1]+y[N-1].length-E;m.push(p6(t,y,w,T,N,E,A,null,c))}g.push(E+j-i)}}return x(e,n,r,s,0),(l||c)(m,g,a)}class Rce{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof jo?this.setBuffer(e.context.buffer,e.index,n):e instanceof ki&&this.map.set(e.tree,n)}get(e){return e instanceof jo?this.getBuffer(e.context.buffer,e.index):e instanceof ki?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Ju{constructor(e,n,r,s,i=!1,a=!1){this.from=e,this.to=n,this.tree=r,this.offset=s,this.open=(i?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let s=[new Ju(0,e.length,e,0,!1,r)];for(let i of n)i.to>e.length&&s.push(i);return s}static applyChanges(e,n,r=128){if(!n.length)return e;let s=[],i=1,a=e.length?e[0]:null;for(let l=0,c=0,d=0;;l++){let h=l=r)for(;a&&a.from=g.from||m<=g.to||d){let x=Math.max(g.from,c)-d,y=Math.min(g.to,m)-d;g=x>=y?null:new Ju(x,y,g.tree,g.offset+d,l>0,!!h)}if(g&&s.push(g),a.to>m)break;a=inew V4(s.from,s.to)):[new V4(0,0)]:[new V4(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let s=this.startParse(e,n,r);for(;;){let i=s.advance();if(i)return i}}};class Dce{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new sn({perNode:!0});let Pce=0;class ha{constructor(e,n,r,s){this.name=e,this.set=n,this.base=r,this.modified=s,this.id=Pce++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof ha&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let s=new ha(r,[],null,[]);if(s.set.push(s),n)for(let i of n.set)s.set.push(i);return s}static defineModifier(e){let n=new Kv(e);return r=>r.modified.indexOf(n)>-1?r:Kv.get(r.base||r,r.modified.concat(n).sort((s,i)=>s.id-i.id))}}let zce=0;class Kv{constructor(e){this.name=e,this.instances=[],this.id=zce++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(l=>l.base==e&&Ice(n,l.modified));if(r)return r;let s=[],i=new ha(e.name,s,e,n);for(let l of n)l.instances.push(i);let a=Lce(n);for(let l of e.set)if(!l.modified.length)for(let c of a)s.push(Kv.get(l,c));return i}}function Ice(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function Lce(t){let e=[[]];for(let n=0;nr.length-n.length)}function x6(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let s of n.split(" "))if(s){let i=[],a=2,l=s;for(let m=0;;){if(l=="..."&&m>0&&m+3==s.length){a=1;break}let g=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!g)throw new RangeError("Invalid path: "+s);if(i.push(g[0]=="*"?"":g[0][0]=='"'?JSON.parse(g[0]):g[0]),m+=g[0].length,m==s.length)break;let x=s[m++];if(m==s.length&&x=="!"){a=0;break}if(x!="/")throw new RangeError("Invalid path: "+s);l=s.slice(m)}let c=i.length-1,d=i[c];if(!d)throw new RangeError("Invalid path: "+s);let h=new G0(r,a,c>0?i.slice(0,c):null);e[d]=h.sort(e[d])}}return Iq.add(e)}const Iq=new sn({combine(t,e){let n,r,s;for(;t||e;){if(!t||e&&t.depth>=e.depth?(s=e,e=e.next):(s=t,t=t.next),n&&n.mode==s.mode&&!s.context&&!n.context)continue;let i=new G0(s.tags,s.mode,s.context);n?n.next=i:r=i,n=i}return r}});class G0{constructor(e,n,r,s){this.tags=e,this.mode=n,this.context=r,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let a=s;for(let l of i)for(let c of l.set){let d=n[c.id];if(d){a=a?a+" "+d:d;break}}return a},scope:r}}function Bce(t,e){let n=null;for(let r of t){let s=r.style(e);s&&(n=n?n+" "+s:s)}return n}function Fce(t,e,n,r=0,s=t.length){let i=new qce(r,Array.isArray(e)?e:[e],n);i.highlightRange(t.cursor(),r,s,"",i.highlighters),i.flush(s)}class qce{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,s,i){let{type:a,from:l,to:c}=e;if(l>=r||c<=n)return;a.isTop&&(i=this.highlighters.filter(x=>!x.scope||x.scope(a)));let d=s,h=$ce(e)||G0.empty,m=Bce(i,h.tags);if(m&&(d&&(d+=" "),d+=m,h.mode==1&&(s+=(s?" ":"")+m)),this.startSpan(Math.max(n,l),d),h.opaque)return;let g=e.tree&&e.tree.prop(sn.mounted);if(g&&g.overlay){let x=e.node.enter(g.overlay[0].from+l,1),y=this.highlighters.filter(S=>!S.scope||S.scope(g.tree.type)),w=e.firstChild();for(let S=0,k=l;;S++){let j=S=N||!e.nextSibling())););if(!j||N>r)break;k=j.to+l,k>n&&(this.highlightRange(x.cursor(),Math.max(n,j.from+l),Math.min(r,k),"",y),this.startSpan(Math.min(r,k),d))}w&&e.parent()}else if(e.firstChild()){g&&(s="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,s,i),this.startSpan(Math.min(r,e.to),d)}while(e.nextSibling());e.parent()}}}function $ce(t){let e=t.type.prop(Iq);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Ke=ha.define,m1=Ke(),Mc=Ke(),f_=Ke(Mc),m_=Ke(Mc),Rc=Ke(),p1=Ke(Rc),U4=Ke(Rc),po=Ke(),Ru=Ke(po),fo=Ke(),mo=Ke(),rO=Ke(),qm=Ke(rO),g1=Ke(),ve={comment:m1,lineComment:Ke(m1),blockComment:Ke(m1),docComment:Ke(m1),name:Mc,variableName:Ke(Mc),typeName:f_,tagName:Ke(f_),propertyName:m_,attributeName:Ke(m_),className:Ke(Mc),labelName:Ke(Mc),namespace:Ke(Mc),macroName:Ke(Mc),literal:Rc,string:p1,docString:Ke(p1),character:Ke(p1),attributeValue:Ke(p1),number:U4,integer:Ke(U4),float:Ke(U4),bool:Ke(Rc),regexp:Ke(Rc),escape:Ke(Rc),color:Ke(Rc),url:Ke(Rc),keyword:fo,self:Ke(fo),null:Ke(fo),atom:Ke(fo),unit:Ke(fo),modifier:Ke(fo),operatorKeyword:Ke(fo),controlKeyword:Ke(fo),definitionKeyword:Ke(fo),moduleKeyword:Ke(fo),operator:mo,derefOperator:Ke(mo),arithmeticOperator:Ke(mo),logicOperator:Ke(mo),bitwiseOperator:Ke(mo),compareOperator:Ke(mo),updateOperator:Ke(mo),definitionOperator:Ke(mo),typeOperator:Ke(mo),controlOperator:Ke(mo),punctuation:rO,separator:Ke(rO),bracket:qm,angleBracket:Ke(qm),squareBracket:Ke(qm),paren:Ke(qm),brace:Ke(qm),content:po,heading:Ru,heading1:Ke(Ru),heading2:Ke(Ru),heading3:Ke(Ru),heading4:Ke(Ru),heading5:Ke(Ru),heading6:Ke(Ru),contentSeparator:Ke(po),list:Ke(po),quote:Ke(po),emphasis:Ke(po),strong:Ke(po),link:Ke(po),monospace:Ke(po),strikethrough:Ke(po),inserted:Ke(),deleted:Ke(),changed:Ke(),invalid:Ke(),meta:g1,documentMeta:Ke(g1),annotation:Ke(g1),processingInstruction:Ke(g1),definition:ha.defineModifier("definition"),constant:ha.defineModifier("constant"),function:ha.defineModifier("function"),standard:ha.defineModifier("standard"),local:ha.defineModifier("local"),special:ha.defineModifier("special")};for(let t in ve){let e=ve[t];e instanceof ha&&(e.name=t)}Lq([{tag:ve.link,class:"tok-link"},{tag:ve.heading,class:"tok-heading"},{tag:ve.emphasis,class:"tok-emphasis"},{tag:ve.strong,class:"tok-strong"},{tag:ve.keyword,class:"tok-keyword"},{tag:ve.atom,class:"tok-atom"},{tag:ve.bool,class:"tok-bool"},{tag:ve.url,class:"tok-url"},{tag:ve.labelName,class:"tok-labelName"},{tag:ve.inserted,class:"tok-inserted"},{tag:ve.deleted,class:"tok-deleted"},{tag:ve.literal,class:"tok-literal"},{tag:ve.string,class:"tok-string"},{tag:ve.number,class:"tok-number"},{tag:[ve.regexp,ve.escape,ve.special(ve.string)],class:"tok-string2"},{tag:ve.variableName,class:"tok-variableName"},{tag:ve.local(ve.variableName),class:"tok-variableName tok-local"},{tag:ve.definition(ve.variableName),class:"tok-variableName tok-definition"},{tag:ve.special(ve.variableName),class:"tok-variableName2"},{tag:ve.definition(ve.propertyName),class:"tok-propertyName tok-definition"},{tag:ve.typeName,class:"tok-typeName"},{tag:ve.namespace,class:"tok-namespace"},{tag:ve.className,class:"tok-className"},{tag:ve.macroName,class:"tok-macroName"},{tag:ve.propertyName,class:"tok-propertyName"},{tag:ve.operator,class:"tok-operator"},{tag:ve.comment,class:"tok-comment"},{tag:ve.meta,class:"tok-meta"},{tag:ve.invalid,class:"tok-invalid"},{tag:ve.punctuation,class:"tok-punctuation"}]);var W4;const Qu=new sn;function Bq(t){return at.define({combine:t?e=>e.concat(t):void 0})}const Hce=new sn;class va{constructor(e,n,r=[],s=""){this.data=e,this.name=s,wn.prototype.hasOwnProperty("tree")||Object.defineProperty(wn.prototype,"tree",{get(){return Ss(this)}}),this.parser=n,this.extension=[Kc.of(this),wn.languageData.of((i,a,l)=>{let c=p_(i,a,l),d=c.type.prop(Qu);if(!d)return[];let h=i.facet(d),m=c.type.prop(Hce);if(m){let g=c.resolve(a-c.from,l);for(let x of m)if(x.test(g,i)){let y=i.facet(x.facet);return x.type=="replace"?y:y.concat(h)}}return h})].concat(r)}isActiveAt(e,n,r=-1){return p_(e,n,r).type.prop(Qu)==this.data}findRegions(e){let n=e.facet(Kc);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],s=(i,a)=>{if(i.prop(Qu)==this.data){r.push({from:a,to:a+i.length});return}let l=i.prop(sn.mounted);if(l){if(l.tree.prop(Qu)==this.data){if(l.overlay)for(let c of l.overlay)r.push({from:c.from+a,to:c.to+a});else r.push({from:a,to:a+i.length});return}else if(l.overlay){let c=r.length;if(s(l.tree,l.overlay[0].from+a),r.length>c)return}}for(let c=0;cr.isTop?n:void 0)]}),e.name)}configure(e,n){return new X0(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Ss(t){let e=t.field(va.state,!1);return e?e.tree:ar.empty}class Qce{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,n){let r=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let $m=null;class rf{constructor(e,n,r=[],s,i,a,l,c){this.parser=e,this.state=n,this.fragments=r,this.tree=s,this.treeLen=i,this.viewport=a,this.skipped=l,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new rf(e,n,[],ar.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Qce(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=ar.empty&&this.isDone(n??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()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Ju.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=$m;$m=this;try{return e()}finally{$m=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=g_(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:s,treeLen:i,viewport:a,skipped:l}=this;if(this.takeTree(),!e.empty){let c=[];if(e.iterChangedRanges((d,h,m,g)=>c.push({fromA:d,toA:h,fromB:m,toB:g})),r=Ju.applyChanges(r,c),s=ar.empty,i=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){l=[];for(let d of this.skipped){let h=e.mapPos(d.from,1),m=e.mapPos(d.to,-1);he.from&&(this.fragments=g_(this.fragments,s,i),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends g6{createParse(n,r,s){let i=s[0].from,a=s[s.length-1].to;return{parsedPos:i,advance(){let c=$m;if(c){for(let d of s)c.tempSkipped.push(d);e&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,e]):e)}return this.parsedPos=a,new ar(si.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return $m}}function g_(t,e,n){return Ju.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class sf{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=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),n.viewport.to);return n.work(20,r)||n.takeTree(),new sf(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=rf.create(e.facet(Kc).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new sf(r)}}va.state=Os.define({create:sf.init,update(t,e){for(let n of e.effects)if(n.is(va.setState))return n.value;return e.startState.facet(Kc)!=e.state.facet(Kc)?sf.init(e.state):t.apply(e)}});let Fq=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Fq=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const G4=typeof navigator<"u"&&(!((W4=navigator.scheduling)===null||W4===void 0)&&W4.isInputPending)?()=>navigator.scheduling.isInputPending():null,Vce=Vr.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 n=this.view.state.field(va.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(va.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=Fq(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnds+1e3,c=i.context.work(()=>G4&&G4()||Date.now()>a,s+(l?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:va.setState.of(new sf(i.context))})),this.chunkBudget>0&&!(c&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>vi(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Kc=at.define({combine(t){return t.length?t[0]:null},enables:t=>[va.state,Vce,Ze.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class qq{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const Uce=at.define(),Wp=at.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function ld(t){let e=t.facet(Wp);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Y0(t,e){let n="",r=t.tabSize,s=t.facet(Wp)[0];if(s==" "){for(;e>=r;)n+=" ",e-=r;s=" "}for(let i=0;i=e?Wce(t,n,e):null}class fb{constructor(e,n={}){this.state=e,this.options=n,this.unit=ld(e)}lineAt(e,n=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}:(n<0?s-1&&(i+=a-this.countColumn(r,r.search(/\S|$/))),i}countColumn(e,n=e.length){return Nf(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:s}=this.lineAt(e,n),i=this.options.overrideIndentation;if(i){let a=i(s);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const mb=new sn;function Wce(t,e,n){let r=e.resolveStack(n),s=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(s!=r.node){let i=[];for(let a=s;a&&!(a.fromr.node.to||a.from==r.node.from&&a.type==r.node.type);a=a.parent)i.push(a);for(let a=i.length-1;a>=0;a--)r={node:i[a],next:r}}return $q(r,t,n)}function $q(t,e,n){for(let r=t;r;r=r.next){let s=Xce(r.node);if(s)return s(y6.create(e,n,r))}return 0}function Gce(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function Xce(t){let e=t.type.prop(mb);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(sn.closedBy))){let s=t.lastChild,i=s&&r.indexOf(s.name)>-1;return a=>Hq(a,!0,1,void 0,i&&!Gce(a)?s.from:void 0)}return t.parent==null?Yce:null}function Yce(){return 0}class y6 extends fb{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new y6(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(Kce(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return $q(this.context.next,this.base,this.pos)}}function Kce(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function Zce(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let s=t.options.simulateBreak,i=t.state.doc.lineAt(n.from),a=s==null||s<=i.from?i.to:Math.min(i.to,s);for(let l=n.to;;){let c=e.childAfter(l);if(!c||c==r)return null;if(!c.type.isSkipped){if(c.from>=a)return null;let d=/^ */.exec(i.text.slice(n.to-i.from))[0].length;return{from:n.from,to:n.to+d}}l=c.to}}function X4({closing:t,align:e=!0,units:n=1}){return r=>Hq(r,e,n,t)}function Hq(t,e,n,r,s){let i=t.textAfter,a=i.match(/^\s*/)[0].length,l=r&&i.slice(a,a+r.length)==r||s==t.pos+a,c=e?Zce(t):null;return c?l?t.column(c.from):t.column(c.to):t.baseIndent+(l?0:t.unit*n)}function x_({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const Jce=200;function eue(){return wn.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,s=n.lineAt(r);if(r>s.from+Jce)return t;let i=n.sliceString(s.from,r);if(!e.some(d=>d.test(i)))return t;let{state:a}=t,l=-1,c=[];for(let{head:d}of a.selection.ranges){let h=a.doc.lineAt(d);if(h.from==l)continue;l=h.from;let m=v6(a,h.from);if(m==null)continue;let g=/^\s*/.exec(h.text)[0],x=Y0(a,m);g!=x&&c.push({from:h.from,to:h.from+g.length,insert:x})}return c.length?[t,{changes:c,sequential:!0}]:t})}const tue=at.define(),b6=new sn;function Qq(t){let e=t.firstChild,n=t.lastChild;return e&&e.ton)continue;if(i&&l.from=e&&d.to>n&&(i=d)}}return i}function rue(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function Zv(t,e,n){for(let r of t.facet(tue)){let s=r(t,e,n);if(s)return s}return nue(t,e,n)}function Vq(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const pb=Ft.define({map:Vq}),Gp=Ft.define({map:Vq});function Uq(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const cd=Os.define({create(){return kt.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,r)=>t=v_(t,n,r)),t=t.map(e.changes);for(let n of e.effects)if(n.is(pb)&&!sue(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(Xq),s=r?kt.replace({widget:new due(r(e.state,n.value))}):y_;t=t.update({add:[s.range(n.value.from,n.value.to)]})}else n.is(Gp)&&(t=t.update({filter:(r,s)=>n.value.from!=r||n.value.to!=s,filterFrom:n.value.from,filterTo:n.value.to}));return e.selection&&(t=v_(t,e.selection.main.head)),t},provide:t=>Ze.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,s)=>{n.push(r,s)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n{se&&(r=!0)}),r?t.update({filterFrom:e,filterTo:n,filter:(s,i)=>s>=n||i<=e}):t}function Jv(t,e,n){var r;let s=null;return(r=t.field(cd,!1))===null||r===void 0||r.between(e,n,(i,a)=>{(!s||s.from>i)&&(s={from:i,to:a})}),s}function sue(t,e,n){let r=!1;return t.between(e,e,(s,i)=>{s==e&&i==n&&(r=!0)}),r}function Wq(t,e){return t.field(cd,!1)?e:e.concat(Ft.appendConfig.of(Yq()))}const iue=t=>{for(let e of Uq(t)){let n=Zv(t.state,e.from,e.to);if(n)return t.dispatch({effects:Wq(t.state,[pb.of(n),Gq(t,n)])}),!0}return!1},aue=t=>{if(!t.state.field(cd,!1))return!1;let e=[];for(let n of Uq(t)){let r=Jv(t.state,n.from,n.to);r&&e.push(Gp.of(r),Gq(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function Gq(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,s=t.state.doc.lineAt(e.to).number;return Ze.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${s}.`)}const oue=t=>{let{state:e}=t,n=[];for(let r=0;r{let e=t.state.field(cd,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,s)=>{n.push(Gp.of({from:r,to:s}))}),t.dispatch({effects:n}),!0},cue=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:iue},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:aue},{key:"Ctrl-Alt-[",run:oue},{key:"Ctrl-Alt-]",run:lue}],uue={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Xq=at.define({combine(t){return $o(t,uue)}});function Yq(t){return[cd,mue]}function Kq(t,e){let{state:n}=t,r=n.facet(Xq),s=a=>{let l=t.lineBlockAt(t.posAtDOM(a.target)),c=Jv(t.state,l.from,l.to);c&&t.dispatch({effects:Gp.of(c)}),a.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,s,e);let i=document.createElement("span");return i.textContent=r.placeholderText,i.setAttribute("aria-label",n.phrase("folded code")),i.title=n.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=s,i}const y_=kt.replace({widget:new class extends Ho{toDOM(t){return Kq(t,null)}}});class due extends Ho{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Kq(e,this.value)}}const hue={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Y4 extends Hl{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function fue(t={}){let e={...hue,...t},n=new Y4(e,!0),r=new Y4(e,!1),s=Vr.fromClass(class{constructor(a){this.from=a.viewport.from,this.markers=this.buildMarkers(a)}update(a){(a.docChanged||a.viewportChanged||a.startState.facet(Kc)!=a.state.facet(Kc)||a.startState.field(cd,!1)!=a.state.field(cd,!1)||Ss(a.startState)!=Ss(a.state)||e.foldingChanged(a))&&(this.markers=this.buildMarkers(a.view))}buildMarkers(a){let l=new ql;for(let c of a.viewportLineBlocks){let d=Jv(a.state,c.from,c.to)?r:Zv(a.state,c.from,c.to)?n:null;d&&l.add(c.from,c.from,d)}return l.finish()}}),{domEventHandlers:i}=e;return[s,gce({class:"cm-foldGutter",markers(a){var l;return((l=a.plugin(s))===null||l===void 0?void 0:l.markers)||Rn.empty},initialSpacer(){return new Y4(e,!1)},domEventHandlers:{...i,click:(a,l,c)=>{if(i.click&&i.click(a,l,c))return!0;let d=Jv(a.state,l.from,l.to);if(d)return a.dispatch({effects:Gp.of(d)}),!0;let h=Zv(a.state,l.from,l.to);return h?(a.dispatch({effects:pb.of(h)}),!0):!1}}}),Yq()]}const mue=Ze.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 Xp{constructor(e,n){this.specs=e;let r;function s(l){let c=Wc.newName();return(r||(r=Object.create(null)))["."+c]=l,c}const i=typeof n.all=="string"?n.all:n.all?s(n.all):void 0,a=n.scope;this.scope=a instanceof va?l=>l.prop(Qu)==a.data:a?l=>l==a:void 0,this.style=Lq(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:i}).style,this.module=r?new Wc(r):null,this.themeType=n.themeType}static define(e,n){return new Xp(e,n||{})}}const sO=at.define(),Zq=at.define({combine(t){return t.length?[t[0]]:null}});function K4(t){let e=t.facet(sO);return e.length?e:t.facet(Zq)}function Jq(t,e){let n=[gue],r;return t instanceof Xp&&(t.module&&n.push(Ze.styleModule.of(t.module)),r=t.themeType),e?.fallback?n.push(Zq.of(t)):r?n.push(sO.computeN([Ze.darkTheme],s=>s.facet(Ze.darkTheme)==(r=="dark")?[t]:[])):n.push(sO.of(t)),n}class pue{constructor(e){this.markCache=Object.create(null),this.tree=Ss(e.state),this.decorations=this.buildDeco(e,K4(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=Ss(e.state),r=K4(e.state),s=r!=K4(e.startState),{viewport:i}=e.view,a=e.changes.mapPos(this.decoratedTo,1);n.length=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(n!=this.tree||e.viewportChanged||s)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=i.to)}buildDeco(e,n){if(!n||!this.tree.length)return kt.none;let r=new ql;for(let{from:s,to:i}of e.visibleRanges)Fce(this.tree,n,(a,l,c)=>{r.add(a,l,this.markCache[c]||(this.markCache[c]=kt.mark({class:c})))},s,i);return r.finish()}}const gue=ou.high(Vr.fromClass(pue,{decorations:t=>t.decorations})),xue=Xp.define([{tag:ve.meta,color:"#404740"},{tag:ve.link,textDecoration:"underline"},{tag:ve.heading,textDecoration:"underline",fontWeight:"bold"},{tag:ve.emphasis,fontStyle:"italic"},{tag:ve.strong,fontWeight:"bold"},{tag:ve.strikethrough,textDecoration:"line-through"},{tag:ve.keyword,color:"#708"},{tag:[ve.atom,ve.bool,ve.url,ve.contentSeparator,ve.labelName],color:"#219"},{tag:[ve.literal,ve.inserted],color:"#164"},{tag:[ve.string,ve.deleted],color:"#a11"},{tag:[ve.regexp,ve.escape,ve.special(ve.string)],color:"#e40"},{tag:ve.definition(ve.variableName),color:"#00f"},{tag:ve.local(ve.variableName),color:"#30a"},{tag:[ve.typeName,ve.namespace],color:"#085"},{tag:ve.className,color:"#167"},{tag:[ve.special(ve.variableName),ve.macroName],color:"#256"},{tag:ve.definition(ve.propertyName),color:"#00c"},{tag:ve.comment,color:"#940"},{tag:ve.invalid,color:"#f00"}]),vue=Ze.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),e$=1e4,t$="()[]{}",n$=at.define({combine(t){return $o(t,{afterCursor:!0,brackets:t$,maxScanDistance:e$,renderMatch:wue})}}),yue=kt.mark({class:"cm-matchingBracket"}),bue=kt.mark({class:"cm-nonmatchingBracket"});function wue(t){let e=[],n=t.matched?yue:bue;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const Sue=Os.define({create(){return kt.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(n$);for(let s of e.state.selection.ranges){if(!s.empty)continue;let i=No(e.state,s.head,-1,r)||s.head>0&&No(e.state,s.head-1,1,r)||r.afterCursor&&(No(e.state,s.head,1,r)||s.headZe.decorations.from(t)}),kue=[Sue,vue];function Oue(t={}){return[n$.of(t),kue]}const jue=new sn;function iO(t,e,n){let r=t.prop(e<0?sn.openedBy:sn.closedBy);if(r)return r;if(t.name.length==1){let s=n.indexOf(t.name);if(s>-1&&s%2==(e<0?1:0))return[n[s+e]]}return null}function aO(t){let e=t.type.prop(jue);return e?e(t.node):t}function No(t,e,n,r={}){let s=r.maxScanDistance||e$,i=r.brackets||t$,a=Ss(t),l=a.resolveInner(e,n);for(let c=l;c;c=c.parent){let d=iO(c.type,n,i);if(d&&c.from0?e>=h.from&&eh.from&&e<=h.to))return Nue(t,e,n,c,h,d,i)}}return Cue(t,e,n,a,l.type,s,i)}function Nue(t,e,n,r,s,i,a){let l=r.parent,c={from:s.from,to:s.to},d=0,h=l?.cursor();if(h&&(n<0?h.childBefore(r.from):h.childAfter(r.to)))do if(n<0?h.to<=r.from:h.from>=r.to){if(d==0&&i.indexOf(h.type.name)>-1&&h.from0)return null;let d={from:n<0?e-1:e,to:n>0?e+1:e},h=t.doc.iterRange(e,n>0?t.doc.length:0),m=0;for(let g=0;!h.next().done&&g<=i;){let x=h.value;n<0&&(g+=x.length);let y=e+g*n;for(let w=n>0?0:x.length-1,S=n>0?x.length:-1;w!=S;w+=n){let k=a.indexOf(x[w]);if(!(k<0||r.resolveInner(y+w,1).type!=s))if(k%2==0==n>0)m++;else{if(m==1)return{start:d,end:{from:y+w,to:y+w+1},matched:k>>1==c>>1};m--}}n>0&&(g+=x.length)}return h.done?{start:d,matched:!1}:null}function b_(t,e,n,r=0,s=0){e==null&&(e=t.search(/[^\s\u00a0]/),e==-1&&(e=t.length));let i=s;for(let a=r;a=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.posn}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 n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosr?a.toLowerCase():a,i=this.string.substr(this.pos,e.length);return s(i)==s(e)?(n!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&n!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function Tue(t){return{name:t.name||"",token:t.token,blankLine:t.blankLine||(()=>{}),startState:t.startState||(()=>!0),copyState:t.copyState||Eue,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||k6,mergeTokens:t.mergeTokens!==!1}}function Eue(t){if(typeof t!="object")return t;let e={};for(let n in t){let r=t[n];e[n]=r instanceof Array?r.slice():r}return e}const w_=new WeakMap;class w6 extends va{constructor(e){let n=Bq(e.languageData),r=Tue(e),s,i=new class extends g6{createParse(a,l,c){return new Aue(s,a,l,c)}};super(n,i,[],e.name),this.topNode=Due(n,this),s=this,this.streamParser=r,this.stateAfter=new sn({perNode:!0}),this.tokenTable=e.tokenTable?new o$(r.tokenTable):Rue}static define(e){return new w6(e)}getIndent(e){let n,{overrideIndentation:r}=e.options;r&&(n=w_.get(e.state),n!=null&&n1e4)return null;for(;i=r&&n+e.length<=s&&e.prop(t.stateAfter);if(i)return{state:t.streamParser.copyState(i),pos:n+e.length};for(let a=e.children.length-1;a>=0;a--){let l=e.children[a],c=n+e.positions[a],d=l instanceof ar&&c=e.length)return e;!s&&n==0&&e.type==t.topNode&&(s=!0);for(let i=e.children.length-1;i>=0;i--){let a=e.positions[i],l=e.children[i],c;if(an&&S6(t,i.tree,0-i.offset,n,l),d;if(c&&c.pos<=r&&(d=s$(t,i.tree,n+i.offset,c.pos+i.offset,!1)))return{state:c.state,tree:d}}return{state:t.streamParser.startState(s?ld(s):4),tree:ar.empty}}let Aue=class{constructor(e,n,r,s){this.lang=e,this.input=n,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=rf.get(),a=s[0].from,{state:l,tree:c}=_ue(e,r,a,this.to,i?.state);this.state=l,this.parsedPos=this.chunkStart=a+c.length;for(let d=0;dd.from<=i.viewport.from&&d.to>=i.viewport.from)&&(this.state=this.lang.streamParser.startState(ld(i.state)),i.skipUntilInView(this.parsedPos,i.viewport.from),this.parsedPos=i.viewport.from),this.moveRangeIndex()}advance(){let e=rf.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),r=Math.min(n,this.chunkStart+512);for(e&&(r=Math.min(r,e.viewport.to));this.parsedPos=n?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let n=this.input.chunk(e);if(this.input.lineChunks)n==` `&&(n="");else{let r=n.indexOf(` -`);r>-1&&(n=n.slice(0,r))}return e+n.length<=this.to?n:n.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,n=this.lineAfter(e),r=e+n.length;for(let s=this.rangeIndex;;){let i=this.ranges[s].to;if(i>=r||(n=n.slice(0,i-(r-n.length)),s++,s==this.ranges.length))break;let a=this.ranges[s].from,l=this.lineAfter(a);n+=l,r=a+l.length}return{line:n,end:r}}skipGapsTo(e,n,r){for(;;){let s=this.ranges[this.rangeIndex].to,i=e+n;if(r>0?s>i:s>=i)break;let a=this.ranges[++this.rangeIndex].from;n+=a-s}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){s=this.skipGapsTo(n,s,1),n+=s;let l=this.chunk.length;s=this.skipGapsTo(r,s,-1),r+=s,i+=this.chunk.length-l}let a=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&i==4&&a>=0&&this.chunk[a]==e&&this.chunk[a+2]==n?this.chunk[a+2]=r:this.chunk.push(e,n,r,i),s}parseLine(e){let{line:n,end:r}=this.nextLine(),s=0,{streamParser:i}=this.lang,a=new Kq(n,e?e.state.tabSize:4,e?ld(e.state):2);if(a.eol())i.blankLine(this.state,a.indentUnit);else for(;!a.eol();){let l=Jq(i.token,a,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+a.start,this.parsedPos+a.pos,s)),a.start>1e4)break}this.parsedPos=r,this.moveRangeIndex(),this.parsedPose.start)return s}throw new Error("Stream parser failed to advance stream.")}const y6=Object.create(null),G0=[ri.none],fue=new ab(G0),g_=[],x_=Object.create(null),e$=Object.create(null);for(let[t,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"]])e$[t]=n$(y6,e);class t${constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),e$)}resolve(e){return e?this.table[e]||(this.table[e]=n$(this.extra,e)):0}}const mue=new t$(y6);function U4(t,e){g_.indexOf(t)>-1||(g_.push(t),console.warn(e))}function n$(t,e){let n=[];for(let l of e.split(" ")){let c=[];for(let d of l.split(".")){let h=t[d]||xe[d];h?typeof h=="function"?c.length?c=c.map(h):U4(d,`Modifier ${d} used at start of tag`):c.length?U4(d,`Tag ${d} used as modifier`):c=Array.isArray(h)?h:[h]:U4(d,`Unknown highlighting tag ${d}`)}for(let d of c)n.push(d)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),s=r+" "+n.map(l=>l.id),i=x_[s];if(i)return i.id;let a=x_[s]=ri.define({id:G0.length,name:r,props:[f6({[r]:n})]});return G0.push(a),a.id}function pue(t,e){let n=ri.define({id:G0.length,name:"Document",props:[Qu.add(()=>t),lb.add(()=>r=>e.getIndent(r))],top:!0});return G0.push(n),n}gr.RTL,gr.LTR;const gue=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=w6(t.state,n.from);return r.line?xue(t):r.block?yue(t):!1};function b6(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let s=t(e,n);return s?(r(n.update(s)),!0):!1}}const xue=b6(Sue,0),vue=b6(r$,0),yue=b6((t,e)=>r$(t,e,wue(e)),0);function w6(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const qm=50;function bue(t,{open:e,close:n},r,s){let i=t.sliceDoc(r-qm,r),a=t.sliceDoc(s,s+qm),l=/\s*$/.exec(i)[0].length,c=/^\s*/.exec(a)[0].length,d=i.length-l;if(i.slice(d-e.length,d)==e&&a.slice(c,c+n.length)==n)return{open:{pos:r-l,margin:l&&1},close:{pos:s+c,margin:c&&1}};let h,m;s-r<=2*qm?h=m=t.sliceDoc(r,s):(h=t.sliceDoc(r,r+qm),m=t.sliceDoc(s-qm,s));let g=/^\s*/.exec(h)[0].length,x=/\s*$/.exec(m)[0].length,y=m.length-x-n.length;return h.slice(g,g+e.length)==e&&m.slice(y,y+n.length)==n?{open:{pos:r+g+e.length,margin:/\s/.test(h.charAt(g+e.length))?1:0},close:{pos:s-x-n.length,margin:/\s/.test(m.charAt(y-1))?1:0}}:null}function wue(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),s=n.to<=r.to?r:t.doc.lineAt(n.to);s.from>r.from&&s.from==n.to&&(s=n.to==r.to+1?r:t.doc.lineAt(n.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 r$(t,e,n=e.selection.ranges){let r=n.map(i=>w6(e,i.from).block);if(!r.every(i=>i))return null;let s=n.map((i,a)=>bue(e,r[a],i.from,i.to));if(t!=2&&!s.every(i=>i))return{changes:e.changes(n.map((i,a)=>s[a]?[]:[{from:i.from,insert:r[a].open+" "},{from:i.to,insert:" "+r[a].close}]))};if(t!=1&&s.some(i=>i)){let i=[];for(let a=0,l;as&&(i==a||a>m.from)){s=m.from;let g=/^\s*/.exec(m.text)[0].length,x=g==m.length,y=m.text.slice(g,g+d.length)==d?g:-1;gi.comment<0&&(!i.empty||i.single))){let i=[];for(let{line:l,token:c,indent:d,empty:h,single:m}of r)(m||!h)&&i.push({from:l.from+d,insert:c+" "});let a=e.changes(i);return{changes:a,selection:e.selection.map(a,1)}}else if(t!=1&&r.some(i=>i.comment>=0)){let i=[];for(let{line:a,comment:l,token:c}of r)if(l>=0){let d=a.from+l,h=d+c.length;a.text[h-a.from]==" "&&h++,i.push({from:d,to:h})}return{changes:i}}return null}const tO=Fo.define(),kue=Fo.define(),Oue=at.define(),s$=at.define({combine(t){return qo(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,s)=>e(r,s)||n(r,s)})}}),i$=Os.define({create(){return Co.empty},update(t,e){let n=e.state.facet(s$),r=e.annotation(tO);if(r){let c=yi.fromTransaction(e,r.selection),d=r.side,h=d==0?t.undone:t.done;return c?h=Xv(h,h.length,n.minDepth,c):h=l$(h,e.startState.selection),new Co(d==0?r.rest:h,d==0?h:r.rest)}let s=e.annotation(kue);if((s=="full"||s=="before")&&(t=t.isolate()),e.annotation(ns.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let i=yi.fromTransaction(e),a=e.annotation(ns.time),l=e.annotation(ns.userEvent);return i?t=t.addChanges(i,a,l,n,e):e.selection&&(t=t.addSelection(e.startState.selection,a,l,n.newGroupDelay)),(s=="full"||s=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Co(t.done.map(yi.fromJSON),t.undone.map(yi.fromJSON))}});function jue(t={}){return[i$,s$.of(t),Ze.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?a$:e.inputType=="historyRedo"?nO:null;return r?(e.preventDefault(),r(n)):!1}})]}function ub(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let s=n.field(i$,!1);if(!s)return!1;let i=s.pop(t,n,e);return i?(r(i),!0):!1}}const a$=ub(0,!1),nO=ub(1,!1),Nue=ub(0,!0),Cue=ub(1,!0);class yi{constructor(e,n,r,s,i){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=s,this.selectionsAfter=i}setSelAfter(e){return new yi(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.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 yi(e.changes&&cs.fromJSON(e.changes),[],e.mapped&&Do.fromJSON(e.mapped),e.startSelection&&Ae.fromJSON(e.startSelection),e.selectionsAfter.map(Ae.fromJSON))}static fromTransaction(e,n){let r=ya;for(let s of e.startState.facet(Oue)){let i=s(e);i.length&&(r=r.concat(i))}return!r.length&&e.changes.empty?null:new yi(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,ya)}static selection(e){return new yi(void 0,ya,void 0,void 0,e)}}function Xv(t,e,n,r){let s=e+1>n+20?e-n-1:0,i=t.slice(s,e);return i.push(r),i}function Tue(t,e){let n=[],r=!1;return t.iterChangedRanges((s,i)=>n.push(s,i)),e.iterChangedRanges((s,i,a,l)=>{for(let c=0;c=d&&a<=h&&(r=!0)}}),r}function Eue(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function o$(t,e){return t.length?e.length?t.concat(e):t:e}const ya=[],_ue=200;function l$(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-_ue));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),Xv(t,t.length-1,1e9,n.setSelAfter(r)))}else return[yi.selection([e])]}function Mue(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function W4(t,e){if(!t.length)return t;let n=t.length,r=ya;for(;n;){let s=Aue(t[n-1],e,r);if(s.changes&&!s.changes.empty||s.effects.length){let i=t.slice(0,n);return i[n-1]=s,i}else e=s.mapped,n--,r=s.selectionsAfter}return r.length?[yi.selection(r)]:ya}function Aue(t,e,n){let r=o$(t.selectionsAfter.length?t.selectionsAfter.map(l=>l.map(e)):ya,n);if(!t.changes)return yi.selection(r);let s=t.changes.map(e),i=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(i):i;return new yi(s,Ft.mapEffects(t.effects,e),a,t.startSelection.map(i),r)}const Rue=/^(input\.type|delete)($|\.)/;class Co{constructor(e,n,r=0,s=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=s}isolate(){return this.prevTime?new Co(this.done,this.undone):this}addChanges(e,n,r,s,i){let a=this.done,l=a[a.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!r||Rue.test(r))&&(!l.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?t.moveByChar(n,e):db(n,e))}function Us(t){return t.textDirectionAt(t.state.selection.main.head)==gr.LTR}const u$=t=>c$(t,!Us(t)),d$=t=>c$(t,Us(t));function h$(t,e){return no(t,n=>n.empty?t.moveByGroup(n,e):db(n,e))}const Pue=t=>h$(t,!Us(t)),zue=t=>h$(t,Us(t));function Iue(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function hb(t,e,n){let r=ws(t).resolveInner(e.head),s=n?sn.closedBy:sn.openedBy;for(let c=e.head;;){let d=n?r.childAfter(c):r.childBefore(c);if(!d)break;Iue(t,d,s)?r=d:c=n?d.to:d.from}let i=r.type.prop(s),a,l;return i&&(a=n?No(t,r.from,1):No(t,r.to,-1))&&a.matched?l=n?a.end.to:a.end.from:l=n?r.to:r.from,Ae.cursor(l,n?-1:1)}const Lue=t=>no(t,e=>hb(t.state,e,!Us(t))),Bue=t=>no(t,e=>hb(t.state,e,Us(t)));function f$(t,e){return no(t,n=>{if(!n.empty)return db(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const m$=t=>f$(t,!1),p$=t=>f$(t,!0);function g$(t){let e=t.scrollDOM.clientHeighta.empty?t.moveVertically(a,e,n.height):db(a,e));if(s.eq(r.selection))return!1;let i;if(n.selfScroll){let a=t.coordsAtPos(r.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),c=l.top+n.marginTop,d=l.bottom-n.marginBottom;a&&a.top>c&&a.bottomx$(t,!1),rO=t=>x$(t,!0);function lu(t,e,n){let r=t.lineBlockAt(e.head),s=t.moveToLineBoundary(e,n);if(s.head==e.head&&s.head!=(n?r.to:r.from)&&(s=t.moveToLineBoundary(e,n,!1)),!n&&s.head==r.from&&r.length){let i=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;i&&e.head!=r.from+i&&(s=Ae.cursor(r.from+i))}return s}const Fue=t=>no(t,e=>lu(t,e,!0)),que=t=>no(t,e=>lu(t,e,!1)),$ue=t=>no(t,e=>lu(t,e,!Us(t))),Hue=t=>no(t,e=>lu(t,e,Us(t))),Que=t=>no(t,e=>Ae.cursor(t.lineBlockAt(e.head).from,1)),Vue=t=>no(t,e=>Ae.cursor(t.lineBlockAt(e.head).to,-1));function Uue(t,e,n){let r=!1,s=jf(t.selection,i=>{let a=No(t,i.head,-1)||No(t,i.head,1)||i.head>0&&No(t,i.head-1,1)||i.headUue(t,e);function Pa(t,e){let n=jf(t.state.selection,r=>{let s=e(r);return Ae.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(to(t.state,n)),!0)}function v$(t,e){return Pa(t,n=>t.moveByChar(n,e))}const y$=t=>v$(t,!Us(t)),b$=t=>v$(t,Us(t));function w$(t,e){return Pa(t,n=>t.moveByGroup(n,e))}const Gue=t=>w$(t,!Us(t)),Xue=t=>w$(t,Us(t)),Yue=t=>Pa(t,e=>hb(t.state,e,!Us(t))),Kue=t=>Pa(t,e=>hb(t.state,e,Us(t)));function S$(t,e){return Pa(t,n=>t.moveVertically(n,e))}const k$=t=>S$(t,!1),O$=t=>S$(t,!0);function j$(t,e){return Pa(t,n=>t.moveVertically(n,e,g$(t).height))}const y_=t=>j$(t,!1),b_=t=>j$(t,!0),Zue=t=>Pa(t,e=>lu(t,e,!0)),Jue=t=>Pa(t,e=>lu(t,e,!1)),ede=t=>Pa(t,e=>lu(t,e,!Us(t))),tde=t=>Pa(t,e=>lu(t,e,Us(t))),nde=t=>Pa(t,e=>Ae.cursor(t.lineBlockAt(e.head).from)),rde=t=>Pa(t,e=>Ae.cursor(t.lineBlockAt(e.head).to)),w_=({state:t,dispatch:e})=>(e(to(t,{anchor:0})),!0),S_=({state:t,dispatch:e})=>(e(to(t,{anchor:t.doc.length})),!0),k_=({state:t,dispatch:e})=>(e(to(t,{anchor:t.selection.main.anchor,head:0})),!0),O_=({state:t,dispatch:e})=>(e(to(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),sde=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),ide=({state:t,dispatch:e})=>{let n=fb(t).map(({from:r,to:s})=>Ae.range(r,Math.min(s+1,t.doc.length)));return e(t.update({selection:Ae.create(n),userEvent:"select"})),!0},ade=({state:t,dispatch:e})=>{let n=jf(t.selection,r=>{let s=ws(t),i=s.resolveStack(r.from,1);if(r.empty){let a=s.resolveStack(r.from,-1);a.node.from>=i.node.from&&a.node.to<=i.node.to&&(i=a)}for(let a=i;a;a=a.next){let{node:l}=a;if((l.from=r.to||l.to>r.to&&l.from<=r.from)&&a.next)return Ae.range(l.to,l.from)}return r});return n.eq(t.selection)?!1:(e(to(t,n)),!0)};function N$(t,e){let{state:n}=t,r=n.selection,s=n.selection.ranges.slice();for(let i of n.selection.ranges){let a=n.doc.lineAt(i.head);if(e?a.to0)for(let l=i;;){let c=t.moveVertically(l,e);if(c.heada.to){s.some(d=>d.head==c.head)||s.push(c);break}else{if(c.head==l.head)break;l=c}}}return s.length==r.ranges.length?!1:(t.dispatch(to(n,Ae.create(s,s.length-1))),!0)}const ode=t=>N$(t,!1),lde=t=>N$(t,!0),cde=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=Ae.create([n.main]):n.main.empty||(r=Ae.create([Ae.cursor(n.main.head)])),r?(e(to(t,r)),!0):!1};function Gp(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,s=r.changeByRange(i=>{let{from:a,to:l}=i;if(a==l){let c=e(i);ca&&(n="delete.forward",c=p1(t,c,!0)),a=Math.min(a,c),l=Math.max(l,c)}else a=p1(t,a,!1),l=p1(t,l,!0);return a==l?{range:i}:{changes:{from:a,to:l},range:Ae.cursor(a,as(t)))r.between(e,e,(s,i)=>{se&&(e=n?i:s)});return e}const C$=(t,e,n)=>Gp(t,r=>{let s=r.from,{state:i}=t,a=i.doc.lineAt(s),l,c;if(n&&!e&&s>a.from&&sC$(t,!1,!0),T$=t=>C$(t,!0,!1),E$=(t,e)=>Gp(t,n=>{let r=n.head,{state:s}=t,i=s.doc.lineAt(r),a=s.charCategorizer(r);for(let l=null;;){if(r==(e?i.to:i.from)){r==n.head&&i.number!=(e?s.doc.lines:1)&&(r+=e?1:-1);break}let c=Ds(i.text,r-i.from,e)+i.from,d=i.text.slice(Math.min(r,c)-i.from,Math.max(r,c)-i.from),h=a(d);if(l!=null&&h!=l)break;(d!=" "||r!=n.head)&&(l=h),r=c}return r}),_$=t=>E$(t,!1),ude=t=>E$(t,!0),dde=t=>Gp(t,e=>{let n=t.lineBlockAt(e.head).to;return e.headGp(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),fde=t=>Gp(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:jn.of(["",""])},range:Ae.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},pde=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let s=r.from,i=t.doc.lineAt(s),a=s==i.from?s-1:Ds(i.text,s-i.from,!1)+i.from,l=s==i.to?s+1:Ds(i.text,s-i.from,!0)+i.from;return{changes:{from:a,to:l,insert:t.doc.slice(s,l).append(t.doc.slice(a,s))},range:Ae.cursor(l)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function fb(t){let e=[],n=-1;for(let r of t.selection.ranges){let s=t.doc.lineAt(r.from),i=t.doc.lineAt(r.to);if(!r.empty&&r.to==i.from&&(i=t.doc.lineAt(r.to-1)),n>=s.number){let a=e[e.length-1];a.to=i.to,a.ranges.push(r)}else e.push({from:s.from,to:i.to,ranges:[r]});n=i.number+1}return e}function M$(t,e,n){if(t.readOnly)return!1;let r=[],s=[];for(let i of fb(t)){if(n?i.to==t.doc.length:i.from==0)continue;let a=t.doc.lineAt(n?i.to+1:i.from-1),l=a.length+1;if(n){r.push({from:i.to,to:a.to},{from:i.from,insert:a.text+t.lineBreak});for(let c of i.ranges)s.push(Ae.range(Math.min(t.doc.length,c.anchor+l),Math.min(t.doc.length,c.head+l)))}else{r.push({from:a.from,to:i.from},{from:i.to,insert:t.lineBreak+a.text});for(let c of i.ranges)s.push(Ae.range(c.anchor-l,c.head-l))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:Ae.create(s,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const gde=({state:t,dispatch:e})=>M$(t,e,!1),xde=({state:t,dispatch:e})=>M$(t,e,!0);function A$(t,e,n){if(t.readOnly)return!1;let r=[];for(let s of fb(t))n?r.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):r.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});return e(t.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const vde=({state:t,dispatch:e})=>A$(t,e,!1),yde=({state:t,dispatch:e})=>A$(t,e,!0),bde=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(fb(e).map(({from:s,to:i})=>(s>0?s--:i{let i;if(t.lineWrapping){let a=t.lineBlockAt(s.head),l=t.coordsAtPos(s.head,s.assoc||1);l&&(i=a.bottom+t.documentTop-l.bottom+t.defaultLineHeight/2)}return t.moveVertically(s,!0,i)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function wde(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=ws(t).resolveInner(e),r=n.childBefore(e),s=n.childAfter(e),i;return r&&s&&r.to<=e&&s.from>=e&&(i=r.type.prop(sn.closedBy))&&i.indexOf(s.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(s.from).from&&!/\S/.test(t.sliceDoc(r.to,s.from))?{from:r.to,to:s.from}:null}const j_=R$(!1),Sde=R$(!0);function R$(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(s=>{let{from:i,to:a}=s,l=e.doc.lineAt(i),c=!t&&i==a&&wde(e,i);t&&(i=a=(a<=l.to?l:e.doc.lineAt(a)).to);let d=new ob(e,{simulateBreak:i,simulateDoubleBreak:!!c}),h=m6(d,i);for(h==null&&(h=Of(/^\s*/.exec(e.doc.lineAt(i).text)[0],e.tabSize));al.from&&i{let s=[];for(let a=r.from;a<=r.to;){let l=t.doc.lineAt(a);l.number>n&&(r.empty||r.to>l.from)&&(e(l,s,r),n=l.number),a=l.to+1}let i=t.changes(s);return{changes:s,range:Ae.range(i.mapPos(r.anchor,1),i.mapPos(r.head,1))}})}const kde=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new ob(t,{overrideIndentation:i=>{let a=n[i];return a??-1}}),s=S6(t,(i,a,l)=>{let c=m6(r,i.from);if(c==null)return;/\S/.test(i.text)||(c=0);let d=/^\s*/.exec(i.text)[0],h=W0(t,c);(d!=h||l.fromt.readOnly?!1:(e(t.update(S6(t,(n,r)=>{r.push({from:n.from,insert:t.facet(Vp)})}),{userEvent:"input.indent"})),!0),P$=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(S6(t,(n,r)=>{let s=/^\s*/.exec(n.text)[0];if(!s)return;let i=Of(s,t.tabSize),a=0,l=W0(t,Math.max(0,i-ld(t)));for(;a(t.setTabFocusMode(),!0),jde=[{key:"Ctrl-b",run:u$,shift:y$,preventDefault:!0},{key:"Ctrl-f",run:d$,shift:b$},{key:"Ctrl-p",run:m$,shift:k$},{key:"Ctrl-n",run:p$,shift:O$},{key:"Ctrl-a",run:Que,shift:nde},{key:"Ctrl-e",run:Vue,shift:rde},{key:"Ctrl-d",run:T$},{key:"Ctrl-h",run:sO},{key:"Ctrl-k",run:dde},{key:"Ctrl-Alt-h",run:_$},{key:"Ctrl-o",run:mde},{key:"Ctrl-t",run:pde},{key:"Ctrl-v",run:rO}],Nde=[{key:"ArrowLeft",run:u$,shift:y$,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Pue,shift:Gue,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:$ue,shift:ede,preventDefault:!0},{key:"ArrowRight",run:d$,shift:b$,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:zue,shift:Xue,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Hue,shift:tde,preventDefault:!0},{key:"ArrowUp",run:m$,shift:k$,preventDefault:!0},{mac:"Cmd-ArrowUp",run:w_,shift:k_},{mac:"Ctrl-ArrowUp",run:v_,shift:y_},{key:"ArrowDown",run:p$,shift:O$,preventDefault:!0},{mac:"Cmd-ArrowDown",run:S_,shift:O_},{mac:"Ctrl-ArrowDown",run:rO,shift:b_},{key:"PageUp",run:v_,shift:y_},{key:"PageDown",run:rO,shift:b_},{key:"Home",run:que,shift:Jue,preventDefault:!0},{key:"Mod-Home",run:w_,shift:k_},{key:"End",run:Fue,shift:Zue,preventDefault:!0},{key:"Mod-End",run:S_,shift:O_},{key:"Enter",run:j_,shift:j_},{key:"Mod-a",run:sde},{key:"Backspace",run:sO,shift:sO,preventDefault:!0},{key:"Delete",run:T$,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:_$,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:ude,preventDefault:!0},{mac:"Mod-Backspace",run:hde,preventDefault:!0},{mac:"Mod-Delete",run:fde,preventDefault:!0}].concat(jde.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Cde=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Lue,shift:Yue},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Bue,shift:Kue},{key:"Alt-ArrowUp",run:gde},{key:"Shift-Alt-ArrowUp",run:vde},{key:"Alt-ArrowDown",run:xde},{key:"Shift-Alt-ArrowDown",run:yde},{key:"Mod-Alt-ArrowUp",run:ode},{key:"Mod-Alt-ArrowDown",run:lde},{key:"Escape",run:cde},{key:"Mod-Enter",run:Sde},{key:"Alt-l",mac:"Ctrl-l",run:ide},{key:"Mod-i",run:ade,preventDefault:!0},{key:"Mod-[",run:P$},{key:"Mod-]",run:D$},{key:"Mod-Alt-\\",run:kde},{key:"Shift-Mod-k",run:bde},{key:"Shift-Mod-\\",run:Wue},{key:"Mod-/",run:gue},{key:"Alt-A",run:vue},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Ode}].concat(Nde),Tde={key:"Tab",run:D$,shift:P$},N_=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class rf{constructor(e,n,r=0,s=e.length,i,a){this.test=a,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?l=>i(N_(l)):N_,this.query=this.normalize(n)}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 gi(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 n=Gj(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=wo(e);let s=this.normalize(n);if(s.length)for(let i=0,a=r;;i++){let l=s.charCodeAt(i),c=this.match(l,a,this.bufferPos+this.bufferStart);if(i==s.length-1){if(c)return this.value=c,this;break}a==r&&ithis.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 n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,s=r+n[0].length;if(this.matchPos=Yv(this.text,s+(r==s?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(rthis.value.to)&&(!this.test||this.test(r,s,n)))return this.value={from:r,to:s,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=r||s.to<=n){let l=new Ih(n,e.sliceString(n,r));return G4.set(e,l),l}if(s.from==n&&s.to==r)return s;let{text:i,from:a}=s;return a>n&&(i=e.sliceString(n,a)+i,a=n),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,s=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,s,n)))return this.value={from:r,to:s,match:n},this.matchPos=Yv(this.text,s+(r==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ih.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(I$.prototype[Symbol.iterator]=L$.prototype[Symbol.iterator]=function(){return this});function Ede(t){try{return new RegExp(t,k6),!0}catch{return!1}}function Yv(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e=56320&&r<57344;)e++;return e}function iO(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=sr("input",{class:"cm-textfield",name:"line",value:e}),r=sr("form",{class:"cm-gotoLine",onkeydown:i=>{i.keyCode==27?(i.preventDefault(),t.dispatch({effects:k0.of(!1)}),t.focus()):i.keyCode==13&&(i.preventDefault(),s())},onsubmit:i=>{i.preventDefault(),s()}},sr("label",t.state.phrase("Go to line"),": ",n)," ",sr("button",{class:"cm-button",type:"submit"},t.state.phrase("go")),sr("button",{name:"close",onclick:()=>{t.dispatch({effects:k0.of(!1)}),t.focus()},"aria-label":t.state.phrase("close"),type:"button"},["×"]));function s(){let i=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!i)return;let{state:a}=t,l=a.doc.lineAt(a.selection.main.head),[,c,d,h,m]=i,g=h?+h.slice(1):0,x=d?+d:l.number;if(d&&m){let S=x/100;c&&(S=S*(c=="-"?-1:1)+l.number/a.doc.lines),x=Math.round(a.doc.lines*S)}else d&&c&&(x=x*(c=="-"?-1:1)+l.number);let y=a.doc.line(Math.max(1,Math.min(a.doc.lines,x))),w=Ae.cursor(y.from+Math.max(0,Math.min(g,y.length)));t.dispatch({effects:[k0.of(!1),Ze.scrollIntoView(w.from,{y:"center"})],selection:w}),t.focus()}return{dom:r}}const k0=Ft.define(),C_=Os.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(k0)&&(t=n.value);return t},provide:t=>H0.from(t,e=>e?iO:null)}),_de=t=>{let e=$0(t,iO);if(!e){let n=[k0.of(!0)];t.state.field(C_,!1)==null&&n.push(Ft.appendConfig.of([C_,Mde])),t.dispatch({effects:n}),e=$0(t,iO)}return e&&e.dom.querySelector("input").select(),!0},Mde=Ze.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"}}}),Ade={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Rde=at.define({combine(t){return qo(t,Ade,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function Dde(t){return[Bde,Lde]}const Pde=kt.mark({class:"cm-selectionMatch"}),zde=kt.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function T_(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=wr.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=wr.Word)}function Ide(t,e,n,r){return t(e.sliceDoc(n,n+1))==wr.Word&&t(e.sliceDoc(r-1,r))==wr.Word}const Lde=Vr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(Rde),{state:n}=t,r=n.selection;if(r.ranges.length>1)return kt.none;let s=r.main,i,a=null;if(s.empty){if(!e.highlightWordAroundCursor)return kt.none;let c=n.wordAt(s.head);if(!c)return kt.none;a=n.charCategorizer(s.head),i=n.sliceDoc(c.from,c.to)}else{let c=s.to-s.from;if(c200)return kt.none;if(e.wholeWords){if(i=n.sliceDoc(s.from,s.to),a=n.charCategorizer(s.head),!(T_(a,n,s.from,s.to)&&Ide(a,n,s.from,s.to)))return kt.none}else if(i=n.sliceDoc(s.from,s.to),!i)return kt.none}let l=[];for(let c of t.visibleRanges){let d=new rf(n.doc,i,c.from,c.to);for(;!d.next().done;){let{from:h,to:m}=d.value;if((!a||T_(a,n,h,m))&&(s.empty&&h<=s.from&&m>=s.to?l.push(zde.range(h,m)):(h>=s.to||m<=s.from)&&l.push(Pde.range(h,m)),l.length>e.maxMatches))return kt.none}}return kt.set(l)}},{decorations:t=>t.decorations}),Bde=Ze.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Fde=({state:t,dispatch:e})=>{let{selection:n}=t,r=Ae.create(n.ranges.map(s=>t.wordAt(s.head)||Ae.cursor(s.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function qde(t,e){let{main:n,ranges:r}=t.selection,s=t.wordAt(n.head),i=s&&s.from==n.from&&s.to==n.to;for(let a=!1,l=new rf(t.doc,e,r[r.length-1].to);;)if(l.next(),l.done){if(a)return null;l=new rf(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),a=!0}else{if(a&&r.some(c=>c.from==l.value.from))continue;if(i){let c=t.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const $de=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(i=>i.from===i.to))return Fde({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(i=>t.sliceDoc(i.from,i.to)!=r))return!1;let s=qde(t,r);return s?(e(t.update({selection:t.selection.addRange(Ae.range(s.from,s.to),!1),effects:Ze.scrollIntoView(s.to)})),!0):!1},Nf=at.define({combine(t){return qo(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new ehe(e),scrollToMatch:e=>Ze.scrollIntoView(e)})}});class B${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||Ede(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,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 Ude(this):new Qde(this)}getCursor(e,n=0,r){let s=e.doc?e:bn.create({doc:e});return r==null&&(r=s.doc.length),this.regexp?bh(this,s,n,r):yh(this,s,n,r)}}class F${constructor(e){this.spec=e}}function yh(t,e,n,r){return new rf(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:s=>s.toLowerCase(),t.wholeWord?Hde(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function Hde(t,e){return(n,r,s,i)=>((i>n||i+s.length=n)return null;s.push(r.value)}return s}highlight(e,n,r,s){let i=yh(this.spec,e,Math.max(0,n-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 bh(t,e,n,r){return new I$(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?Vde(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function Kv(t,e){return t.slice(Ds(t,e,!1),e)}function Zv(t,e){return t.slice(e,Ds(t,e))}function Vde(t){return(e,n,r)=>!r[0].length||(t(Kv(r.input,r.index))!=wr.Word||t(Zv(r.input,r.index))!=wr.Word)&&(t(Zv(r.input,r.index+r[0].length))!=wr.Word||t(Kv(r.input,r.index+r[0].length))!=wr.Word)}class Ude extends F${nextMatch(e,n,r){let s=bh(this.spec,e,r,e.doc.length).next();return s.done&&(s=bh(this.spec,e,0,n).next()),s.done?null:s.value}prevMatchInRange(e,n,r){for(let s=1;;s++){let i=Math.max(n,r-s*1e4),a=bh(this.spec,e,i,r),l=null;for(;!a.next().done;)l=a.value;if(l&&(i==n||l.from>i+10))return l;if(i==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,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=n)return null;s.push(r.value)}return s}highlight(e,n,r,s){let i=bh(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!i.next().done;)s(i.value.from,i.value.to)}}const X0=Ft.define(),O6=Ft.define(),qc=Os.define({create(t){return new X4(aO(t).create(),null)},update(t,e){for(let n of e.effects)n.is(X0)?t=new X4(n.value.create(),t.panel):n.is(O6)&&(t=new X4(t.query,n.value?j6:null));return t},provide:t=>H0.from(t,e=>e.panel)});class X4{constructor(e,n){this.query=e,this.panel=n}}const Wde=kt.mark({class:"cm-searchMatch"}),Gde=kt.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Xde=Vr.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(qc))}update(t){let e=t.state.field(qc);(e!=t.startState.field(qc)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return kt.none;let{view:n}=this,r=new Fl;for(let s=0,i=n.visibleRanges,a=i.length;si[s+1].from-500;)c=i[++s].to;t.highlight(n.state,l,c,(d,h)=>{let m=n.state.selection.ranges.some(g=>g.from==d&&g.to==h);r.add(d,h,m?Gde:Wde)})}return r.finish()}},{decorations:t=>t.decorations});function Xp(t){return e=>{let n=e.state.field(qc,!1);return n&&n.query.spec.valid?t(e,n):H$(e)}}const Jv=Xp((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let s=Ae.single(r.from,r.to),i=t.state.facet(Nf);return t.dispatch({selection:s,effects:[N6(t,r),i.scrollToMatch(s.main,t)],userEvent:"select.search"}),$$(t),!0}),ey=Xp((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,s=e.prevMatch(n,r,r);if(!s)return!1;let i=Ae.single(s.from,s.to),a=t.state.facet(Nf);return t.dispatch({selection:i,effects:[N6(t,s),a.scrollToMatch(i.main,t)],userEvent:"select.search"}),$$(t),!0}),Yde=Xp((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:Ae.create(n.map(r=>Ae.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),Kde=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:s}=n.main,i=[],a=0;for(let l=new rf(t.doc,t.sliceDoc(r,s));!l.next().done;){if(i.length>1e3)return!1;l.value.from==r&&(a=i.length),i.push(Ae.range(l.value.from,l.value.to))}return e(t.update({selection:Ae.create(i,a),userEvent:"select.search.matches"})),!0},E_=Xp((t,{query:e})=>{let{state:n}=t,{from:r,to:s}=n.selection.main;if(n.readOnly)return!1;let i=e.nextMatch(n,r,r);if(!i)return!1;let a=i,l=[],c,d,h=[];a.from==r&&a.to==s&&(d=n.toText(e.getReplacement(a)),l.push({from:a.from,to:a.to,insert:d}),a=e.nextMatch(n,a.from,a.to),h.push(Ze.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let m=t.state.changes(l);return a&&(c=Ae.single(a.from,a.to).map(m),h.push(N6(t,a)),h.push(n.facet(Nf).scrollToMatch(c.main,t))),t.dispatch({changes:m,selection:c,effects:h,userEvent:"input.replace"}),!0}),Zde=Xp((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(s=>{let{from:i,to:a}=s;return{from:i,to:a,insert:e.getReplacement(s)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:Ze.announce.of(r),userEvent:"input.replace.all"}),!0});function j6(t){return t.state.facet(Nf).createPanel(t)}function aO(t,e){var n,r,s,i,a;let l=t.selection.main,c=l.empty||l.to>l.from+100?"":t.sliceDoc(l.from,l.to);if(e&&!c)return e;let d=t.facet(Nf);return new B$({search:((n=e?.literal)!==null&&n!==void 0?n:d.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(r=e?.caseSensitive)!==null&&r!==void 0?r:d.caseSensitive,literal:(s=e?.literal)!==null&&s!==void 0?s:d.literal,regexp:(i=e?.regexp)!==null&&i!==void 0?i:d.regexp,wholeWord:(a=e?.wholeWord)!==null&&a!==void 0?a:d.wholeWord})}function q$(t){let e=$0(t,j6);return e&&e.dom.querySelector("[main-field]")}function $$(t){let e=q$(t);e&&e==t.root.activeElement&&e.select()}const H$=t=>{let e=t.state.field(qc,!1);if(e&&e.panel){let n=q$(t);if(n&&n!=t.root.activeElement){let r=aO(t.state,e.query.spec);r.valid&&t.dispatch({effects:X0.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[O6.of(!0),e?X0.of(aO(t.state,e.query.spec)):Ft.appendConfig.of(nhe)]});return!0},Q$=t=>{let e=t.state.field(qc,!1);if(!e||!e.panel)return!1;let n=$0(t,j6);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:O6.of(!1)}),!0},Jde=[{key:"Mod-f",run:H$,scope:"editor search-panel"},{key:"F3",run:Jv,shift:ey,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Jv,shift:ey,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Q$,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Kde},{key:"Mod-Alt-g",run:_de},{key:"Mod-d",run:$de,preventDefault:!0}];class ehe{constructor(e){this.view=e;let n=this.query=e.state.field(qc).query.spec;this.commit=this.commit.bind(this),this.searchField=sr("input",{value:n.search,placeholder:Li(e,"Find"),"aria-label":Li(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=sr("input",{value:n.replace,placeholder:Li(e,"Replace"),"aria-label":Li(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=sr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=sr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=sr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(s,i,a){return sr("button",{class:"cm-button",name:s,onclick:i,type:"button"},a)}this.dom=sr("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,r("next",()=>Jv(e),[Li(e,"next")]),r("prev",()=>ey(e),[Li(e,"previous")]),r("select",()=>Yde(e),[Li(e,"all")]),sr("label",null,[this.caseField,Li(e,"match case")]),sr("label",null,[this.reField,Li(e,"regexp")]),sr("label",null,[this.wordField,Li(e,"by word")]),...e.state.readOnly?[]:[sr("br"),this.replaceField,r("replace",()=>E_(e),[Li(e,"replace")]),r("replaceAll",()=>Zde(e),[Li(e,"replace all")])],sr("button",{name:"close",onclick:()=>Q$(e),"aria-label":Li(e,"close"),type:"button"},["×"])])}commit(){let e=new B$({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:X0.of(e)}))}keydown(e){ile(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?ey:Jv)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),E_(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(X0)&&!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(Nf).top}}function Li(t,e){return t.state.phrase(e)}const g1=30,x1=/[\s\.,:;?!]/;function N6(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),s=t.state.doc.lineAt(n).to,i=Math.max(r.from,e-g1),a=Math.min(s,n+g1),l=t.state.sliceDoc(i,a);if(i!=r.from){for(let c=0;cl.length-g1;c--)if(!x1.test(l[c-1])&&x1.test(l[c])){l=l.slice(0,c);break}}return Ze.announce.of(`${t.state.phrase("current match")}. ${l} ${t.state.phrase("on line")} ${r.number}.`)}const the=Ze.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"}}),nhe=[qc,ou.low(Xde),the];class V${constructor(e,n,r,s){this.state=e,this.pos=n,this.explicit=r,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=ws(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),s=n.text.slice(r-n.from,this.pos-n.from),i=s.search(W$(e,!1));return i<0?null:{from:r+i,to:this.pos,text:s.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function __(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function rhe(t){let e=Object.create(null),n=Object.create(null);for(let{label:s}of t){e[s[0]]=!0;for(let i=1;itypeof s=="string"?{label:s}:s),[n,r]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:rhe(e);return s=>{let i=s.matchBefore(r);return i||s.explicit?{from:i?i.from:s.pos,options:e,validFor:n}:null}}function she(t,e){return n=>{for(let r=ws(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}let M_=class{constructor(e,n,r,s){this.completion=e,this.source=n,this.match=r,this.score=s}};function ed(t){return t.selection.main.from}function W$(t,e){var n;let{source:r}=t,s=e&&r[0]!="^",i=r[r.length-1]!="$";return!s&&!i?t:new RegExp(`${s?"^":""}(?:${r})${i?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}const C6=Fo.define();function ihe(t,e,n,r){let{main:s}=t.selection,i=n-s.from,a=r-s.from;return{...t.changeByRange(l=>{if(l!=s&&n!=r&&t.sliceDoc(l.from+i,l.from+a)!=t.sliceDoc(n,r))return{range:l};let c=t.toText(e);return{changes:{from:l.from+i,to:r==s.from?l.to:l.from+a,insert:c},range:Ae.cursor(l.from+i+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const A_=new WeakMap;function ahe(t){if(!Array.isArray(t))return t;let e=A_.get(t);return e||A_.set(t,e=U$(t)),e}const ty=Ft.define(),Y0=Ft.define();class ohe{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&E<=57||E>=97&&E<=122?2:E>=65&&E<=90?1:0:(_=Gj(E))!=_.toLowerCase()?1:_!=_.toUpperCase()?2:0;(!j||M==1&&S||T==0&&M!=0)&&(n[m]==E||r[m]==E&&(g=!0)?a[m++]=j:a.length&&(k=!1)),T=M,j+=wo(E)}return m==c&&a[0]==0&&k?this.result(-100+(g?-200:0),a,e):x==c&&y==0?this.ret(-200-e.length+(w==e.length?0:-100),[0,w]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):x==c?this.ret(-900-e.length,[y,w]):m==c?this.result(-100+(g?-200:0)+-700+(k?0:-1100),a,e):n.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,n,r){let s=[],i=0;for(let a of n){let l=a+(this.astral?wo(gi(r,a)):1);i&&s[i-1]==a?s[i-1]=l:(s[i++]=a,s[i++]=l)}return this.ret(e-r.length,s)}}class lhe{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:che,filterStrict:!1,compareCompletions:(e,n)=>e.label.localeCompare(n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>R_(e(r),n(r)),optionClass:(e,n)=>r=>R_(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function R_(t,e){return t?e?t+" "+e:t:e}function che(t,e,n,r,s,i){let a=t.textDirection==gr.RTL,l=a,c=!1,d="top",h,m,g=e.left-s.left,x=s.right-e.right,y=r.right-r.left,w=r.bottom-r.top;if(l&&g=w||j>e.top?h=n.bottom-e.top:(d="bottom",h=e.bottom-n.top)}let S=(e.bottom-e.top)/i.offsetHeight,k=(e.right-e.left)/i.offsetWidth;return{style:`${d}: ${h/S}px; max-width: ${m/k}px`,class:"cm-completionInfo-"+(c?a?"left-narrow":"right-narrow":l?"left":"right")}}function uhe(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,s,i){let a=document.createElement("span");a.className="cm-completionLabel";let l=n.displayLabel||n.label,c=0;for(let d=0;dc&&a.appendChild(document.createTextNode(l.slice(c,h)));let g=a.appendChild(document.createElement("span"));g.appendChild(document.createTextNode(l.slice(h,m))),g.className="cm-completionMatchedText",c=m}return cn.position-r.position).map(n=>n.render)}function Y4(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let s=Math.floor(e/n);return{from:s*n,to:(s+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}class dhe{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let s=e.state.field(n),{options:i,selected:a}=s.open,l=e.state.facet(ys);this.optionContent=uhe(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=Y4(i.length,a,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",c=>{let{options:d}=e.state.field(n).open;for(let h=c.target,m;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(m=/-(\d+)$/.exec(h.id))&&+m[1]{let d=e.state.field(this.stateField,!1);d&&d.tooltip&&e.state.facet(ys).closeOnBlur&&c.relatedTarget!=e.contentDOM&&e.dispatch({effects:Y0.of(null)})}),this.showOptions(i,s.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),s=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=s){let{options:i,selected:a,disabled:l}=r.open;(!s.open||s.open.options!=i)&&(this.range=Y4(i.length,a,e.state.facet(ys).maxRenderedOptions),this.showOptions(i,r.id)),this.updateSel(),l!=((n=s.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;(n.selected>-1&&n.selected=this.range.to)&&(this.range=Y4(n.options.length,n.selected,this.view.state.facet(ys).maxRenderedOptions),this.showOptions(n.options,e.id));let r=this.updateSelectedOption(n.selected);if(r){this.destroyInfo();let{completion:s}=n.options[n.selected],{info:i}=s;if(!i)return;let a=typeof i=="string"?document.createTextNode(i):i(s);if(!a)return;"then"in a?a.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,s)}).catch(l=>vi(this.view.state,l,"completion info")):(this.addInfoPane(a,s),r.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,n){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 n=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"),n=r):r.hasAttribute("aria-selected")&&(r.removeAttribute("aria-selected"),r.removeAttribute("aria-describedby"));return n&&fhe(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),i=this.space;if(!i){let a=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:a.clientWidth,bottom:a.clientHeight}}return s.top>Math.min(i.bottom,n.bottom)-10||s.bottom{a.target==s&&a.preventDefault()});let i=null;for(let a=r.from;ar.from||r.from==0))if(i=g,typeof d!="string"&&d.header)s.appendChild(d.header(d));else{let x=s.appendChild(document.createElement("completion-section"));x.textContent=g}}const h=s.appendChild(document.createElement("li"));h.id=n+"-"+a,h.setAttribute("role","option");let m=this.optionClass(l);m&&(h.className=m);for(let g of this.optionContent){let x=g(l,this.view.state,this.view,c);x&&h.appendChild(x)}}return r.from&&s.classList.add("cm-completionListIncompleteTop"),r.tonew dhe(n,t,e)}function fhe(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),s=n.height/t.offsetHeight;r.topn.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/s)}function D_(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function mhe(t,e){let n=[],r=null,s=null,i=h=>{n.push(h);let{section:m}=h.completion;if(m){r||(r=[]);let g=typeof m=="string"?m:m.name;r.some(x=>x.name==g)||r.push(typeof m=="string"?{name:g}:m)}},a=e.facet(ys);for(let h of t)if(h.hasResult()){let m=h.result.getMatch;if(h.result.filter===!1)for(let g of h.result.options)i(new M_(g,h.source,m?m(g):[],1e9-n.length));else{let g=e.sliceDoc(h.from,h.to),x,y=a.filterStrict?new lhe(g):new ohe(g);for(let w of h.result.options)if(x=y.match(w.label)){let S=w.displayLabel?m?m(w,x.matched):[]:x.matched,k=x.score+(w.boost||0);if(i(new M_(w,h.source,S,k)),typeof w.section=="object"&&w.section.rank==="dynamic"){let{name:j}=w.section;s||(s=Object.create(null)),s[j]=Math.max(k,s[j]||-1e9)}}}}if(r){let h=Object.create(null),m=0,g=(x,y)=>(x.rank==="dynamic"&&y.rank==="dynamic"?s[y.name]-s[x.name]:0)||(typeof x.rank=="number"?x.rank:1e9)-(typeof y.rank=="number"?y.rank:1e9)||(x.nameg.score-m.score||d(m.completion,g.completion))){let m=h.completion;!c||c.label!=m.label||c.detail!=m.detail||c.type!=null&&m.type!=null&&c.type!=m.type||c.apply!=m.apply||c.boost!=m.boost?l.push(h):D_(h.completion)>D_(c)&&(l[l.length-1]=h),c=h.completion}return l}class Th{constructor(e,n,r,s,i,a){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=s,this.selected=i,this.disabled=a}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new Th(this.options,P_(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,s,i,a){if(s&&!a&&e.some(d=>d.isPending))return s.setDisabled();let l=mhe(e,n);if(!l.length)return s&&e.some(d=>d.isPending)?s.setDisabled():null;let c=n.facet(ys).selectOnOpen?0:-1;if(s&&s.selected!=c&&s.selected!=-1){let d=s.options[s.selected].completion;for(let h=0;hh.hasResult()?Math.min(d,h.from):d,1e8),create:bhe,above:i.aboveCursor},s?s.timestamp:Date.now(),c,!1)}map(e){return new Th(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Th(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class ny{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new ny(vhe,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(ys),i=(r.override||n.languageDataAt("autocomplete",ed(n)).map(ahe)).map(c=>(this.active.find(h=>h.source==c)||new ba(c,this.active.some(h=>h.state!=0)?1:0)).update(e,r));i.length==this.active.length&&i.every((c,d)=>c==this.active[d])&&(i=this.active);let a=this.open,l=e.effects.some(c=>c.is(T6));a&&e.docChanged&&(a=a.map(e.changes)),e.selection||i.some(c=>c.hasResult()&&e.changes.touchesRange(c.from,c.to))||!phe(i,this.active)||l?a=Th.build(i,n,this.id,a,r,l):a&&a.disabled&&!i.some(c=>c.isPending)&&(a=null),!a&&i.every(c=>!c.isPending)&&i.some(c=>c.hasResult())&&(i=i.map(c=>c.hasResult()?new ba(c.source,0):c));for(let c of e.effects)c.is(X$)&&(a=a&&a.setSelected(c.value,this.id));return i==this.active&&a==this.open?this:new ny(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?ghe:xhe}}function phe(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n-1&&(n["aria-activedescendant"]=t+"-"+e),n}const vhe=[];function G$(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(C6);if(r&&e.activateOnCompletion(r))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class ba{constructor(e,n,r=!1){this.source=e,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,n){let r=G$(e,n),s=this;(r&8||r&16&&this.touches(e))&&(s=new ba(s.source,0)),r&4&&s.state==0&&(s=new ba(this.source,1)),s=s.updateFor(e,r);for(let i of e.effects)if(i.is(ty))s=new ba(s.source,1,i.value);else if(i.is(Y0))s=new ba(s.source,0);else if(i.is(T6))for(let a of i.value)a.source==s.source&&(s=a);return s}updateFor(e,n){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(ed(e.state))}}class Lh extends ba{constructor(e,n,r,s,i,a){super(e,3,n),this.limit=r,this.result=s,this.from=i,this.to=a}hasResult(){return!0}updateFor(e,n){var r;if(!(n&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),a=e.changes.mapPos(this.to,1),l=ed(e.state);if(l>a||!s||n&2&&(ed(e.startState)==this.from||ln.map(e))}}),X$=Ft.define(),xi=Os.define({create(){return ny.start()},update(t,e){return t.update(e)},provide:t=>[l6.from(t,e=>e.tooltip),Ze.contentAttributes.from(t,e=>e.attrs)]});function E6(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(xi).active.find(s=>s.source==e.source);return r instanceof Lh?(typeof n=="string"?t.dispatch({...ihe(t.state,n,r.from,r.to),annotations:C6.of(e.completion)}):n(t,e.completion,r.from,r.to),!0):!1}const bhe=hhe(xi,E6);function v1(t,e="option"){return n=>{let r=n.state.field(xi,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp-1?r.open.selected+s*(t?1:-1):t?0:a-1;return l<0?l=e=="page"?0:a-1:l>=a&&(l=e=="page"?a-1:0),n.dispatch({effects:X$.of(l)}),!0}}const whe=t=>{let e=t.state.field(xi,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(xi,!1)?(t.dispatch({effects:ty.of(!0)}),!0):!1,She=t=>{let e=t.state.field(xi,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:Y0.of(null)}),!0)};class khe{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const Ohe=50,jhe=1e3,Nhe=Vr.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(xi).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(xi),n=t.state.facet(ys);if(!t.selectionSet&&!t.docChanged&&t.startState.field(xi)==e)return;let r=t.transactions.some(i=>{let a=G$(i,n);return a&8||(i.selection||i.docChanged)&&!(a&3)});for(let i=0;iOhe&&Date.now()-a.time>jhe){for(let l of a.context.abortListeners)try{l()}catch(c){vi(this.view.state,c)}a.context.abortListeners=null,this.running.splice(i--,1)}else a.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(i=>i.effects.some(a=>a.is(ty)))&&(this.pendingStart=!0);let s=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(i=>i.isPending&&!this.running.some(a=>a.active.source==i.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let i of t.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:t}=this.view,e=t.field(xi);for(let n of e.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ys).updateSyncTime))}startQuery(t){let{state:e}=this.view,n=ed(e),r=new V$(e,n,t.explicit,this.view),s=new khe(t,r);this.running.push(s),Promise.resolve(t.source(r)).then(i=>{s.context.aborted||(s.done=i||null,this.scheduleAccept())},i=>{this.view.dispatch({effects:Y0.of(null)}),vi(this.view.state,i)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ys).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(ys),r=this.view.state.field(xi);for(let s=0;sl.source==i.active.source);if(a&&a.isPending)if(i.done==null){let l=new ba(i.active.source,0);for(let c of i.updates)l=l.update(c,n);l.isPending||e.push(l)}else this.startQuery(a)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:T6.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(xi,!1);if(e&&e.tooltip&&this.view.state.facet(ys).closeOnBlur){let n=e.open&&kq(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Y0.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:ty.of(!1)}),20),this.composing=0}}}),Che=typeof navigator=="object"&&/Win/.test(navigator.platform),The=ou.highest(Ze.domEventHandlers({keydown(t,e){let n=e.state.field(xi,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(Che&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],s=n.active.find(a=>a.source==r.source),i=r.completion.commitCharacters||s.result.commitCharacters;return i&&i.indexOf(t.key)>-1&&E6(e,r),!1}})),Y$=Ze.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 Ehe{constructor(e,n,r,s){this.field=e,this.line=n,this.from=r,this.to=s}}class _6{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,Rs.TrackDel),r=e.mapPos(this.to,1,Rs.TrackDel);return n==null||r==null?null:new _6(this.field,n,r)}}class M6{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],s=[n],i=e.doc.lineAt(n),a=/^\s*/.exec(i.text)[0];for(let c of this.lines){if(r.length){let d=a,h=/^\t*/.exec(c)[0].length;for(let m=0;mnew _6(c.field,s[c.line]+c.from,s[c.line]+c.to));return{text:r,ranges:l}}static parse(e){let n=[],r=[],s=[],i;for(let a of e.split(/\r\n?|\n/)){for(;i=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(a);){let l=i[1]?+i[1]:null,c=i[2]||i[3]||"",d=-1,h=c.replace(/\\[{}]/g,m=>m[1]);for(let m=0;m=d&&g.field++}for(let m of s)if(m.line==r.length&&m.from>i.index){let g=i[2]?3+(i[1]||"").length:2;m.from-=g,m.to-=g}s.push(new Ehe(d,r.length,i.index,i.index+h.length)),a=a.slice(0,i.index)+c+a.slice(i.index+i[0].length)}a=a.replace(/\\([{}])/g,(l,c,d)=>{for(let h of s)h.line==r.length&&h.from>d&&(h.from--,h.to--);return c}),r.push(a)}return new M6(r,s)}}let _he=kt.widget({widget:new class extends $o{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),Mhe=kt.mark({class:"cm-snippetField"});class Cf{constructor(e,n){this.ranges=e,this.active=n,this.deco=kt.set(e.map(r=>(r.from==r.to?_he:Mhe).range(r.from,r.to)),!0)}map(e){let n=[];for(let r of this.ranges){let s=r.map(e);if(!s)return null;n.push(s)}return new Cf(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const Yp=Ft.define({map(t,e){return t&&t.map(e)}}),Ahe=Ft.define(),K0=Os.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(Yp))return n.value;if(n.is(Ahe)&&t)return new Cf(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>Ze.decorations.from(t,e=>e?e.deco:kt.none)});function A6(t,e){return Ae.create(t.filter(n=>n.field==e).map(n=>Ae.range(n.from,n.to)))}function Rhe(t){let e=M6.parse(t);return(n,r,s,i)=>{let{text:a,ranges:l}=e.instantiate(n.state,s),{main:c}=n.state.selection,d={changes:{from:s,to:i==c.from?c.to:i,insert:jn.of(a)},scrollIntoView:!0,annotations:r?[C6.of(r),ns.userEvent.of("input.complete")]:void 0};if(l.length&&(d.selection=A6(l,0)),l.some(h=>h.field>0)){let h=new Cf(l,0),m=d.effects=[Yp.of(h)];n.state.field(K0,!1)===void 0&&m.push(Ft.appendConfig.of([K0,Lhe,Bhe,Y$]))}n.dispatch(n.state.update(d))}}function K$(t){return({state:e,dispatch:n})=>{let r=e.field(K0,!1);if(!r||t<0&&r.active==0)return!1;let s=r.active+t,i=t>0&&!r.ranges.some(a=>a.field==s+t);return n(e.update({selection:A6(r.ranges,s),effects:Yp.of(i?null:new Cf(r.ranges,s)),scrollIntoView:!0})),!0}}const Dhe=({state:t,dispatch:e})=>t.field(K0,!1)?(e(t.update({effects:Yp.of(null)})),!0):!1,Phe=K$(1),zhe=K$(-1),Ihe=[{key:"Tab",run:Phe,shift:zhe},{key:"Escape",run:Dhe}],z_=at.define({combine(t){return t.length?t[0]:Ihe}}),Lhe=ou.highest(Hp.compute([z_],t=>t.facet(z_)));function xl(t,e){return{...e,apply:Rhe(t)}}const Bhe=Ze.domEventHandlers({mousedown(t,e){let n=e.state.field(K0,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let s=n.ranges.find(i=>i.from<=r&&i.to>=r);return!s||s.field==n.active?!1:(e.dispatch({selection:A6(n.ranges,s.field),effects:Yp.of(n.ranges.some(i=>i.field>s.field)?new Cf(n.ranges,s.field):null),scrollIntoView:!0}),!0)}}),Z0={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Vu=Ft.define({map(t,e){let n=e.mapPos(t,-1,Rs.TrackAfter);return n??void 0}}),R6=new class extends sd{};R6.startSide=1;R6.endSide=-1;const Z$=Os.define({create(){return Rn.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(Vu)&&(t=t.update({add:[R6.range(n.value,n.value+1)]}));return t}});function Fhe(){return[$he,Z$]}const Z4="()[]{}<>«»»«[]{}";function J$(t){for(let e=0;e{if((qhe?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let s=t.state.selection.main;if(r.length>2||r.length==2&&wo(gi(r,0))==1||e!=s.from||n!=s.to)return!1;let i=Vhe(t.state,r);return i?(t.dispatch(i),!0):!1}),Hhe=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=eH(t,t.selection.main.head).brackets||Z0.brackets,s=null,i=t.changeByRange(a=>{if(a.empty){let l=Uhe(t.doc,a.head);for(let c of r)if(c==l&&mb(t.doc,a.head)==J$(gi(c,0)))return{changes:{from:a.head-c.length,to:a.head+c.length},range:Ae.cursor(a.head-c.length)}}return{range:s=a}});return s||e(t.update(i,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},Qhe=[{key:"Backspace",run:Hhe}];function Vhe(t,e){let n=eH(t,t.selection.main.head),r=n.brackets||Z0.brackets;for(let s of r){let i=J$(gi(s,0));if(e==s)return i==s?Xhe(t,s,r.indexOf(s+s+s)>-1,n):Whe(t,s,i,n.before||Z0.before);if(e==i&&tH(t,t.selection.main.from))return Ghe(t,s,i)}return null}function tH(t,e){let n=!1;return t.field(Z$).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function mb(t,e){let n=t.sliceString(e,e+2);return n.slice(0,wo(gi(n,0)))}function Uhe(t,e){let n=t.sliceString(e-2,e);return wo(gi(n,0))==n.length?n:n.slice(1)}function Whe(t,e,n,r){let s=null,i=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:n,from:a.to}],effects:Vu.of(a.to+e.length),range:Ae.range(a.anchor+e.length,a.head+e.length)};let l=mb(t.doc,a.head);return!l||/\s/.test(l)||r.indexOf(l)>-1?{changes:{insert:e+n,from:a.head},effects:Vu.of(a.head+e.length),range:Ae.cursor(a.head+e.length)}:{range:s=a}});return s?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function Ghe(t,e,n){let r=null,s=t.changeByRange(i=>i.empty&&mb(t.doc,i.head)==n?{changes:{from:i.head,to:i.head+n.length,insert:n},range:Ae.cursor(i.head+n.length)}:r={range:i});return r?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Xhe(t,e,n,r){let s=r.stringPrefixes||Z0.stringPrefixes,i=null,a=t.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:Vu.of(l.to+e.length),range:Ae.range(l.anchor+e.length,l.head+e.length)};let c=l.head,d=mb(t.doc,c),h;if(d==e){if(I_(t,c))return{changes:{insert:e+e,from:c},effects:Vu.of(c+e.length),range:Ae.cursor(c+e.length)};if(tH(t,c)){let g=n&&t.sliceDoc(c,c+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:c,to:c+g.length,insert:g},range:Ae.cursor(c+g.length)}}}else{if(n&&t.sliceDoc(c-2*e.length,c)==e+e&&(h=L_(t,c-2*e.length,s))>-1&&I_(t,h))return{changes:{insert:e+e+e+e,from:c},effects:Vu.of(c+e.length),range:Ae.cursor(c+e.length)};if(t.charCategorizer(c)(d)!=wr.Word&&L_(t,c,s)>-1&&!Yhe(t,c,e,s))return{changes:{insert:e+e,from:c},effects:Vu.of(c+e.length),range:Ae.cursor(c+e.length)}}return{range:i=l}});return i?null:t.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function I_(t,e){let n=ws(t).resolveInner(e+1);return n.parent&&n.from==e}function Yhe(t,e,n,r){let s=ws(t).resolveInner(e,-1),i=r.reduce((a,l)=>Math.max(a,l.length),0);for(let a=0;a<5;a++){let l=t.sliceDoc(s.from,Math.min(s.to,s.from+n.length+i)),c=l.indexOf(n);if(!c||c>-1&&r.indexOf(l.slice(0,c))>-1){let h=s.firstChild;for(;h&&h.from==s.from&&h.to-h.from>n.length+c;){if(t.sliceDoc(h.to-n.length,h.to)==n)return!1;h=h.firstChild}return!0}let d=s.to==e&&s.parent;if(!d)break;s=d}return!1}function L_(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=wr.Word)return e;for(let s of n){let i=e-s.length;if(t.sliceDoc(i,e)==s&&r(t.sliceDoc(i-1,i))!=wr.Word)return i}return-1}function Khe(t={}){return[The,xi,ys.of(t),Nhe,Zhe,Y$]}const nH=[{key:"Ctrl-Space",run:K4},{mac:"Alt-`",run:K4},{mac:"Alt-i",run:K4},{key:"Escape",run:She},{key:"ArrowDown",run:v1(!0)},{key:"ArrowUp",run:v1(!1)},{key:"PageDown",run:v1(!0,"page")},{key:"PageUp",run:v1(!1,"page")},{key:"Enter",run:whe}],Zhe=ou.highest(Hp.computeN([ys],t=>t.facet(ys).defaultKeymap?[nH]:[]));class B_{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class qu{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let s=r.facet(J0).markerFilter;s&&(e=s(e,r));let i=e.slice().sort((x,y)=>x.from-y.from||x.to-y.to),a=new Fl,l=[],c=0,d=r.doc.iter(),h=0,m=r.doc.length;for(let x=0;;){let y=x==i.length?null:i[x];if(!y&&!l.length)break;let w,S;if(l.length)w=c,S=l.reduce((N,T)=>Math.min(N,T.to),y&&y.from>w?y.from:1e8);else{if(w=y.from,w>m)break;S=y.to,l.push(y),x++}for(;xN.from||N.to==w))l.push(N),x++,S=Math.min(N.to,S);else{S=Math.min(N.from,S);break}}S=Math.min(S,m);let k=!1;if(l.some(N=>N.from==w&&(N.to==S||S==m))&&(k=w==S,!k&&S-w<10)){let N=w-(h+d.value.length);N>0&&(d.next(N),h=w);for(let T=w;;){if(T>=S){k=!0;break}if(!d.lineBreak&&h+d.value.length>T)break;T=h+d.value.length,h+=d.value.length,d.next()}}let j=dfe(l);if(k)a.add(w,w,kt.widget({widget:new ofe(j),diagnostics:l.slice()}));else{let N=l.reduce((T,E)=>E.markClass?T+" "+E.markClass:T,"");a.add(w,S,kt.mark({class:"cm-lintRange cm-lintRange-"+j+N,diagnostics:l.slice(),inclusiveEnd:l.some(T=>T.to>S)}))}if(c=S,c==m)break;for(let N=0;N{if(!(e&&a.diagnostics.indexOf(e)<0))if(!r)r=new B_(s,i,e||a.diagnostics[0]);else{if(a.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new B_(r.from,i,r.diagnostic)}}),r}function Jhe(t,e){let n=e.pos,r=e.end||n,s=t.state.facet(J0).hideOn(t,n,r);if(s!=null)return s;let i=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(a=>a.is(rH))||t.changes.touchesRange(i.from,Math.max(i.to,r)))}function efe(t,e){return t.field(Vi,!1)?e:e.concat(Ft.appendConfig.of(hfe))}const rH=Ft.define(),D6=Ft.define(),sH=Ft.define(),Vi=Os.define({create(){return new qu(kt.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),r=null,s=t.panel;if(t.selected){let i=e.changes.mapPos(t.selected.from,1);r=sf(n,t.selected.diagnostic,i)||sf(n,null,i)}!n.size&&s&&e.state.facet(J0).autoPanel&&(s=null),t=new qu(n,s,r)}for(let n of e.effects)if(n.is(rH)){let r=e.state.facet(J0).autoPanel?n.value.length?ep.open:null:t.panel;t=qu.init(n.value,r,e.state)}else n.is(D6)?t=new qu(t.diagnostics,n.value?ep.open:null,t.selected):n.is(sH)&&(t=new qu(t.diagnostics,t.panel,n.value));return t},provide:t=>[H0.from(t,e=>e.panel),Ze.decorations.from(t,e=>e.diagnostics)]}),tfe=kt.mark({class:"cm-lintRange cm-lintRange-active"});function nfe(t,e,n){let{diagnostics:r}=t.state.field(Vi),s,i=-1,a=-1;r.between(e-(n<0?1:0),e+(n>0?1:0),(c,d,{spec:h})=>{if(e>=c&&e<=d&&(c==d||(e>c||n>0)&&(eaH(t,n,!1)))}const sfe=t=>{let e=t.state.field(Vi,!1);(!e||!e.panel)&&t.dispatch({effects:efe(t.state,[D6.of(!0)])});let n=$0(t,ep.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},F_=t=>{let e=t.state.field(Vi,!1);return!e||!e.panel?!1:(t.dispatch({effects:D6.of(!1)}),!0)},ife=t=>{let e=t.state.field(Vi,!1);if(!e)return!1;let n=t.state.selection.main,r=e.diagnostics.iter(n.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(t.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},afe=[{key:"Mod-Shift-m",run:sfe,preventDefault:!0},{key:"F8",run:ife}],J0=at.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...qo(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:q_,tooltipFilter:q_,needsRefresh:(e,n)=>e?n?r=>e(r)||n(r):e:n,hideOn:(e,n)=>e?n?(r,s,i)=>e(r,s,i)||n(r,s,i):e:n,autoPanel:(e,n)=>e||n})}}});function q_(t,e){return t?e?(n,r)=>e(t(n,r),r):t:e}function iH(t){let e=[];if(t)e:for(let{name:n}of t){for(let r=0;ri.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function aH(t,e,n){var r;let s=n?iH(e.actions):[];return sr("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},sr("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((i,a)=>{let l=!1,c=x=>{if(x.preventDefault(),l)return;l=!0;let y=sf(t.state.field(Vi).diagnostics,e);y&&i.apply(t,y.from,y.to)},{name:d}=i,h=s[a]?d.indexOf(s[a]):-1,m=h<0?d:[d.slice(0,h),sr("u",d.slice(h,h+1)),d.slice(h+1)],g=i.markClass?" "+i.markClass:"";return sr("button",{type:"button",class:"cm-diagnosticAction"+g,onclick:c,onmousedown:c,"aria-label":` Action: ${d}${h<0?"":` (access key "${s[a]})"`}.`},m)}),e.source&&sr("div",{class:"cm-diagnosticSource"},e.source))}class ofe extends $o{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return sr("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class $_{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=aH(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class ep{constructor(e){this.view=e,this.items=[];let n=s=>{if(s.keyCode==27)F_(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],a=iH(i.actions);for(let l=0;l{for(let i=0;iF_(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Vi).selected;if(!e)return-1;for(let n=0;n{for(let h of d.diagnostics){if(a.has(h))continue;a.add(h);let m=-1,g;for(let x=r;xr&&(this.items.splice(r,m-r),s=!0)),n&&g.diagnostic==n.diagnostic?g.dom.hasAttribute("aria-selected")||(g.dom.setAttribute("aria-selected","true"),i=g):g.dom.hasAttribute("aria-selected")&&g.dom.removeAttribute("aria-selected"),r++}});r({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:c})=>{let d=c.height/this.list.offsetHeight;l.topc.bottom&&(this.list.scrollTop+=(l.bottom-c.bottom)/d)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function n(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)n();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(Vi),r=sf(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:sH.of(r)})}static open(e){return new ep(e)}}function lfe(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function y1(t){return lfe(``,'width="6" height="3"')}const cfe=Ze.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:y1("#d11")},".cm-lintRange-warning":{backgroundImage:y1("orange")},".cm-lintRange-info":{backgroundImage:y1("#999")},".cm-lintRange-hint":{backgroundImage:y1("#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 ufe(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function dfe(t){let e="hint",n=1;for(let r of t){let s=ufe(r.severity);s>n&&(n=s,e=r.severity)}return e}const hfe=[Vi,Ze.decorations.compute([Vi],t=>{let{selected:e,panel:n}=t.field(Vi);return!e||!n||e.from==e.to?kt.none:kt.set([tfe.range(e.from,e.to)])}),Wle(nfe,{hideOn:Jhe}),cfe];var H_=function(e){e===void 0&&(e={});var{crosshairCursor:n=!1}=e,r=[];e.closeBracketsKeymap!==!1&&(r=r.concat(Qhe)),e.defaultKeymap!==!1&&(r=r.concat(Cde)),e.searchKeymap!==!1&&(r=r.concat(Jde)),e.historyKeymap!==!1&&(r=r.concat(Due)),e.foldKeymap!==!1&&(r=r.concat(Qce)),e.completionKeymap!==!1&&(r=r.concat(nH)),e.lintKeymap!==!1&&(r=r.concat(afe));var s=[];return e.lineNumbers!==!1&&s.push(sce()),e.highlightActiveLineGutter!==!1&&s.push(oce()),e.highlightSpecialChars!==!1&&s.push(Sle()),e.history!==!1&&s.push(jue()),e.foldGutter!==!1&&s.push(Gce()),e.drawSelection!==!1&&s.push(dle()),e.dropCursor!==!1&&s.push(gle()),e.allowMultipleSelections!==!1&&s.push(bn.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&s.push(Pce()),e.syntaxHighlighting!==!1&&s.push(Wq(Zce,{fallback:!0})),e.bracketMatching!==!1&&s.push(iue()),e.closeBrackets!==!1&&s.push(Fhe()),e.autocompletion!==!1&&s.push(Khe()),e.rectangularSelection!==!1&&s.push(zle()),n!==!1&&s.push(Ble()),e.highlightActiveLine!==!1&&s.push(Tle()),e.highlightSelectionMatches!==!1&&s.push(Dde()),e.tabSize&&typeof e.tabSize=="number"&&s.push(Vp.of(" ".repeat(e.tabSize))),s.concat([Hp.of(r.flat())]).filter(Boolean)};const ffe="#e5c07b",Q_="#e06c75",mfe="#56b6c2",pfe="#ffffff",fv="#abb2bf",oO="#7d8799",gfe="#61afef",xfe="#98c379",V_="#d19a66",vfe="#c678dd",yfe="#21252b",U_="#2c313a",W_="#282c34",J4="#353a42",bfe="#3E4451",G_="#528bff",wfe=Ze.theme({"&":{color:fv,backgroundColor:W_},".cm-content":{caretColor:G_},".cm-cursor, .cm-dropCursor":{borderLeftColor:G_},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:bfe},".cm-panels":{backgroundColor:yfe,color:fv},".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:W_,color:oO,border:"none"},".cm-activeLineGutter":{backgroundColor:U_},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:J4},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:J4,borderBottomColor:J4},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:U_,color:fv}}},{dark:!0}),Sfe=Wp.define([{tag:xe.keyword,color:vfe},{tag:[xe.name,xe.deleted,xe.character,xe.propertyName,xe.macroName],color:Q_},{tag:[xe.function(xe.variableName),xe.labelName],color:gfe},{tag:[xe.color,xe.constant(xe.name),xe.standard(xe.name)],color:V_},{tag:[xe.definition(xe.name),xe.separator],color:fv},{tag:[xe.typeName,xe.className,xe.number,xe.changed,xe.annotation,xe.modifier,xe.self,xe.namespace],color:ffe},{tag:[xe.operator,xe.operatorKeyword,xe.url,xe.escape,xe.regexp,xe.link,xe.special(xe.string)],color:mfe},{tag:[xe.meta,xe.comment],color:oO},{tag:xe.strong,fontWeight:"bold"},{tag:xe.emphasis,fontStyle:"italic"},{tag:xe.strikethrough,textDecoration:"line-through"},{tag:xe.link,color:oO,textDecoration:"underline"},{tag:xe.heading,fontWeight:"bold",color:Q_},{tag:[xe.atom,xe.bool,xe.special(xe.variableName)],color:V_},{tag:[xe.processingInstruction,xe.string,xe.inserted],color:xfe},{tag:xe.invalid,color:pfe}]),oH=[wfe,Wq(Sfe)];var kfe=Ze.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),Ofe=function(e){e===void 0&&(e={});var{indentWithTab:n=!0,editable:r=!0,readOnly:s=!1,theme:i="light",placeholder:a="",basicSetup:l=!0}=e,c=[];switch(n&&c.unshift(Hp.of([Tde])),l&&(typeof l=="boolean"?c.unshift(H_()):c.unshift(H_(l))),a&&c.unshift(Ale(a)),i){case"light":c.push(kfe);break;case"dark":c.push(oH);break;case"none":break;default:c.push(i);break}return r===!1&&c.push(Ze.editable.of(!1)),s&&c.push(bn.readOnly.of(!0)),[...c]},jfe=t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map(e=>t.state.sliceDoc(e.from,e.to)),selectedText:t.state.selection.ranges.some(e=>!e.empty)});class Nfe{constructor(e,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,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(n=>{try{n()}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 X_{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 eS=null,Cfe=()=>typeof window>"u"?new X_:(eS||(eS=new X_),eS),Y_=Fo.define(),Tfe=200,Efe=[];function _fe(t){var{value:e,selection:n,onChange:r,onStatistics:s,onCreateEditor:i,onUpdate:a,extensions:l=Efe,autoFocus:c,theme:d="light",height:h=null,minHeight:m=null,maxHeight:g=null,width:x=null,minWidth:y=null,maxWidth:w=null,placeholder:S="",editable:k=!0,readOnly:j=!1,indentWithTab:N=!0,basicSetup:T=!0,root:E,initialState:_}=t,[M,I]=b.useState(),[P,L]=b.useState(),[H,U]=b.useState(),ee=b.useState(()=>({current:null}))[0],z=b.useState(()=>({current:null}))[0],Q=Ze.theme({"&":{height:h,minHeight:m,maxHeight:g,width:x,minWidth:y,maxWidth:w},"& .cm-scroller":{height:"100% !important"}}),B=Ze.updateListener.of(G=>{if(G.docChanged&&typeof r=="function"&&!G.transactions.some(W=>W.annotation(Y_))){ee.current?ee.current.reset():(ee.current=new Nfe(()=>{if(z.current){var W=z.current;z.current=null,W()}ee.current=null},Tfe),Cfe().add(ee.current));var R=G.state.doc,ie=R.toString();r(ie,G)}s&&s(jfe(G))}),X=Ofe({theme:d,editable:k,readOnly:j,placeholder:S,indentWithTab:N,basicSetup:T}),J=[B,Q,...X];return a&&typeof a=="function"&&J.push(Ze.updateListener.of(a)),J=J.concat(l),b.useLayoutEffect(()=>{if(M&&!H){var G={doc:e,selection:n,extensions:J},R=_?bn.fromJSON(_.json,G,_.fields):bn.create(G);if(U(R),!P){var ie=new Ze({state:R,parent:M,root:E});L(ie),i&&i(ie,R)}}return()=>{P&&(U(void 0),L(void 0))}},[M,H]),b.useEffect(()=>{t.container&&I(t.container)},[t.container]),b.useEffect(()=>()=>{P&&(P.destroy(),L(void 0)),ee.current&&(ee.current.cancel(),ee.current=null)},[P]),b.useEffect(()=>{c&&P&&P.focus()},[c,P]),b.useEffect(()=>{P&&P.dispatch({effects:Ft.reconfigure.of(J)})},[d,l,h,m,g,x,y,w,S,k,j,N,T,r,a]),b.useEffect(()=>{if(e!==void 0){var G=P?P.state.doc.toString():"";if(P&&e!==G){var R=ee.current&&!ee.current.isDone,ie=()=>{P&&e!==P.state.doc.toString()&&P.dispatch({changes:{from:0,to:P.state.doc.toString().length,insert:e||""},annotations:[Y_.of(!0)]})};R?z.current=ie:ie()}}},[e,P]),{state:H,setState:U,view:P,setView:L,container:M,setContainer:I}}var Mfe=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],lH=b.forwardRef((t,e)=>{var{className:n,value:r="",selection:s,extensions:i=[],onChange:a,onStatistics:l,onCreateEditor:c,onUpdate:d,autoFocus:h,theme:m="light",height:g,minHeight:x,maxHeight:y,width:w,minWidth:S,maxWidth:k,basicSetup:j,placeholder:N,indentWithTab:T,editable:E,readOnly:_,root:M,initialState:I}=t,P=xJ(t,Mfe),L=b.useRef(null),{state:H,view:U,container:ee,setContainer:z}=_fe({root:M,value:r,autoFocus:h,theme:m,height:g,minHeight:x,maxHeight:y,width:w,minWidth:S,maxWidth:k,basicSetup:j,placeholder:N,indentWithTab:T,editable:E,readOnly:_,selection:s,onChange:a,onStatistics:l,onCreateEditor:c,onUpdate:d,extensions:i,initialState:I});b.useImperativeHandle(e,()=>({editor:L.current,state:H,view:U}),[L,ee,H,U]);var Q=b.useCallback(X=>{L.current=X,z(X)},[z]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var B=typeof m=="string"?"cm-theme-"+m:"cm-theme";return o.jsx("div",vJ({ref:Q,className:""+B+(n?" "+n:"")},P))});lH.displayName="CodeMirror";var K_={};class ry{constructor(e,n,r,s,i,a,l,c,d,h=0,m){this.p=e,this.stack=n,this.state=r,this.reducePos=s,this.pos=i,this.score=a,this.buffer=l,this.bufferBase=c,this.curContext=d,this.lookAhead=h,this.parent=m}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let s=e.parser.context;return new ry(e,[],n,r,r,0,[],0,s?new Z_(s,s.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,s=e&65535,{parser:i}=this.p,a=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[s])===null||n===void 0)&&n.isAnonymous)&&(d==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizec;)this.stack.pop();this.reduceContext(s,d)}storeNode(e,n,r,s=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&a.buffer[l-4]==0&&a.buffer[l-1]>-1){if(n==r)return;if(a.buffer[l-2]>=n){a.buffer[l-2]=r;return}}}if(!i||this.pos==r)this.buffer.push(e,n,r,s);else{let a=this.buffer.length;if(a>0&&(this.buffer[a-4]!=0||this.buffer[a-1]<0)){let l=!1;for(let c=a;c>0&&this.buffer[c-2]>r;c-=4)if(this.buffer[c-1]>=0){l=!0;break}if(l)for(;a>0&&this.buffer[a-2]>r;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,s>4&&(s-=4)}this.buffer[a]=e,this.buffer[a+1]=n,this.buffer[a+2]=r,this.buffer[a+3]=s}}shift(e,n,r,s){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let i=e,{parser:a}=this.p;(s>this.pos||n<=a.maxNode)&&(this.pos=s,a.stateFlag(i,1)||(this.reducePos=s)),this.pushState(i,r),this.shiftContext(n,r),n<=a.maxNode&&this.buffer.push(n,r,s,4)}else this.pos=s,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,s,4)}apply(e,n,r,s){e&65536?this.reduce(e):this.shift(e,n,r,s)}useNode(e,n){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(n,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,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),s=e.bufferBase+n;for(;e&&s==e.bufferBase;)e=e.parent;return new ry(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,s,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new Afe(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if((r&65536)==0)return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let s=[];for(let i=0,a;ic&1&&l==a)||s.push(n[i],a)}n=s}let r=[];for(let s=0;s>19,s=n&65535,i=this.stack.length-r*3;if(i<0||e.getGoto(this.stack[i],s,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;n=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(s,i)=>{if(!n.includes(s))return n.push(s),e.allActions(s,a=>{if(!(a&393216))if(a&65536){let l=(a>>19)-i;if(l>1){let c=a&65535,d=this.stack.length-l*3;if(d>=0&&e.getGoto(this.stack[d],c,!1)>=0)return l<<19|65536|c}}else{let l=r(a,i+1);if(l!=null)return l}})};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 n=0;nthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Z_{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class Afe{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=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],n,!0);this.state=s}}class sy{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new sy(e,n,n-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 sy(this.stack,this.pos,this.index)}}function b1(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,s=0;r=92&&a--,a>=34&&a--;let c=a-32;if(c>=46&&(c-=46,l=!0),i+=c,l)break;i*=46}n?n[s++]=i:n=new e(i)}return n}class mv{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const J_=new mv;class Rfe{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=J_,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,s=this.rangeIndex,i=this.pos+e;for(;ir.to:i>=r.to;){if(s==this.ranges.length-1)return null;let a=this.ranges[++s];i+=a.from-r.to,r=a}return i}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,s;if(n>=0&&n=this.chunk2Pos&&rl.to&&(this.chunk2=this.chunk2.slice(0,l.to-r)),s=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),s}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r=this.chunk2Pos&&this.posthis.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,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=J_,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let s of this.ranges){if(s.from>=n)break;s.to>e&&(r+=this.input.read(Math.max(s.from,e),Math.min(s.to,n)))}return r}}class Bh{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;Dfe(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}Bh.prototype.contextual=Bh.prototype.fallback=Bh.prototype.extend=!1;Bh.prototype.fallback=Bh.prototype.extend=!1;class pb{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function Dfe(t,e,n,r,s,i){let a=0,l=1<0){let y=t[x];if(c.allows(y)&&(e.token.value==-1||e.token.value==y||Pfe(y,e.token.value,s,i))){e.acceptToken(y);break}}let h=e.next,m=0,g=t[a+2];if(e.next<0&&g>m&&t[d+g*3-3]==65535){a=t[d+g*3-1];continue e}for(;m>1,y=d+x+(x<<1),w=t[y],S=t[y+1]||65536;if(h=S)m=x+1;else{a=t[y+2],e.advance();continue e}}break}}function eM(t,e,n){for(let r=e,s;(s=t[r])!=65535;r++)if(s==n)return r-e;return-1}function Pfe(t,e,n,r){let s=eM(n,r,e);return s<0||eM(n,r,t)e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class zfe{constructor(e,n){this.fragments=e,this.nodeSet=n,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?tM(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?tM(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(ee)return this.nextStart=a,null;if(i instanceof ar){if(a==e){if(a=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[n]++,this.nextStart=a+i.length}}}class Ife{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new mv)}getActions(e){let n=0,r=null,{parser:s}=e.p,{tokenizers:i}=s,a=s.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,c=0;for(let d=0;dm.end+25&&(c=Math.max(m.lookAhead,c)),m.value!=0)){let g=n;if(m.extended>-1&&(n=this.addActions(e,m.extended,m.end,n)),n=this.addActions(e,m.value,m.end,n),!h.extend&&(r=m,n>g))break}}for(;this.actions.length>n;)this.actions.pop();return c&&e.setLookAhead(c),!r&&e.pos==this.stream.end&&(r=new mv,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new mv,{pos:r,p:s}=e;return n.start=r,n.end=Math.min(r+1,s.stream.end),n.value=r==s.stream.end?s.parser.eofTerm:0,n}updateCachedToken(e,n,r){let s=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(s,e),r),e.value>-1){let{parser:i}=r.p;for(let a=0;a=0&&r.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(s+1)}putAction(e,n,r,s){for(let i=0;ie.bufferLength*4?new zfe(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],s,i;if(this.bigReductionCount>300&&e.length==1){let[a]=e;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;an)r.push(l);else{if(this.advanceStack(l,r,e))continue;{s||(s=[],i=[]),s.push(l);let c=this.tokens.getMainToken(l);i.push(c.value,c.end)}}break}}if(!r.length){let a=s&&qfe(s);if(a)return Bi&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw Bi&&s&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&s){let a=this.stoppedAt!=null&&s[0].pos>this.stoppedAt?s[0]:this.runRecovery(s,i,r);if(a)return Bi&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(r.length>a)for(r.sort((l,c)=>c.score-l.score);r.length>a;)r.pop();r.some(l=>l.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let a=0;a500&&d.buffer.length>500)if((l.score-d.score||l.buffer.length-d.buffer.length)>0)r.splice(c--,1);else{r.splice(a--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let a=1;a ":"";if(this.stoppedAt!=null&&s>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let d=e.curContext&&e.curContext.tracker.strict,h=d?e.curContext.hash:0;for(let m=this.fragments.nodeAt(s);m;){let g=this.parser.nodeSet.types[m.type.id]==m.type?i.getGoto(e.state,m.type.id):-1;if(g>-1&&m.length&&(!d||(m.prop(sn.contextHash)||0)==h))return e.useNode(m,g),Bi&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(m.type.id)})`),!0;if(!(m instanceof ar)||m.children.length==0||m.positions[0]>0)break;let x=m.children[0];if(x instanceof ar&&m.positions[0]==0)m=x;else break}}let l=i.stateSlot(e.state,4);if(l>0)return e.reduce(l),Bi&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let c=this.tokens.getActions(e);for(let d=0;ds?n.push(y):r.push(y)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return nM(e,n),!0}}runRecovery(e,n,r){let s=null,i=!1;for(let a=0;a ":"";if(l.deadEnd&&(i||(i=!0,l.restart(),Bi&&console.log(h+this.stackID(l)+" (restarted)"),this.advanceFully(l,r))))continue;let m=l.split(),g=h;for(let x=0;x<10&&m.forceReduce()&&(Bi&&console.log(g+this.stackID(m)+" (via force-reduce)"),!this.advanceFully(m,r));x++)Bi&&(g=this.stackID(m)+" -> ");for(let x of l.recoverByInsert(c))Bi&&console.log(h+this.stackID(x)+" (via recover-insert)"),this.advanceFully(x,r);this.stream.end>l.pos?(d==l.pos&&(d++,c=0),l.recoverByDelete(c,d),Bi&&console.log(h+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),nM(l,r)):(!s||s.scoret;class Ffe{constructor(e){this.start=e.start,this.shift=e.shift||nS,this.reduce=e.reduce||nS,this.reuse=e.reuse||nS,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class tp extends h6{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let l=0;le.topRules[l][1]),s=[];for(let l=0;l=0)i(h,c,l[d++]);else{let m=l[d+-h];for(let g=-h;g>0;g--)i(l[d++],c,m);d++}}}this.nodeSet=new ab(n.map((l,c)=>ri.define({name:c>=this.minRepeatTerm?void 0:l,id:c,props:s[c],top:r.indexOf(c)>-1,error:c==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(c)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Cq;let a=b1(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new Bh(a,l):l),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,n,r){let s=new Lfe(this,e,n,r);for(let i of this.wrappers)s=i(s,e,n,r);return s}getGoto(e,n,r=!1){let s=this.goto;if(n>=s[0])return-1;for(let i=s[n+1];;){let a=s[i++],l=a&1,c=s[i++];if(l&&r)return c;for(let d=i+(a>>1);i0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),s=r?n(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=n(Nl(this.data,i+1))}return s}nextStates(e){let n=[];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];n.some((i,a)=>a&1&&i==s)||n.push(this.data[r],s)}}return n}configure(e){let n=Object.assign(Object.create(tp.prototype),this);if(e.props&&(n.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}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let s=e.tokenizers.find(i=>i.from==r);return s?s.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,s)=>{let i=e.specializers.find(l=>l.from==r.external);if(!i)return r;let a=Object.assign(Object.assign({},r),{external:i.to});return n.specializers[s]=rM(a),a})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}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 n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let i of e.split(" ")){let a=n.indexOf(i);a>=0&&(r[a]=!0)}let s=null;for(let i=0;ir)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.scoret.external(n,r)<<1|e}return t.get}const $fe=1,cH=194,uH=195,Hfe=196,sM=197,Qfe=198,Vfe=199,Ufe=200,Wfe=2,dH=3,iM=201,Gfe=24,Xfe=25,Yfe=49,Kfe=50,Zfe=55,Jfe=56,eme=57,tme=59,nme=60,rme=61,sme=62,ime=63,ame=65,ome=238,lme=71,cme=241,ume=242,dme=243,hme=244,fme=245,mme=246,pme=247,gme=248,hH=72,xme=249,vme=250,yme=251,bme=252,wme=253,Sme=254,kme=255,Ome=256,jme=73,Nme=77,Cme=263,Tme=112,Eme=130,_me=151,Mme=152,Ame=155,ud=10,np=13,P6=32,gb=9,z6=35,Rme=40,Dme=46,lO=123,aM=125,fH=39,mH=34,oM=92,Pme=111,zme=120,Ime=78,Lme=117,Bme=85,Fme=new Set([Xfe,Yfe,Kfe,Cme,ame,Eme,Jfe,eme,ome,sme,ime,hH,jme,Nme,nme,rme,_me,Mme,Ame,Tme]);function rS(t){return t==ud||t==np}function sS(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const qme=new pb((t,e)=>{let n;if(t.next<0)t.acceptToken(Vfe);else if(e.context.flags&pv)rS(t.next)&&t.acceptToken(Qfe,1);else if(((n=t.peek(-1))<0||rS(n))&&e.canShift(sM)){let r=0;for(;t.next==P6||t.next==gb;)t.advance(),r++;(t.next==ud||t.next==np||t.next==z6)&&t.acceptToken(sM,-r)}else rS(t.next)&&t.acceptToken(Hfe,1)},{contextual:!0}),$me=new pb((t,e)=>{let n=e.context;if(n.flags)return;let r=t.peek(-1);if(r==ud||r==np){let s=0,i=0;for(;;){if(t.next==P6)s++;else if(t.next==gb)s+=8-s%8;else break;t.advance(),i++}s!=n.indent&&t.next!=ud&&t.next!=np&&t.next!=z6&&(s[t,e|pH])),Vme=new Ffe({start:Hme,reduce(t,e,n,r){return t.flags&pv&&Fme.has(e)||(e==lme||e==hH)&&t.flags&pH?t.parent:t},shift(t,e,n,r){return e==cH?new gv(t,Qme(r.read(r.pos,n.pos)),0):e==uH?t.parent:e==Gfe||e==Zfe||e==tme||e==dH?new gv(t,0,pv):lM.has(e)?new gv(t,0,lM.get(e)|t.flags&pv):t},hash(t){return t.hash}}),Ume=new pb(t=>{for(let e=0;e<5;e++){if(t.next!="print".charCodeAt(e))return;t.advance()}if(!/\w/.test(String.fromCharCode(t.next)))for(let e=0;;e++){let n=t.peek(e);if(!(n==P6||n==gb)){n!=Rme&&n!=Dme&&n!=ud&&n!=np&&n!=z6&&t.acceptToken($fe);return}}}),Wme=new pb((t,e)=>{let{flags:n}=e.context,r=n&wl?mH:fH,s=(n&Sl)>0,i=!(n&kl),a=(n&Ol)>0,l=t.pos;for(;!(t.next<0);)if(a&&t.next==lO)if(t.peek(1)==lO)t.advance(2);else{if(t.pos==l){t.acceptToken(dH,1);return}break}else if(i&&t.next==oM){if(t.pos==l){t.advance();let c=t.next;c>=0&&(t.advance(),Gme(t,c)),t.acceptToken(Wfe);return}break}else if(t.next==oM&&!i&&t.peek(1)>-1)t.advance(2);else if(t.next==r&&(!s||t.peek(1)==r&&t.peek(2)==r)){if(t.pos==l){t.acceptToken(iM,s?3:1);return}break}else if(t.next==ud){if(s)t.advance();else if(t.pos==l){t.acceptToken(iM);return}break}else t.advance();t.pos>l&&t.acceptToken(Ufe)});function Gme(t,e){if(e==Pme)for(let n=0;n<2&&t.next>=48&&t.next<=55;n++)t.advance();else if(e==zme)for(let n=0;n<2&&sS(t.next);n++)t.advance();else if(e==Lme)for(let n=0;n<4&&sS(t.next);n++)t.advance();else if(e==Bme)for(let n=0;n<8&&sS(t.next);n++)t.advance();else if(e==Ime&&t.next==lO){for(t.advance();t.next>=0&&t.next!=aM&&t.next!=fH&&t.next!=mH&&t.next!=ud;)t.advance();t.next==aM&&t.advance()}}const Xme=f6({'async "*" "**" FormatConversion FormatSpec':xe.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":xe.controlKeyword,"in not and or is del":xe.operatorKeyword,"from def class global nonlocal lambda":xe.definitionKeyword,import:xe.moduleKeyword,"with as print":xe.keyword,Boolean:xe.bool,None:xe.null,VariableName:xe.variableName,"CallExpression/VariableName":xe.function(xe.variableName),"FunctionDefinition/VariableName":xe.function(xe.definition(xe.variableName)),"ClassDefinition/VariableName":xe.definition(xe.className),PropertyName:xe.propertyName,"CallExpression/MemberExpression/PropertyName":xe.function(xe.propertyName),Comment:xe.lineComment,Number:xe.number,String:xe.string,FormatString:xe.special(xe.string),Escape:xe.escape,UpdateOp:xe.updateOperator,"ArithOp!":xe.arithmeticOperator,BitOp:xe.bitwiseOperator,CompareOp:xe.compareOperator,AssignOp:xe.definitionOperator,Ellipsis:xe.punctuation,At:xe.meta,"( )":xe.paren,"[ ]":xe.squareBracket,"{ }":xe.brace,".":xe.derefOperator,", ;":xe.separator}),Yme={__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},Kme=tp.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'#FyOOOOQS'#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,5kOOQS1G1`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,5jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!lO!lO!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,5nQdO,5sQdO1G4OOOQS-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<mO#BQQdO,5>mOOQS1G0v1G0vOOQS<rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ oQdO<cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<tO$4{QdO,5>tO1XQdO,5vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5wO$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,5S~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!;|!_![!]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:[Ume,$me,qme,Wme,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>Yme[t]||-1}],tokenPrec:7668}),cM=new mce,gH=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function w1(t){return(e,n,r)=>{if(r)return!1;let s=e.node.getChild("VariableName");return s&&n(s,t),!0}}const Zme={FunctionDefinition:w1("function"),ClassDefinition:w1("class"),ForStatement(t,e,n){if(n){for(let r=t.node.firstChild;r;r=r.nextSibling)if(r.name=="VariableName")e(r,"variable");else if(r.name=="in")break}},ImportStatement(t,e){var n,r;let{node:s}=t,i=((n=s.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let a=s.getChild("import");a;a=a.nextSibling)a.name=="VariableName"&&((r=a.nextSibling)===null||r===void 0?void 0:r.name)!="as"&&e(a,i?"variable":"namespace")},AssignStatement(t,e){for(let n=t.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")e(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(t,e){for(let n=null,r=t.node.firstChild;r;r=r.nextSibling)r.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&e(r,"variable"),n=r},CapturePattern:w1("variable"),AsPattern:w1("variable"),__proto__:null};function xH(t,e){let n=cM.get(e);if(n)return n;let r=[],s=!0;function i(a,l){let c=t.sliceString(a.from,a.to);r.push({label:c,type:l})}return e.cursor(ds.IncludeAnonymous).iterate(a=>{if(a.name){let l=Zme[a.name];if(l&&l(a,i,s)||!s&&gH.has(a.name))return!1;s=!1}else if(a.to-a.from>8192){for(let l of xH(t,a.node))r.push(l);return!1}}),cM.set(e,r),r}const uM=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,vH=["String","FormatString","Comment","PropertyName"];function Jme(t){let e=ws(t.state).resolveInner(t.pos,-1);if(vH.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&uM.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let s=e;s;s=s.parent)gH.has(s.name)&&(r=r.concat(xH(t.state.doc,s)));return{options:r,from:n?e.from:t.pos,validFor:uM}}const e0e=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(t=>({label:t,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(t=>({label:t,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(t=>({label:t,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(t=>({label:t,type:"function"}))),t0e=[xl("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),xl("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),xl("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),xl("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),xl(`if \${}: +`);r>-1&&(n=n.slice(0,r))}return e+n.length<=this.to?n:n.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,n=this.lineAfter(e),r=e+n.length;for(let s=this.rangeIndex;;){let i=this.ranges[s].to;if(i>=r||(n=n.slice(0,i-(r-n.length)),s++,s==this.ranges.length))break;let a=this.ranges[s].from,l=this.lineAfter(a);n+=l,r=a+l.length}return{line:n,end:r}}skipGapsTo(e,n,r){for(;;){let s=this.ranges[this.rangeIndex].to,i=e+n;if(r>0?s>i:s>=i)break;let a=this.ranges[++this.rangeIndex].from;n+=a-s}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){s=this.skipGapsTo(n,s,1),n+=s;let l=this.chunk.length;s=this.skipGapsTo(r,s,-1),r+=s,i+=this.chunk.length-l}let a=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&i==4&&a>=0&&this.chunk[a]==e&&this.chunk[a+2]==n?this.chunk[a+2]=r:this.chunk.push(e,n,r,i),s}parseLine(e){let{line:n,end:r}=this.nextLine(),s=0,{streamParser:i}=this.lang,a=new r$(n,e?e.state.tabSize:4,e?ld(e.state):2);if(a.eol())i.blankLine(this.state,a.indentUnit);else for(;!a.eol();){let l=i$(i.token,a,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+a.start,this.parsedPos+a.pos,s)),a.start>1e4)break}this.parsedPos=r,this.moveRangeIndex(),this.parsedPose.start)return s}throw new Error("Stream parser failed to advance stream.")}const k6=Object.create(null),K0=[si.none],Mue=new hb(K0),S_=[],k_=Object.create(null),a$=Object.create(null);for(let[t,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"]])a$[t]=l$(k6,e);class o${constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),a$)}resolve(e){return e?this.table[e]||(this.table[e]=l$(this.extra,e)):0}}const Rue=new o$(k6);function Z4(t,e){S_.indexOf(t)>-1||(S_.push(t),console.warn(e))}function l$(t,e){let n=[];for(let l of e.split(" ")){let c=[];for(let d of l.split(".")){let h=t[d]||ve[d];h?typeof h=="function"?c.length?c=c.map(h):Z4(d,`Modifier ${d} used at start of tag`):c.length?Z4(d,`Tag ${d} used as modifier`):c=Array.isArray(h)?h:[h]:Z4(d,`Unknown highlighting tag ${d}`)}for(let d of c)n.push(d)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),s=r+" "+n.map(l=>l.id),i=k_[s];if(i)return i.id;let a=k_[s]=si.define({id:K0.length,name:r,props:[x6({[r]:n})]});return K0.push(a),a.id}function Due(t,e){let n=si.define({id:K0.length,name:"Document",props:[Qu.add(()=>t),mb.add(()=>r=>e.getIndent(r))],top:!0});return K0.push(n),n}gr.RTL,gr.LTR;const Pue=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=j6(t.state,n.from);return r.line?zue(t):r.block?Lue(t):!1};function O6(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let s=t(e,n);return s?(r(n.update(s)),!0):!1}}const zue=O6(que,0),Iue=O6(c$,0),Lue=O6((t,e)=>c$(t,e,Fue(e)),0);function j6(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const Hm=50;function Bue(t,{open:e,close:n},r,s){let i=t.sliceDoc(r-Hm,r),a=t.sliceDoc(s,s+Hm),l=/\s*$/.exec(i)[0].length,c=/^\s*/.exec(a)[0].length,d=i.length-l;if(i.slice(d-e.length,d)==e&&a.slice(c,c+n.length)==n)return{open:{pos:r-l,margin:l&&1},close:{pos:s+c,margin:c&&1}};let h,m;s-r<=2*Hm?h=m=t.sliceDoc(r,s):(h=t.sliceDoc(r,r+Hm),m=t.sliceDoc(s-Hm,s));let g=/^\s*/.exec(h)[0].length,x=/\s*$/.exec(m)[0].length,y=m.length-x-n.length;return h.slice(g,g+e.length)==e&&m.slice(y,y+n.length)==n?{open:{pos:r+g+e.length,margin:/\s/.test(h.charAt(g+e.length))?1:0},close:{pos:s-x-n.length,margin:/\s/.test(m.charAt(y-1))?1:0}}:null}function Fue(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),s=n.to<=r.to?r:t.doc.lineAt(n.to);s.from>r.from&&s.from==n.to&&(s=n.to==r.to+1?r:t.doc.lineAt(n.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 c$(t,e,n=e.selection.ranges){let r=n.map(i=>j6(e,i.from).block);if(!r.every(i=>i))return null;let s=n.map((i,a)=>Bue(e,r[a],i.from,i.to));if(t!=2&&!s.every(i=>i))return{changes:e.changes(n.map((i,a)=>s[a]?[]:[{from:i.from,insert:r[a].open+" "},{from:i.to,insert:" "+r[a].close}]))};if(t!=1&&s.some(i=>i)){let i=[];for(let a=0,l;as&&(i==a||a>m.from)){s=m.from;let g=/^\s*/.exec(m.text)[0].length,x=g==m.length,y=m.text.slice(g,g+d.length)==d?g:-1;gi.comment<0&&(!i.empty||i.single))){let i=[];for(let{line:l,token:c,indent:d,empty:h,single:m}of r)(m||!h)&&i.push({from:l.from+d,insert:c+" "});let a=e.changes(i);return{changes:a,selection:e.selection.map(a,1)}}else if(t!=1&&r.some(i=>i.comment>=0)){let i=[];for(let{line:a,comment:l,token:c}of r)if(l>=0){let d=a.from+l,h=d+c.length;a.text[h-a.from]==" "&&h++,i.push({from:d,to:h})}return{changes:i}}return null}const oO=qo.define(),$ue=qo.define(),Hue=at.define(),u$=at.define({combine(t){return $o(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,s)=>e(r,s)||n(r,s)})}}),d$=Os.define({create(){return Co.empty},update(t,e){let n=e.state.facet(u$),r=e.annotation(oO);if(r){let c=yi.fromTransaction(e,r.selection),d=r.side,h=d==0?t.undone:t.done;return c?h=ey(h,h.length,n.minDepth,c):h=m$(h,e.startState.selection),new Co(d==0?r.rest:h,d==0?h:r.rest)}let s=e.annotation($ue);if((s=="full"||s=="before")&&(t=t.isolate()),e.annotation(ns.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let i=yi.fromTransaction(e),a=e.annotation(ns.time),l=e.annotation(ns.userEvent);return i?t=t.addChanges(i,a,l,n,e):e.selection&&(t=t.addSelection(e.startState.selection,a,l,n.newGroupDelay)),(s=="full"||s=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Co(t.done.map(yi.fromJSON),t.undone.map(yi.fromJSON))}});function Que(t={}){return[d$,u$.of(t),Ze.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?h$:e.inputType=="historyRedo"?lO:null;return r?(e.preventDefault(),r(n)):!1}})]}function gb(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let s=n.field(d$,!1);if(!s)return!1;let i=s.pop(t,n,e);return i?(r(i),!0):!1}}const h$=gb(0,!1),lO=gb(1,!1),Vue=gb(0,!0),Uue=gb(1,!0);class yi{constructor(e,n,r,s,i){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=s,this.selectionsAfter=i}setSelAfter(e){return new yi(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.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 yi(e.changes&&us.fromJSON(e.changes),[],e.mapped&&Do.fromJSON(e.mapped),e.startSelection&&Me.fromJSON(e.startSelection),e.selectionsAfter.map(Me.fromJSON))}static fromTransaction(e,n){let r=ya;for(let s of e.startState.facet(Hue)){let i=s(e);i.length&&(r=r.concat(i))}return!r.length&&e.changes.empty?null:new yi(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,ya)}static selection(e){return new yi(void 0,ya,void 0,void 0,e)}}function ey(t,e,n,r){let s=e+1>n+20?e-n-1:0,i=t.slice(s,e);return i.push(r),i}function Wue(t,e){let n=[],r=!1;return t.iterChangedRanges((s,i)=>n.push(s,i)),e.iterChangedRanges((s,i,a,l)=>{for(let c=0;c=d&&a<=h&&(r=!0)}}),r}function Gue(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function f$(t,e){return t.length?e.length?t.concat(e):t:e}const ya=[],Xue=200;function m$(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Xue));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),ey(t,t.length-1,1e9,n.setSelAfter(r)))}else return[yi.selection([e])]}function Yue(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function J4(t,e){if(!t.length)return t;let n=t.length,r=ya;for(;n;){let s=Kue(t[n-1],e,r);if(s.changes&&!s.changes.empty||s.effects.length){let i=t.slice(0,n);return i[n-1]=s,i}else e=s.mapped,n--,r=s.selectionsAfter}return r.length?[yi.selection(r)]:ya}function Kue(t,e,n){let r=f$(t.selectionsAfter.length?t.selectionsAfter.map(l=>l.map(e)):ya,n);if(!t.changes)return yi.selection(r);let s=t.changes.map(e),i=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(i):i;return new yi(s,Ft.mapEffects(t.effects,e),a,t.startSelection.map(i),r)}const Zue=/^(input\.type|delete)($|\.)/;class Co{constructor(e,n,r=0,s=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=s}isolate(){return this.prevTime?new Co(this.done,this.undone):this}addChanges(e,n,r,s,i){let a=this.done,l=a[a.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!r||Zue.test(r))&&(!l.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?t.moveByChar(n,e):xb(n,e))}function Us(t){return t.textDirectionAt(t.state.selection.main.head)==gr.LTR}const g$=t=>p$(t,!Us(t)),x$=t=>p$(t,Us(t));function v$(t,e){return no(t,n=>n.empty?t.moveByGroup(n,e):xb(n,e))}const ede=t=>v$(t,!Us(t)),tde=t=>v$(t,Us(t));function nde(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function vb(t,e,n){let r=Ss(t).resolveInner(e.head),s=n?sn.closedBy:sn.openedBy;for(let c=e.head;;){let d=n?r.childAfter(c):r.childBefore(c);if(!d)break;nde(t,d,s)?r=d:c=n?d.to:d.from}let i=r.type.prop(s),a,l;return i&&(a=n?No(t,r.from,1):No(t,r.to,-1))&&a.matched?l=n?a.end.to:a.end.from:l=n?r.to:r.from,Me.cursor(l,n?-1:1)}const rde=t=>no(t,e=>vb(t.state,e,!Us(t))),sde=t=>no(t,e=>vb(t.state,e,Us(t)));function y$(t,e){return no(t,n=>{if(!n.empty)return xb(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const b$=t=>y$(t,!1),w$=t=>y$(t,!0);function S$(t){let e=t.scrollDOM.clientHeighta.empty?t.moveVertically(a,e,n.height):xb(a,e));if(s.eq(r.selection))return!1;let i;if(n.selfScroll){let a=t.coordsAtPos(r.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),c=l.top+n.marginTop,d=l.bottom-n.marginBottom;a&&a.top>c&&a.bottomk$(t,!1),cO=t=>k$(t,!0);function lu(t,e,n){let r=t.lineBlockAt(e.head),s=t.moveToLineBoundary(e,n);if(s.head==e.head&&s.head!=(n?r.to:r.from)&&(s=t.moveToLineBoundary(e,n,!1)),!n&&s.head==r.from&&r.length){let i=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;i&&e.head!=r.from+i&&(s=Me.cursor(r.from+i))}return s}const ide=t=>no(t,e=>lu(t,e,!0)),ade=t=>no(t,e=>lu(t,e,!1)),ode=t=>no(t,e=>lu(t,e,!Us(t))),lde=t=>no(t,e=>lu(t,e,Us(t))),cde=t=>no(t,e=>Me.cursor(t.lineBlockAt(e.head).from,1)),ude=t=>no(t,e=>Me.cursor(t.lineBlockAt(e.head).to,-1));function dde(t,e,n){let r=!1,s=Cf(t.selection,i=>{let a=No(t,i.head,-1)||No(t,i.head,1)||i.head>0&&No(t,i.head-1,1)||i.headdde(t,e);function Pa(t,e){let n=Cf(t.state.selection,r=>{let s=e(r);return Me.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(to(t.state,n)),!0)}function O$(t,e){return Pa(t,n=>t.moveByChar(n,e))}const j$=t=>O$(t,!Us(t)),N$=t=>O$(t,Us(t));function C$(t,e){return Pa(t,n=>t.moveByGroup(n,e))}const fde=t=>C$(t,!Us(t)),mde=t=>C$(t,Us(t)),pde=t=>Pa(t,e=>vb(t.state,e,!Us(t))),gde=t=>Pa(t,e=>vb(t.state,e,Us(t)));function T$(t,e){return Pa(t,n=>t.moveVertically(n,e))}const E$=t=>T$(t,!1),_$=t=>T$(t,!0);function A$(t,e){return Pa(t,n=>t.moveVertically(n,e,S$(t).height))}const j_=t=>A$(t,!1),N_=t=>A$(t,!0),xde=t=>Pa(t,e=>lu(t,e,!0)),vde=t=>Pa(t,e=>lu(t,e,!1)),yde=t=>Pa(t,e=>lu(t,e,!Us(t))),bde=t=>Pa(t,e=>lu(t,e,Us(t))),wde=t=>Pa(t,e=>Me.cursor(t.lineBlockAt(e.head).from)),Sde=t=>Pa(t,e=>Me.cursor(t.lineBlockAt(e.head).to)),C_=({state:t,dispatch:e})=>(e(to(t,{anchor:0})),!0),T_=({state:t,dispatch:e})=>(e(to(t,{anchor:t.doc.length})),!0),E_=({state:t,dispatch:e})=>(e(to(t,{anchor:t.selection.main.anchor,head:0})),!0),__=({state:t,dispatch:e})=>(e(to(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),kde=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),Ode=({state:t,dispatch:e})=>{let n=yb(t).map(({from:r,to:s})=>Me.range(r,Math.min(s+1,t.doc.length)));return e(t.update({selection:Me.create(n),userEvent:"select"})),!0},jde=({state:t,dispatch:e})=>{let n=Cf(t.selection,r=>{let s=Ss(t),i=s.resolveStack(r.from,1);if(r.empty){let a=s.resolveStack(r.from,-1);a.node.from>=i.node.from&&a.node.to<=i.node.to&&(i=a)}for(let a=i;a;a=a.next){let{node:l}=a;if((l.from=r.to||l.to>r.to&&l.from<=r.from)&&a.next)return Me.range(l.to,l.from)}return r});return n.eq(t.selection)?!1:(e(to(t,n)),!0)};function M$(t,e){let{state:n}=t,r=n.selection,s=n.selection.ranges.slice();for(let i of n.selection.ranges){let a=n.doc.lineAt(i.head);if(e?a.to0)for(let l=i;;){let c=t.moveVertically(l,e);if(c.heada.to){s.some(d=>d.head==c.head)||s.push(c);break}else{if(c.head==l.head)break;l=c}}}return s.length==r.ranges.length?!1:(t.dispatch(to(n,Me.create(s,s.length-1))),!0)}const Nde=t=>M$(t,!1),Cde=t=>M$(t,!0),Tde=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=Me.create([n.main]):n.main.empty||(r=Me.create([Me.cursor(n.main.head)])),r?(e(to(t,r)),!0):!1};function Yp(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,s=r.changeByRange(i=>{let{from:a,to:l}=i;if(a==l){let c=e(i);ca&&(n="delete.forward",c=x1(t,c,!0)),a=Math.min(a,c),l=Math.max(l,c)}else a=x1(t,a,!1),l=x1(t,l,!0);return a==l?{range:i}:{changes:{from:a,to:l},range:Me.cursor(a,as(t)))r.between(e,e,(s,i)=>{se&&(e=n?i:s)});return e}const R$=(t,e,n)=>Yp(t,r=>{let s=r.from,{state:i}=t,a=i.doc.lineAt(s),l,c;if(n&&!e&&s>a.from&&sR$(t,!1,!0),D$=t=>R$(t,!0,!1),P$=(t,e)=>Yp(t,n=>{let r=n.head,{state:s}=t,i=s.doc.lineAt(r),a=s.charCategorizer(r);for(let l=null;;){if(r==(e?i.to:i.from)){r==n.head&&i.number!=(e?s.doc.lines:1)&&(r+=e?1:-1);break}let c=zs(i.text,r-i.from,e)+i.from,d=i.text.slice(Math.min(r,c)-i.from,Math.max(r,c)-i.from),h=a(d);if(l!=null&&h!=l)break;(d!=" "||r!=n.head)&&(l=h),r=c}return r}),z$=t=>P$(t,!1),Ede=t=>P$(t,!0),_de=t=>Yp(t,e=>{let n=t.lineBlockAt(e.head).to;return e.headYp(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),Mde=t=>Yp(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:jn.of(["",""])},range:Me.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},Dde=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let s=r.from,i=t.doc.lineAt(s),a=s==i.from?s-1:zs(i.text,s-i.from,!1)+i.from,l=s==i.to?s+1:zs(i.text,s-i.from,!0)+i.from;return{changes:{from:a,to:l,insert:t.doc.slice(s,l).append(t.doc.slice(a,s))},range:Me.cursor(l)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function yb(t){let e=[],n=-1;for(let r of t.selection.ranges){let s=t.doc.lineAt(r.from),i=t.doc.lineAt(r.to);if(!r.empty&&r.to==i.from&&(i=t.doc.lineAt(r.to-1)),n>=s.number){let a=e[e.length-1];a.to=i.to,a.ranges.push(r)}else e.push({from:s.from,to:i.to,ranges:[r]});n=i.number+1}return e}function I$(t,e,n){if(t.readOnly)return!1;let r=[],s=[];for(let i of yb(t)){if(n?i.to==t.doc.length:i.from==0)continue;let a=t.doc.lineAt(n?i.to+1:i.from-1),l=a.length+1;if(n){r.push({from:i.to,to:a.to},{from:i.from,insert:a.text+t.lineBreak});for(let c of i.ranges)s.push(Me.range(Math.min(t.doc.length,c.anchor+l),Math.min(t.doc.length,c.head+l)))}else{r.push({from:a.from,to:i.from},{from:i.to,insert:t.lineBreak+a.text});for(let c of i.ranges)s.push(Me.range(c.anchor-l,c.head-l))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:Me.create(s,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Pde=({state:t,dispatch:e})=>I$(t,e,!1),zde=({state:t,dispatch:e})=>I$(t,e,!0);function L$(t,e,n){if(t.readOnly)return!1;let r=[];for(let s of yb(t))n?r.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):r.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});return e(t.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Ide=({state:t,dispatch:e})=>L$(t,e,!1),Lde=({state:t,dispatch:e})=>L$(t,e,!0),Bde=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(yb(e).map(({from:s,to:i})=>(s>0?s--:i{let i;if(t.lineWrapping){let a=t.lineBlockAt(s.head),l=t.coordsAtPos(s.head,s.assoc||1);l&&(i=a.bottom+t.documentTop-l.bottom+t.defaultLineHeight/2)}return t.moveVertically(s,!0,i)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Fde(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=Ss(t).resolveInner(e),r=n.childBefore(e),s=n.childAfter(e),i;return r&&s&&r.to<=e&&s.from>=e&&(i=r.type.prop(sn.closedBy))&&i.indexOf(s.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(s.from).from&&!/\S/.test(t.sliceDoc(r.to,s.from))?{from:r.to,to:s.from}:null}const A_=B$(!1),qde=B$(!0);function B$(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(s=>{let{from:i,to:a}=s,l=e.doc.lineAt(i),c=!t&&i==a&&Fde(e,i);t&&(i=a=(a<=l.to?l:e.doc.lineAt(a)).to);let d=new fb(e,{simulateBreak:i,simulateDoubleBreak:!!c}),h=v6(d,i);for(h==null&&(h=Nf(/^\s*/.exec(e.doc.lineAt(i).text)[0],e.tabSize));al.from&&i{let s=[];for(let a=r.from;a<=r.to;){let l=t.doc.lineAt(a);l.number>n&&(r.empty||r.to>l.from)&&(e(l,s,r),n=l.number),a=l.to+1}let i=t.changes(s);return{changes:s,range:Me.range(i.mapPos(r.anchor,1),i.mapPos(r.head,1))}})}const $de=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new fb(t,{overrideIndentation:i=>{let a=n[i];return a??-1}}),s=N6(t,(i,a,l)=>{let c=v6(r,i.from);if(c==null)return;/\S/.test(i.text)||(c=0);let d=/^\s*/.exec(i.text)[0],h=Y0(t,c);(d!=h||l.fromt.readOnly?!1:(e(t.update(N6(t,(n,r)=>{r.push({from:n.from,insert:t.facet(Wp)})}),{userEvent:"input.indent"})),!0),q$=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(N6(t,(n,r)=>{let s=/^\s*/.exec(n.text)[0];if(!s)return;let i=Nf(s,t.tabSize),a=0,l=Y0(t,Math.max(0,i-ld(t)));for(;a(t.setTabFocusMode(),!0),Qde=[{key:"Ctrl-b",run:g$,shift:j$,preventDefault:!0},{key:"Ctrl-f",run:x$,shift:N$},{key:"Ctrl-p",run:b$,shift:E$},{key:"Ctrl-n",run:w$,shift:_$},{key:"Ctrl-a",run:cde,shift:wde},{key:"Ctrl-e",run:ude,shift:Sde},{key:"Ctrl-d",run:D$},{key:"Ctrl-h",run:uO},{key:"Ctrl-k",run:_de},{key:"Ctrl-Alt-h",run:z$},{key:"Ctrl-o",run:Rde},{key:"Ctrl-t",run:Dde},{key:"Ctrl-v",run:cO}],Vde=[{key:"ArrowLeft",run:g$,shift:j$,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:ede,shift:fde,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:ode,shift:yde,preventDefault:!0},{key:"ArrowRight",run:x$,shift:N$,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:tde,shift:mde,preventDefault:!0},{mac:"Cmd-ArrowRight",run:lde,shift:bde,preventDefault:!0},{key:"ArrowUp",run:b$,shift:E$,preventDefault:!0},{mac:"Cmd-ArrowUp",run:C_,shift:E_},{mac:"Ctrl-ArrowUp",run:O_,shift:j_},{key:"ArrowDown",run:w$,shift:_$,preventDefault:!0},{mac:"Cmd-ArrowDown",run:T_,shift:__},{mac:"Ctrl-ArrowDown",run:cO,shift:N_},{key:"PageUp",run:O_,shift:j_},{key:"PageDown",run:cO,shift:N_},{key:"Home",run:ade,shift:vde,preventDefault:!0},{key:"Mod-Home",run:C_,shift:E_},{key:"End",run:ide,shift:xde,preventDefault:!0},{key:"Mod-End",run:T_,shift:__},{key:"Enter",run:A_,shift:A_},{key:"Mod-a",run:kde},{key:"Backspace",run:uO,shift:uO,preventDefault:!0},{key:"Delete",run:D$,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:z$,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Ede,preventDefault:!0},{mac:"Mod-Backspace",run:Ade,preventDefault:!0},{mac:"Mod-Delete",run:Mde,preventDefault:!0}].concat(Qde.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Ude=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:rde,shift:pde},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:sde,shift:gde},{key:"Alt-ArrowUp",run:Pde},{key:"Shift-Alt-ArrowUp",run:Ide},{key:"Alt-ArrowDown",run:zde},{key:"Shift-Alt-ArrowDown",run:Lde},{key:"Mod-Alt-ArrowUp",run:Nde},{key:"Mod-Alt-ArrowDown",run:Cde},{key:"Escape",run:Tde},{key:"Mod-Enter",run:qde},{key:"Alt-l",mac:"Ctrl-l",run:Ode},{key:"Mod-i",run:jde,preventDefault:!0},{key:"Mod-[",run:q$},{key:"Mod-]",run:F$},{key:"Mod-Alt-\\",run:$de},{key:"Shift-Mod-k",run:Bde},{key:"Shift-Mod-\\",run:hde},{key:"Mod-/",run:Pue},{key:"Alt-A",run:Iue},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Hde}].concat(Vde),Wde={key:"Tab",run:F$,shift:q$},M_=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class af{constructor(e,n,r=0,s=e.length,i,a){this.test=a,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?l=>i(M_(l)):M_,this.query=this.normalize(n)}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 gi(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 n=Zj(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=wo(e);let s=this.normalize(n);if(s.length)for(let i=0,a=r;;i++){let l=s.charCodeAt(i),c=this.match(l,a,this.bufferPos+this.bufferStart);if(i==s.length-1){if(c)return this.value=c,this;break}a==r&&ithis.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 n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,s=r+n[0].length;if(this.matchPos=ty(this.text,s+(r==s?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(rthis.value.to)&&(!this.test||this.test(r,s,n)))return this.value={from:r,to:s,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=r||s.to<=n){let l=new Ih(n,e.sliceString(n,r));return eS.set(e,l),l}if(s.from==n&&s.to==r)return s;let{text:i,from:a}=s;return a>n&&(i=e.sliceString(n,a)+i,a=n),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,s=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,s,n)))return this.value={from:r,to:s,match:n},this.matchPos=ty(this.text,s+(r==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ih.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(H$.prototype[Symbol.iterator]=Q$.prototype[Symbol.iterator]=function(){return this});function Gde(t){try{return new RegExp(t,C6),!0}catch{return!1}}function ty(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e=56320&&r<57344;)e++;return e}function dO(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=sr("input",{class:"cm-textfield",name:"line",value:e}),r=sr("form",{class:"cm-gotoLine",onkeydown:i=>{i.keyCode==27?(i.preventDefault(),t.dispatch({effects:N0.of(!1)}),t.focus()):i.keyCode==13&&(i.preventDefault(),s())},onsubmit:i=>{i.preventDefault(),s()}},sr("label",t.state.phrase("Go to line"),": ",n)," ",sr("button",{class:"cm-button",type:"submit"},t.state.phrase("go")),sr("button",{name:"close",onclick:()=>{t.dispatch({effects:N0.of(!1)}),t.focus()},"aria-label":t.state.phrase("close"),type:"button"},["×"]));function s(){let i=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!i)return;let{state:a}=t,l=a.doc.lineAt(a.selection.main.head),[,c,d,h,m]=i,g=h?+h.slice(1):0,x=d?+d:l.number;if(d&&m){let S=x/100;c&&(S=S*(c=="-"?-1:1)+l.number/a.doc.lines),x=Math.round(a.doc.lines*S)}else d&&c&&(x=x*(c=="-"?-1:1)+l.number);let y=a.doc.line(Math.max(1,Math.min(a.doc.lines,x))),w=Me.cursor(y.from+Math.max(0,Math.min(g,y.length)));t.dispatch({effects:[N0.of(!1),Ze.scrollIntoView(w.from,{y:"center"})],selection:w}),t.focus()}return{dom:r}}const N0=Ft.define(),R_=Os.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(N0)&&(t=n.value);return t},provide:t=>U0.from(t,e=>e?dO:null)}),Xde=t=>{let e=V0(t,dO);if(!e){let n=[N0.of(!0)];t.state.field(R_,!1)==null&&n.push(Ft.appendConfig.of([R_,Yde])),t.dispatch({effects:n}),e=V0(t,dO)}return e&&e.dom.querySelector("input").select(),!0},Yde=Ze.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"}}}),Kde={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Zde=at.define({combine(t){return $o(t,Kde,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function Jde(t){return[she,rhe]}const ehe=kt.mark({class:"cm-selectionMatch"}),the=kt.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function D_(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=wr.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=wr.Word)}function nhe(t,e,n,r){return t(e.sliceDoc(n,n+1))==wr.Word&&t(e.sliceDoc(r-1,r))==wr.Word}const rhe=Vr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(Zde),{state:n}=t,r=n.selection;if(r.ranges.length>1)return kt.none;let s=r.main,i,a=null;if(s.empty){if(!e.highlightWordAroundCursor)return kt.none;let c=n.wordAt(s.head);if(!c)return kt.none;a=n.charCategorizer(s.head),i=n.sliceDoc(c.from,c.to)}else{let c=s.to-s.from;if(c200)return kt.none;if(e.wholeWords){if(i=n.sliceDoc(s.from,s.to),a=n.charCategorizer(s.head),!(D_(a,n,s.from,s.to)&&nhe(a,n,s.from,s.to)))return kt.none}else if(i=n.sliceDoc(s.from,s.to),!i)return kt.none}let l=[];for(let c of t.visibleRanges){let d=new af(n.doc,i,c.from,c.to);for(;!d.next().done;){let{from:h,to:m}=d.value;if((!a||D_(a,n,h,m))&&(s.empty&&h<=s.from&&m>=s.to?l.push(the.range(h,m)):(h>=s.to||m<=s.from)&&l.push(ehe.range(h,m)),l.length>e.maxMatches))return kt.none}}return kt.set(l)}},{decorations:t=>t.decorations}),she=Ze.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),ihe=({state:t,dispatch:e})=>{let{selection:n}=t,r=Me.create(n.ranges.map(s=>t.wordAt(s.head)||Me.cursor(s.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function ahe(t,e){let{main:n,ranges:r}=t.selection,s=t.wordAt(n.head),i=s&&s.from==n.from&&s.to==n.to;for(let a=!1,l=new af(t.doc,e,r[r.length-1].to);;)if(l.next(),l.done){if(a)return null;l=new af(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),a=!0}else{if(a&&r.some(c=>c.from==l.value.from))continue;if(i){let c=t.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const ohe=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(i=>i.from===i.to))return ihe({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(i=>t.sliceDoc(i.from,i.to)!=r))return!1;let s=ahe(t,r);return s?(e(t.update({selection:t.selection.addRange(Me.range(s.from,s.to),!1),effects:Ze.scrollIntoView(s.to)})),!0):!1},Tf=at.define({combine(t){return $o(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new yhe(e),scrollToMatch:e=>Ze.scrollIntoView(e)})}});class V${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||Gde(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,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 dhe(this):new che(this)}getCursor(e,n=0,r){let s=e.doc?e:wn.create({doc:e});return r==null&&(r=s.doc.length),this.regexp?bh(this,s,n,r):yh(this,s,n,r)}}class U${constructor(e){this.spec=e}}function yh(t,e,n,r){return new af(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:s=>s.toLowerCase(),t.wholeWord?lhe(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function lhe(t,e){return(n,r,s,i)=>((i>n||i+s.length=n)return null;s.push(r.value)}return s}highlight(e,n,r,s){let i=yh(this.spec,e,Math.max(0,n-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 bh(t,e,n,r){return new H$(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?uhe(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function ny(t,e){return t.slice(zs(t,e,!1),e)}function ry(t,e){return t.slice(e,zs(t,e))}function uhe(t){return(e,n,r)=>!r[0].length||(t(ny(r.input,r.index))!=wr.Word||t(ry(r.input,r.index))!=wr.Word)&&(t(ry(r.input,r.index+r[0].length))!=wr.Word||t(ny(r.input,r.index+r[0].length))!=wr.Word)}class dhe extends U${nextMatch(e,n,r){let s=bh(this.spec,e,r,e.doc.length).next();return s.done&&(s=bh(this.spec,e,0,n).next()),s.done?null:s.value}prevMatchInRange(e,n,r){for(let s=1;;s++){let i=Math.max(n,r-s*1e4),a=bh(this.spec,e,i,r),l=null;for(;!a.next().done;)l=a.value;if(l&&(i==n||l.from>i+10))return l;if(i==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,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=n)return null;s.push(r.value)}return s}highlight(e,n,r,s){let i=bh(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!i.next().done;)s(i.value.from,i.value.to)}}const Z0=Ft.define(),T6=Ft.define(),$c=Os.define({create(t){return new tS(hO(t).create(),null)},update(t,e){for(let n of e.effects)n.is(Z0)?t=new tS(n.value.create(),t.panel):n.is(T6)&&(t=new tS(t.query,n.value?E6:null));return t},provide:t=>U0.from(t,e=>e.panel)});class tS{constructor(e,n){this.query=e,this.panel=n}}const hhe=kt.mark({class:"cm-searchMatch"}),fhe=kt.mark({class:"cm-searchMatch cm-searchMatch-selected"}),mhe=Vr.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field($c))}update(t){let e=t.state.field($c);(e!=t.startState.field($c)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return kt.none;let{view:n}=this,r=new ql;for(let s=0,i=n.visibleRanges,a=i.length;si[s+1].from-500;)c=i[++s].to;t.highlight(n.state,l,c,(d,h)=>{let m=n.state.selection.ranges.some(g=>g.from==d&&g.to==h);r.add(d,h,m?fhe:hhe)})}return r.finish()}},{decorations:t=>t.decorations});function Kp(t){return e=>{let n=e.state.field($c,!1);return n&&n.query.spec.valid?t(e,n):X$(e)}}const sy=Kp((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let s=Me.single(r.from,r.to),i=t.state.facet(Tf);return t.dispatch({selection:s,effects:[_6(t,r),i.scrollToMatch(s.main,t)],userEvent:"select.search"}),G$(t),!0}),iy=Kp((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,s=e.prevMatch(n,r,r);if(!s)return!1;let i=Me.single(s.from,s.to),a=t.state.facet(Tf);return t.dispatch({selection:i,effects:[_6(t,s),a.scrollToMatch(i.main,t)],userEvent:"select.search"}),G$(t),!0}),phe=Kp((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:Me.create(n.map(r=>Me.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),ghe=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:s}=n.main,i=[],a=0;for(let l=new af(t.doc,t.sliceDoc(r,s));!l.next().done;){if(i.length>1e3)return!1;l.value.from==r&&(a=i.length),i.push(Me.range(l.value.from,l.value.to))}return e(t.update({selection:Me.create(i,a),userEvent:"select.search.matches"})),!0},P_=Kp((t,{query:e})=>{let{state:n}=t,{from:r,to:s}=n.selection.main;if(n.readOnly)return!1;let i=e.nextMatch(n,r,r);if(!i)return!1;let a=i,l=[],c,d,h=[];a.from==r&&a.to==s&&(d=n.toText(e.getReplacement(a)),l.push({from:a.from,to:a.to,insert:d}),a=e.nextMatch(n,a.from,a.to),h.push(Ze.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let m=t.state.changes(l);return a&&(c=Me.single(a.from,a.to).map(m),h.push(_6(t,a)),h.push(n.facet(Tf).scrollToMatch(c.main,t))),t.dispatch({changes:m,selection:c,effects:h,userEvent:"input.replace"}),!0}),xhe=Kp((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(s=>{let{from:i,to:a}=s;return{from:i,to:a,insert:e.getReplacement(s)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:Ze.announce.of(r),userEvent:"input.replace.all"}),!0});function E6(t){return t.state.facet(Tf).createPanel(t)}function hO(t,e){var n,r,s,i,a;let l=t.selection.main,c=l.empty||l.to>l.from+100?"":t.sliceDoc(l.from,l.to);if(e&&!c)return e;let d=t.facet(Tf);return new V$({search:((n=e?.literal)!==null&&n!==void 0?n:d.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(r=e?.caseSensitive)!==null&&r!==void 0?r:d.caseSensitive,literal:(s=e?.literal)!==null&&s!==void 0?s:d.literal,regexp:(i=e?.regexp)!==null&&i!==void 0?i:d.regexp,wholeWord:(a=e?.wholeWord)!==null&&a!==void 0?a:d.wholeWord})}function W$(t){let e=V0(t,E6);return e&&e.dom.querySelector("[main-field]")}function G$(t){let e=W$(t);e&&e==t.root.activeElement&&e.select()}const X$=t=>{let e=t.state.field($c,!1);if(e&&e.panel){let n=W$(t);if(n&&n!=t.root.activeElement){let r=hO(t.state,e.query.spec);r.valid&&t.dispatch({effects:Z0.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[T6.of(!0),e?Z0.of(hO(t.state,e.query.spec)):Ft.appendConfig.of(whe)]});return!0},Y$=t=>{let e=t.state.field($c,!1);if(!e||!e.panel)return!1;let n=V0(t,E6);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:T6.of(!1)}),!0},vhe=[{key:"Mod-f",run:X$,scope:"editor search-panel"},{key:"F3",run:sy,shift:iy,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:sy,shift:iy,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Y$,scope:"editor search-panel"},{key:"Mod-Shift-l",run:ghe},{key:"Mod-Alt-g",run:Xde},{key:"Mod-d",run:ohe,preventDefault:!0}];class yhe{constructor(e){this.view=e;let n=this.query=e.state.field($c).query.spec;this.commit=this.commit.bind(this),this.searchField=sr("input",{value:n.search,placeholder:Li(e,"Find"),"aria-label":Li(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=sr("input",{value:n.replace,placeholder:Li(e,"Replace"),"aria-label":Li(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=sr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=sr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=sr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(s,i,a){return sr("button",{class:"cm-button",name:s,onclick:i,type:"button"},a)}this.dom=sr("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,r("next",()=>sy(e),[Li(e,"next")]),r("prev",()=>iy(e),[Li(e,"previous")]),r("select",()=>phe(e),[Li(e,"all")]),sr("label",null,[this.caseField,Li(e,"match case")]),sr("label",null,[this.reField,Li(e,"regexp")]),sr("label",null,[this.wordField,Li(e,"by word")]),...e.state.readOnly?[]:[sr("br"),this.replaceField,r("replace",()=>P_(e),[Li(e,"replace")]),r("replaceAll",()=>xhe(e),[Li(e,"replace all")])],sr("button",{name:"close",onclick:()=>Y$(e),"aria-label":Li(e,"close"),type:"button"},["×"])])}commit(){let e=new V$({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:Z0.of(e)}))}keydown(e){Ole(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?iy:sy)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),P_(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(Z0)&&!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(Tf).top}}function Li(t,e){return t.state.phrase(e)}const v1=30,y1=/[\s\.,:;?!]/;function _6(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),s=t.state.doc.lineAt(n).to,i=Math.max(r.from,e-v1),a=Math.min(s,n+v1),l=t.state.sliceDoc(i,a);if(i!=r.from){for(let c=0;cl.length-v1;c--)if(!y1.test(l[c-1])&&y1.test(l[c])){l=l.slice(0,c);break}}return Ze.announce.of(`${t.state.phrase("current match")}. ${l} ${t.state.phrase("on line")} ${r.number}.`)}const bhe=Ze.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"}}),whe=[$c,ou.low(mhe),bhe];class K${constructor(e,n,r,s){this.state=e,this.pos=n,this.explicit=r,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=Ss(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),s=n.text.slice(r-n.from,this.pos-n.from),i=s.search(J$(e,!1));return i<0?null:{from:r+i,to:this.pos,text:s.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function z_(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function She(t){let e=Object.create(null),n=Object.create(null);for(let{label:s}of t){e[s[0]]=!0;for(let i=1;itypeof s=="string"?{label:s}:s),[n,r]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:She(e);return s=>{let i=s.matchBefore(r);return i||s.explicit?{from:i?i.from:s.pos,options:e,validFor:n}:null}}function khe(t,e){return n=>{for(let r=Ss(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}let I_=class{constructor(e,n,r,s){this.completion=e,this.source=n,this.match=r,this.score=s}};function ed(t){return t.selection.main.from}function J$(t,e){var n;let{source:r}=t,s=e&&r[0]!="^",i=r[r.length-1]!="$";return!s&&!i?t:new RegExp(`${s?"^":""}(?:${r})${i?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}const A6=qo.define();function Ohe(t,e,n,r){let{main:s}=t.selection,i=n-s.from,a=r-s.from;return{...t.changeByRange(l=>{if(l!=s&&n!=r&&t.sliceDoc(l.from+i,l.from+a)!=t.sliceDoc(n,r))return{range:l};let c=t.toText(e);return{changes:{from:l.from+i,to:r==s.from?l.to:l.from+a,insert:c},range:Me.cursor(l.from+i+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const L_=new WeakMap;function jhe(t){if(!Array.isArray(t))return t;let e=L_.get(t);return e||L_.set(t,e=Z$(t)),e}const ay=Ft.define(),J0=Ft.define();class Nhe{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&E<=57||E>=97&&E<=122?2:E>=65&&E<=90?1:0:(_=Zj(E))!=_.toLowerCase()?1:_!=_.toUpperCase()?2:0;(!j||A==1&&S||T==0&&A!=0)&&(n[m]==E||r[m]==E&&(g=!0)?a[m++]=j:a.length&&(k=!1)),T=A,j+=wo(E)}return m==c&&a[0]==0&&k?this.result(-100+(g?-200:0),a,e):x==c&&y==0?this.ret(-200-e.length+(w==e.length?0:-100),[0,w]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):x==c?this.ret(-900-e.length,[y,w]):m==c?this.result(-100+(g?-200:0)+-700+(k?0:-1100),a,e):n.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,n,r){let s=[],i=0;for(let a of n){let l=a+(this.astral?wo(gi(r,a)):1);i&&s[i-1]==a?s[i-1]=l:(s[i++]=a,s[i++]=l)}return this.ret(e-r.length,s)}}class Che{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:The,filterStrict:!1,compareCompletions:(e,n)=>e.label.localeCompare(n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>B_(e(r),n(r)),optionClass:(e,n)=>r=>B_(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function B_(t,e){return t?e?t+" "+e:t:e}function The(t,e,n,r,s,i){let a=t.textDirection==gr.RTL,l=a,c=!1,d="top",h,m,g=e.left-s.left,x=s.right-e.right,y=r.right-r.left,w=r.bottom-r.top;if(l&&g=w||j>e.top?h=n.bottom-e.top:(d="bottom",h=e.bottom-n.top)}let S=(e.bottom-e.top)/i.offsetHeight,k=(e.right-e.left)/i.offsetWidth;return{style:`${d}: ${h/S}px; max-width: ${m/k}px`,class:"cm-completionInfo-"+(c?a?"left-narrow":"right-narrow":l?"left":"right")}}function Ehe(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,s,i){let a=document.createElement("span");a.className="cm-completionLabel";let l=n.displayLabel||n.label,c=0;for(let d=0;dc&&a.appendChild(document.createTextNode(l.slice(c,h)));let g=a.appendChild(document.createElement("span"));g.appendChild(document.createTextNode(l.slice(h,m))),g.className="cm-completionMatchedText",c=m}return cn.position-r.position).map(n=>n.render)}function nS(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let s=Math.floor(e/n);return{from:s*n,to:(s+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}class _he{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let s=e.state.field(n),{options:i,selected:a}=s.open,l=e.state.facet(bs);this.optionContent=Ehe(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=nS(i.length,a,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",c=>{let{options:d}=e.state.field(n).open;for(let h=c.target,m;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(m=/-(\d+)$/.exec(h.id))&&+m[1]{let d=e.state.field(this.stateField,!1);d&&d.tooltip&&e.state.facet(bs).closeOnBlur&&c.relatedTarget!=e.contentDOM&&e.dispatch({effects:J0.of(null)})}),this.showOptions(i,s.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),s=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=s){let{options:i,selected:a,disabled:l}=r.open;(!s.open||s.open.options!=i)&&(this.range=nS(i.length,a,e.state.facet(bs).maxRenderedOptions),this.showOptions(i,r.id)),this.updateSel(),l!=((n=s.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;(n.selected>-1&&n.selected=this.range.to)&&(this.range=nS(n.options.length,n.selected,this.view.state.facet(bs).maxRenderedOptions),this.showOptions(n.options,e.id));let r=this.updateSelectedOption(n.selected);if(r){this.destroyInfo();let{completion:s}=n.options[n.selected],{info:i}=s;if(!i)return;let a=typeof i=="string"?document.createTextNode(i):i(s);if(!a)return;"then"in a?a.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,s)}).catch(l=>vi(this.view.state,l,"completion info")):(this.addInfoPane(a,s),r.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,n){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 n=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"),n=r):r.hasAttribute("aria-selected")&&(r.removeAttribute("aria-selected"),r.removeAttribute("aria-describedby"));return n&&Mhe(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),i=this.space;if(!i){let a=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:a.clientWidth,bottom:a.clientHeight}}return s.top>Math.min(i.bottom,n.bottom)-10||s.bottom{a.target==s&&a.preventDefault()});let i=null;for(let a=r.from;ar.from||r.from==0))if(i=g,typeof d!="string"&&d.header)s.appendChild(d.header(d));else{let x=s.appendChild(document.createElement("completion-section"));x.textContent=g}}const h=s.appendChild(document.createElement("li"));h.id=n+"-"+a,h.setAttribute("role","option");let m=this.optionClass(l);m&&(h.className=m);for(let g of this.optionContent){let x=g(l,this.view.state,this.view,c);x&&h.appendChild(x)}}return r.from&&s.classList.add("cm-completionListIncompleteTop"),r.tonew _he(n,t,e)}function Mhe(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),s=n.height/t.offsetHeight;r.topn.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/s)}function F_(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function Rhe(t,e){let n=[],r=null,s=null,i=h=>{n.push(h);let{section:m}=h.completion;if(m){r||(r=[]);let g=typeof m=="string"?m:m.name;r.some(x=>x.name==g)||r.push(typeof m=="string"?{name:g}:m)}},a=e.facet(bs);for(let h of t)if(h.hasResult()){let m=h.result.getMatch;if(h.result.filter===!1)for(let g of h.result.options)i(new I_(g,h.source,m?m(g):[],1e9-n.length));else{let g=e.sliceDoc(h.from,h.to),x,y=a.filterStrict?new Che(g):new Nhe(g);for(let w of h.result.options)if(x=y.match(w.label)){let S=w.displayLabel?m?m(w,x.matched):[]:x.matched,k=x.score+(w.boost||0);if(i(new I_(w,h.source,S,k)),typeof w.section=="object"&&w.section.rank==="dynamic"){let{name:j}=w.section;s||(s=Object.create(null)),s[j]=Math.max(k,s[j]||-1e9)}}}}if(r){let h=Object.create(null),m=0,g=(x,y)=>(x.rank==="dynamic"&&y.rank==="dynamic"?s[y.name]-s[x.name]:0)||(typeof x.rank=="number"?x.rank:1e9)-(typeof y.rank=="number"?y.rank:1e9)||(x.nameg.score-m.score||d(m.completion,g.completion))){let m=h.completion;!c||c.label!=m.label||c.detail!=m.detail||c.type!=null&&m.type!=null&&c.type!=m.type||c.apply!=m.apply||c.boost!=m.boost?l.push(h):F_(h.completion)>F_(c)&&(l[l.length-1]=h),c=h.completion}return l}class Th{constructor(e,n,r,s,i,a){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=s,this.selected=i,this.disabled=a}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new Th(this.options,q_(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,s,i,a){if(s&&!a&&e.some(d=>d.isPending))return s.setDisabled();let l=Rhe(e,n);if(!l.length)return s&&e.some(d=>d.isPending)?s.setDisabled():null;let c=n.facet(bs).selectOnOpen?0:-1;if(s&&s.selected!=c&&s.selected!=-1){let d=s.options[s.selected].completion;for(let h=0;hh.hasResult()?Math.min(d,h.from):d,1e8),create:Bhe,above:i.aboveCursor},s?s.timestamp:Date.now(),c,!1)}map(e){return new Th(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Th(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class oy{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new oy(Ihe,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(bs),i=(r.override||n.languageDataAt("autocomplete",ed(n)).map(jhe)).map(c=>(this.active.find(h=>h.source==c)||new ba(c,this.active.some(h=>h.state!=0)?1:0)).update(e,r));i.length==this.active.length&&i.every((c,d)=>c==this.active[d])&&(i=this.active);let a=this.open,l=e.effects.some(c=>c.is(M6));a&&e.docChanged&&(a=a.map(e.changes)),e.selection||i.some(c=>c.hasResult()&&e.changes.touchesRange(c.from,c.to))||!Dhe(i,this.active)||l?a=Th.build(i,n,this.id,a,r,l):a&&a.disabled&&!i.some(c=>c.isPending)&&(a=null),!a&&i.every(c=>!c.isPending)&&i.some(c=>c.hasResult())&&(i=i.map(c=>c.hasResult()?new ba(c.source,0):c));for(let c of e.effects)c.is(tH)&&(a=a&&a.setSelected(c.value,this.id));return i==this.active&&a==this.open?this:new oy(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Phe:zhe}}function Dhe(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n-1&&(n["aria-activedescendant"]=t+"-"+e),n}const Ihe=[];function eH(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(A6);if(r&&e.activateOnCompletion(r))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class ba{constructor(e,n,r=!1){this.source=e,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,n){let r=eH(e,n),s=this;(r&8||r&16&&this.touches(e))&&(s=new ba(s.source,0)),r&4&&s.state==0&&(s=new ba(this.source,1)),s=s.updateFor(e,r);for(let i of e.effects)if(i.is(ay))s=new ba(s.source,1,i.value);else if(i.is(J0))s=new ba(s.source,0);else if(i.is(M6))for(let a of i.value)a.source==s.source&&(s=a);return s}updateFor(e,n){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(ed(e.state))}}class Lh extends ba{constructor(e,n,r,s,i,a){super(e,3,n),this.limit=r,this.result=s,this.from=i,this.to=a}hasResult(){return!0}updateFor(e,n){var r;if(!(n&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),a=e.changes.mapPos(this.to,1),l=ed(e.state);if(l>a||!s||n&2&&(ed(e.startState)==this.from||ln.map(e))}}),tH=Ft.define(),xi=Os.define({create(){return oy.start()},update(t,e){return t.update(e)},provide:t=>[h6.from(t,e=>e.tooltip),Ze.contentAttributes.from(t,e=>e.attrs)]});function R6(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(xi).active.find(s=>s.source==e.source);return r instanceof Lh?(typeof n=="string"?t.dispatch({...Ohe(t.state,n,r.from,r.to),annotations:A6.of(e.completion)}):n(t,e.completion,r.from,r.to),!0):!1}const Bhe=Ahe(xi,R6);function b1(t,e="option"){return n=>{let r=n.state.field(xi,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp-1?r.open.selected+s*(t?1:-1):t?0:a-1;return l<0?l=e=="page"?0:a-1:l>=a&&(l=e=="page"?a-1:0),n.dispatch({effects:tH.of(l)}),!0}}const Fhe=t=>{let e=t.state.field(xi,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(xi,!1)?(t.dispatch({effects:ay.of(!0)}),!0):!1,qhe=t=>{let e=t.state.field(xi,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:J0.of(null)}),!0)};class $he{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const Hhe=50,Qhe=1e3,Vhe=Vr.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(xi).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(xi),n=t.state.facet(bs);if(!t.selectionSet&&!t.docChanged&&t.startState.field(xi)==e)return;let r=t.transactions.some(i=>{let a=eH(i,n);return a&8||(i.selection||i.docChanged)&&!(a&3)});for(let i=0;iHhe&&Date.now()-a.time>Qhe){for(let l of a.context.abortListeners)try{l()}catch(c){vi(this.view.state,c)}a.context.abortListeners=null,this.running.splice(i--,1)}else a.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(i=>i.effects.some(a=>a.is(ay)))&&(this.pendingStart=!0);let s=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(i=>i.isPending&&!this.running.some(a=>a.active.source==i.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let i of t.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:t}=this.view,e=t.field(xi);for(let n of e.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(bs).updateSyncTime))}startQuery(t){let{state:e}=this.view,n=ed(e),r=new K$(e,n,t.explicit,this.view),s=new $he(t,r);this.running.push(s),Promise.resolve(t.source(r)).then(i=>{s.context.aborted||(s.done=i||null,this.scheduleAccept())},i=>{this.view.dispatch({effects:J0.of(null)}),vi(this.view.state,i)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(bs).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(bs),r=this.view.state.field(xi);for(let s=0;sl.source==i.active.source);if(a&&a.isPending)if(i.done==null){let l=new ba(i.active.source,0);for(let c of i.updates)l=l.update(c,n);l.isPending||e.push(l)}else this.startQuery(a)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:M6.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(xi,!1);if(e&&e.tooltip&&this.view.state.facet(bs).closeOnBlur){let n=e.open&&Eq(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:J0.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:ay.of(!1)}),20),this.composing=0}}}),Uhe=typeof navigator=="object"&&/Win/.test(navigator.platform),Whe=ou.highest(Ze.domEventHandlers({keydown(t,e){let n=e.state.field(xi,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(Uhe&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],s=n.active.find(a=>a.source==r.source),i=r.completion.commitCharacters||s.result.commitCharacters;return i&&i.indexOf(t.key)>-1&&R6(e,r),!1}})),nH=Ze.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 Ghe{constructor(e,n,r,s){this.field=e,this.line=n,this.from=r,this.to=s}}class D6{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,Ds.TrackDel),r=e.mapPos(this.to,1,Ds.TrackDel);return n==null||r==null?null:new D6(this.field,n,r)}}class P6{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],s=[n],i=e.doc.lineAt(n),a=/^\s*/.exec(i.text)[0];for(let c of this.lines){if(r.length){let d=a,h=/^\t*/.exec(c)[0].length;for(let m=0;mnew D6(c.field,s[c.line]+c.from,s[c.line]+c.to));return{text:r,ranges:l}}static parse(e){let n=[],r=[],s=[],i;for(let a of e.split(/\r\n?|\n/)){for(;i=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(a);){let l=i[1]?+i[1]:null,c=i[2]||i[3]||"",d=-1,h=c.replace(/\\[{}]/g,m=>m[1]);for(let m=0;m=d&&g.field++}for(let m of s)if(m.line==r.length&&m.from>i.index){let g=i[2]?3+(i[1]||"").length:2;m.from-=g,m.to-=g}s.push(new Ghe(d,r.length,i.index,i.index+h.length)),a=a.slice(0,i.index)+c+a.slice(i.index+i[0].length)}a=a.replace(/\\([{}])/g,(l,c,d)=>{for(let h of s)h.line==r.length&&h.from>d&&(h.from--,h.to--);return c}),r.push(a)}return new P6(r,s)}}let Xhe=kt.widget({widget:new class extends Ho{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),Yhe=kt.mark({class:"cm-snippetField"});class Ef{constructor(e,n){this.ranges=e,this.active=n,this.deco=kt.set(e.map(r=>(r.from==r.to?Xhe:Yhe).range(r.from,r.to)),!0)}map(e){let n=[];for(let r of this.ranges){let s=r.map(e);if(!s)return null;n.push(s)}return new Ef(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const Zp=Ft.define({map(t,e){return t&&t.map(e)}}),Khe=Ft.define(),ep=Os.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(Zp))return n.value;if(n.is(Khe)&&t)return new Ef(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>Ze.decorations.from(t,e=>e?e.deco:kt.none)});function z6(t,e){return Me.create(t.filter(n=>n.field==e).map(n=>Me.range(n.from,n.to)))}function Zhe(t){let e=P6.parse(t);return(n,r,s,i)=>{let{text:a,ranges:l}=e.instantiate(n.state,s),{main:c}=n.state.selection,d={changes:{from:s,to:i==c.from?c.to:i,insert:jn.of(a)},scrollIntoView:!0,annotations:r?[A6.of(r),ns.userEvent.of("input.complete")]:void 0};if(l.length&&(d.selection=z6(l,0)),l.some(h=>h.field>0)){let h=new Ef(l,0),m=d.effects=[Zp.of(h)];n.state.field(ep,!1)===void 0&&m.push(Ft.appendConfig.of([ep,rfe,sfe,nH]))}n.dispatch(n.state.update(d))}}function rH(t){return({state:e,dispatch:n})=>{let r=e.field(ep,!1);if(!r||t<0&&r.active==0)return!1;let s=r.active+t,i=t>0&&!r.ranges.some(a=>a.field==s+t);return n(e.update({selection:z6(r.ranges,s),effects:Zp.of(i?null:new Ef(r.ranges,s)),scrollIntoView:!0})),!0}}const Jhe=({state:t,dispatch:e})=>t.field(ep,!1)?(e(t.update({effects:Zp.of(null)})),!0):!1,efe=rH(1),tfe=rH(-1),nfe=[{key:"Tab",run:efe,shift:tfe},{key:"Escape",run:Jhe}],$_=at.define({combine(t){return t.length?t[0]:nfe}}),rfe=ou.highest(Vp.compute([$_],t=>t.facet($_)));function vl(t,e){return{...e,apply:Zhe(t)}}const sfe=Ze.domEventHandlers({mousedown(t,e){let n=e.state.field(ep,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let s=n.ranges.find(i=>i.from<=r&&i.to>=r);return!s||s.field==n.active?!1:(e.dispatch({selection:z6(n.ranges,s.field),effects:Zp.of(n.ranges.some(i=>i.field>s.field)?new Ef(n.ranges,s.field):null),scrollIntoView:!0}),!0)}}),tp={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Vu=Ft.define({map(t,e){let n=e.mapPos(t,-1,Ds.TrackAfter);return n??void 0}}),I6=new class extends sd{};I6.startSide=1;I6.endSide=-1;const sH=Os.define({create(){return Rn.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(Vu)&&(t=t.update({add:[I6.range(n.value,n.value+1)]}));return t}});function ife(){return[ofe,sH]}const sS="()[]{}<>«»»«[]{}";function iH(t){for(let e=0;e{if((afe?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let s=t.state.selection.main;if(r.length>2||r.length==2&&wo(gi(r,0))==1||e!=s.from||n!=s.to)return!1;let i=ufe(t.state,r);return i?(t.dispatch(i),!0):!1}),lfe=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=aH(t,t.selection.main.head).brackets||tp.brackets,s=null,i=t.changeByRange(a=>{if(a.empty){let l=dfe(t.doc,a.head);for(let c of r)if(c==l&&bb(t.doc,a.head)==iH(gi(c,0)))return{changes:{from:a.head-c.length,to:a.head+c.length},range:Me.cursor(a.head-c.length)}}return{range:s=a}});return s||e(t.update(i,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},cfe=[{key:"Backspace",run:lfe}];function ufe(t,e){let n=aH(t,t.selection.main.head),r=n.brackets||tp.brackets;for(let s of r){let i=iH(gi(s,0));if(e==s)return i==s?mfe(t,s,r.indexOf(s+s+s)>-1,n):hfe(t,s,i,n.before||tp.before);if(e==i&&oH(t,t.selection.main.from))return ffe(t,s,i)}return null}function oH(t,e){let n=!1;return t.field(sH).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function bb(t,e){let n=t.sliceString(e,e+2);return n.slice(0,wo(gi(n,0)))}function dfe(t,e){let n=t.sliceString(e-2,e);return wo(gi(n,0))==n.length?n:n.slice(1)}function hfe(t,e,n,r){let s=null,i=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:n,from:a.to}],effects:Vu.of(a.to+e.length),range:Me.range(a.anchor+e.length,a.head+e.length)};let l=bb(t.doc,a.head);return!l||/\s/.test(l)||r.indexOf(l)>-1?{changes:{insert:e+n,from:a.head},effects:Vu.of(a.head+e.length),range:Me.cursor(a.head+e.length)}:{range:s=a}});return s?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function ffe(t,e,n){let r=null,s=t.changeByRange(i=>i.empty&&bb(t.doc,i.head)==n?{changes:{from:i.head,to:i.head+n.length,insert:n},range:Me.cursor(i.head+n.length)}:r={range:i});return r?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function mfe(t,e,n,r){let s=r.stringPrefixes||tp.stringPrefixes,i=null,a=t.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:Vu.of(l.to+e.length),range:Me.range(l.anchor+e.length,l.head+e.length)};let c=l.head,d=bb(t.doc,c),h;if(d==e){if(H_(t,c))return{changes:{insert:e+e,from:c},effects:Vu.of(c+e.length),range:Me.cursor(c+e.length)};if(oH(t,c)){let g=n&&t.sliceDoc(c,c+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:c,to:c+g.length,insert:g},range:Me.cursor(c+g.length)}}}else{if(n&&t.sliceDoc(c-2*e.length,c)==e+e&&(h=Q_(t,c-2*e.length,s))>-1&&H_(t,h))return{changes:{insert:e+e+e+e,from:c},effects:Vu.of(c+e.length),range:Me.cursor(c+e.length)};if(t.charCategorizer(c)(d)!=wr.Word&&Q_(t,c,s)>-1&&!pfe(t,c,e,s))return{changes:{insert:e+e,from:c},effects:Vu.of(c+e.length),range:Me.cursor(c+e.length)}}return{range:i=l}});return i?null:t.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function H_(t,e){let n=Ss(t).resolveInner(e+1);return n.parent&&n.from==e}function pfe(t,e,n,r){let s=Ss(t).resolveInner(e,-1),i=r.reduce((a,l)=>Math.max(a,l.length),0);for(let a=0;a<5;a++){let l=t.sliceDoc(s.from,Math.min(s.to,s.from+n.length+i)),c=l.indexOf(n);if(!c||c>-1&&r.indexOf(l.slice(0,c))>-1){let h=s.firstChild;for(;h&&h.from==s.from&&h.to-h.from>n.length+c;){if(t.sliceDoc(h.to-n.length,h.to)==n)return!1;h=h.firstChild}return!0}let d=s.to==e&&s.parent;if(!d)break;s=d}return!1}function Q_(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=wr.Word)return e;for(let s of n){let i=e-s.length;if(t.sliceDoc(i,e)==s&&r(t.sliceDoc(i-1,i))!=wr.Word)return i}return-1}function gfe(t={}){return[Whe,xi,bs.of(t),Vhe,xfe,nH]}const lH=[{key:"Ctrl-Space",run:rS},{mac:"Alt-`",run:rS},{mac:"Alt-i",run:rS},{key:"Escape",run:qhe},{key:"ArrowDown",run:b1(!0)},{key:"ArrowUp",run:b1(!1)},{key:"PageDown",run:b1(!0,"page")},{key:"PageUp",run:b1(!1,"page")},{key:"Enter",run:Fhe}],xfe=ou.highest(Vp.computeN([bs],t=>t.facet(bs).defaultKeymap?[lH]:[]));class V_{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class qu{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let s=r.facet(np).markerFilter;s&&(e=s(e,r));let i=e.slice().sort((x,y)=>x.from-y.from||x.to-y.to),a=new ql,l=[],c=0,d=r.doc.iter(),h=0,m=r.doc.length;for(let x=0;;){let y=x==i.length?null:i[x];if(!y&&!l.length)break;let w,S;if(l.length)w=c,S=l.reduce((N,T)=>Math.min(N,T.to),y&&y.from>w?y.from:1e8);else{if(w=y.from,w>m)break;S=y.to,l.push(y),x++}for(;xN.from||N.to==w))l.push(N),x++,S=Math.min(N.to,S);else{S=Math.min(N.from,S);break}}S=Math.min(S,m);let k=!1;if(l.some(N=>N.from==w&&(N.to==S||S==m))&&(k=w==S,!k&&S-w<10)){let N=w-(h+d.value.length);N>0&&(d.next(N),h=w);for(let T=w;;){if(T>=S){k=!0;break}if(!d.lineBreak&&h+d.value.length>T)break;T=h+d.value.length,h+=d.value.length,d.next()}}let j=_fe(l);if(k)a.add(w,w,kt.widget({widget:new Nfe(j),diagnostics:l.slice()}));else{let N=l.reduce((T,E)=>E.markClass?T+" "+E.markClass:T,"");a.add(w,S,kt.mark({class:"cm-lintRange cm-lintRange-"+j+N,diagnostics:l.slice(),inclusiveEnd:l.some(T=>T.to>S)}))}if(c=S,c==m)break;for(let N=0;N{if(!(e&&a.diagnostics.indexOf(e)<0))if(!r)r=new V_(s,i,e||a.diagnostics[0]);else{if(a.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new V_(r.from,i,r.diagnostic)}}),r}function vfe(t,e){let n=e.pos,r=e.end||n,s=t.state.facet(np).hideOn(t,n,r);if(s!=null)return s;let i=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(a=>a.is(cH))||t.changes.touchesRange(i.from,Math.max(i.to,r)))}function yfe(t,e){return t.field(Vi,!1)?e:e.concat(Ft.appendConfig.of(Afe))}const cH=Ft.define(),L6=Ft.define(),uH=Ft.define(),Vi=Os.define({create(){return new qu(kt.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),r=null,s=t.panel;if(t.selected){let i=e.changes.mapPos(t.selected.from,1);r=of(n,t.selected.diagnostic,i)||of(n,null,i)}!n.size&&s&&e.state.facet(np).autoPanel&&(s=null),t=new qu(n,s,r)}for(let n of e.effects)if(n.is(cH)){let r=e.state.facet(np).autoPanel?n.value.length?rp.open:null:t.panel;t=qu.init(n.value,r,e.state)}else n.is(L6)?t=new qu(t.diagnostics,n.value?rp.open:null,t.selected):n.is(uH)&&(t=new qu(t.diagnostics,t.panel,n.value));return t},provide:t=>[U0.from(t,e=>e.panel),Ze.decorations.from(t,e=>e.diagnostics)]}),bfe=kt.mark({class:"cm-lintRange cm-lintRange-active"});function wfe(t,e,n){let{diagnostics:r}=t.state.field(Vi),s,i=-1,a=-1;r.between(e-(n<0?1:0),e+(n>0?1:0),(c,d,{spec:h})=>{if(e>=c&&e<=d&&(c==d||(e>c||n>0)&&(ehH(t,n,!1)))}const kfe=t=>{let e=t.state.field(Vi,!1);(!e||!e.panel)&&t.dispatch({effects:yfe(t.state,[L6.of(!0)])});let n=V0(t,rp.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},U_=t=>{let e=t.state.field(Vi,!1);return!e||!e.panel?!1:(t.dispatch({effects:L6.of(!1)}),!0)},Ofe=t=>{let e=t.state.field(Vi,!1);if(!e)return!1;let n=t.state.selection.main,r=e.diagnostics.iter(n.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(t.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},jfe=[{key:"Mod-Shift-m",run:kfe,preventDefault:!0},{key:"F8",run:Ofe}],np=at.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...$o(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:W_,tooltipFilter:W_,needsRefresh:(e,n)=>e?n?r=>e(r)||n(r):e:n,hideOn:(e,n)=>e?n?(r,s,i)=>e(r,s,i)||n(r,s,i):e:n,autoPanel:(e,n)=>e||n})}}});function W_(t,e){return t?e?(n,r)=>e(t(n,r),r):t:e}function dH(t){let e=[];if(t)e:for(let{name:n}of t){for(let r=0;ri.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function hH(t,e,n){var r;let s=n?dH(e.actions):[];return sr("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},sr("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((i,a)=>{let l=!1,c=x=>{if(x.preventDefault(),l)return;l=!0;let y=of(t.state.field(Vi).diagnostics,e);y&&i.apply(t,y.from,y.to)},{name:d}=i,h=s[a]?d.indexOf(s[a]):-1,m=h<0?d:[d.slice(0,h),sr("u",d.slice(h,h+1)),d.slice(h+1)],g=i.markClass?" "+i.markClass:"";return sr("button",{type:"button",class:"cm-diagnosticAction"+g,onclick:c,onmousedown:c,"aria-label":` Action: ${d}${h<0?"":` (access key "${s[a]})"`}.`},m)}),e.source&&sr("div",{class:"cm-diagnosticSource"},e.source))}class Nfe extends Ho{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return sr("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class G_{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=hH(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class rp{constructor(e){this.view=e,this.items=[];let n=s=>{if(s.keyCode==27)U_(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],a=dH(i.actions);for(let l=0;l{for(let i=0;iU_(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Vi).selected;if(!e)return-1;for(let n=0;n{for(let h of d.diagnostics){if(a.has(h))continue;a.add(h);let m=-1,g;for(let x=r;xr&&(this.items.splice(r,m-r),s=!0)),n&&g.diagnostic==n.diagnostic?g.dom.hasAttribute("aria-selected")||(g.dom.setAttribute("aria-selected","true"),i=g):g.dom.hasAttribute("aria-selected")&&g.dom.removeAttribute("aria-selected"),r++}});r({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:c})=>{let d=c.height/this.list.offsetHeight;l.topc.bottom&&(this.list.scrollTop+=(l.bottom-c.bottom)/d)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function n(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)n();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(Vi),r=of(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:uH.of(r)})}static open(e){return new rp(e)}}function Cfe(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function w1(t){return Cfe(``,'width="6" height="3"')}const Tfe=Ze.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:w1("#d11")},".cm-lintRange-warning":{backgroundImage:w1("orange")},".cm-lintRange-info":{backgroundImage:w1("#999")},".cm-lintRange-hint":{backgroundImage:w1("#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 Efe(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function _fe(t){let e="hint",n=1;for(let r of t){let s=Efe(r.severity);s>n&&(n=s,e=r.severity)}return e}const Afe=[Vi,Ze.decorations.compute([Vi],t=>{let{selected:e,panel:n}=t.field(Vi);return!e||!n||e.from==e.to?kt.none:kt.set([bfe.range(e.from,e.to)])}),hce(wfe,{hideOn:vfe}),Tfe];var X_=function(e){e===void 0&&(e={});var{crosshairCursor:n=!1}=e,r=[];e.closeBracketsKeymap!==!1&&(r=r.concat(cfe)),e.defaultKeymap!==!1&&(r=r.concat(Ude)),e.searchKeymap!==!1&&(r=r.concat(vhe)),e.historyKeymap!==!1&&(r=r.concat(Jue)),e.foldKeymap!==!1&&(r=r.concat(cue)),e.completionKeymap!==!1&&(r=r.concat(lH)),e.lintKeymap!==!1&&(r=r.concat(jfe));var s=[];return e.lineNumbers!==!1&&s.push(kce()),e.highlightActiveLineGutter!==!1&&s.push(Nce()),e.highlightSpecialChars!==!1&&s.push(qle()),e.history!==!1&&s.push(Que()),e.foldGutter!==!1&&s.push(fue()),e.drawSelection!==!1&&s.push(_le()),e.dropCursor!==!1&&s.push(Ple()),e.allowMultipleSelections!==!1&&s.push(wn.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&s.push(eue()),e.syntaxHighlighting!==!1&&s.push(Jq(xue,{fallback:!0})),e.bracketMatching!==!1&&s.push(Oue()),e.closeBrackets!==!1&&s.push(ife()),e.autocompletion!==!1&&s.push(gfe()),e.rectangularSelection!==!1&&s.push(tce()),n!==!1&&s.push(sce()),e.highlightActiveLine!==!1&&s.push(Wle()),e.highlightSelectionMatches!==!1&&s.push(Jde()),e.tabSize&&typeof e.tabSize=="number"&&s.push(Wp.of(" ".repeat(e.tabSize))),s.concat([Vp.of(r.flat())]).filter(Boolean)};const Mfe="#e5c07b",Y_="#e06c75",Rfe="#56b6c2",Dfe="#ffffff",pv="#abb2bf",fO="#7d8799",Pfe="#61afef",zfe="#98c379",K_="#d19a66",Ife="#c678dd",Lfe="#21252b",Z_="#2c313a",J_="#282c34",iS="#353a42",Bfe="#3E4451",eA="#528bff",Ffe=Ze.theme({"&":{color:pv,backgroundColor:J_},".cm-content":{caretColor:eA},".cm-cursor, .cm-dropCursor":{borderLeftColor:eA},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Bfe},".cm-panels":{backgroundColor:Lfe,color:pv},".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:J_,color:fO,border:"none"},".cm-activeLineGutter":{backgroundColor:Z_},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:iS},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:iS,borderBottomColor:iS},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Z_,color:pv}}},{dark:!0}),qfe=Xp.define([{tag:ve.keyword,color:Ife},{tag:[ve.name,ve.deleted,ve.character,ve.propertyName,ve.macroName],color:Y_},{tag:[ve.function(ve.variableName),ve.labelName],color:Pfe},{tag:[ve.color,ve.constant(ve.name),ve.standard(ve.name)],color:K_},{tag:[ve.definition(ve.name),ve.separator],color:pv},{tag:[ve.typeName,ve.className,ve.number,ve.changed,ve.annotation,ve.modifier,ve.self,ve.namespace],color:Mfe},{tag:[ve.operator,ve.operatorKeyword,ve.url,ve.escape,ve.regexp,ve.link,ve.special(ve.string)],color:Rfe},{tag:[ve.meta,ve.comment],color:fO},{tag:ve.strong,fontWeight:"bold"},{tag:ve.emphasis,fontStyle:"italic"},{tag:ve.strikethrough,textDecoration:"line-through"},{tag:ve.link,color:fO,textDecoration:"underline"},{tag:ve.heading,fontWeight:"bold",color:Y_},{tag:[ve.atom,ve.bool,ve.special(ve.variableName)],color:K_},{tag:[ve.processingInstruction,ve.string,ve.inserted],color:zfe},{tag:ve.invalid,color:Dfe}]),fH=[Ffe,Jq(qfe)];var $fe=Ze.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),Hfe=function(e){e===void 0&&(e={});var{indentWithTab:n=!0,editable:r=!0,readOnly:s=!1,theme:i="light",placeholder:a="",basicSetup:l=!0}=e,c=[];switch(n&&c.unshift(Vp.of([Wde])),l&&(typeof l=="boolean"?c.unshift(X_()):c.unshift(X_(l))),a&&c.unshift(Kle(a)),i){case"light":c.push($fe);break;case"dark":c.push(fH);break;case"none":break;default:c.push(i);break}return r===!1&&c.push(Ze.editable.of(!1)),s&&c.push(wn.readOnly.of(!0)),[...c]},Qfe=t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map(e=>t.state.sliceDoc(e.from,e.to)),selectedText:t.state.selection.ranges.some(e=>!e.empty)});class Vfe{constructor(e,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,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(n=>{try{n()}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 tA{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 aS=null,Ufe=()=>typeof window>"u"?new tA:(aS||(aS=new tA),aS),nA=qo.define(),Wfe=200,Gfe=[];function Xfe(t){var{value:e,selection:n,onChange:r,onStatistics:s,onCreateEditor:i,onUpdate:a,extensions:l=Gfe,autoFocus:c,theme:d="light",height:h=null,minHeight:m=null,maxHeight:g=null,width:x=null,minWidth:y=null,maxWidth:w=null,placeholder:S="",editable:k=!0,readOnly:j=!1,indentWithTab:N=!0,basicSetup:T=!0,root:E,initialState:_}=t,[A,L]=b.useState(),[P,B]=b.useState(),[$,U]=b.useState(),te=b.useState(()=>({current:null}))[0],z=b.useState(()=>({current:null}))[0],Q=Ze.theme({"&":{height:h,minHeight:m,maxHeight:g,width:x,minWidth:y,maxWidth:w},"& .cm-scroller":{height:"100% !important"}}),F=Ze.updateListener.of(X=>{if(X.docChanged&&typeof r=="function"&&!X.transactions.some(G=>G.annotation(nA))){te.current?te.current.reset():(te.current=new Vfe(()=>{if(z.current){var G=z.current;z.current=null,G()}te.current=null},Wfe),Ufe().add(te.current));var R=X.state.doc,ie=R.toString();r(ie,X)}s&&s(Qfe(X))}),Y=Hfe({theme:d,editable:k,readOnly:j,placeholder:S,indentWithTab:N,basicSetup:T}),J=[F,Q,...Y];return a&&typeof a=="function"&&J.push(Ze.updateListener.of(a)),J=J.concat(l),b.useLayoutEffect(()=>{if(A&&!$){var X={doc:e,selection:n,extensions:J},R=_?wn.fromJSON(_.json,X,_.fields):wn.create(X);if(U(R),!P){var ie=new Ze({state:R,parent:A,root:E});B(ie),i&&i(ie,R)}}return()=>{P&&(U(void 0),B(void 0))}},[A,$]),b.useEffect(()=>{t.container&&L(t.container)},[t.container]),b.useEffect(()=>()=>{P&&(P.destroy(),B(void 0)),te.current&&(te.current.cancel(),te.current=null)},[P]),b.useEffect(()=>{c&&P&&P.focus()},[c,P]),b.useEffect(()=>{P&&P.dispatch({effects:Ft.reconfigure.of(J)})},[d,l,h,m,g,x,y,w,S,k,j,N,T,r,a]),b.useEffect(()=>{if(e!==void 0){var X=P?P.state.doc.toString():"";if(P&&e!==X){var R=te.current&&!te.current.isDone,ie=()=>{P&&e!==P.state.doc.toString()&&P.dispatch({changes:{from:0,to:P.state.doc.toString().length,insert:e||""},annotations:[nA.of(!0)]})};R?z.current=ie:ie()}}},[e,P]),{state:$,setState:U,view:P,setView:B,container:A,setContainer:L}}var Yfe=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],mH=b.forwardRef((t,e)=>{var{className:n,value:r="",selection:s,extensions:i=[],onChange:a,onStatistics:l,onCreateEditor:c,onUpdate:d,autoFocus:h,theme:m="light",height:g,minHeight:x,maxHeight:y,width:w,minWidth:S,maxWidth:k,basicSetup:j,placeholder:N,indentWithTab:T,editable:E,readOnly:_,root:A,initialState:L}=t,P=RJ(t,Yfe),B=b.useRef(null),{state:$,view:U,container:te,setContainer:z}=Xfe({root:A,value:r,autoFocus:h,theme:m,height:g,minHeight:x,maxHeight:y,width:w,minWidth:S,maxWidth:k,basicSetup:j,placeholder:N,indentWithTab:T,editable:E,readOnly:_,selection:s,onChange:a,onStatistics:l,onCreateEditor:c,onUpdate:d,extensions:i,initialState:L});b.useImperativeHandle(e,()=>({editor:B.current,state:$,view:U}),[B,te,$,U]);var Q=b.useCallback(Y=>{B.current=Y,z(Y)},[z]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var F=typeof m=="string"?"cm-theme-"+m:"cm-theme";return o.jsx("div",DJ({ref:Q,className:""+F+(n?" "+n:"")},P))});mH.displayName="CodeMirror";var rA={};class ly{constructor(e,n,r,s,i,a,l,c,d,h=0,m){this.p=e,this.stack=n,this.state=r,this.reducePos=s,this.pos=i,this.score=a,this.buffer=l,this.bufferBase=c,this.curContext=d,this.lookAhead=h,this.parent=m}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let s=e.parser.context;return new ly(e,[],n,r,r,0,[],0,s?new sA(s,s.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,s=e&65535,{parser:i}=this.p,a=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[s])===null||n===void 0)&&n.isAnonymous)&&(d==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizec;)this.stack.pop();this.reduceContext(s,d)}storeNode(e,n,r,s=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&a.buffer[l-4]==0&&a.buffer[l-1]>-1){if(n==r)return;if(a.buffer[l-2]>=n){a.buffer[l-2]=r;return}}}if(!i||this.pos==r)this.buffer.push(e,n,r,s);else{let a=this.buffer.length;if(a>0&&(this.buffer[a-4]!=0||this.buffer[a-1]<0)){let l=!1;for(let c=a;c>0&&this.buffer[c-2]>r;c-=4)if(this.buffer[c-1]>=0){l=!0;break}if(l)for(;a>0&&this.buffer[a-2]>r;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,s>4&&(s-=4)}this.buffer[a]=e,this.buffer[a+1]=n,this.buffer[a+2]=r,this.buffer[a+3]=s}}shift(e,n,r,s){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let i=e,{parser:a}=this.p;(s>this.pos||n<=a.maxNode)&&(this.pos=s,a.stateFlag(i,1)||(this.reducePos=s)),this.pushState(i,r),this.shiftContext(n,r),n<=a.maxNode&&this.buffer.push(n,r,s,4)}else this.pos=s,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,s,4)}apply(e,n,r,s){e&65536?this.reduce(e):this.shift(e,n,r,s)}useNode(e,n){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(n,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,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),s=e.bufferBase+n;for(;e&&s==e.bufferBase;)e=e.parent;return new ly(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,s,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new Kfe(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if((r&65536)==0)return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let s=[];for(let i=0,a;ic&1&&l==a)||s.push(n[i],a)}n=s}let r=[];for(let s=0;s>19,s=n&65535,i=this.stack.length-r*3;if(i<0||e.getGoto(this.stack[i],s,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;n=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(s,i)=>{if(!n.includes(s))return n.push(s),e.allActions(s,a=>{if(!(a&393216))if(a&65536){let l=(a>>19)-i;if(l>1){let c=a&65535,d=this.stack.length-l*3;if(d>=0&&e.getGoto(this.stack[d],c,!1)>=0)return l<<19|65536|c}}else{let l=r(a,i+1);if(l!=null)return l}})};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 n=0;nthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class sA{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class Kfe{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=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],n,!0);this.state=s}}class cy{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new cy(e,n,n-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 cy(this.stack,this.pos,this.index)}}function S1(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,s=0;r=92&&a--,a>=34&&a--;let c=a-32;if(c>=46&&(c-=46,l=!0),i+=c,l)break;i*=46}n?n[s++]=i:n=new e(i)}return n}class gv{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const iA=new gv;class Zfe{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=iA,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,s=this.rangeIndex,i=this.pos+e;for(;ir.to:i>=r.to;){if(s==this.ranges.length-1)return null;let a=this.ranges[++s];i+=a.from-r.to,r=a}return i}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,s;if(n>=0&&n=this.chunk2Pos&&rl.to&&(this.chunk2=this.chunk2.slice(0,l.to-r)),s=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),s}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r=this.chunk2Pos&&this.posthis.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,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=iA,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let s of this.ranges){if(s.from>=n)break;s.to>e&&(r+=this.input.read(Math.max(s.from,e),Math.min(s.to,n)))}return r}}class Bh{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;Jfe(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}Bh.prototype.contextual=Bh.prototype.fallback=Bh.prototype.extend=!1;Bh.prototype.fallback=Bh.prototype.extend=!1;class wb{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function Jfe(t,e,n,r,s,i){let a=0,l=1<0){let y=t[x];if(c.allows(y)&&(e.token.value==-1||e.token.value==y||eme(y,e.token.value,s,i))){e.acceptToken(y);break}}let h=e.next,m=0,g=t[a+2];if(e.next<0&&g>m&&t[d+g*3-3]==65535){a=t[d+g*3-1];continue e}for(;m>1,y=d+x+(x<<1),w=t[y],S=t[y+1]||65536;if(h=S)m=x+1;else{a=t[y+2],e.advance();continue e}}break}}function aA(t,e,n){for(let r=e,s;(s=t[r])!=65535;r++)if(s==n)return r-e;return-1}function eme(t,e,n,r){let s=aA(n,r,e);return s<0||aA(n,r,t)e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class tme{constructor(e,n){this.fragments=e,this.nodeSet=n,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?oA(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?oA(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(ee)return this.nextStart=a,null;if(i instanceof ar){if(a==e){if(a=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[n]++,this.nextStart=a+i.length}}}class nme{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new gv)}getActions(e){let n=0,r=null,{parser:s}=e.p,{tokenizers:i}=s,a=s.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,c=0;for(let d=0;dm.end+25&&(c=Math.max(m.lookAhead,c)),m.value!=0)){let g=n;if(m.extended>-1&&(n=this.addActions(e,m.extended,m.end,n)),n=this.addActions(e,m.value,m.end,n),!h.extend&&(r=m,n>g))break}}for(;this.actions.length>n;)this.actions.pop();return c&&e.setLookAhead(c),!r&&e.pos==this.stream.end&&(r=new gv,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new gv,{pos:r,p:s}=e;return n.start=r,n.end=Math.min(r+1,s.stream.end),n.value=r==s.stream.end?s.parser.eofTerm:0,n}updateCachedToken(e,n,r){let s=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(s,e),r),e.value>-1){let{parser:i}=r.p;for(let a=0;a=0&&r.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(s+1)}putAction(e,n,r,s){for(let i=0;ie.bufferLength*4?new tme(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],s,i;if(this.bigReductionCount>300&&e.length==1){let[a]=e;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;an)r.push(l);else{if(this.advanceStack(l,r,e))continue;{s||(s=[],i=[]),s.push(l);let c=this.tokens.getMainToken(l);i.push(c.value,c.end)}}break}}if(!r.length){let a=s&&ame(s);if(a)return Bi&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw Bi&&s&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&s){let a=this.stoppedAt!=null&&s[0].pos>this.stoppedAt?s[0]:this.runRecovery(s,i,r);if(a)return Bi&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(r.length>a)for(r.sort((l,c)=>c.score-l.score);r.length>a;)r.pop();r.some(l=>l.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let a=0;a500&&d.buffer.length>500)if((l.score-d.score||l.buffer.length-d.buffer.length)>0)r.splice(c--,1);else{r.splice(a--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let a=1;a ":"";if(this.stoppedAt!=null&&s>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let d=e.curContext&&e.curContext.tracker.strict,h=d?e.curContext.hash:0;for(let m=this.fragments.nodeAt(s);m;){let g=this.parser.nodeSet.types[m.type.id]==m.type?i.getGoto(e.state,m.type.id):-1;if(g>-1&&m.length&&(!d||(m.prop(sn.contextHash)||0)==h))return e.useNode(m,g),Bi&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(m.type.id)})`),!0;if(!(m instanceof ar)||m.children.length==0||m.positions[0]>0)break;let x=m.children[0];if(x instanceof ar&&m.positions[0]==0)m=x;else break}}let l=i.stateSlot(e.state,4);if(l>0)return e.reduce(l),Bi&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let c=this.tokens.getActions(e);for(let d=0;ds?n.push(y):r.push(y)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return lA(e,n),!0}}runRecovery(e,n,r){let s=null,i=!1;for(let a=0;a ":"";if(l.deadEnd&&(i||(i=!0,l.restart(),Bi&&console.log(h+this.stackID(l)+" (restarted)"),this.advanceFully(l,r))))continue;let m=l.split(),g=h;for(let x=0;x<10&&m.forceReduce()&&(Bi&&console.log(g+this.stackID(m)+" (via force-reduce)"),!this.advanceFully(m,r));x++)Bi&&(g=this.stackID(m)+" -> ");for(let x of l.recoverByInsert(c))Bi&&console.log(h+this.stackID(x)+" (via recover-insert)"),this.advanceFully(x,r);this.stream.end>l.pos?(d==l.pos&&(d++,c=0),l.recoverByDelete(c,d),Bi&&console.log(h+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),lA(l,r)):(!s||s.scoret;class ime{constructor(e){this.start=e.start,this.shift=e.shift||lS,this.reduce=e.reduce||lS,this.reuse=e.reuse||lS,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class sp extends g6{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let l=0;le.topRules[l][1]),s=[];for(let l=0;l=0)i(h,c,l[d++]);else{let m=l[d+-h];for(let g=-h;g>0;g--)i(l[d++],c,m);d++}}}this.nodeSet=new hb(n.map((l,c)=>si.define({name:c>=this.minRepeatTerm?void 0:l,id:c,props:s[c],top:r.indexOf(c)>-1,error:c==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(c)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Rq;let a=S1(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new Bh(a,l):l),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,n,r){let s=new rme(this,e,n,r);for(let i of this.wrappers)s=i(s,e,n,r);return s}getGoto(e,n,r=!1){let s=this.goto;if(n>=s[0])return-1;for(let i=s[n+1];;){let a=s[i++],l=a&1,c=s[i++];if(l&&r)return c;for(let d=i+(a>>1);i0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),s=r?n(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=Cl(this.data,i+2);else break;s=n(Cl(this.data,i+1))}return s}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Cl(this.data,r+2);else break;if((this.data[r+2]&1)==0){let s=this.data[r+1];n.some((i,a)=>a&1&&i==s)||n.push(this.data[r],s)}}return n}configure(e){let n=Object.assign(Object.create(sp.prototype),this);if(e.props&&(n.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}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let s=e.tokenizers.find(i=>i.from==r);return s?s.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,s)=>{let i=e.specializers.find(l=>l.from==r.external);if(!i)return r;let a=Object.assign(Object.assign({},r),{external:i.to});return n.specializers[s]=cA(a),a})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}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 n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let i of e.split(" ")){let a=n.indexOf(i);a>=0&&(r[a]=!0)}let s=null;for(let i=0;ir)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.scoret.external(n,r)<<1|e}return t.get}const ome=1,pH=194,gH=195,lme=196,uA=197,cme=198,ume=199,dme=200,hme=2,xH=3,dA=201,fme=24,mme=25,pme=49,gme=50,xme=55,vme=56,yme=57,bme=59,wme=60,Sme=61,kme=62,Ome=63,jme=65,Nme=238,Cme=71,Tme=241,Eme=242,_me=243,Ame=244,Mme=245,Rme=246,Dme=247,Pme=248,vH=72,zme=249,Ime=250,Lme=251,Bme=252,Fme=253,qme=254,$me=255,Hme=256,Qme=73,Vme=77,Ume=263,Wme=112,Gme=130,Xme=151,Yme=152,Kme=155,ud=10,ip=13,B6=32,Sb=9,F6=35,Zme=40,Jme=46,mO=123,hA=125,yH=39,bH=34,fA=92,e0e=111,t0e=120,n0e=78,r0e=117,s0e=85,i0e=new Set([mme,pme,gme,Ume,jme,Gme,vme,yme,Nme,kme,Ome,vH,Qme,Vme,wme,Sme,Xme,Yme,Kme,Wme]);function cS(t){return t==ud||t==ip}function uS(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const a0e=new wb((t,e)=>{let n;if(t.next<0)t.acceptToken(ume);else if(e.context.flags&xv)cS(t.next)&&t.acceptToken(cme,1);else if(((n=t.peek(-1))<0||cS(n))&&e.canShift(uA)){let r=0;for(;t.next==B6||t.next==Sb;)t.advance(),r++;(t.next==ud||t.next==ip||t.next==F6)&&t.acceptToken(uA,-r)}else cS(t.next)&&t.acceptToken(lme,1)},{contextual:!0}),o0e=new wb((t,e)=>{let n=e.context;if(n.flags)return;let r=t.peek(-1);if(r==ud||r==ip){let s=0,i=0;for(;;){if(t.next==B6)s++;else if(t.next==Sb)s+=8-s%8;else break;t.advance(),i++}s!=n.indent&&t.next!=ud&&t.next!=ip&&t.next!=F6&&(s[t,e|wH])),u0e=new ime({start:l0e,reduce(t,e,n,r){return t.flags&xv&&i0e.has(e)||(e==Cme||e==vH)&&t.flags&wH?t.parent:t},shift(t,e,n,r){return e==pH?new vv(t,c0e(r.read(r.pos,n.pos)),0):e==gH?t.parent:e==fme||e==xme||e==bme||e==xH?new vv(t,0,xv):mA.has(e)?new vv(t,0,mA.get(e)|t.flags&xv):t},hash(t){return t.hash}}),d0e=new wb(t=>{for(let e=0;e<5;e++){if(t.next!="print".charCodeAt(e))return;t.advance()}if(!/\w/.test(String.fromCharCode(t.next)))for(let e=0;;e++){let n=t.peek(e);if(!(n==B6||n==Sb)){n!=Zme&&n!=Jme&&n!=ud&&n!=ip&&n!=F6&&t.acceptToken(ome);return}}}),h0e=new wb((t,e)=>{let{flags:n}=e.context,r=n&Sl?bH:yH,s=(n&kl)>0,i=!(n&Ol),a=(n&jl)>0,l=t.pos;for(;!(t.next<0);)if(a&&t.next==mO)if(t.peek(1)==mO)t.advance(2);else{if(t.pos==l){t.acceptToken(xH,1);return}break}else if(i&&t.next==fA){if(t.pos==l){t.advance();let c=t.next;c>=0&&(t.advance(),f0e(t,c)),t.acceptToken(hme);return}break}else if(t.next==fA&&!i&&t.peek(1)>-1)t.advance(2);else if(t.next==r&&(!s||t.peek(1)==r&&t.peek(2)==r)){if(t.pos==l){t.acceptToken(dA,s?3:1);return}break}else if(t.next==ud){if(s)t.advance();else if(t.pos==l){t.acceptToken(dA);return}break}else t.advance();t.pos>l&&t.acceptToken(dme)});function f0e(t,e){if(e==e0e)for(let n=0;n<2&&t.next>=48&&t.next<=55;n++)t.advance();else if(e==t0e)for(let n=0;n<2&&uS(t.next);n++)t.advance();else if(e==r0e)for(let n=0;n<4&&uS(t.next);n++)t.advance();else if(e==s0e)for(let n=0;n<8&&uS(t.next);n++)t.advance();else if(e==n0e&&t.next==mO){for(t.advance();t.next>=0&&t.next!=hA&&t.next!=yH&&t.next!=bH&&t.next!=ud;)t.advance();t.next==hA&&t.advance()}}const m0e=x6({'async "*" "**" FormatConversion FormatSpec':ve.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":ve.controlKeyword,"in not and or is del":ve.operatorKeyword,"from def class global nonlocal lambda":ve.definitionKeyword,import:ve.moduleKeyword,"with as print":ve.keyword,Boolean:ve.bool,None:ve.null,VariableName:ve.variableName,"CallExpression/VariableName":ve.function(ve.variableName),"FunctionDefinition/VariableName":ve.function(ve.definition(ve.variableName)),"ClassDefinition/VariableName":ve.definition(ve.className),PropertyName:ve.propertyName,"CallExpression/MemberExpression/PropertyName":ve.function(ve.propertyName),Comment:ve.lineComment,Number:ve.number,String:ve.string,FormatString:ve.special(ve.string),Escape:ve.escape,UpdateOp:ve.updateOperator,"ArithOp!":ve.arithmeticOperator,BitOp:ve.bitwiseOperator,CompareOp:ve.compareOperator,AssignOp:ve.definitionOperator,Ellipsis:ve.punctuation,At:ve.meta,"( )":ve.paren,"[ ]":ve.squareBracket,"{ }":ve.brace,".":ve.derefOperator,", ;":ve.separator}),p0e={__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},g0e=sp.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'#FyOOOOQS'#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,5kOOQS1G1`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,5jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!lO!lO!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,5nQdO,5sQdO1G4OOOQS-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<mO#BQQdO,5>mOOQS1G0v1G0vOOQS<rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ oQdO<cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<tO$4{QdO,5>tO1XQdO,5vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5wO$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,5S~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!;|!_![!]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:[d0e,o0e,a0e,h0e,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>p0e[t]||-1}],tokenPrec:7668}),pA=new Rce,SH=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function k1(t){return(e,n,r)=>{if(r)return!1;let s=e.node.getChild("VariableName");return s&&n(s,t),!0}}const x0e={FunctionDefinition:k1("function"),ClassDefinition:k1("class"),ForStatement(t,e,n){if(n){for(let r=t.node.firstChild;r;r=r.nextSibling)if(r.name=="VariableName")e(r,"variable");else if(r.name=="in")break}},ImportStatement(t,e){var n,r;let{node:s}=t,i=((n=s.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let a=s.getChild("import");a;a=a.nextSibling)a.name=="VariableName"&&((r=a.nextSibling)===null||r===void 0?void 0:r.name)!="as"&&e(a,i?"variable":"namespace")},AssignStatement(t,e){for(let n=t.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")e(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(t,e){for(let n=null,r=t.node.firstChild;r;r=r.nextSibling)r.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&e(r,"variable"),n=r},CapturePattern:k1("variable"),AsPattern:k1("variable"),__proto__:null};function kH(t,e){let n=pA.get(e);if(n)return n;let r=[],s=!0;function i(a,l){let c=t.sliceString(a.from,a.to);r.push({label:c,type:l})}return e.cursor(hs.IncludeAnonymous).iterate(a=>{if(a.name){let l=x0e[a.name];if(l&&l(a,i,s)||!s&&SH.has(a.name))return!1;s=!1}else if(a.to-a.from>8192){for(let l of kH(t,a.node))r.push(l);return!1}}),pA.set(e,r),r}const gA=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,OH=["String","FormatString","Comment","PropertyName"];function v0e(t){let e=Ss(t.state).resolveInner(t.pos,-1);if(OH.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&gA.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let s=e;s;s=s.parent)SH.has(s.name)&&(r=r.concat(kH(t.state.doc,s)));return{options:r,from:n?e.from:t.pos,validFor:gA}}const y0e=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(t=>({label:t,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(t=>({label:t,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(t=>({label:t,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(t=>({label:t,type:"function"}))),b0e=[vl("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),vl("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),vl("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),vl("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),vl(`if \${}: -`,{label:"if",detail:"block",type:"keyword"}),xl("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),xl("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),xl("import ${module}",{label:"import",detail:"statement",type:"keyword"}),xl("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],n0e=she(vH,U$(e0e.concat(t0e)));function iS(t){let{node:e,pos:n}=t,r=t.lineIndent(n,-1),s=null;for(;;){let i=e.childBefore(n);if(i)if(i.name=="Comment")n=i.from;else if(i.name=="Body"||i.name=="MatchBody")t.baseIndentFor(i)+t.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 aS(t,e){let n=t.baseIndentFor(e),r=t.lineAt(t.pos,-1),s=r.from+r.text.length;return/^\s*($|#)/.test(r.text)&&t.node.ton?null:n+t.unit}const oS=U0.define({name:"python",parser:Kme.configure({props:[lb.add({Body:t=>{var e;let n=/^\s*(#|$)/.test(t.textAfter)&&iS(t)||t.node;return(e=aS(t,n))!==null&&e!==void 0?e:t.continue()},MatchBody:t=>{var e;let n=iS(t);return(e=aS(t,n||t.node))!==null&&e!==void 0?e:t.continue()},IfStatement:t=>/^\s*(else:|elif )/.test(t.textAfter)?t.baseIndent:t.continue(),"ForStatement WhileStatement":t=>/^\s*else:/.test(t.textAfter)?t.baseIndent:t.continue(),TryStatement:t=>/^\s*(except[ :]|finally:|else:)/.test(t.textAfter)?t.baseIndent:t.continue(),MatchStatement:t=>/^\s*case /.test(t.textAfter)?t.baseIndent+t.unit:t.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":H4({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":H4({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":H4({closing:"]"}),MemberExpression:t=>t.baseIndent+t.unit,"String FormatString":()=>null,Script:t=>{var e;let n=iS(t);return(e=n&&aS(t,n))!==null&&e!==void 0?e:t.continue()}}),g6.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":Lq,Body:(t,e)=>({from:t.from+1,to:t.to-(t.to==e.doc.length?0:1)}),"String FormatString":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.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 r0e(){return new Pq(oS,[oS.data.of({autocomplete:Jme}),oS.data.of({autocomplete:n0e})])}const s0e=f6({String:xe.string,Number:xe.number,"True False":xe.bool,PropertyName:xe.propertyName,Null:xe.null,", :":xe.separator,"[ ]":xe.squareBracket,"{ }":xe.brace}),i0e=tp.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:[s0e],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}),a0e=()=>t=>{try{JSON.parse(t.state.doc.toString())}catch(e){if(!(e instanceof SyntaxError))throw e;const n=o0e(e,t.state.doc);return[{from:n,message:e.message,severity:"error",to:n}]}return[]};function o0e(t,e){let n;return(n=t.message.match(/at position (\d+)/))?Math.min(+n[1],e.length):(n=t.message.match(/at line (\d+) column (\d+)/))?Math.min(e.line(+n[1]).from+ +n[2]-1,e.length):0}const l0e=U0.define({name:"json",parser:i0e.configure({props:[lb.add({Object:d_({except:/^\s*\}/}),Array:d_({except:/^\s*\]/})}),g6.add({"Object Array":Lq})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function c0e(){return new Pq(l0e)}const u0e={name:"toml",startState:function(){return{inString:!1,stringType:"",lhs:!0,inArray:0}},token:function(t,e){let n;if(!e.inString&&(n=t.match(/^('''|"""|'|")/))&&(e.stringType=n[0],e.inString=!0),t.sol()&&!e.inString&&e.inArray===0&&(e.lhs=!0),e.inString){for(;e.inString;)if(t.match(e.stringType))e.inString=!1;else if(t.peek()==="\\")t.next(),t.next();else{if(t.eol())break;t.match(/^.[^\\\"\']*/)}return e.lhs?"property":"string"}else{if(e.inArray&&t.peek()==="]")return t.next(),e.inArray--,"bracket";if(e.lhs&&t.peek()==="["&&t.skipTo("]"))return t.next(),t.peek()==="]"&&t.next(),"atom";if(t.peek()==="#")return t.skipToEnd(),"comment";if(t.eatSpace())return null;if(e.lhs&&t.eatWhile(function(r){return r!="="&&r!=" "}))return"property";if(e.lhs&&t.peek()==="=")return t.next(),e.lhs=!1,null;if(!e.lhs&&t.match(/^\d\d\d\d[\d\-\:\.T]*Z/))return"atom";if(!e.lhs&&(t.match("true")||t.match("false")))return"atom";if(!e.lhs&&t.peek()==="[")return e.inArray++,t.next(),"bracket";if(!e.lhs&&t.match(/^\-?\d+(?:\.\d+)?/))return"number";t.eatSpace()||t.next()}return null},languageData:{commentTokens:{line:"#"}}},d0e={python:[r0e()],json:[c0e(),a0e()],toml:[x6.define(u0e)],text:[]};function h0e({value:t,onChange:e,language:n="text",readOnly:r=!1,height:s="400px",minHeight:i,maxHeight:a,placeholder:l,theme:c="dark",className:d=""}){const[h,m]=b.useState(!1);if(b.useEffect(()=>{m(!0)},[]),!h)return o.jsx("div",{className:`rounded-md border bg-muted animate-pulse ${d}`,style:{height:s,minHeight:i,maxHeight:a}});const g=[...d0e[n]||[],Ze.lineWrapping];return r&&g.push(Ze.editable.of(!1)),o.jsx("div",{className:`rounded-md overflow-hidden border ${d}`,children:o.jsx(lH,{value:t,height:s,minHeight:i,maxHeight:a,theme:c==="dark"?oH:void 0,extensions:g,onChange:e,placeholder:l,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 f0e(){const[t,e]=b.useState(!0),[n,r]=b.useState(!1),[s,i]=b.useState(!1),[a,l]=b.useState(!1),[c,d]=b.useState(!1),[h,m]=b.useState(!1),[g,x]=b.useState("visual"),[y,w]=b.useState(""),[S,k]=b.useState(!1),{toast:j}=fs(),[N,T]=b.useState(null),[E,_]=b.useState(null),[M,I]=b.useState(null),[P,L]=b.useState(null),[H,U]=b.useState(null),[ee,z]=b.useState(null),[Q,B]=b.useState(null),[X,J]=b.useState(null),[G,R]=b.useState(null),[ie,W]=b.useState(null),[q,V]=b.useState(null),[te,ne]=b.useState(null),[K,se]=b.useState(null),[re,oe]=b.useState(null),[Te,We]=b.useState(null),[Ye,Je]=b.useState(null),[Oe,Ve]=b.useState(null),[Ue,He]=b.useState(null),Ot=b.useRef(null),xt=b.useRef(!0),kn=b.useRef({}),It=b.useCallback(async()=>{try{const Fe=await tae();w(Fe),k(!1)}catch(Fe){j({variant:"destructive",title:"加载失败",description:Fe instanceof Error?Fe.message:"加载源代码失败"})}},[j]),Yt=b.useCallback(async()=>{try{e(!0);const Fe=await J9();kn.current=Fe,T(Fe.bot),_(Fe.personality);const rt=Fe.chat;rt.talk_value_rules||(rt.talk_value_rules=[]),I(rt),L(Fe.expression),U(Fe.emoji),z(Fe.memory),B(Fe.tool),J(Fe.mood),R(Fe.voice),W(Fe.lpmm_knowledge),V(Fe.keyword_reaction),ne(Fe.response_post_process),se(Fe.chinese_typo),oe(Fe.response_splitter),We(Fe.log),Je(Fe.debug),Ve(Fe.maim_message),He(Fe.telemetry),l(!1),xt.current=!1,await It()}catch(Fe){console.error("加载配置失败:",Fe),j({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}finally{e(!1)}},[j,It]);b.useEffect(()=>{Yt()},[Yt]);const _t=b.useCallback(async(Fe,rt)=>{if(!xt.current)try{i(!0),await rae(Fe,rt),l(!1)}catch(tn){console.error(`自动保存 ${Fe} 失败:`,tn),l(!0)}finally{i(!1)}},[]),mt=b.useCallback((Fe,rt)=>{xt.current||(l(!0),Ot.current&&clearTimeout(Ot.current),Ot.current=setTimeout(()=>{_t(Fe,rt)},2e3))},[_t]);b.useEffect(()=>{N&&!xt.current&&mt("bot",N)},[N,mt]),b.useEffect(()=>{E&&!xt.current&&mt("personality",E)},[E,mt]),b.useEffect(()=>{M&&!xt.current&&mt("chat",M)},[M,mt]),b.useEffect(()=>{P&&!xt.current&&mt("expression",P)},[P,mt]),b.useEffect(()=>{H&&!xt.current&&mt("emoji",H)},[H,mt]),b.useEffect(()=>{ee&&!xt.current&&mt("memory",ee)},[ee,mt]),b.useEffect(()=>{Q&&!xt.current&&mt("tool",Q)},[Q,mt]),b.useEffect(()=>{X&&!xt.current&&mt("mood",X)},[X,mt]),b.useEffect(()=>{G&&!xt.current&&mt("voice",G)},[G,mt]),b.useEffect(()=>{ie&&!xt.current&&mt("lpmm_knowledge",ie)},[ie,mt]),b.useEffect(()=>{q&&!xt.current&&mt("keyword_reaction",q)},[q,mt]),b.useEffect(()=>{te&&!xt.current&&mt("response_post_process",te)},[te,mt]),b.useEffect(()=>{K&&!xt.current&&mt("chinese_typo",K)},[K,mt]),b.useEffect(()=>{re&&!xt.current&&mt("response_splitter",re)},[re,mt]),b.useEffect(()=>{Te&&!xt.current&&mt("log",Te)},[Te,mt]),b.useEffect(()=>{Ye&&!xt.current&&mt("debug",Ye)},[Ye,mt]),b.useEffect(()=>{Oe&&!xt.current&&mt("maim_message",Oe)},[Oe,mt]),b.useEffect(()=>{Ue&&!xt.current&&mt("telemetry",Ue)},[Ue,mt]);const Ne=async()=>{try{r(!0),await nae(y),l(!1),k(!1),j({title:"保存成功",description:"配置已保存"}),await Yt()}catch(Fe){k(!0),j({variant:"destructive",title:"保存失败",description:Fe instanceof Error?Fe.message:"保存配置失败"})}finally{r(!1)}},Ie=async Fe=>{if(a){j({variant:"destructive",title:"切换失败",description:"请先保存当前更改"});return}if(x(Fe),Fe==="source")await It();else try{const rt=await J9();kn.current=rt,T(rt.bot),_(rt.personality);const tn=rt.chat;tn.talk_value_rules||(tn.talk_value_rules=[]),I(tn),L(rt.expression),U(rt.emoji),z(rt.memory),B(rt.tool),J(rt.mood),R(rt.voice),W(rt.lpmm_knowledge),V(rt.keyword_reaction),ne(rt.response_post_process),se(rt.chinese_typo),oe(rt.response_splitter),We(rt.log),Je(rt.debug),Ve(rt.maim_message),He(rt.telemetry),l(!1)}catch(rt){console.error("加载配置失败:",rt),j({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}},st=async()=>{try{r(!0),Ot.current&&clearTimeout(Ot.current);const Fe={...kn.current,bot:N,personality:E,chat:M,expression:P,emoji:H,memory:ee,tool:Q,mood:X,voice:G,lpmm_knowledge:ie,keyword_reaction:q,response_post_process:te,chinese_typo:K,response_splitter:re,log:Te,debug:Ye,maim_message:Oe,telemetry:Ue};await eE(Fe),l(!1),j({title:"保存成功",description:"麦麦主程序配置已保存"})}catch(Fe){console.error("保存配置失败:",Fe),j({title:"保存失败",description:Fe.message,variant:"destructive"})}finally{r(!1)}},yt=async()=>{try{d(!0),Jy().catch(()=>{}),m(!0)}catch(Fe){console.error("重启失败:",Fe),m(!1),j({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),d(!1)}},Pt=async()=>{try{r(!0),Ot.current&&clearTimeout(Ot.current);const Fe={...kn.current,bot:N,personality:E,chat:M,expression:P,emoji:H,memory:ee,tool:Q,mood:X,voice:G,lpmm_knowledge:ie,keyword_reaction:q,response_post_process:te,chinese_typo:K,response_splitter:re,log:Te,debug:Ye,maim_message:Oe,telemetry:Ue};await eE(Fe),l(!1),j({title:"保存成功",description:"配置已保存,即将重启麦麦..."}),await new Promise(rt=>setTimeout(rt,500)),await yt()}catch(Fe){console.error("保存失败:",Fe),j({title:"保存失败",description:Fe.message,variant:"destructive"})}finally{r(!1)}},At=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},zn=()=>{m(!1),d(!1),j({title:"重启失败",description:"服务器未能在预期时间内恢复,请手动检查",variant:"destructive"})};return t?o.jsx(wn,{className:"h-full",children:o.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):o.jsx(wn,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦主程序配置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的核心功能和行为设置"})]}),o.jsxs("div",{className:"flex gap-2 w-full sm:w-auto items-center",children:[o.jsx(ja,{value:g,onValueChange:Fe=>Ie(Fe),className:"w-auto",children:o.jsxs(Wi,{className:"h-9",children:[o.jsxs(Lt,{value:"visual",className:"text-xs sm:text-sm px-2 sm:px-3",children:[o.jsx(Aee,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"可视化"]}),o.jsxs(Lt,{value:"source",className:"text-xs sm:text-sm px-2 sm:px-3",children:[o.jsx(Ree,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"源代码"]})]})}),o.jsxs(he,{onClick:g==="visual"?st:Ne,disabled:n||s||!a||c,size:"sm",variant:"outline",className:"flex-1 sm:flex-none",children:[o.jsx($y,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),n?"保存中...":s?"自动保存中...":a?"保存配置":"已保存"]}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsxs(he,{disabled:n||s||c,size:"sm",className:"flex-1 sm:flex-none",children:[o.jsx(Cj,{className:"mr-2 h-4 w-4"}),c?"重启中...":a?"保存并重启":"重启麦麦"]})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认重启麦麦?"}),o.jsx(_n,{className:"space-y-3",asChild:!0,children:o.jsxs("div",{children:[o.jsx("p",{children:a?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"}),o.jsxs(ga,{className:"border-yellow-500/50 bg-yellow-500/10",children:[o.jsx(Oa,{className:"h-4 w-4 text-yellow-600"}),o.jsxs(xa,{className:"text-yellow-900 dark:text-yellow-100",children:[o.jsx("strong",{children:"重要提示:"}),"由于技术原因,使用重启功能后,将无法再使用 ",o.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。",o.jsxs(Dr,{children:[o.jsx(Sf,{asChild:!0,children:o.jsxs("button",{className:"ml-1 text-yellow-700 dark:text-yellow-300 underline hover:text-yellow-800 dark:hover:text-yellow-200 inline-flex items-center gap-1",children:[o.jsx(qy,{className:"h-3 w-3"}),"如何结束程序?"]})}),o.jsxs(Sr,{className:"max-w-2xl",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"如何结束使用重启功能后的麦麦程序"}),o.jsx(ss,{children:"由于重启功能会使程序脱离终端控制,需要通过系统命令来结束进程"})]}),o.jsxs(ja,{defaultValue:"windows",className:"w-full",children:[o.jsxs(Wi,{className:"grid w-full grid-cols-3",children:[o.jsx(Lt,{value:"windows",children:"Windows"}),o.jsx(Lt,{value:"macos",children:"macOS"}),o.jsx(Lt,{value:"linux",children:"Linux"})]}),o.jsxs(un,{value:"windows",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用任务管理器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Ctrl + Shift + Esc"})," 打开任务管理器"]}),o.jsxs("li",{children:['在"进程"或"详细信息"标签页中找到 ',o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"python.exe"})]}),o.jsx("li",{children:'右键点击并选择"结束任务"'})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用命令行"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开 PowerShell 或命令提示符,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:'Get-Process python | Where-Object {$_.MainWindowTitle -eq ""}'}),o.jsx("p",{className:"mt-2",children:"# 结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"Stop-Process -Name python -Force"})]})]})]}),o.jsxs(un,{value:"macos",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用活动监视器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Cmd + Space"}),' 打开 Spotlight,搜索"活动监视器"']}),o.jsxs("li",{children:["在进程列表中找到 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Python"})]}),o.jsx("li",{children:"选中后点击左上角的 X 按钮结束进程"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用终端"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 "}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]})]}),o.jsxs(un,{value:"linux",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用终端命令"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 "}),o.jsx("p",{className:"mt-2",children:"# 或使用 pkill 按名称结束"}),o.jsx("p",{children:'pkill -9 -f "bot.py"'}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用 htop(如已安装)"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["在终端输入 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"htop"})]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F3"})," 搜索 python"]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F9"})," 发送信号,选择 SIGKILL"]})]})]})]})]}),o.jsx(bs,{children:o.jsx(Qj,{asChild:!0,children:o.jsx(he,{variant:"outline",children:"关闭"})})})]})]})]})]})]})})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:a?Pt:yt,children:a?"保存并重启":"确认重启"})]})]})]})]})]}),o.jsxs(ga,{children:[o.jsx(Oa,{className:"h-4 w-4"}),o.jsxs(xa,{children:["配置更新后需要",o.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),g==="source"&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs(ga,{children:[o.jsx(Oa,{className:"h-4 w-4"}),o.jsxs(xa,{children:[o.jsx("strong",{children:"源代码模式(高级功能):"}),"直接编辑 TOML 配置文件。此功能仅适用于熟悉 TOML 语法的高级用户。保存时会在后端验证格式,只有格式完全正确才能保存。",S&&o.jsx("span",{className:"text-destructive font-semibold ml-2",children:"⚠️ 上次保存失败,请检查 TOML 格式"})]})]}),o.jsx(h0e,{value:y,onChange:Fe=>{w(Fe),l(!0),S&&k(!1)},language:"toml",theme:"dark",height:"calc(100vh - 280px)",minHeight:"500px",placeholder:"TOML 配置内容"})]}),g==="visual"&&o.jsx(o.Fragment,{children:o.jsxs(ja,{defaultValue:"bot",className:"w-full",children:[o.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:o.jsxs(Wi,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5 lg:grid-cols-10",children:[o.jsx(Lt,{value:"bot",className:"flex-shrink-0",children:"基本信息"}),o.jsx(Lt,{value:"personality",className:"flex-shrink-0",children:"人格"}),o.jsx(Lt,{value:"chat",className:"flex-shrink-0",children:"聊天"}),o.jsx(Lt,{value:"expression",className:"flex-shrink-0",children:"表达"}),o.jsx(Lt,{value:"features",className:"flex-shrink-0",children:"功能"}),o.jsx(Lt,{value:"processing",className:"flex-shrink-0",children:"处理"}),o.jsx(Lt,{value:"mood",className:"flex-shrink-0",children:"情绪"}),o.jsx(Lt,{value:"voice",className:"flex-shrink-0",children:"语音"}),o.jsx(Lt,{value:"lpmm",className:"flex-shrink-0",children:"知识库"}),o.jsx(Lt,{value:"other",className:"flex-shrink-0",children:"其他"})]})}),o.jsx(un,{value:"bot",className:"space-y-4",children:N&&o.jsx(m0e,{config:N,onChange:T})}),o.jsx(un,{value:"personality",className:"space-y-4",children:E&&o.jsx(p0e,{config:E,onChange:_})}),o.jsx(un,{value:"chat",className:"space-y-4",children:M&&o.jsx(g0e,{config:M,onChange:I})}),o.jsx(un,{value:"expression",className:"space-y-4",children:P&&o.jsx(v0e,{config:P,onChange:L})}),o.jsx(un,{value:"features",className:"space-y-4",children:H&&ee&&Q&&o.jsx(y0e,{emojiConfig:H,memoryConfig:ee,toolConfig:Q,onEmojiChange:U,onMemoryChange:z,onToolChange:B})}),o.jsx(un,{value:"processing",className:"space-y-4",children:q&&te&&K&&re&&o.jsx(b0e,{keywordReactionConfig:q,responsePostProcessConfig:te,chineseTypoConfig:K,responseSplitterConfig:re,onKeywordReactionChange:V,onResponsePostProcessChange:ne,onChineseTypoChange:se,onResponseSplitterChange:oe})}),o.jsx(un,{value:"mood",className:"space-y-4",children:X&&o.jsx(w0e,{config:X,onChange:J})}),o.jsx(un,{value:"voice",className:"space-y-4",children:G&&o.jsx(S0e,{config:G,onChange:R})}),o.jsx(un,{value:"lpmm",className:"space-y-4",children:ie&&o.jsx(k0e,{config:ie,onChange:W})}),o.jsxs(un,{value:"other",className:"space-y-4",children:[Te&&o.jsx(O0e,{config:Te,onChange:We}),Ye&&o.jsx(j0e,{config:Ye,onChange:Je}),Oe&&o.jsx(N0e,{config:Oe,onChange:Ve}),Ue&&o.jsx(C0e,{config:Ue,onChange:He})]})]})}),h&&o.jsx(Wj,{onRestartComplete:At,onRestartFailed:zn})]})})}function m0e({config:t,onChange:e}){const n=()=>{e({...t,platforms:[...t.platforms,""]})},r=c=>{e({...t,platforms:t.platforms.filter((d,h)=>h!==c)})},s=(c,d)=>{const h=[...t.platforms];h[c]=d,e({...t,platforms:h})},i=()=>{e({...t,alias_names:[...t.alias_names,""]})},a=c=>{e({...t,alias_names:t.alias_names.filter((d,h)=>h!==c)})},l=(c,d)=>{const h=[...t.alias_names];h[c]=d,e({...t,alias_names:h})};return o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"基本信息"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"platform",children:"平台"}),o.jsx(ze,{id:"platform",value:t.platform,onChange:c=>e({...t,platform:c.target.value}),placeholder:"qq"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"qq_account",children:"QQ账号"}),o.jsx(ze,{id:"qq_account",value:t.qq_account,onChange:c=>e({...t,qq_account:c.target.value}),placeholder:"123456789"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"nickname",children:"昵称"}),o.jsx(ze,{id:"nickname",value:t.nickname,onChange:c=>e({...t,nickname:c.target.value}),placeholder:"麦麦"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(de,{children:"其他平台账号"}),o.jsxs(he,{onClick:n,size:"sm",variant:"outline",children:[o.jsx(zs,{className:"h-4 w-4 mr-1"}),"添加"]})]}),o.jsxs("div",{className:"space-y-2",children:[t.platforms.map((c,d)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ze,{value:c,onChange:h=>s(d,h.target.value),placeholder:"wx:114514"}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(he,{size:"icon",variant:"outline",children:o.jsx(Sn,{className:"h-4 w-4"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:['确定要删除平台账号 "',c||"(空)",'" 吗?此操作无法撤销。']})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:()=>r(d),children:"删除"})]})]})]})]},d)),t.platforms.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无其他平台账号"})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(de,{children:"别名"}),o.jsxs(he,{onClick:i,size:"sm",variant:"outline",children:[o.jsx(zs,{className:"h-4 w-4 mr-1"}),"添加"]})]}),o.jsxs("div",{className:"space-y-2",children:[t.alias_names.map((c,d)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ze,{value:c,onChange:h=>l(d,h.target.value),placeholder:"小麦"}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(he,{size:"icon",variant:"outline",children:o.jsx(Sn,{className:"h-4 w-4"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:['确定要删除别名 "',c||"(空)",'" 吗?此操作无法撤销。']})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:()=>a(d),children:"删除"})]})]})]})]},d)),t.alias_names.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无别名"})]})]})]})]})})}function p0e({config:t,onChange:e}){const n=()=>{e({...t,states:[...t.states,""]})},r=i=>{e({...t,states:t.states.filter((a,l)=>l!==i)})},s=(i,a)=>{const l=[...t.states];l[i]=a,e({...t,states:l})};return o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"人格设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"personality",children:"人格特质"}),o.jsx(Ar,{id:"personality",value:t.personality,onChange:i=>e({...t,personality:i.target.value}),placeholder:"描述人格特质和身份特征(建议120字以内)",rows:3}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"建议120字以内,描述人格特质和身份特征"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"reply_style",children:"表达风格"}),o.jsx(Ar,{id:"reply_style",value:t.reply_style,onChange:i=>e({...t,reply_style:i.target.value}),placeholder:"描述说话的表达风格和习惯",rows:3})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"interest",children:"兴趣"}),o.jsx(Ar,{id:"interest",value:t.interest,onChange:i=>e({...t,interest:i.target.value}),placeholder:"会影响麦麦对什么话题进行回复",rows:2})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"plan_style",children:"说话规则与行为风格"}),o.jsx(Ar,{id:"plan_style",value:t.plan_style,onChange:i=>e({...t,plan_style:i.target.value}),placeholder:"麦麦的说话规则和行为风格",rows:5})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"visual_style",children:"识图规则"}),o.jsx(Ar,{id:"visual_style",value:t.visual_style,onChange:i=>e({...t,visual_style:i.target.value}),placeholder:"识图时的处理规则",rows:3})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"private_plan_style",children:"私聊规则"}),o.jsx(Ar,{id:"private_plan_style",value:t.private_plan_style,onChange:i=>e({...t,private_plan_style:i.target.value}),placeholder:"私聊的说话规则和行为风格",rows:4})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(de,{children:"状态列表(人格多样性)"}),o.jsxs(he,{onClick:n,size:"sm",variant:"outline",children:[o.jsx(zs,{className:"h-4 w-4 mr-1"}),"添加状态"]})]}),o.jsx("div",{className:"space-y-2",children:t.states.map((i,a)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Ar,{value:i,onChange:l=>s(a,l.target.value),placeholder:"描述一个人格状态",rows:2}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(he,{size:"icon",variant:"outline",children:o.jsx(Sn,{className:"h-4 w-4"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsx(_n,{children:"确定要删除这个人格状态吗?此操作无法撤销。"})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:()=>r(a),children:"删除"})]})]})]})]},a))})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"state_probability",children:"状态替换概率"}),o.jsx(ze,{id:"state_probability",type:"number",step:"0.1",min:"0",max:"1",value:t.state_probability,onChange:i=>e({...t,state_probability:parseFloat(i.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"每次构建人格时替换 personality 的概率(0.0-1.0)"})]})]})]})})}function g0e({config:t,onChange:e}){const n=()=>{e({...t,talk_value_rules:[...t.talk_value_rules,{target:"",time:"00:00-23:59",value:1}]})},r=l=>{e({...t,talk_value_rules:t.talk_value_rules.filter((c,d)=>d!==l)})},s=(l,c,d)=>{const h=[...t.talk_value_rules];h[l]={...h[l],[c]:d},e({...t,talk_value_rules:h})},i=({value:l,onChange:c})=>{const[d,h]=b.useState("00"),[m,g]=b.useState("00"),[x,y]=b.useState("23"),[w,S]=b.useState("59");b.useEffect(()=>{const j=l.split("-");if(j.length===2){const[N,T]=j,[E,_]=N.split(":"),[M,I]=T.split(":");E&&h(E.padStart(2,"0")),_&&g(_.padStart(2,"0")),M&&y(M.padStart(2,"0")),I&&S(I.padStart(2,"0"))}},[l]);const k=(j,N,T,E)=>{const _=`${j}:${N}-${T}:${E}`;c(_)};return o.jsxs(Po,{children:[o.jsx(zo,{asChild:!0,children:o.jsxs(he,{variant:"outline",className:"w-full justify-start font-mono text-sm",children:[o.jsx(_h,{className:"h-4 w-4 mr-2"}),l||"选择时间段"]})}),o.jsx(Xa,{className:"w-80",children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium text-sm mb-3",children:"开始时间"}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[o.jsxs("div",{children:[o.jsx(de,{className:"text-xs",children:"小时"}),o.jsxs(Vt,{value:d,onValueChange:j=>{h(j),k(j,m,x,w)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:Array.from({length:24},(j,N)=>N).map(j=>o.jsx(De,{value:j.toString().padStart(2,"0"),children:j.toString().padStart(2,"0")},j))})]})]}),o.jsxs("div",{children:[o.jsx(de,{className:"text-xs",children:"分钟"}),o.jsxs(Vt,{value:m,onValueChange:j=>{g(j),k(d,j,x,w)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:Array.from({length:60},(j,N)=>N).map(j=>o.jsx(De,{value:j.toString().padStart(2,"0"),children:j.toString().padStart(2,"0")},j))})]})]})]})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium text-sm mb-3",children:"结束时间"}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[o.jsxs("div",{children:[o.jsx(de,{className:"text-xs",children:"小时"}),o.jsxs(Vt,{value:x,onValueChange:j=>{y(j),k(d,m,j,w)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:Array.from({length:24},(j,N)=>N).map(j=>o.jsx(De,{value:j.toString().padStart(2,"0"),children:j.toString().padStart(2,"0")},j))})]})]}),o.jsxs("div",{children:[o.jsx(de,{className:"text-xs",children:"分钟"}),o.jsxs(Vt,{value:w,onValueChange:j=>{S(j),k(d,m,x,j)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:Array.from({length:60},(j,N)=>N).map(j=>o.jsx(De,{value:j.toString().padStart(2,"0"),children:j.toString().padStart(2,"0")},j))})]})]})]})]})]})})]})},a=({rule:l})=>{const c=`{ target = "${l.target}", time = "${l.time}", value = ${l.value.toFixed(1)} }`;return o.jsxs(Po,{children:[o.jsx(zo,{asChild:!0,children:o.jsxs(he,{variant:"outline",size:"sm",children:[o.jsx(Ea,{className:"h-4 w-4 mr-1"}),"预览"]})}),o.jsx(Xa,{className:"w-96",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),o.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:c}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"聊天设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"talk_value",children:"聊天频率(基础值)"}),o.jsx(ze,{id:"talk_value",type:"number",step:"0.1",min:"0",max:"1",value:t.talk_value,onChange:l=>e({...t,talk_value:parseFloat(l.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"越小越沉默,范围 0-1"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"mentioned_bot_reply",checked:t.mentioned_bot_reply,onCheckedChange:l=>e({...t,mentioned_bot_reply:l})}),o.jsx(de,{htmlFor:"mentioned_bot_reply",className:"cursor-pointer",children:"启用提及必回复"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"max_context_size",children:"上下文长度"}),o.jsx(ze,{id:"max_context_size",type:"number",min:"1",value:t.max_context_size,onChange:l=>e({...t,max_context_size:parseInt(l.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"planner_smooth",children:"规划器平滑"}),o.jsx(ze,{id:"planner_smooth",type:"number",step:"1",min:"0",value:t.planner_smooth,onChange:l=>e({...t,planner_smooth:parseFloat(l.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"增大数值会减小 planner 负荷,推荐 1-5,0 为关闭"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"enable_talk_value_rules",checked:t.enable_talk_value_rules,onCheckedChange:l=>e({...t,enable_talk_value_rules:l})}),o.jsx(de,{htmlFor:"enable_talk_value_rules",className:"cursor-pointer",children:"启用动态发言频率规则"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"include_planner_reasoning",checked:t.include_planner_reasoning,onCheckedChange:l=>e({...t,include_planner_reasoning:l})}),o.jsx(de,{htmlFor:"include_planner_reasoning",className:"cursor-pointer",children:"将 planner 推理加入 replyer"})]})]})]}),t.enable_talk_value_rules&&o.jsxs("div",{className:"border-t pt-6",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-base font-semibold",children:"动态发言频率规则"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"按时段或聊天流ID调整发言频率,优先匹配具体聊天,再匹配全局规则"})]}),o.jsxs(he,{onClick:n,size:"sm",children:[o.jsx(zs,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),t.talk_value_rules&&t.talk_value_rules.length>0?o.jsx("div",{className:"space-y-4",children:t.talk_value_rules.map((l,c)=>o.jsxs("div",{className:"rounded-lg border p-4 bg-muted/50 space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["规则 #",c+1]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(a,{rule:l}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(he,{variant:"ghost",size:"sm",children:o.jsx(Sn,{className:"h-4 w-4 text-destructive"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:["确定要删除规则 #",c+1," 吗?此操作无法撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:()=>r(c),children:"删除"})]})]})]})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{className:"text-xs font-medium",children:"配置类型"}),o.jsxs(Vt,{value:l.target===""?"global":"specific",onValueChange:d=>{d==="global"?s(c,"target",""):s(c,"target","qq::group")},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"global",children:"全局配置"}),o.jsx(De,{value:"specific",children:"详细配置"})]})]})]}),l.target!==""&&(()=>{const d=l.target.split(":"),h=d[0]||"qq",m=d[1]||"",g=d[2]||"group";return o.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[o.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{className:"text-xs font-medium",children:"平台"}),o.jsxs(Vt,{value:h,onValueChange:x=>{s(c,"target",`${x}:${m}:${g}`)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"qq",children:"QQ"}),o.jsx(De,{value:"wx",children:"微信"})]})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{className:"text-xs font-medium",children:"群 ID"}),o.jsx(ze,{value:m,onChange:x=>{s(c,"target",`${h}:${x.target.value}:${g}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{className:"text-xs font-medium",children:"类型"}),o.jsxs(Vt,{value:g,onValueChange:x=>{s(c,"target",`${h}:${m}:${x}`)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"group",children:"群组(group)"}),o.jsx(De,{value:"private",children:"私聊(private)"})]})]})]})]}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",l.target||"(未设置)"]})]})})(),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{className:"text-xs font-medium",children:"时间段 (Time)"}),o.jsx(i,{value:l.time,onChange:d=>s(c,"time",d)}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"支持跨夜区间,例如 23:00-02:00"})]}),o.jsxs("div",{className:"grid gap-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(de,{htmlFor:`rule-value-${c}`,className:"text-xs font-medium",children:"发言频率值 (Value)"}),o.jsx(ze,{id:`rule-value-${c}`,type:"number",step:"0.01",min:"0.01",max:"1",value:l.value,onChange:d=>{const h=parseFloat(d.target.value);isNaN(h)||s(c,"value",Math.max(.01,Math.min(1,h)))},className:"w-20 h-8 text-xs"})]}),o.jsx(Ip,{value:[l.value],onValueChange:d=>s(c,"value",d[0]),min:.01,max:1,step:.01,className:"w-full"}),o.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[o.jsx("span",{children:"0.01 (极少发言)"}),o.jsx("span",{children:"0.5"}),o.jsx("span",{children:"1.0 (正常)"})]})]})]})]},c))}):o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:o.jsx("p",{className:"text-sm",children:'暂无规则,点击"添加规则"按钮创建'})}),o.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:[o.jsx("h5",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"📝 规则说明"}),o.jsxs("ul",{className:"text-xs text-blue-800 dark:text-blue-200 space-y-1",children:[o.jsxs("li",{children:["• ",o.jsx("strong",{children:"Target 为空"}),":全局规则,对所有聊天生效"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"Target 指定"}),":仅对特定聊天流生效(格式:platform:id:type)"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"优先级"}),":先匹配具体聊天流规则,再匹配全局规则"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"时间支持跨夜"}),":例如 23:00-02:00 表示晚上11点到次日凌晨2点"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"数值范围"}),":建议 0-1,0 表示完全沉默,1 表示正常发言"]})]})]})]})]})}function x0e({member:t,groupIndex:e,memberIndex:n,availableChatIds:r,onUpdate:s,onRemove:i}){const a=r.includes(t)||t==="*",[l,c]=b.useState(!a);return o.jsxs("div",{className:"flex gap-2",children:[o.jsx("div",{className:"flex-1 flex gap-2",children:l?o.jsxs(o.Fragment,{children:[o.jsx(ze,{value:t,onChange:d=>s(e,n,d.target.value),placeholder:'输入 "*" 或 "qq:123456:group"',className:"flex-1"}),r.length>0&&o.jsx(he,{size:"sm",variant:"outline",onClick:()=>c(!1),title:"切换到下拉选择",children:"下拉"})]}):o.jsxs(o.Fragment,{children:[o.jsxs(Vt,{value:t,onValueChange:d=>s(e,n,d),children:[o.jsx($t,{className:"flex-1",children:o.jsx(Ut,{placeholder:"选择聊天流"})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"*",children:"* (全局共享)"}),r.map((d,h)=>o.jsx(De,{value:d,children:d},h))]})]}),o.jsx(he,{size:"sm",variant:"outline",onClick:()=>c(!0),title:"切换到手动输入",children:"输入"})]})}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(he,{size:"icon",variant:"outline",children:o.jsx(Sn,{className:"h-4 w-4"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:['确定要删除组成员 "',t||"(空)",'" 吗?此操作无法撤销。']})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:()=>i(e,n),children:"删除"})]})]})]})]})}function v0e({config:t,onChange:e}){const n=()=>{e({...t,learning_list:[...t.learning_list,["","enable","enable","1.0"]]})},r=m=>{e({...t,learning_list:t.learning_list.filter((g,x)=>x!==m)})},s=(m,g,x)=>{const y=[...t.learning_list];y[m][g]=x,e({...t,learning_list:y})},i=({rule:m})=>{const g=`["${m[0]}", "${m[1]}", "${m[2]}", "${m[3]}"]`;return o.jsxs(Po,{children:[o.jsx(zo,{asChild:!0,children:o.jsxs(he,{variant:"outline",size:"sm",children:[o.jsx(Ea,{className:"h-4 w-4 mr-1"}),"预览"]})}),o.jsx(Xa,{className:"w-96",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),o.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:g}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},a=()=>{e({...t,expression_groups:[...t.expression_groups,[]]})},l=m=>{e({...t,expression_groups:t.expression_groups.filter((g,x)=>x!==m)})},c=m=>{const g=[...t.expression_groups];g[m]=[...g[m],""],e({...t,expression_groups:g})},d=(m,g)=>{const x=[...t.expression_groups];x[m]=x[m].filter((y,w)=>w!==g),e({...t,expression_groups:x})},h=(m,g,x)=>{const y=[...t.expression_groups];y[m][g]=x,e({...t,expression_groups:y})};return o.jsxs("div",{className:"space-y-6",children:[o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold",children:"表达学习配置"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置麦麦如何学习和使用表达方式"})]}),o.jsxs(he,{onClick:n,size:"sm",variant:"outline",children:[o.jsx(zs,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),o.jsxs("div",{className:"space-y-4",children:[t.learning_list.map((m,g)=>{const x=t.learning_list.some((N,T)=>T!==g&&N[0]===""),y=m[0]==="",w=m[0].split(":"),S=w[0]||"qq",k=w[1]||"",j=w[2]||"group";return o.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium",children:["规则 ",g+1," ",y&&"(全局配置)"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(i,{rule:m}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(he,{size:"sm",variant:"ghost",children:o.jsx(Sn,{className:"h-4 w-4"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:["确定要删除学习规则 ",g+1," 吗?此操作无法撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:()=>r(g),children:"删除"})]})]})]})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{className:"text-xs font-medium",children:"配置类型"}),o.jsxs(Vt,{value:y?"global":"specific",onValueChange:N=>{N==="global"?s(g,0,""):s(g,0,"qq::group")},disabled:x&&!y,children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"global",children:"全局配置"}),o.jsx(De,{value:"specific",disabled:x&&!y,children:"详细配置"})]})]}),x&&!y&&o.jsx("p",{className:"text-xs text-amber-600",children:"已存在全局配置,无法创建新的全局配置"})]}),!y&&o.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[o.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{className:"text-xs font-medium",children:"平台"}),o.jsxs(Vt,{value:S,onValueChange:N=>{s(g,0,`${N}:${k}:${j}`)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"qq",children:"QQ"}),o.jsx(De,{value:"wx",children:"微信"})]})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{className:"text-xs font-medium",children:"群 ID"}),o.jsx(ze,{value:k,onChange:N=>{s(g,0,`${S}:${N.target.value}:${j}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{className:"text-xs font-medium",children:"类型"}),o.jsxs(Vt,{value:j,onValueChange:N=>{s(g,0,`${S}:${k}:${N}`)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"group",children:"群组(group)"}),o.jsx(De,{value:"private",children:"私聊(private)"})]})]})]})]}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",m[0]||"(未设置)"]})]}),o.jsx("div",{className:"grid gap-2",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx(de,{className:"text-xs font-medium",children:"使用学到的表达"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦使用从聊天中学到的表达方式"})]}),o.jsx(Bt,{checked:m[1]==="enable",onCheckedChange:N=>s(g,1,N?"enable":"disable")})]})}),o.jsx("div",{className:"grid gap-2",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx(de,{className:"text-xs font-medium",children:"学习表达"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦从聊天中学习新的表达方式"})]}),o.jsx(Bt,{checked:m[2]==="enable",onCheckedChange:N=>s(g,2,N?"enable":"disable")})]})}),o.jsxs("div",{className:"grid gap-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(de,{className:"text-xs font-medium",children:"学习强度"}),o.jsx(ze,{type:"number",step:"0.1",min:"0",max:"5",value:m[3],onChange:N=>{const T=parseFloat(N.target.value);isNaN(T)||s(g,3,Math.max(0,Math.min(5,T)).toFixed(1))},className:"w-20 h-8 text-xs"})]}),o.jsx(Ip,{value:[parseFloat(m[3])||1],onValueChange:N=>s(g,3,N[0].toFixed(1)),min:0,max:5,step:.1,className:"w-full"}),o.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[o.jsx("span",{children:"0 (不学习)"}),o.jsx("span",{children:"2.5"}),o.jsx("span",{children:"5.0 (快速学习)"})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"影响学习频率,最短学习间隔 = 300/学习强度(秒)"})]})]})]},g)}),t.learning_list.length===0&&o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无学习规则,点击"添加规则"开始配置'})]})]})}),o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold",children:"表达共享组配置"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置不同聊天流之间如何共享学到的表达方式"})]}),o.jsxs(he,{onClick:a,size:"sm",variant:"outline",children:[o.jsx(zs,{className:"h-4 w-4 mr-1"}),"添加共享组"]})]}),o.jsxs("div",{className:"space-y-4",children:[t.expression_groups.map((m,g)=>{const x=t.learning_list.map(y=>y[0]).filter(y=>y!=="");return o.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium",children:["共享组 ",g+1,m.length===1&&m[0]==="*"&&"(全局共享)"]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(he,{onClick:()=>c(g),size:"sm",variant:"outline",children:o.jsx(zs,{className:"h-4 w-4"})}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(he,{size:"sm",variant:"ghost",children:o.jsx(Sn,{className:"h-4 w-4"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:["确定要删除共享组 ",g+1," 吗?此操作无法撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:()=>l(g),children:"删除"})]})]})]})]})]}),o.jsx("div",{className:"space-y-2",children:m.map((y,w)=>o.jsx(x0e,{member:y,groupIndex:g,memberIndex:w,availableChatIds:x,onUpdate:h,onRemove:d},`${g}-${w}`))}),o.jsx("p",{className:"text-xs text-muted-foreground",children:'提示:可以从下拉框选择已配置的聊天流,或手动输入。输入 "*" 启用全局共享'})]},g)}),t.expression_groups.length===0&&o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无共享组,点击"添加共享组"开始配置'})]})]})})]})}function y0e({emojiConfig:t,memoryConfig:e,toolConfig:n,onEmojiChange:r,onMemoryChange:s,onToolChange:i}){return o.jsxs("div",{className:"space-y-6",children:[o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"工具设置"}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"enable_tool",checked:n.enable_tool,onCheckedChange:a=>i({...n,enable_tool:a})}),o.jsx(de,{htmlFor:"enable_tool",className:"cursor-pointer",children:"启用工具系统"})]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"允许麦麦使用各种工具来增强功能"})]})}),o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"记忆设置"}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"max_agent_iterations",children:"记忆思考深度"}),o.jsx(ze,{id:"max_agent_iterations",type:"number",min:"1",value:e.max_agent_iterations,onChange:a=>s({...e,max_agent_iterations:parseInt(a.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"最低为 1(不深入思考)"})]})]})}),o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"表情包设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"emoji_chance",children:"表情包激活概率"}),o.jsx(ze,{id:"emoji_chance",type:"number",step:"0.1",min:"0",max:"1",value:t.emoji_chance,onChange:a=>r({...t,emoji_chance:parseFloat(a.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"范围 0-1,越大越容易发送表情包"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"max_reg_num",children:"最大注册数量"}),o.jsx(ze,{id:"max_reg_num",type:"number",min:"1",value:t.max_reg_num,onChange:a=>r({...t,max_reg_num:parseInt(a.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦最多可以注册的表情包数量"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),o.jsx(ze,{id:"check_interval",type:"number",min:"1",value:t.check_interval,onChange:a=>r({...t,check_interval:parseInt(a.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包(注册、破损、删除)的时间间隔"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"do_replace",checked:t.do_replace,onCheckedChange:a=>r({...t,do_replace:a})}),o.jsx(de,{htmlFor:"do_replace",className:"cursor-pointer",children:"达到最大数量时替换表情包"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"steal_emoji",checked:t.steal_emoji,onCheckedChange:a=>r({...t,steal_emoji:a})}),o.jsx(de,{htmlFor:"steal_emoji",className:"cursor-pointer",children:"偷取表情包"})]}),o.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"允许麦麦将看到的表情包据为己有"}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"content_filtration",checked:t.content_filtration,onCheckedChange:a=>r({...t,content_filtration:a})}),o.jsx(de,{htmlFor:"content_filtration",className:"cursor-pointer",children:"启用表情包过滤"})]}),t.content_filtration&&o.jsxs("div",{className:"grid gap-2 pl-6 border-l-2 border-primary/20",children:[o.jsx(de,{htmlFor:"filtration_prompt",children:"过滤要求"}),o.jsx(ze,{id:"filtration_prompt",value:t.filtration_prompt,onChange:a=>r({...t,filtration_prompt:a.target.value}),placeholder:"符合公序良俗"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"只有符合此要求的表情包才会被保存"})]})]})]})})]})}function b0e({keywordReactionConfig:t,responsePostProcessConfig:e,chineseTypoConfig:n,responseSplitterConfig:r,onKeywordReactionChange:s,onResponsePostProcessChange:i,onChineseTypoChange:a,onResponseSplitterChange:l}){const c=()=>{s({...t,regex_rules:[...t.regex_rules,{regex:[""],reaction:""}]})},d=T=>{s({...t,regex_rules:t.regex_rules.filter((E,_)=>_!==T)})},h=(T,E,_)=>{const M=[...t.regex_rules];E==="regex"&&typeof _=="string"?M[T]={...M[T],regex:[_]}:E==="reaction"&&typeof _=="string"&&(M[T]={...M[T],reaction:_}),s({...t,regex_rules:M})},m=({regex:T,reaction:E,onRegexChange:_,onReactionChange:M})=>{const[I,P]=b.useState(!1),[L,H]=b.useState(""),[U,ee]=b.useState(null),[z,Q]=b.useState(""),[B,X]=b.useState({}),[J,G]=b.useState(""),R=b.useRef(null),[ie,W]=b.useState("build"),q=K=>K.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),V=(K,se=0)=>{const re=R.current;if(!re)return;const oe=re.selectionStart||0,Te=re.selectionEnd||0,We=T.substring(0,oe)+K+T.substring(Te);_(We),setTimeout(()=>{const Ye=oe+K.length+se;re.setSelectionRange(Ye,Ye),re.focus()},0)};b.useEffect(()=>{if(!T||!L){ee(null),X({}),G(E),Q("");return}try{const K=q(T),se=new RegExp(K,"g"),re=L.match(se);ee(re),Q("");const Te=new RegExp(K).exec(L);if(Te&&Te.groups){X(Te.groups);let We=E;Object.entries(Te.groups).forEach(([Ye,Je])=>{We=We.replace(new RegExp(`\\[${Ye}\\]`,"g"),Je||"")}),G(We)}else X({}),G(E)}catch(K){Q(K.message),ee(null),X({}),G(E)}},[T,L,E]);const te=()=>{if(!L||!U||U.length===0)return o.jsx("span",{className:"text-muted-foreground",children:L||"请输入测试文本"});try{const K=q(T),se=new RegExp(K,"g");let re=0;const oe=[];let Te;for(;(Te=se.exec(L))!==null;)Te.index>re&&oe.push(o.jsx("span",{children:L.substring(re,Te.index)},`text-${re}`)),oe.push(o.jsx("span",{className:"bg-yellow-200 dark:bg-yellow-900 font-semibold",children:Te[0]},`match-${Te.index}`)),re=Te.index+Te[0].length;return re)",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\\S+)",desc:"捕获一个词语"},{label:"捕获句子",pattern:"(?P.+)",desc:"捕获整个句子"},{label:"捕获数字",pattern:"(?P\\d+)",desc:"捕获一个或多个数字"},{label:"可选词语",pattern:"(?:词语1|词语2)",desc:"匹配多个可选项之一"}]}];return o.jsxs(Dr,{open:I,onOpenChange:P,children:[o.jsx(Sf,{asChild:!0,children:o.jsxs(he,{variant:"outline",size:"sm",children:[o.jsx(_v,{className:"h-4 w-4 mr-1"}),"正则编辑器"]})}),o.jsxs(Sr,{className:"max-w-[95vw] sm:max-w-[900px] max-h-[90vh]",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"正则表达式编辑器"}),o.jsx(ss,{className:"text-sm",children:"使用可视化工具构建正则表达式,并实时测试效果"})]}),o.jsx(wn,{className:"max-h-[calc(90vh-120px)]",children:o.jsxs(ja,{value:ie,onValueChange:K=>W(K),className:"w-full",children:[o.jsxs(Wi,{className:"grid w-full grid-cols-2",children:[o.jsx(Lt,{value:"build",children:"🔧 构建器"}),o.jsx(Lt,{value:"test",children:"🧪 测试器"})]}),o.jsxs(un,{value:"build",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{className:"text-sm font-medium",children:"正则表达式"}),o.jsx(ze,{ref:R,value:T,onChange:K=>_(K.target.value),className:"font-mono text-sm",placeholder:"点击下方按钮构建正则表达式..."})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{className:"text-sm font-medium",children:"Reaction 内容"}),o.jsx(Ar,{value:E,onChange:K=>M(K.target.value),placeholder:"使用 [捕获组名] 引用捕获的内容...",rows:3,className:"text-sm"})]}),o.jsxs("div",{className:"space-y-4 border-t pt-4",children:[ne.map(K=>o.jsxs("div",{className:"space-y-2",children:[o.jsx("h5",{className:"text-xs font-semibold text-primary",children:K.category}),o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:K.items.map(se=>o.jsx(he,{variant:"outline",size:"sm",className:"justify-start h-auto py-2 px-3",onClick:()=>V(se.pattern,se.moveCursor||0),children:o.jsxs("div",{className:"flex flex-col items-start w-full",children:[o.jsxs("div",{className:"flex items-center gap-2 w-full",children:[o.jsx("span",{className:"text-xs font-medium",children:se.label}),o.jsx("code",{className:"ml-auto text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:se.pattern})]}),o.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:se.desc})]})},se.label))})]},K.category)),o.jsxs("div",{className:"space-y-2 border-t pt-4",children:[o.jsx("h5",{className:"text-xs font-semibold text-primary",children:"完整示例模板"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>_("^(?P\\S{1,20})是这样的$"),children:o.jsxs("div",{className:"flex flex-col items-start w-full",children:[o.jsxs("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:["^(?P\\S","{1,20}",")是这样的$"]}),o.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「某事物是这样的」并捕获事物名称"})]})}),o.jsx(he,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>_("(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"),children:o.jsxs("div",{className:"flex flex-col items-start w-full",children:[o.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"}),o.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「我没要求你做某事」并捕获具体行为"})]})}),o.jsx(he,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>_("(?P.+?)(?:是|为什么|怎么)"),children:o.jsxs("div",{className:"flex flex-col items-start w-full",children:[o.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?P.+?)(?:是|为什么|怎么)"}),o.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"捕获问题主题词"})]})})]})]})]}),o.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:[o.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 使用提示"}),o.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[o.jsx("li",{children:"点击输入框设置光标位置,然后点击按钮插入模式"}),o.jsxs("li",{children:["命名捕获组格式:",o.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"(?P<名称>模式)"})]}),o.jsxs("li",{children:["在 reaction 中使用 ",o.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"[名称]"})," 引用捕获的内容"]}),o.jsx("li",{children:"切换到测试器标签页验证正则表达式效果"})]})]})]}),o.jsxs(un,{value:"test",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{className:"text-sm font-medium",children:"当前正则表达式"}),o.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:T||"(未设置)"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{htmlFor:"test-text",className:"text-sm font-medium",children:"测试文本"}),o.jsx(Ar,{id:"test-text",value:L,onChange:K=>H(K.target.value),placeholder:`在此输入要测试的文本... -例如:打游戏是这样的`,className:"min-h-[100px] text-sm"})]}),z&&o.jsxs("div",{className:"rounded-md bg-destructive/10 border border-destructive/20 p-3",children:[o.jsx("p",{className:"text-sm text-destructive font-medium",children:"正则表达式错误"}),o.jsx("p",{className:"text-xs text-destructive/80 mt-1",children:z})]}),!z&&L&&o.jsxs("div",{className:"space-y-3",children:[o.jsx("div",{className:"flex items-center gap-2",children:U&&U.length>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),o.jsxs("span",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:["匹配成功 (",U.length," 处)"]})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-400"}),o.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"无匹配"})]})}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{className:"text-sm font-medium",children:"匹配高亮"}),o.jsx(wn,{className:"h-40 rounded-md bg-muted p-3",children:o.jsx("div",{className:"text-sm break-words",children:te()})})]}),Object.keys(B).length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{className:"text-sm font-medium",children:"命名捕获组"}),o.jsx(wn,{className:"h-32 rounded-md border p-3",children:o.jsx("div",{className:"space-y-2",children:Object.entries(B).map(([K,se])=>o.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[o.jsxs("span",{className:"font-mono font-semibold text-primary min-w-[80px]",children:["[",K,"]"]}),o.jsx("span",{className:"text-muted-foreground",children:"="}),o.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded",children:se})]},K))})})]}),Object.keys(B).length>0&&E&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{className:"text-sm font-medium",children:"Reaction 替换预览"}),o.jsx(wn,{className:"h-48 rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3",children:o.jsx("div",{className:"text-sm break-words",children:J})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"reaction 中的 [name] 已被替换为对应的捕获组值"})]})]}),o.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:[o.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 测试说明"}),o.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[o.jsx("li",{children:"匹配的文本会以黄色背景高亮显示"}),o.jsx("li",{children:"命名捕获组的值会显示在下方列表中"}),o.jsx("li",{children:"Reaction 替换预览显示最终生成的反应内容"}),o.jsx("li",{children:"如需修改正则,切换回构建器标签页"})]})]})]})]})})]})]})},g=()=>{s({...t,keyword_rules:[...t.keyword_rules,{keywords:[],reaction:""}]})},x=T=>{s({...t,keyword_rules:t.keyword_rules.filter((E,_)=>_!==T)})},y=(T,E,_)=>{const M=[...t.keyword_rules];typeof _=="string"&&(M[T]={...M[T],reaction:_}),s({...t,keyword_rules:M})},w=T=>{const E=[...t.keyword_rules];E[T]={...E[T],keywords:[...E[T].keywords||[],""]},s({...t,keyword_rules:E})},S=(T,E)=>{const _=[...t.keyword_rules];_[T]={..._[T],keywords:(_[T].keywords||[]).filter((M,I)=>I!==E)},s({...t,keyword_rules:_})},k=(T,E,_)=>{const M=[...t.keyword_rules],I=[...M[T].keywords||[]];I[E]=_,M[T]={...M[T],keywords:I},s({...t,keyword_rules:M})},j=({rule:T})=>{const E=`{ regex = [${(T.regex||[]).map(_=>`"${_}"`).join(", ")}], reaction = "${T.reaction}" }`;return o.jsxs(Po,{children:[o.jsx(zo,{asChild:!0,children:o.jsxs(he,{variant:"outline",size:"sm",children:[o.jsx(Ea,{className:"h-4 w-4 mr-1"}),"预览"]})}),o.jsx(Xa,{className:"w-[95vw] sm:w-[500px]",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),o.jsx(wn,{className:"h-60 rounded-md bg-muted p-3",children:o.jsx("pre",{className:"font-mono text-xs break-all",children:E})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},N=({rule:T})=>{const E=`[[keyword_reaction.keyword_rules]] +`,{label:"if",detail:"block",type:"keyword"}),vl("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),vl("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),vl("import ${module}",{label:"import",detail:"statement",type:"keyword"}),vl("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],w0e=khe(OH,Z$(y0e.concat(b0e)));function dS(t){let{node:e,pos:n}=t,r=t.lineIndent(n,-1),s=null;for(;;){let i=e.childBefore(n);if(i)if(i.name=="Comment")n=i.from;else if(i.name=="Body"||i.name=="MatchBody")t.baseIndentFor(i)+t.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 hS(t,e){let n=t.baseIndentFor(e),r=t.lineAt(t.pos,-1),s=r.from+r.text.length;return/^\s*($|#)/.test(r.text)&&t.node.ton?null:n+t.unit}const fS=X0.define({name:"python",parser:g0e.configure({props:[mb.add({Body:t=>{var e;let n=/^\s*(#|$)/.test(t.textAfter)&&dS(t)||t.node;return(e=hS(t,n))!==null&&e!==void 0?e:t.continue()},MatchBody:t=>{var e;let n=dS(t);return(e=hS(t,n||t.node))!==null&&e!==void 0?e:t.continue()},IfStatement:t=>/^\s*(else:|elif )/.test(t.textAfter)?t.baseIndent:t.continue(),"ForStatement WhileStatement":t=>/^\s*else:/.test(t.textAfter)?t.baseIndent:t.continue(),TryStatement:t=>/^\s*(except[ :]|finally:|else:)/.test(t.textAfter)?t.baseIndent:t.continue(),MatchStatement:t=>/^\s*case /.test(t.textAfter)?t.baseIndent+t.unit:t.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":X4({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":X4({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":X4({closing:"]"}),MemberExpression:t=>t.baseIndent+t.unit,"String FormatString":()=>null,Script:t=>{var e;let n=dS(t);return(e=n&&hS(t,n))!==null&&e!==void 0?e:t.continue()}}),b6.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":Qq,Body:(t,e)=>({from:t.from+1,to:t.to-(t.to==e.doc.length?0:1)}),"String FormatString":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.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 S0e(){return new qq(fS,[fS.data.of({autocomplete:v0e}),fS.data.of({autocomplete:w0e})])}const k0e=x6({String:ve.string,Number:ve.number,"True False":ve.bool,PropertyName:ve.propertyName,Null:ve.null,", :":ve.separator,"[ ]":ve.squareBracket,"{ }":ve.brace}),O0e=sp.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:[k0e],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}),j0e=()=>t=>{try{JSON.parse(t.state.doc.toString())}catch(e){if(!(e instanceof SyntaxError))throw e;const n=N0e(e,t.state.doc);return[{from:n,message:e.message,severity:"error",to:n}]}return[]};function N0e(t,e){let n;return(n=t.message.match(/at position (\d+)/))?Math.min(+n[1],e.length):(n=t.message.match(/at line (\d+) column (\d+)/))?Math.min(e.line(+n[1]).from+ +n[2]-1,e.length):0}const C0e=X0.define({name:"json",parser:O0e.configure({props:[mb.add({Object:x_({except:/^\s*\}/}),Array:x_({except:/^\s*\]/})}),b6.add({"Object Array":Qq})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function T0e(){return new qq(C0e)}const E0e={name:"toml",startState:function(){return{inString:!1,stringType:"",lhs:!0,inArray:0}},token:function(t,e){let n;if(!e.inString&&(n=t.match(/^('''|"""|'|")/))&&(e.stringType=n[0],e.inString=!0),t.sol()&&!e.inString&&e.inArray===0&&(e.lhs=!0),e.inString){for(;e.inString;)if(t.match(e.stringType))e.inString=!1;else if(t.peek()==="\\")t.next(),t.next();else{if(t.eol())break;t.match(/^.[^\\\"\']*/)}return e.lhs?"property":"string"}else{if(e.inArray&&t.peek()==="]")return t.next(),e.inArray--,"bracket";if(e.lhs&&t.peek()==="["&&t.skipTo("]"))return t.next(),t.peek()==="]"&&t.next(),"atom";if(t.peek()==="#")return t.skipToEnd(),"comment";if(t.eatSpace())return null;if(e.lhs&&t.eatWhile(function(r){return r!="="&&r!=" "}))return"property";if(e.lhs&&t.peek()==="=")return t.next(),e.lhs=!1,null;if(!e.lhs&&t.match(/^\d\d\d\d[\d\-\:\.T]*Z/))return"atom";if(!e.lhs&&(t.match("true")||t.match("false")))return"atom";if(!e.lhs&&t.peek()==="[")return e.inArray++,t.next(),"bracket";if(!e.lhs&&t.match(/^\-?\d+(?:\.\d+)?/))return"number";t.eatSpace()||t.next()}return null},languageData:{commentTokens:{line:"#"}}},_0e={python:[S0e()],json:[T0e(),j0e()],toml:[w6.define(E0e)],text:[]};function A0e({value:t,onChange:e,language:n="text",readOnly:r=!1,height:s="400px",minHeight:i,maxHeight:a,placeholder:l,theme:c="dark",className:d=""}){const[h,m]=b.useState(!1);if(b.useEffect(()=>{m(!0)},[]),!h)return o.jsx("div",{className:`rounded-md border bg-muted animate-pulse ${d}`,style:{height:s,minHeight:i,maxHeight:a}});const g=[..._0e[n]||[],Ze.lineWrapping];return r&&g.push(Ze.editable.of(!1)),o.jsx("div",{className:`rounded-md overflow-hidden border ${d}`,children:o.jsx(mH,{value:t,height:s,minHeight:i,maxHeight:a,theme:c==="dark"?fH:void 0,extensions:g,onChange:e,placeholder:l,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 M0e(){const[t,e]=b.useState(!0),[n,r]=b.useState(!1),[s,i]=b.useState(!1),[a,l]=b.useState(!1),[c,d]=b.useState(!1),[h,m]=b.useState(!1),[g,x]=b.useState("visual"),[y,w]=b.useState(""),[S,k]=b.useState(!1),{toast:j}=as(),[N,T]=b.useState(null),[E,_]=b.useState(null),[A,L]=b.useState(null),[P,B]=b.useState(null),[$,U]=b.useState(null),[te,z]=b.useState(null),[Q,F]=b.useState(null),[Y,J]=b.useState(null),[X,R]=b.useState(null),[ie,G]=b.useState(null),[I,V]=b.useState(null),[ee,ne]=b.useState(null),[W,se]=b.useState(null),[re,oe]=b.useState(null),[Te,We]=b.useState(null),[Ye,Je]=b.useState(null),[Oe,Ve]=b.useState(null),[Ue,He]=b.useState(null),Ot=b.useRef(null),xt=b.useRef(!0),kn=b.useRef({}),It=b.useCallback(async()=>{try{const Fe=await bae();w(Fe),k(!1)}catch(Fe){j({variant:"destructive",title:"加载失败",description:Fe instanceof Error?Fe.message:"加载源代码失败"})}},[j]),Yt=b.useCallback(async()=>{try{e(!0);const Fe=await iE();kn.current=Fe,T(Fe.bot),_(Fe.personality);const rt=Fe.chat;rt.talk_value_rules||(rt.talk_value_rules=[]),L(rt),B(Fe.expression),U(Fe.emoji),z(Fe.memory),F(Fe.tool),J(Fe.mood),R(Fe.voice),G(Fe.lpmm_knowledge),V(Fe.keyword_reaction),ne(Fe.response_post_process),se(Fe.chinese_typo),oe(Fe.response_splitter),We(Fe.log),Je(Fe.debug),Ve(Fe.maim_message),He(Fe.telemetry),l(!1),xt.current=!1,await It()}catch(Fe){console.error("加载配置失败:",Fe),j({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}finally{e(!1)}},[j,It]);b.useEffect(()=>{Yt()},[Yt]);const _t=b.useCallback(async(Fe,rt)=>{if(!xt.current)try{i(!0),await Sae(Fe,rt),l(!1)}catch(tn){console.error(`自动保存 ${Fe} 失败:`,tn),l(!0)}finally{i(!1)}},[]),mt=b.useCallback((Fe,rt)=>{xt.current||(l(!0),Ot.current&&clearTimeout(Ot.current),Ot.current=setTimeout(()=>{_t(Fe,rt)},2e3))},[_t]);b.useEffect(()=>{N&&!xt.current&&mt("bot",N)},[N,mt]),b.useEffect(()=>{E&&!xt.current&&mt("personality",E)},[E,mt]),b.useEffect(()=>{A&&!xt.current&&mt("chat",A)},[A,mt]),b.useEffect(()=>{P&&!xt.current&&mt("expression",P)},[P,mt]),b.useEffect(()=>{$&&!xt.current&&mt("emoji",$)},[$,mt]),b.useEffect(()=>{te&&!xt.current&&mt("memory",te)},[te,mt]),b.useEffect(()=>{Q&&!xt.current&&mt("tool",Q)},[Q,mt]),b.useEffect(()=>{Y&&!xt.current&&mt("mood",Y)},[Y,mt]),b.useEffect(()=>{X&&!xt.current&&mt("voice",X)},[X,mt]),b.useEffect(()=>{ie&&!xt.current&&mt("lpmm_knowledge",ie)},[ie,mt]),b.useEffect(()=>{I&&!xt.current&&mt("keyword_reaction",I)},[I,mt]),b.useEffect(()=>{ee&&!xt.current&&mt("response_post_process",ee)},[ee,mt]),b.useEffect(()=>{W&&!xt.current&&mt("chinese_typo",W)},[W,mt]),b.useEffect(()=>{re&&!xt.current&&mt("response_splitter",re)},[re,mt]),b.useEffect(()=>{Te&&!xt.current&&mt("log",Te)},[Te,mt]),b.useEffect(()=>{Ye&&!xt.current&&mt("debug",Ye)},[Ye,mt]),b.useEffect(()=>{Oe&&!xt.current&&mt("maim_message",Oe)},[Oe,mt]),b.useEffect(()=>{Ue&&!xt.current&&mt("telemetry",Ue)},[Ue,mt]);const Ne=async()=>{try{r(!0),await wae(y),l(!1),k(!1),j({title:"保存成功",description:"配置已保存"}),await Yt()}catch(Fe){k(!0),j({variant:"destructive",title:"保存失败",description:Fe instanceof Error?Fe.message:"保存配置失败"})}finally{r(!1)}},Ie=async Fe=>{if(a){j({variant:"destructive",title:"切换失败",description:"请先保存当前更改"});return}if(x(Fe),Fe==="source")await It();else try{const rt=await iE();kn.current=rt,T(rt.bot),_(rt.personality);const tn=rt.chat;tn.talk_value_rules||(tn.talk_value_rules=[]),L(tn),B(rt.expression),U(rt.emoji),z(rt.memory),F(rt.tool),J(rt.mood),R(rt.voice),G(rt.lpmm_knowledge),V(rt.keyword_reaction),ne(rt.response_post_process),se(rt.chinese_typo),oe(rt.response_splitter),We(rt.log),Je(rt.debug),Ve(rt.maim_message),He(rt.telemetry),l(!1)}catch(rt){console.error("加载配置失败:",rt),j({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}},st=async()=>{try{r(!0),Ot.current&&clearTimeout(Ot.current);const Fe={...kn.current,bot:N,personality:E,chat:A,expression:P,emoji:$,memory:te,tool:Q,mood:Y,voice:X,lpmm_knowledge:ie,keyword_reaction:I,response_post_process:ee,chinese_typo:W,response_splitter:re,log:Te,debug:Ye,maim_message:Oe,telemetry:Ue};await aE(Fe),l(!1),j({title:"保存成功",description:"麦麦主程序配置已保存"})}catch(Fe){console.error("保存配置失败:",Fe),j({title:"保存失败",description:Fe.message,variant:"destructive"})}finally{r(!1)}},yt=async()=>{try{d(!0),ib().catch(()=>{}),m(!0)}catch(Fe){console.error("重启失败:",Fe),m(!1),j({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),d(!1)}},Pt=async()=>{try{r(!0),Ot.current&&clearTimeout(Ot.current);const Fe={...kn.current,bot:N,personality:E,chat:A,expression:P,emoji:$,memory:te,tool:Q,mood:Y,voice:X,lpmm_knowledge:ie,keyword_reaction:I,response_post_process:ee,chinese_typo:W,response_splitter:re,log:Te,debug:Ye,maim_message:Oe,telemetry:Ue};await aE(Fe),l(!1),j({title:"保存成功",description:"配置已保存,即将重启麦麦..."}),await new Promise(rt=>setTimeout(rt,500)),await yt()}catch(Fe){console.error("保存失败:",Fe),j({title:"保存失败",description:Fe.message,variant:"destructive"})}finally{r(!1)}},Mt=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},zn=()=>{m(!1),d(!1),j({title:"重启失败",description:"服务器未能在预期时间内恢复,请手动检查",variant:"destructive"})};return t?o.jsx(gn,{className:"h-full",children:o.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):o.jsx(gn,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦主程序配置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的核心功能和行为设置"})]}),o.jsxs("div",{className:"flex gap-2 w-full sm:w-auto items-center",children:[o.jsx(ja,{value:g,onValueChange:Fe=>Ie(Fe),className:"w-auto",children:o.jsxs(Wi,{className:"h-9",children:[o.jsxs(Lt,{value:"visual",className:"text-xs sm:text-sm px-2 sm:px-3",children:[o.jsx(Wee,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"可视化"]}),o.jsxs(Lt,{value:"source",className:"text-xs sm:text-sm px-2 sm:px-3",children:[o.jsx(Gee,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"源代码"]})]})}),o.jsxs(de,{onClick:g==="visual"?st:Ne,disabled:n||s||!a||c,size:"sm",variant:"outline",className:"flex-1 sm:flex-none",children:[o.jsx(Gy,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),n?"保存中...":s?"自动保存中...":a?"保存配置":"已保存"]}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsxs(de,{disabled:n||s||c,size:"sm",className:"flex-1 sm:flex-none",children:[o.jsx(Aj,{className:"mr-2 h-4 w-4"}),c?"重启中...":a?"保存并重启":"重启麦麦"]})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认重启麦麦?"}),o.jsx(_n,{className:"space-y-3",asChild:!0,children:o.jsxs("div",{children:[o.jsx("p",{children:a?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"}),o.jsxs(ga,{className:"border-yellow-500/50 bg-yellow-500/10",children:[o.jsx(Oa,{className:"h-4 w-4 text-yellow-600"}),o.jsxs(xa,{className:"text-yellow-900 dark:text-yellow-100",children:[o.jsx("strong",{children:"重要提示:"}),"由于技术原因,使用重启功能后,将无法再使用 ",o.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。",o.jsxs(Dr,{children:[o.jsx(Of,{asChild:!0,children:o.jsxs("button",{className:"ml-1 text-yellow-700 dark:text-yellow-300 underline hover:text-yellow-800 dark:hover:text-yellow-200 inline-flex items-center gap-1",children:[o.jsx(Wy,{className:"h-3 w-3"}),"如何结束程序?"]})}),o.jsxs(Sr,{className:"max-w-2xl",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"如何结束使用重启功能后的麦麦程序"}),o.jsx(ss,{children:"由于重启功能会使程序脱离终端控制,需要通过系统命令来结束进程"})]}),o.jsxs(ja,{defaultValue:"windows",className:"w-full",children:[o.jsxs(Wi,{className:"grid w-full grid-cols-3",children:[o.jsx(Lt,{value:"windows",children:"Windows"}),o.jsx(Lt,{value:"macos",children:"macOS"}),o.jsx(Lt,{value:"linux",children:"Linux"})]}),o.jsxs(un,{value:"windows",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用任务管理器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Ctrl + Shift + Esc"})," 打开任务管理器"]}),o.jsxs("li",{children:['在"进程"或"详细信息"标签页中找到 ',o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"python.exe"})]}),o.jsx("li",{children:'右键点击并选择"结束任务"'})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用命令行"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开 PowerShell 或命令提示符,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:'Get-Process python | Where-Object {$_.MainWindowTitle -eq ""}'}),o.jsx("p",{className:"mt-2",children:"# 结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"Stop-Process -Name python -Force"})]})]})]}),o.jsxs(un,{value:"macos",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用活动监视器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Cmd + Space"}),' 打开 Spotlight,搜索"活动监视器"']}),o.jsxs("li",{children:["在进程列表中找到 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Python"})]}),o.jsx("li",{children:"选中后点击左上角的 X 按钮结束进程"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用终端"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 "}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]})]}),o.jsxs(un,{value:"linux",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用终端命令"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 "}),o.jsx("p",{className:"mt-2",children:"# 或使用 pkill 按名称结束"}),o.jsx("p",{children:'pkill -9 -f "bot.py"'}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用 htop(如已安装)"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["在终端输入 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"htop"})]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F3"})," 搜索 python"]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F9"})," 发送信号,选择 SIGKILL"]})]})]})]})]}),o.jsx(ws,{children:o.jsx(Gj,{asChild:!0,children:o.jsx(de,{variant:"outline",children:"关闭"})})})]})]})]})]})]})})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:a?Pt:yt,children:a?"保存并重启":"确认重启"})]})]})]})]})]}),o.jsxs(ga,{children:[o.jsx(Oa,{className:"h-4 w-4"}),o.jsxs(xa,{children:["配置更新后需要",o.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),g==="source"&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs(ga,{children:[o.jsx(Oa,{className:"h-4 w-4"}),o.jsxs(xa,{children:[o.jsx("strong",{children:"源代码模式(高级功能):"}),"直接编辑 TOML 配置文件。此功能仅适用于熟悉 TOML 语法的高级用户。保存时会在后端验证格式,只有格式完全正确才能保存。",S&&o.jsx("span",{className:"text-destructive font-semibold ml-2",children:"⚠️ 上次保存失败,请检查 TOML 格式"})]})]}),o.jsx(A0e,{value:y,onChange:Fe=>{w(Fe),l(!0),S&&k(!1)},language:"toml",theme:"dark",height:"calc(100vh - 280px)",minHeight:"500px",placeholder:"TOML 配置内容"})]}),g==="visual"&&o.jsx(o.Fragment,{children:o.jsxs(ja,{defaultValue:"bot",className:"w-full",children:[o.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:o.jsxs(Wi,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5 lg:grid-cols-10",children:[o.jsx(Lt,{value:"bot",className:"flex-shrink-0",children:"基本信息"}),o.jsx(Lt,{value:"personality",className:"flex-shrink-0",children:"人格"}),o.jsx(Lt,{value:"chat",className:"flex-shrink-0",children:"聊天"}),o.jsx(Lt,{value:"expression",className:"flex-shrink-0",children:"表达"}),o.jsx(Lt,{value:"features",className:"flex-shrink-0",children:"功能"}),o.jsx(Lt,{value:"processing",className:"flex-shrink-0",children:"处理"}),o.jsx(Lt,{value:"mood",className:"flex-shrink-0",children:"情绪"}),o.jsx(Lt,{value:"voice",className:"flex-shrink-0",children:"语音"}),o.jsx(Lt,{value:"lpmm",className:"flex-shrink-0",children:"知识库"}),o.jsx(Lt,{value:"other",className:"flex-shrink-0",children:"其他"})]})}),o.jsx(un,{value:"bot",className:"space-y-4",children:N&&o.jsx(R0e,{config:N,onChange:T})}),o.jsx(un,{value:"personality",className:"space-y-4",children:E&&o.jsx(D0e,{config:E,onChange:_})}),o.jsx(un,{value:"chat",className:"space-y-4",children:A&&o.jsx(P0e,{config:A,onChange:L})}),o.jsx(un,{value:"expression",className:"space-y-4",children:P&&o.jsx(I0e,{config:P,onChange:B})}),o.jsx(un,{value:"features",className:"space-y-4",children:$&&te&&Q&&o.jsx(L0e,{emojiConfig:$,memoryConfig:te,toolConfig:Q,onEmojiChange:U,onMemoryChange:z,onToolChange:F})}),o.jsx(un,{value:"processing",className:"space-y-4",children:I&&ee&&W&&re&&o.jsx(B0e,{keywordReactionConfig:I,responsePostProcessConfig:ee,chineseTypoConfig:W,responseSplitterConfig:re,onKeywordReactionChange:V,onResponsePostProcessChange:ne,onChineseTypoChange:se,onResponseSplitterChange:oe})}),o.jsx(un,{value:"mood",className:"space-y-4",children:Y&&o.jsx(F0e,{config:Y,onChange:J})}),o.jsx(un,{value:"voice",className:"space-y-4",children:X&&o.jsx(q0e,{config:X,onChange:R})}),o.jsx(un,{value:"lpmm",className:"space-y-4",children:ie&&o.jsx($0e,{config:ie,onChange:G})}),o.jsxs(un,{value:"other",className:"space-y-4",children:[Te&&o.jsx(H0e,{config:Te,onChange:We}),Ye&&o.jsx(Q0e,{config:Ye,onChange:Je}),Oe&&o.jsx(V0e,{config:Oe,onChange:Ve}),Ue&&o.jsx(U0e,{config:Ue,onChange:He})]})]})}),h&&o.jsx(Kj,{onRestartComplete:Mt,onRestartFailed:zn})]})})}function R0e({config:t,onChange:e}){const n=()=>{e({...t,platforms:[...t.platforms,""]})},r=c=>{e({...t,platforms:t.platforms.filter((d,h)=>h!==c)})},s=(c,d)=>{const h=[...t.platforms];h[c]=d,e({...t,platforms:h})},i=()=>{e({...t,alias_names:[...t.alias_names,""]})},a=c=>{e({...t,alias_names:t.alias_names.filter((d,h)=>h!==c)})},l=(c,d)=>{const h=[...t.alias_names];h[c]=d,e({...t,alias_names:h})};return o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"基本信息"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"platform",children:"平台"}),o.jsx(ze,{id:"platform",value:t.platform,onChange:c=>e({...t,platform:c.target.value}),placeholder:"qq"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"qq_account",children:"QQ账号"}),o.jsx(ze,{id:"qq_account",value:t.qq_account,onChange:c=>e({...t,qq_account:c.target.value}),placeholder:"123456789"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"nickname",children:"昵称"}),o.jsx(ze,{id:"nickname",value:t.nickname,onChange:c=>e({...t,nickname:c.target.value}),placeholder:"麦麦"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{children:"其他平台账号"}),o.jsxs(de,{onClick:n,size:"sm",variant:"outline",children:[o.jsx(Ls,{className:"h-4 w-4 mr-1"}),"添加"]})]}),o.jsxs("div",{className:"space-y-2",children:[t.platforms.map((c,d)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ze,{value:c,onChange:h=>s(d,h.target.value),placeholder:"wx:114514"}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(de,{size:"icon",variant:"outline",children:o.jsx(Sn,{className:"h-4 w-4"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:['确定要删除平台账号 "',c||"(空)",'" 吗?此操作无法撤销。']})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:()=>r(d),children:"删除"})]})]})]})]},d)),t.platforms.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无其他平台账号"})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{children:"别名"}),o.jsxs(de,{onClick:i,size:"sm",variant:"outline",children:[o.jsx(Ls,{className:"h-4 w-4 mr-1"}),"添加"]})]}),o.jsxs("div",{className:"space-y-2",children:[t.alias_names.map((c,d)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ze,{value:c,onChange:h=>l(d,h.target.value),placeholder:"小麦"}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(de,{size:"icon",variant:"outline",children:o.jsx(Sn,{className:"h-4 w-4"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:['确定要删除别名 "',c||"(空)",'" 吗?此操作无法撤销。']})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:()=>a(d),children:"删除"})]})]})]})]},d)),t.alias_names.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无别名"})]})]})]})]})})}function D0e({config:t,onChange:e}){const n=()=>{e({...t,states:[...t.states,""]})},r=i=>{e({...t,states:t.states.filter((a,l)=>l!==i)})},s=(i,a)=>{const l=[...t.states];l[i]=a,e({...t,states:l})};return o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"人格设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"personality",children:"人格特质"}),o.jsx(Mr,{id:"personality",value:t.personality,onChange:i=>e({...t,personality:i.target.value}),placeholder:"描述人格特质和身份特征(建议120字以内)",rows:3}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"建议120字以内,描述人格特质和身份特征"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"reply_style",children:"表达风格"}),o.jsx(Mr,{id:"reply_style",value:t.reply_style,onChange:i=>e({...t,reply_style:i.target.value}),placeholder:"描述说话的表达风格和习惯",rows:3})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"interest",children:"兴趣"}),o.jsx(Mr,{id:"interest",value:t.interest,onChange:i=>e({...t,interest:i.target.value}),placeholder:"会影响麦麦对什么话题进行回复",rows:2})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"plan_style",children:"说话规则与行为风格"}),o.jsx(Mr,{id:"plan_style",value:t.plan_style,onChange:i=>e({...t,plan_style:i.target.value}),placeholder:"麦麦的说话规则和行为风格",rows:5})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"visual_style",children:"识图规则"}),o.jsx(Mr,{id:"visual_style",value:t.visual_style,onChange:i=>e({...t,visual_style:i.target.value}),placeholder:"识图时的处理规则",rows:3})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"private_plan_style",children:"私聊规则"}),o.jsx(Mr,{id:"private_plan_style",value:t.private_plan_style,onChange:i=>e({...t,private_plan_style:i.target.value}),placeholder:"私聊的说话规则和行为风格",rows:4})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{children:"状态列表(人格多样性)"}),o.jsxs(de,{onClick:n,size:"sm",variant:"outline",children:[o.jsx(Ls,{className:"h-4 w-4 mr-1"}),"添加状态"]})]}),o.jsx("div",{className:"space-y-2",children:t.states.map((i,a)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Mr,{value:i,onChange:l=>s(a,l.target.value),placeholder:"描述一个人格状态",rows:2}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(de,{size:"icon",variant:"outline",children:o.jsx(Sn,{className:"h-4 w-4"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsx(_n,{children:"确定要删除这个人格状态吗?此操作无法撤销。"})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:()=>r(a),children:"删除"})]})]})]})]},a))})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"state_probability",children:"状态替换概率"}),o.jsx(ze,{id:"state_probability",type:"number",step:"0.1",min:"0",max:"1",value:t.state_probability,onChange:i=>e({...t,state_probability:parseFloat(i.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"每次构建人格时替换 personality 的概率(0.0-1.0)"})]})]})]})})}function P0e({config:t,onChange:e}){const n=()=>{e({...t,talk_value_rules:[...t.talk_value_rules,{target:"",time:"00:00-23:59",value:1}]})},r=l=>{e({...t,talk_value_rules:t.talk_value_rules.filter((c,d)=>d!==l)})},s=(l,c,d)=>{const h=[...t.talk_value_rules];h[l]={...h[l],[c]:d},e({...t,talk_value_rules:h})},i=({value:l,onChange:c})=>{const[d,h]=b.useState("00"),[m,g]=b.useState("00"),[x,y]=b.useState("23"),[w,S]=b.useState("59");b.useEffect(()=>{const j=l.split("-");if(j.length===2){const[N,T]=j,[E,_]=N.split(":"),[A,L]=T.split(":");E&&h(E.padStart(2,"0")),_&&g(_.padStart(2,"0")),A&&y(A.padStart(2,"0")),L&&S(L.padStart(2,"0"))}},[l]);const k=(j,N,T,E)=>{const _=`${j}:${N}-${T}:${E}`;c(_)};return o.jsxs(zo,{children:[o.jsx(Io,{asChild:!0,children:o.jsxs(de,{variant:"outline",className:"w-full justify-start font-mono text-sm",children:[o.jsx(_h,{className:"h-4 w-4 mr-2"}),l||"选择时间段"]})}),o.jsx(Xa,{className:"w-80",children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium text-sm mb-3",children:"开始时间"}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-xs",children:"小时"}),o.jsxs(Vt,{value:d,onValueChange:j=>{h(j),k(j,m,x,w)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:Array.from({length:24},(j,N)=>N).map(j=>o.jsx(De,{value:j.toString().padStart(2,"0"),children:j.toString().padStart(2,"0")},j))})]})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-xs",children:"分钟"}),o.jsxs(Vt,{value:m,onValueChange:j=>{g(j),k(d,j,x,w)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:Array.from({length:60},(j,N)=>N).map(j=>o.jsx(De,{value:j.toString().padStart(2,"0"),children:j.toString().padStart(2,"0")},j))})]})]})]})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium text-sm mb-3",children:"结束时间"}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-xs",children:"小时"}),o.jsxs(Vt,{value:x,onValueChange:j=>{y(j),k(d,m,j,w)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:Array.from({length:24},(j,N)=>N).map(j=>o.jsx(De,{value:j.toString().padStart(2,"0"),children:j.toString().padStart(2,"0")},j))})]})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-xs",children:"分钟"}),o.jsxs(Vt,{value:w,onValueChange:j=>{S(j),k(d,m,x,j)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:Array.from({length:60},(j,N)=>N).map(j=>o.jsx(De,{value:j.toString().padStart(2,"0"),children:j.toString().padStart(2,"0")},j))})]})]})]})]})]})})]})},a=({rule:l})=>{const c=`{ target = "${l.target}", time = "${l.time}", value = ${l.value.toFixed(1)} }`;return o.jsxs(zo,{children:[o.jsx(Io,{asChild:!0,children:o.jsxs(de,{variant:"outline",size:"sm",children:[o.jsx(Ea,{className:"h-4 w-4 mr-1"}),"预览"]})}),o.jsx(Xa,{className:"w-96",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),o.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:c}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"聊天设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"talk_value",children:"聊天频率(基础值)"}),o.jsx(ze,{id:"talk_value",type:"number",step:"0.1",min:"0",max:"1",value:t.talk_value,onChange:l=>e({...t,talk_value:parseFloat(l.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"越小越沉默,范围 0-1"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"mentioned_bot_reply",checked:t.mentioned_bot_reply,onCheckedChange:l=>e({...t,mentioned_bot_reply:l})}),o.jsx(he,{htmlFor:"mentioned_bot_reply",className:"cursor-pointer",children:"启用提及必回复"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"max_context_size",children:"上下文长度"}),o.jsx(ze,{id:"max_context_size",type:"number",min:"1",value:t.max_context_size,onChange:l=>e({...t,max_context_size:parseInt(l.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"planner_smooth",children:"规划器平滑"}),o.jsx(ze,{id:"planner_smooth",type:"number",step:"1",min:"0",value:t.planner_smooth,onChange:l=>e({...t,planner_smooth:parseFloat(l.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"增大数值会减小 planner 负荷,推荐 1-5,0 为关闭"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"enable_talk_value_rules",checked:t.enable_talk_value_rules,onCheckedChange:l=>e({...t,enable_talk_value_rules:l})}),o.jsx(he,{htmlFor:"enable_talk_value_rules",className:"cursor-pointer",children:"启用动态发言频率规则"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"include_planner_reasoning",checked:t.include_planner_reasoning,onCheckedChange:l=>e({...t,include_planner_reasoning:l})}),o.jsx(he,{htmlFor:"include_planner_reasoning",className:"cursor-pointer",children:"将 planner 推理加入 replyer"})]})]})]}),t.enable_talk_value_rules&&o.jsxs("div",{className:"border-t pt-6",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-base font-semibold",children:"动态发言频率规则"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"按时段或聊天流ID调整发言频率,优先匹配具体聊天,再匹配全局规则"})]}),o.jsxs(de,{onClick:n,size:"sm",children:[o.jsx(Ls,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),t.talk_value_rules&&t.talk_value_rules.length>0?o.jsx("div",{className:"space-y-4",children:t.talk_value_rules.map((l,c)=>o.jsxs("div",{className:"rounded-lg border p-4 bg-muted/50 space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["规则 #",c+1]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(a,{rule:l}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(de,{variant:"ghost",size:"sm",children:o.jsx(Sn,{className:"h-4 w-4 text-destructive"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:["确定要删除规则 #",c+1," 吗?此操作无法撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:()=>r(c),children:"删除"})]})]})]})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"配置类型"}),o.jsxs(Vt,{value:l.target===""?"global":"specific",onValueChange:d=>{d==="global"?s(c,"target",""):s(c,"target","qq::group")},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"global",children:"全局配置"}),o.jsx(De,{value:"specific",children:"详细配置"})]})]})]}),l.target!==""&&(()=>{const d=l.target.split(":"),h=d[0]||"qq",m=d[1]||"",g=d[2]||"group";return o.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[o.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"平台"}),o.jsxs(Vt,{value:h,onValueChange:x=>{s(c,"target",`${x}:${m}:${g}`)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"qq",children:"QQ"}),o.jsx(De,{value:"wx",children:"微信"})]})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"群 ID"}),o.jsx(ze,{value:m,onChange:x=>{s(c,"target",`${h}:${x.target.value}:${g}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"类型"}),o.jsxs(Vt,{value:g,onValueChange:x=>{s(c,"target",`${h}:${m}:${x}`)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"group",children:"群组(group)"}),o.jsx(De,{value:"private",children:"私聊(private)"})]})]})]})]}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",l.target||"(未设置)"]})]})})(),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"时间段 (Time)"}),o.jsx(i,{value:l.time,onChange:d=>s(c,"time",d)}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"支持跨夜区间,例如 23:00-02:00"})]}),o.jsxs("div",{className:"grid gap-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{htmlFor:`rule-value-${c}`,className:"text-xs font-medium",children:"发言频率值 (Value)"}),o.jsx(ze,{id:`rule-value-${c}`,type:"number",step:"0.01",min:"0.01",max:"1",value:l.value,onChange:d=>{const h=parseFloat(d.target.value);isNaN(h)||s(c,"value",Math.max(.01,Math.min(1,h)))},className:"w-20 h-8 text-xs"})]}),o.jsx(Bp,{value:[l.value],onValueChange:d=>s(c,"value",d[0]),min:.01,max:1,step:.01,className:"w-full"}),o.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[o.jsx("span",{children:"0.01 (极少发言)"}),o.jsx("span",{children:"0.5"}),o.jsx("span",{children:"1.0 (正常)"})]})]})]})]},c))}):o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:o.jsx("p",{className:"text-sm",children:'暂无规则,点击"添加规则"按钮创建'})}),o.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:[o.jsx("h5",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"📝 规则说明"}),o.jsxs("ul",{className:"text-xs text-blue-800 dark:text-blue-200 space-y-1",children:[o.jsxs("li",{children:["• ",o.jsx("strong",{children:"Target 为空"}),":全局规则,对所有聊天生效"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"Target 指定"}),":仅对特定聊天流生效(格式:platform:id:type)"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"优先级"}),":先匹配具体聊天流规则,再匹配全局规则"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"时间支持跨夜"}),":例如 23:00-02:00 表示晚上11点到次日凌晨2点"]}),o.jsxs("li",{children:["• ",o.jsx("strong",{children:"数值范围"}),":建议 0-1,0 表示完全沉默,1 表示正常发言"]})]})]})]})]})}function z0e({member:t,groupIndex:e,memberIndex:n,availableChatIds:r,onUpdate:s,onRemove:i}){const a=r.includes(t)||t==="*",[l,c]=b.useState(!a);return o.jsxs("div",{className:"flex gap-2",children:[o.jsx("div",{className:"flex-1 flex gap-2",children:l?o.jsxs(o.Fragment,{children:[o.jsx(ze,{value:t,onChange:d=>s(e,n,d.target.value),placeholder:'输入 "*" 或 "qq:123456:group"',className:"flex-1"}),r.length>0&&o.jsx(de,{size:"sm",variant:"outline",onClick:()=>c(!1),title:"切换到下拉选择",children:"下拉"})]}):o.jsxs(o.Fragment,{children:[o.jsxs(Vt,{value:t,onValueChange:d=>s(e,n,d),children:[o.jsx($t,{className:"flex-1",children:o.jsx(Ut,{placeholder:"选择聊天流"})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"*",children:"* (全局共享)"}),r.map((d,h)=>o.jsx(De,{value:d,children:d},h))]})]}),o.jsx(de,{size:"sm",variant:"outline",onClick:()=>c(!0),title:"切换到手动输入",children:"输入"})]})}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(de,{size:"icon",variant:"outline",children:o.jsx(Sn,{className:"h-4 w-4"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:['确定要删除组成员 "',t||"(空)",'" 吗?此操作无法撤销。']})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:()=>i(e,n),children:"删除"})]})]})]})]})}function I0e({config:t,onChange:e}){const n=()=>{e({...t,learning_list:[...t.learning_list,["","enable","enable","1.0"]]})},r=m=>{e({...t,learning_list:t.learning_list.filter((g,x)=>x!==m)})},s=(m,g,x)=>{const y=[...t.learning_list];y[m][g]=x,e({...t,learning_list:y})},i=({rule:m})=>{const g=`["${m[0]}", "${m[1]}", "${m[2]}", "${m[3]}"]`;return o.jsxs(zo,{children:[o.jsx(Io,{asChild:!0,children:o.jsxs(de,{variant:"outline",size:"sm",children:[o.jsx(Ea,{className:"h-4 w-4 mr-1"}),"预览"]})}),o.jsx(Xa,{className:"w-96",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),o.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:g}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},a=()=>{e({...t,expression_groups:[...t.expression_groups,[]]})},l=m=>{e({...t,expression_groups:t.expression_groups.filter((g,x)=>x!==m)})},c=m=>{const g=[...t.expression_groups];g[m]=[...g[m],""],e({...t,expression_groups:g})},d=(m,g)=>{const x=[...t.expression_groups];x[m]=x[m].filter((y,w)=>w!==g),e({...t,expression_groups:x})},h=(m,g,x)=>{const y=[...t.expression_groups];y[m][g]=x,e({...t,expression_groups:y})};return o.jsxs("div",{className:"space-y-6",children:[o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold",children:"表达学习配置"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置麦麦如何学习和使用表达方式"})]}),o.jsxs(de,{onClick:n,size:"sm",variant:"outline",children:[o.jsx(Ls,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),o.jsxs("div",{className:"space-y-4",children:[t.learning_list.map((m,g)=>{const x=t.learning_list.some((N,T)=>T!==g&&N[0]===""),y=m[0]==="",w=m[0].split(":"),S=w[0]||"qq",k=w[1]||"",j=w[2]||"group";return o.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium",children:["规则 ",g+1," ",y&&"(全局配置)"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(i,{rule:m}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(de,{size:"sm",variant:"ghost",children:o.jsx(Sn,{className:"h-4 w-4"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:["确定要删除学习规则 ",g+1," 吗?此操作无法撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:()=>r(g),children:"删除"})]})]})]})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"配置类型"}),o.jsxs(Vt,{value:y?"global":"specific",onValueChange:N=>{N==="global"?s(g,0,""):s(g,0,"qq::group")},disabled:x&&!y,children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"global",children:"全局配置"}),o.jsx(De,{value:"specific",disabled:x&&!y,children:"详细配置"})]})]}),x&&!y&&o.jsx("p",{className:"text-xs text-amber-600",children:"已存在全局配置,无法创建新的全局配置"})]}),!y&&o.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[o.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"平台"}),o.jsxs(Vt,{value:S,onValueChange:N=>{s(g,0,`${N}:${k}:${j}`)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"qq",children:"QQ"}),o.jsx(De,{value:"wx",children:"微信"})]})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"群 ID"}),o.jsx(ze,{value:k,onChange:N=>{s(g,0,`${S}:${N.target.value}:${j}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"类型"}),o.jsxs(Vt,{value:j,onValueChange:N=>{s(g,0,`${S}:${k}:${N}`)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"group",children:"群组(group)"}),o.jsx(De,{value:"private",children:"私聊(private)"})]})]})]})]}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",m[0]||"(未设置)"]})]}),o.jsx("div",{className:"grid gap-2",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-xs font-medium",children:"使用学到的表达"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦使用从聊天中学到的表达方式"})]}),o.jsx(Bt,{checked:m[1]==="enable",onCheckedChange:N=>s(g,1,N?"enable":"disable")})]})}),o.jsx("div",{className:"grid gap-2",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-xs font-medium",children:"学习表达"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦从聊天中学习新的表达方式"})]}),o.jsx(Bt,{checked:m[2]==="enable",onCheckedChange:N=>s(g,2,N?"enable":"disable")})]})}),o.jsxs("div",{className:"grid gap-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{className:"text-xs font-medium",children:"学习强度"}),o.jsx(ze,{type:"number",step:"0.1",min:"0",max:"5",value:m[3],onChange:N=>{const T=parseFloat(N.target.value);isNaN(T)||s(g,3,Math.max(0,Math.min(5,T)).toFixed(1))},className:"w-20 h-8 text-xs"})]}),o.jsx(Bp,{value:[parseFloat(m[3])||1],onValueChange:N=>s(g,3,N[0].toFixed(1)),min:0,max:5,step:.1,className:"w-full"}),o.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[o.jsx("span",{children:"0 (不学习)"}),o.jsx("span",{children:"2.5"}),o.jsx("span",{children:"5.0 (快速学习)"})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"影响学习频率,最短学习间隔 = 300/学习强度(秒)"})]})]})]},g)}),t.learning_list.length===0&&o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无学习规则,点击"添加规则"开始配置'})]})]})}),o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold",children:"表达共享组配置"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置不同聊天流之间如何共享学到的表达方式"})]}),o.jsxs(de,{onClick:a,size:"sm",variant:"outline",children:[o.jsx(Ls,{className:"h-4 w-4 mr-1"}),"添加共享组"]})]}),o.jsxs("div",{className:"space-y-4",children:[t.expression_groups.map((m,g)=>{const x=t.learning_list.map(y=>y[0]).filter(y=>y!=="");return o.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium",children:["共享组 ",g+1,m.length===1&&m[0]==="*"&&"(全局共享)"]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(de,{onClick:()=>c(g),size:"sm",variant:"outline",children:o.jsx(Ls,{className:"h-4 w-4"})}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(de,{size:"sm",variant:"ghost",children:o.jsx(Sn,{className:"h-4 w-4"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:["确定要删除共享组 ",g+1," 吗?此操作无法撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:()=>l(g),children:"删除"})]})]})]})]})]}),o.jsx("div",{className:"space-y-2",children:m.map((y,w)=>o.jsx(z0e,{member:y,groupIndex:g,memberIndex:w,availableChatIds:x,onUpdate:h,onRemove:d},`${g}-${w}`))}),o.jsx("p",{className:"text-xs text-muted-foreground",children:'提示:可以从下拉框选择已配置的聊天流,或手动输入。输入 "*" 启用全局共享'})]},g)}),t.expression_groups.length===0&&o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无共享组,点击"添加共享组"开始配置'})]})]})})]})}function L0e({emojiConfig:t,memoryConfig:e,toolConfig:n,onEmojiChange:r,onMemoryChange:s,onToolChange:i}){return o.jsxs("div",{className:"space-y-6",children:[o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"工具设置"}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"enable_tool",checked:n.enable_tool,onCheckedChange:a=>i({...n,enable_tool:a})}),o.jsx(he,{htmlFor:"enable_tool",className:"cursor-pointer",children:"启用工具系统"})]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"允许麦麦使用各种工具来增强功能"})]})}),o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"记忆设置"}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"max_agent_iterations",children:"记忆思考深度"}),o.jsx(ze,{id:"max_agent_iterations",type:"number",min:"1",value:e.max_agent_iterations,onChange:a=>s({...e,max_agent_iterations:parseInt(a.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"最低为 1(不深入思考)"})]})]})}),o.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"表情包设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"emoji_chance",children:"表情包激活概率"}),o.jsx(ze,{id:"emoji_chance",type:"number",step:"0.1",min:"0",max:"1",value:t.emoji_chance,onChange:a=>r({...t,emoji_chance:parseFloat(a.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"范围 0-1,越大越容易发送表情包"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"max_reg_num",children:"最大注册数量"}),o.jsx(ze,{id:"max_reg_num",type:"number",min:"1",value:t.max_reg_num,onChange:a=>r({...t,max_reg_num:parseInt(a.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦最多可以注册的表情包数量"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),o.jsx(ze,{id:"check_interval",type:"number",min:"1",value:t.check_interval,onChange:a=>r({...t,check_interval:parseInt(a.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包(注册、破损、删除)的时间间隔"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"do_replace",checked:t.do_replace,onCheckedChange:a=>r({...t,do_replace:a})}),o.jsx(he,{htmlFor:"do_replace",className:"cursor-pointer",children:"达到最大数量时替换表情包"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"steal_emoji",checked:t.steal_emoji,onCheckedChange:a=>r({...t,steal_emoji:a})}),o.jsx(he,{htmlFor:"steal_emoji",className:"cursor-pointer",children:"偷取表情包"})]}),o.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"允许麦麦将看到的表情包据为己有"}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"content_filtration",checked:t.content_filtration,onCheckedChange:a=>r({...t,content_filtration:a})}),o.jsx(he,{htmlFor:"content_filtration",className:"cursor-pointer",children:"启用表情包过滤"})]}),t.content_filtration&&o.jsxs("div",{className:"grid gap-2 pl-6 border-l-2 border-primary/20",children:[o.jsx(he,{htmlFor:"filtration_prompt",children:"过滤要求"}),o.jsx(ze,{id:"filtration_prompt",value:t.filtration_prompt,onChange:a=>r({...t,filtration_prompt:a.target.value}),placeholder:"符合公序良俗"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"只有符合此要求的表情包才会被保存"})]})]})]})})]})}function B0e({keywordReactionConfig:t,responsePostProcessConfig:e,chineseTypoConfig:n,responseSplitterConfig:r,onKeywordReactionChange:s,onResponsePostProcessChange:i,onChineseTypoChange:a,onResponseSplitterChange:l}){const c=()=>{s({...t,regex_rules:[...t.regex_rules,{regex:[""],reaction:""}]})},d=T=>{s({...t,regex_rules:t.regex_rules.filter((E,_)=>_!==T)})},h=(T,E,_)=>{const A=[...t.regex_rules];E==="regex"&&typeof _=="string"?A[T]={...A[T],regex:[_]}:E==="reaction"&&typeof _=="string"&&(A[T]={...A[T],reaction:_}),s({...t,regex_rules:A})},m=({regex:T,reaction:E,onRegexChange:_,onReactionChange:A})=>{const[L,P]=b.useState(!1),[B,$]=b.useState(""),[U,te]=b.useState(null),[z,Q]=b.useState(""),[F,Y]=b.useState({}),[J,X]=b.useState(""),R=b.useRef(null),[ie,G]=b.useState("build"),I=W=>W.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),V=(W,se=0)=>{const re=R.current;if(!re)return;const oe=re.selectionStart||0,Te=re.selectionEnd||0,We=T.substring(0,oe)+W+T.substring(Te);_(We),setTimeout(()=>{const Ye=oe+W.length+se;re.setSelectionRange(Ye,Ye),re.focus()},0)};b.useEffect(()=>{if(!T||!B){te(null),Y({}),X(E),Q("");return}try{const W=I(T),se=new RegExp(W,"g"),re=B.match(se);te(re),Q("");const Te=new RegExp(W).exec(B);if(Te&&Te.groups){Y(Te.groups);let We=E;Object.entries(Te.groups).forEach(([Ye,Je])=>{We=We.replace(new RegExp(`\\[${Ye}\\]`,"g"),Je||"")}),X(We)}else Y({}),X(E)}catch(W){Q(W.message),te(null),Y({}),X(E)}},[T,B,E]);const ee=()=>{if(!B||!U||U.length===0)return o.jsx("span",{className:"text-muted-foreground",children:B||"请输入测试文本"});try{const W=I(T),se=new RegExp(W,"g");let re=0;const oe=[];let Te;for(;(Te=se.exec(B))!==null;)Te.index>re&&oe.push(o.jsx("span",{children:B.substring(re,Te.index)},`text-${re}`)),oe.push(o.jsx("span",{className:"bg-yellow-200 dark:bg-yellow-900 font-semibold",children:Te[0]},`match-${Te.index}`)),re=Te.index+Te[0].length;return re)",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\\S+)",desc:"捕获一个词语"},{label:"捕获句子",pattern:"(?P.+)",desc:"捕获整个句子"},{label:"捕获数字",pattern:"(?P\\d+)",desc:"捕获一个或多个数字"},{label:"可选词语",pattern:"(?:词语1|词语2)",desc:"匹配多个可选项之一"}]}];return o.jsxs(Dr,{open:L,onOpenChange:P,children:[o.jsx(Of,{asChild:!0,children:o.jsxs(de,{variant:"outline",size:"sm",children:[o.jsx(Pv,{className:"h-4 w-4 mr-1"}),"正则编辑器"]})}),o.jsxs(Sr,{className:"max-w-[95vw] sm:max-w-[900px] max-h-[90vh]",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"正则表达式编辑器"}),o.jsx(ss,{className:"text-sm",children:"使用可视化工具构建正则表达式,并实时测试效果"})]}),o.jsx(gn,{className:"max-h-[calc(90vh-120px)]",children:o.jsxs(ja,{value:ie,onValueChange:W=>G(W),className:"w-full",children:[o.jsxs(Wi,{className:"grid w-full grid-cols-2",children:[o.jsx(Lt,{value:"build",children:"🔧 构建器"}),o.jsx(Lt,{value:"test",children:"🧪 测试器"})]}),o.jsxs(un,{value:"build",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{className:"text-sm font-medium",children:"正则表达式"}),o.jsx(ze,{ref:R,value:T,onChange:W=>_(W.target.value),className:"font-mono text-sm",placeholder:"点击下方按钮构建正则表达式..."})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{className:"text-sm font-medium",children:"Reaction 内容"}),o.jsx(Mr,{value:E,onChange:W=>A(W.target.value),placeholder:"使用 [捕获组名] 引用捕获的内容...",rows:3,className:"text-sm"})]}),o.jsxs("div",{className:"space-y-4 border-t pt-4",children:[ne.map(W=>o.jsxs("div",{className:"space-y-2",children:[o.jsx("h5",{className:"text-xs font-semibold text-primary",children:W.category}),o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:W.items.map(se=>o.jsx(de,{variant:"outline",size:"sm",className:"justify-start h-auto py-2 px-3",onClick:()=>V(se.pattern,se.moveCursor||0),children:o.jsxs("div",{className:"flex flex-col items-start w-full",children:[o.jsxs("div",{className:"flex items-center gap-2 w-full",children:[o.jsx("span",{className:"text-xs font-medium",children:se.label}),o.jsx("code",{className:"ml-auto text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:se.pattern})]}),o.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:se.desc})]})},se.label))})]},W.category)),o.jsxs("div",{className:"space-y-2 border-t pt-4",children:[o.jsx("h5",{className:"text-xs font-semibold text-primary",children:"完整示例模板"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>_("^(?P\\S{1,20})是这样的$"),children:o.jsxs("div",{className:"flex flex-col items-start w-full",children:[o.jsxs("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:["^(?P\\S","{1,20}",")是这样的$"]}),o.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「某事物是这样的」并捕获事物名称"})]})}),o.jsx(de,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>_("(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"),children:o.jsxs("div",{className:"flex flex-col items-start w-full",children:[o.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"}),o.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「我没要求你做某事」并捕获具体行为"})]})}),o.jsx(de,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>_("(?P.+?)(?:是|为什么|怎么)"),children:o.jsxs("div",{className:"flex flex-col items-start w-full",children:[o.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?P.+?)(?:是|为什么|怎么)"}),o.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"捕获问题主题词"})]})})]})]})]}),o.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:[o.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 使用提示"}),o.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[o.jsx("li",{children:"点击输入框设置光标位置,然后点击按钮插入模式"}),o.jsxs("li",{children:["命名捕获组格式:",o.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"(?P<名称>模式)"})]}),o.jsxs("li",{children:["在 reaction 中使用 ",o.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"[名称]"})," 引用捕获的内容"]}),o.jsx("li",{children:"切换到测试器标签页验证正则表达式效果"})]})]})]}),o.jsxs(un,{value:"test",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{className:"text-sm font-medium",children:"当前正则表达式"}),o.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:T||"(未设置)"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"test-text",className:"text-sm font-medium",children:"测试文本"}),o.jsx(Mr,{id:"test-text",value:B,onChange:W=>$(W.target.value),placeholder:`在此输入要测试的文本... +例如:打游戏是这样的`,className:"min-h-[100px] text-sm"})]}),z&&o.jsxs("div",{className:"rounded-md bg-destructive/10 border border-destructive/20 p-3",children:[o.jsx("p",{className:"text-sm text-destructive font-medium",children:"正则表达式错误"}),o.jsx("p",{className:"text-xs text-destructive/80 mt-1",children:z})]}),!z&&B&&o.jsxs("div",{className:"space-y-3",children:[o.jsx("div",{className:"flex items-center gap-2",children:U&&U.length>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),o.jsxs("span",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:["匹配成功 (",U.length," 处)"]})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-400"}),o.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"无匹配"})]})}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{className:"text-sm font-medium",children:"匹配高亮"}),o.jsx(gn,{className:"h-40 rounded-md bg-muted p-3",children:o.jsx("div",{className:"text-sm break-words",children:ee()})})]}),Object.keys(F).length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{className:"text-sm font-medium",children:"命名捕获组"}),o.jsx(gn,{className:"h-32 rounded-md border p-3",children:o.jsx("div",{className:"space-y-2",children:Object.entries(F).map(([W,se])=>o.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[o.jsxs("span",{className:"font-mono font-semibold text-primary min-w-[80px]",children:["[",W,"]"]}),o.jsx("span",{className:"text-muted-foreground",children:"="}),o.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded",children:se})]},W))})})]}),Object.keys(F).length>0&&E&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{className:"text-sm font-medium",children:"Reaction 替换预览"}),o.jsx(gn,{className:"h-48 rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3",children:o.jsx("div",{className:"text-sm break-words",children:J})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"reaction 中的 [name] 已被替换为对应的捕获组值"})]})]}),o.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:[o.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 测试说明"}),o.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[o.jsx("li",{children:"匹配的文本会以黄色背景高亮显示"}),o.jsx("li",{children:"命名捕获组的值会显示在下方列表中"}),o.jsx("li",{children:"Reaction 替换预览显示最终生成的反应内容"}),o.jsx("li",{children:"如需修改正则,切换回构建器标签页"})]})]})]})]})})]})]})},g=()=>{s({...t,keyword_rules:[...t.keyword_rules,{keywords:[],reaction:""}]})},x=T=>{s({...t,keyword_rules:t.keyword_rules.filter((E,_)=>_!==T)})},y=(T,E,_)=>{const A=[...t.keyword_rules];typeof _=="string"&&(A[T]={...A[T],reaction:_}),s({...t,keyword_rules:A})},w=T=>{const E=[...t.keyword_rules];E[T]={...E[T],keywords:[...E[T].keywords||[],""]},s({...t,keyword_rules:E})},S=(T,E)=>{const _=[...t.keyword_rules];_[T]={..._[T],keywords:(_[T].keywords||[]).filter((A,L)=>L!==E)},s({...t,keyword_rules:_})},k=(T,E,_)=>{const A=[...t.keyword_rules],L=[...A[T].keywords||[]];L[E]=_,A[T]={...A[T],keywords:L},s({...t,keyword_rules:A})},j=({rule:T})=>{const E=`{ regex = [${(T.regex||[]).map(_=>`"${_}"`).join(", ")}], reaction = "${T.reaction}" }`;return o.jsxs(zo,{children:[o.jsx(Io,{asChild:!0,children:o.jsxs(de,{variant:"outline",size:"sm",children:[o.jsx(Ea,{className:"h-4 w-4 mr-1"}),"预览"]})}),o.jsx(Xa,{className:"w-[95vw] sm:w-[500px]",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),o.jsx(gn,{className:"h-60 rounded-md bg-muted p-3",children:o.jsx("pre",{className:"font-mono text-xs break-all",children:E})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},N=({rule:T})=>{const E=`[[keyword_reaction.keyword_rules]] keywords = [${(T.keywords||[]).map(_=>`"${_}"`).join(", ")}] -reaction = "${T.reaction}"`;return o.jsxs(Po,{children:[o.jsx(zo,{asChild:!0,children:o.jsxs(he,{variant:"outline",size:"sm",children:[o.jsx(Ea,{className:"h-4 w-4 mr-1"}),"预览"]})}),o.jsx(Xa,{className:"w-[95vw] sm:w-[500px]",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),o.jsx(wn,{className:"h-60 rounded-md bg-muted p-3",children:o.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-all",children:E})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"关键词反应配置"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"配置触发特定反应的关键词和正则表达式规则"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-base font-semibold",children:"正则表达式规则"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用正则表达式匹配消息内容"})]}),o.jsxs(he,{onClick:c,size:"sm",variant:"outline",children:[o.jsx(zs,{className:"h-4 w-4 mr-1"}),"添加正则规则"]})]}),o.jsxs("div",{className:"space-y-3",children:[t.regex_rules.map((T,E)=>o.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium",children:["正则规则 ",E+1]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(m,{regex:T.regex&&T.regex[0]||"",reaction:T.reaction,onRegexChange:_=>h(E,"regex",_),onReactionChange:_=>h(E,"reaction",_)}),o.jsx(j,{rule:T}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(he,{size:"sm",variant:"ghost",children:o.jsx(Sn,{className:"h-4 w-4"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:["确定要删除正则规则 ",E+1," 吗?此操作无法撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:()=>d(E),children:"删除"})]})]})]})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{className:"text-xs font-medium",children:"正则表达式(Python 语法)"}),o.jsx(ze,{value:T.regex&&T.regex[0]||"",onChange:_=>h(E,"regex",_.target.value),placeholder:"例如:^(?P\\\\S{1,20})是这样的$ (点击正则编辑器按钮可视化构建)",className:"font-mono text-sm"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:'支持命名捕获组 (?Ppattern),可在 reaction 中使用 [name] 引用。点击"正则编辑器"可视化构建和测试!'})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{className:"text-xs font-medium",children:"反应内容"}),o.jsx(Ar,{value:T.reaction,onChange:_=>h(E,"reaction",_.target.value),placeholder:`触发后麦麦的反应... -可以使用 [捕获组名] 来引用正则表达式中的内容`,rows:3,className:"text-sm"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"使用 [捕获组名] 引用正则表达式中的命名捕获组,例如 [n] 会被替换为捕获的内容"})]})]})]},E)),t.regex_rules.length===0&&o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无正则规则,点击"添加正则规则"开始配置'})]})]}),o.jsxs("div",{className:"space-y-4 border-t pt-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-base font-semibold",children:"关键词规则"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用关键词列表匹配消息内容"})]}),o.jsxs(he,{onClick:g,size:"sm",variant:"outline",children:[o.jsx(zs,{className:"h-4 w-4 mr-1"}),"添加关键词规则"]})]}),o.jsxs("div",{className:"space-y-3",children:[t.keyword_rules.map((T,E)=>o.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium",children:["关键词规则 ",E+1]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(N,{rule:T}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(he,{size:"sm",variant:"ghost",children:o.jsx(Sn,{className:"h-4 w-4"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:["确定要删除关键词规则 ",E+1," 吗?此操作无法撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:()=>x(E),children:"删除"})]})]})]})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(de,{className:"text-xs font-medium",children:"关键词列表"}),o.jsxs(he,{onClick:()=>w(E),size:"sm",variant:"ghost",children:[o.jsx(zs,{className:"h-3 w-3 mr-1"}),"添加关键词"]})]}),o.jsxs("div",{className:"space-y-2",children:[(T.keywords||[]).map((_,M)=>o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ze,{value:_,onChange:I=>k(E,M,I.target.value),placeholder:"关键词",className:"flex-1"}),o.jsx(he,{onClick:()=>S(E,M),size:"sm",variant:"ghost",children:o.jsx(Sn,{className:"h-4 w-4"})})]},M)),(!T.keywords||T.keywords.length===0)&&o.jsx("p",{className:"text-xs text-muted-foreground text-center py-2",children:'暂无关键词,点击"添加关键词"开始配置'})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{className:"text-xs font-medium",children:"反应内容"}),o.jsx(Ar,{value:T.reaction,onChange:_=>y(E,"reaction",_.target.value),placeholder:"触发后麦麦的反应...",rows:3,className:"text-sm"})]})]})]},E)),t.keyword_rules.length===0&&o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无关键词规则,点击"添加关键词规则"开始配置'})]})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"回复后处理配置"}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"enable_response_post_process",checked:e.enable_response_post_process,onCheckedChange:T=>i({...e,enable_response_post_process:T})}),o.jsx(de,{htmlFor:"enable_response_post_process",className:"cursor-pointer",children:"启用回复后处理"})]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"包括错别字生成器和回复分割器"})]}),e.enable_response_post_process&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"border-t pt-6 space-y-4",children:o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[o.jsx(Bt,{id:"enable_chinese_typo",checked:n.enable,onCheckedChange:T=>a({...n,enable:T})}),o.jsx(de,{htmlFor:"enable_chinese_typo",className:"cursor-pointer font-semibold",children:"中文错别字生成器"})]}),o.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"为回复添加随机错别字,让麦麦的回复更自然"}),n.enable&&o.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"error_rate",className:"text-xs font-medium",children:"单字替换概率"}),o.jsx(ze,{id:"error_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.error_rate,onChange:T=>a({...n,error_rate:parseFloat(T.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"min_freq",className:"text-xs font-medium",children:"最小字频阈值"}),o.jsx(ze,{id:"min_freq",type:"number",min:"0",value:n.min_freq,onChange:T=>a({...n,min_freq:parseInt(T.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"tone_error_rate",className:"text-xs font-medium",children:"声调错误概率"}),o.jsx(ze,{id:"tone_error_rate",type:"number",step:"0.01",min:"0",max:"1",value:n.tone_error_rate,onChange:T=>a({...n,tone_error_rate:parseFloat(T.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"word_replace_rate",className:"text-xs font-medium",children:"整词替换概率"}),o.jsx(ze,{id:"word_replace_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.word_replace_rate,onChange:T=>a({...n,word_replace_rate:parseFloat(T.target.value)})})]})]})]})}),o.jsx("div",{className:"border-t pt-6 space-y-4",children:o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[o.jsx(Bt,{id:"enable_response_splitter",checked:r.enable,onCheckedChange:T=>l({...r,enable:T})}),o.jsx(de,{htmlFor:"enable_response_splitter",className:"cursor-pointer font-semibold",children:"回复分割器"})]}),o.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"控制回复的长度和句子数量"}),r.enable&&o.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"max_length",className:"text-xs font-medium",children:"最大长度"}),o.jsx(ze,{id:"max_length",type:"number",min:"1",value:r.max_length,onChange:T=>l({...r,max_length:parseInt(T.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大字符数"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"max_sentence_num",className:"text-xs font-medium",children:"最大句子数"}),o.jsx(ze,{id:"max_sentence_num",type:"number",min:"1",value:r.max_sentence_num,onChange:T=>l({...r,max_sentence_num:parseInt(T.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大句子数量"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"enable_kaomoji_protection",checked:r.enable_kaomoji_protection,onCheckedChange:T=>l({...r,enable_kaomoji_protection:T})}),o.jsx(de,{htmlFor:"enable_kaomoji_protection",className:"cursor-pointer",children:"启用颜文字保护"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"enable_overflow_return_all",checked:r.enable_overflow_return_all,onCheckedChange:T=>l({...r,enable_overflow_return_all:T})}),o.jsx(de,{htmlFor:"enable_overflow_return_all",className:"cursor-pointer",children:"超出时一次性返回全部"})]}),o.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"当句子数量超出限制时,合并后一次性返回所有内容"})]})]})})]})]})]})}function w0e({config:t,onChange:e}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"情绪设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{checked:t.enable_mood,onCheckedChange:n=>e({...t,enable_mood:n})}),o.jsx(de,{className:"cursor-pointer",children:"启用情绪系统"})]}),t.enable_mood&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{children:"情绪更新阈值"}),o.jsx(ze,{type:"number",min:"1",value:t.mood_update_threshold,onChange:n=>e({...t,mood_update_threshold:parseInt(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"越高,更新越慢"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{children:"情感特征"}),o.jsx(Ar,{value:t.emotion_style,onChange:n=>e({...t,emotion_style:n.target.value}),placeholder:"影响情绪的变化情况",rows:2})]})]})]})]})}function S0e({config:t,onChange:e}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"语音设置"}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{checked:t.enable_asr,onCheckedChange:n=>e({...t,enable_asr:n})}),o.jsx(de,{className:"cursor-pointer",children:"启用语音识别"})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"启用后麦麦可以识别语音消息,需要配置语音识别模型"})]})}function k0e({config:t,onChange:e}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{checked:t.enable,onCheckedChange:n=>e({...t,enable:n})}),o.jsx(de,{className:"cursor-pointer",children:"启用 LPMM 知识库"})]}),t.enable&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{children:"LPMM 模式"}),o.jsxs(Vt,{value:t.lpmm_mode,onValueChange:n=>e({...t,lpmm_mode:n}),children:[o.jsx($t,{children:o.jsx(Ut,{placeholder:"选择 LPMM 模式"})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"classic",children:"经典模式"}),o.jsx(De,{value:"agent",children:"Agent 模式"})]})]})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{children:"同义词搜索 TopK"}),o.jsx(ze,{type:"number",min:"1",value:t.rag_synonym_search_top_k,onChange:n=>e({...t,rag_synonym_search_top_k:parseInt(n.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{children:"同义词阈值"}),o.jsx(ze,{type:"number",step:"0.1",min:"0",max:"1",value:t.rag_synonym_threshold,onChange:n=>e({...t,rag_synonym_threshold:parseFloat(n.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{children:"实体提取线程数"}),o.jsx(ze,{type:"number",min:"1",value:t.info_extraction_workers,onChange:n=>e({...t,info_extraction_workers:parseInt(n.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{children:"嵌入向量维度"}),o.jsx(ze,{type:"number",min:"1",value:t.embedding_dimension,onChange:n=>e({...t,embedding_dimension:parseInt(n.target.value)})})]})]})]})]})]})}function O0e({config:t,onChange:e}){const[n,r]=b.useState(""),[s,i]=b.useState("WARNING"),a=()=>{n&&!t.suppress_libraries.includes(n)&&(e({...t,suppress_libraries:[...t.suppress_libraries,n]}),r(""))},l=x=>{e({...t,suppress_libraries:t.suppress_libraries.filter(y=>y!==x)})},c=()=>{n&&!t.library_log_levels[n]&&(e({...t,library_log_levels:{...t.library_log_levels,[n]:s}}),r(""),i("WARNING"))},d=x=>{const y={...t.library_log_levels};delete y[x],e({...t,library_log_levels:y})},h=["DEBUG","INFO","WARNING","ERROR","CRITICAL"],m=["FULL","compact","lite"],g=["none","title","full"];return o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"日志配置"}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{children:"日期格式"}),o.jsx(ze,{value:t.date_style,onChange:x=>e({...t,date_style:x.target.value}),placeholder:"例如: m-d H:i:s"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"m=月, d=日, H=时, i=分, s=秒"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{children:"日志级别样式"}),o.jsxs(Vt,{value:t.log_level_style,onValueChange:x=>e({...t,log_level_style:x}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:m.map(x=>o.jsx(De,{value:x,children:x},x))})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{children:"日志文本颜色"}),o.jsxs(Vt,{value:t.color_text,onValueChange:x=>e({...t,color_text:x}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:g.map(x=>o.jsx(De,{value:x,children:x},x))})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{children:"全局日志级别"}),o.jsxs(Vt,{value:t.log_level,onValueChange:x=>e({...t,log_level:x}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:h.map(x=>o.jsx(De,{value:x,children:x},x))})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{children:"控制台日志级别"}),o.jsxs(Vt,{value:t.console_log_level,onValueChange:x=>e({...t,console_log_level:x}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:h.map(x=>o.jsx(De,{value:x,children:x},x))})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{children:"文件日志级别"}),o.jsxs(Vt,{value:t.file_log_level,onValueChange:x=>e({...t,file_log_level:x}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:h.map(x=>o.jsx(De,{value:x,children:x},x))})]})]})]})]}),o.jsxs("div",{children:[o.jsx(de,{className:"mb-2 block",children:"完全屏蔽的库"}),o.jsxs("div",{className:"flex gap-2 mb-2",children:[o.jsx(ze,{value:n,onChange:x=>r(x.target.value),placeholder:"输入库名",className:"flex-1",onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),a())}}),o.jsx(he,{onClick:a,size:"sm",className:"flex-shrink-0",children:o.jsx(zs,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),o.jsx("div",{className:"flex flex-wrap gap-2",children:t.suppress_libraries.map(x=>o.jsxs("div",{className:"flex items-center gap-1 bg-secondary px-3 py-1 rounded-md",children:[o.jsx("span",{className:"text-sm",children:x}),o.jsx(he,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>l(x),children:o.jsx(Sn,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},x))})]}),o.jsxs("div",{children:[o.jsx(de,{className:"mb-2 block",children:"特定库的日志级别"}),o.jsxs("div",{className:"flex gap-2 mb-2",children:[o.jsx(ze,{value:n,onChange:x=>r(x.target.value),placeholder:"输入库名",className:"flex-1"}),o.jsxs(Vt,{value:s,onValueChange:i,children:[o.jsx($t,{className:"w-32",children:o.jsx(Ut,{})}),o.jsx(Ht,{children:h.map(x=>o.jsx(De,{value:x,children:x},x))})]}),o.jsx(he,{onClick:c,size:"sm",children:o.jsx(zs,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),o.jsx("div",{className:"space-y-2",children:Object.entries(t.library_log_levels).map(([x,y])=>o.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[o.jsx("span",{className:"text-sm font-medium",children:x}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-sm text-muted-foreground",children:y}),o.jsx(he,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>d(x),children:o.jsx(Sn,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]})]},x))})]})]})}function j0e({config:t,onChange:e}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"调试配置"}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(de,{children:"显示 Prompt"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否在日志中显示提示词"})]}),o.jsx(Bt,{checked:t.show_prompt,onCheckedChange:n=>e({...t,show_prompt:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(de,{children:"显示回复器 Prompt"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的提示词"})]}),o.jsx(Bt,{checked:t.show_replyer_prompt,onCheckedChange:n=>e({...t,show_replyer_prompt:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(de,{children:"显示回复器推理"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的推理过程"})]}),o.jsx(Bt,{checked:t.show_replyer_reasoning,onCheckedChange:n=>e({...t,show_replyer_reasoning:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(de,{children:"显示 Jargon Prompt"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示术语相关的提示词"})]}),o.jsx(Bt,{checked:t.show_jargon_prompt,onCheckedChange:n=>e({...t,show_jargon_prompt:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(de,{children:"显示记忆检索 Prompt"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示记忆检索相关的提示词"})]}),o.jsx(Bt,{checked:t.show_memory_prompt,onCheckedChange:n=>e({...t,show_memory_prompt:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(de,{children:"显示 Planner Prompt"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示 Planner 的提示词和原始返回结果"})]}),o.jsx(Bt,{checked:t.show_planner_prompt,onCheckedChange:n=>e({...t,show_planner_prompt:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(de,{children:"显示 LPMM 相关文段"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示 LPMM 知识库找到的相关文段日志"})]}),o.jsx(Bt,{checked:t.show_lpmm_paragraph,onCheckedChange:n=>e({...t,show_lpmm_paragraph:n})})]})]})]})}function N0e({config:t,onChange:e}){const[n,r]=b.useState(""),s=()=>{n&&!t.auth_token.includes(n)&&(e({...t,auth_token:[...t.auth_token,n]}),r(""))},i=a=>{e({...t,auth_token:t.auth_token.filter((l,c)=>c!==a)})};return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"MaimMessage 服务配置"}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(de,{children:"启用自定义服务器"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否使用自定义的 MaimMessage 服务器"})]}),o.jsx(Bt,{checked:t.use_custom,onCheckedChange:a=>e({...t,use_custom:a})})]}),t.use_custom&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{children:"主机地址"}),o.jsx(ze,{value:t.host,onChange:a=>e({...t,host:a.target.value}),placeholder:"127.0.0.1"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{children:"端口号"}),o.jsx(ze,{type:"number",value:t.port,onChange:a=>e({...t,port:parseInt(a.target.value)}),placeholder:"8090"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{children:"连接模式"}),o.jsxs(Vt,{value:t.mode,onValueChange:a=>e({...t,mode:a}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"ws",children:"WebSocket (ws)"}),o.jsx(De,{value:"tcp",children:"TCP"})]})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{checked:t.use_wss,onCheckedChange:a=>e({...t,use_wss:a}),disabled:t.mode!=="ws"}),o.jsx(de,{children:"使用 WSS 安全连接"})]})]}),t.use_wss&&t.mode==="ws"&&o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{children:"SSL 证书文件路径"}),o.jsx(ze,{value:t.cert_file,onChange:a=>e({...t,cert_file:a.target.value}),placeholder:"cert.pem"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{children:"SSL 密钥文件路径"}),o.jsx(ze,{value:t.key_file,onChange:a=>e({...t,key_file:a.target.value}),placeholder:"key.pem"})]})]})]})]})]}),o.jsxs("div",{children:[o.jsx(de,{className:"mb-2 block",children:"认证令牌"}),o.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"用于 API 验证,为空则不启用验证"}),o.jsxs("div",{className:"flex gap-2 mb-2",children:[o.jsx(ze,{value:n,onChange:a=>r(a.target.value),placeholder:"输入认证令牌",onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),s())}}),o.jsx(he,{onClick:s,size:"sm",children:o.jsx(zs,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),o.jsx("div",{className:"space-y-2",children:t.auth_token.map((a,l)=>o.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[o.jsx("span",{className:"text-sm font-mono",children:a}),o.jsx(he,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>i(l),children:o.jsx(Sn,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},l))})]})]})}function C0e({config:t,onChange:e}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"统计信息"}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(de,{children:"启用统计信息发送"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"发送匿名统计信息,帮助我们了解全球有多少只麦麦在运行"})]}),o.jsx(Bt,{checked:t.enable,onCheckedChange:n=>e({...t,enable:n})})]})]})}const Tf=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{className:"relative w-full overflow-auto",children:o.jsx("table",{ref:n,className:ve("w-full caption-bottom text-sm",t),...e})}));Tf.displayName="Table";const Ef=b.forwardRef(({className:t,...e},n)=>o.jsx("thead",{ref:n,className:ve("[&_tr]:border-b",t),...e}));Ef.displayName="TableHeader";const _f=b.forwardRef(({className:t,...e},n)=>o.jsx("tbody",{ref:n,className:ve("[&_tr:last-child]:border-0",t),...e}));_f.displayName="TableBody";const T0e=b.forwardRef(({className:t,...e},n)=>o.jsx("tfoot",{ref:n,className:ve("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));T0e.displayName="TableFooter";const Ps=b.forwardRef(({className:t,...e},n)=>o.jsx("tr",{ref:n,className:ve("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...e}));Ps.displayName="TableRow";const pn=b.forwardRef(({className:t,...e},n)=>o.jsx("th",{ref:n,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]",t),...e}));pn.displayName="TableHead";const Gt=b.forwardRef(({className:t,...e},n)=>o.jsx("td",{ref:n,className:ve("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e}));Gt.displayName="TableCell";const E0e=b.forwardRef(({className:t,...e},n)=>o.jsx("caption",{ref:n,className:ve("mt-4 text-sm text-muted-foreground",t),...e}));E0e.displayName="TableCaption";var dM=1,_0e=.9,M0e=.8,A0e=.17,lS=.1,cS=.999,R0e=.9999,D0e=.99,P0e=/[\\\/_+.#"@\[\(\{&]/,z0e=/[\\\/_+.#"@\[\(\{&]/g,I0e=/[\s-]/,yH=/[\s-]/g;function cO(t,e,n,r,s,i,a){if(i===e.length)return s===t.length?dM:D0e;var l=`${s},${i}`;if(a[l]!==void 0)return a[l];for(var c=r.charAt(i),d=n.indexOf(c,s),h=0,m,g,x,y;d>=0;)m=cO(t,e,n,r,d+1,i+1,a),m>h&&(d===s?m*=dM:P0e.test(t.charAt(d-1))?(m*=M0e,x=t.slice(s,d-1).match(z0e),x&&s>0&&(m*=Math.pow(cS,x.length))):I0e.test(t.charAt(d-1))?(m*=_0e,y=t.slice(s,d-1).match(yH),y&&s>0&&(m*=Math.pow(cS,y.length))):(m*=A0e,s>0&&(m*=Math.pow(cS,d-s))),t.charAt(d)!==e.charAt(i)&&(m*=R0e)),(mm&&(m=g*lS)),m>h&&(h=m),d=n.indexOf(c,d+1);return a[l]=h,h}function hM(t){return t.toLowerCase().replace(yH," ")}function L0e(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,cO(t,e,hM(t),hM(e),0,0,{})}var B0e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],cu=B0e.reduce((t,e)=>{const n=vj(`Primitive.${e}`),r=b.forwardRef((s,i)=>{const{asChild:a,...l}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),$m='[cmdk-group=""]',uS='[cmdk-group-items=""]',F0e='[cmdk-group-heading=""]',bH='[cmdk-item=""]',fM=`${bH}:not([aria-disabled="true"])`,uO="cmdk-item-select",wh="data-value",q0e=(t,e,n)=>L0e(t,e,n),wH=b.createContext(void 0),Kp=()=>b.useContext(wH),SH=b.createContext(void 0),I6=()=>b.useContext(SH),kH=b.createContext(void 0),OH=b.forwardRef((t,e)=>{let n=Sh(()=>{var W,q;return{search:"",value:(q=(W=t.value)!=null?W:t.defaultValue)!=null?q:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Sh(()=>new Set),s=Sh(()=>new Map),i=Sh(()=>new Map),a=Sh(()=>new Set),l=jH(t),{label:c,children:d,value:h,onValueChange:m,filter:g,shouldFilter:x,loop:y,disablePointerSelection:w=!1,vimBindings:S=!0,...k}=t,j=Ui(),N=Ui(),T=Ui(),E=b.useRef(null),_=Z0e();dd(()=>{if(h!==void 0){let W=h.trim();n.current.value=W,M.emit()}},[h]),dd(()=>{_(6,ee)},[]);let M=b.useMemo(()=>({subscribe:W=>(a.current.add(W),()=>a.current.delete(W)),snapshot:()=>n.current,setState:(W,q,V)=>{var te,ne,K,se;if(!Object.is(n.current[W],q)){if(n.current[W]=q,W==="search")U(),L(),_(1,H);else if(W==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let re=document.getElementById(T);re?re.focus():(te=document.getElementById(j))==null||te.focus()}if(_(7,()=>{var re;n.current.selectedItemId=(re=z())==null?void 0:re.id,M.emit()}),V||_(5,ee),((ne=l.current)==null?void 0:ne.value)!==void 0){let re=q??"";(se=(K=l.current).onValueChange)==null||se.call(K,re);return}}M.emit()}},emit:()=>{a.current.forEach(W=>W())}}),[]),I=b.useMemo(()=>({value:(W,q,V)=>{var te;q!==((te=i.current.get(W))==null?void 0:te.value)&&(i.current.set(W,{value:q,keywords:V}),n.current.filtered.items.set(W,P(q,V)),_(2,()=>{L(),M.emit()}))},item:(W,q)=>(r.current.add(W),q&&(s.current.has(q)?s.current.get(q).add(W):s.current.set(q,new Set([W]))),_(3,()=>{U(),L(),n.current.value||H(),M.emit()}),()=>{i.current.delete(W),r.current.delete(W),n.current.filtered.items.delete(W);let V=z();_(4,()=>{U(),V?.getAttribute("id")===W&&H(),M.emit()})}),group:W=>(s.current.has(W)||s.current.set(W,new Set),()=>{i.current.delete(W),s.current.delete(W)}),filter:()=>l.current.shouldFilter,label:c||t["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:j,inputId:T,labelId:N,listInnerRef:E}),[]);function P(W,q){var V,te;let ne=(te=(V=l.current)==null?void 0:V.filter)!=null?te:q0e;return W?ne(W,n.current.search,q):0}function L(){if(!n.current.search||l.current.shouldFilter===!1)return;let W=n.current.filtered.items,q=[];n.current.filtered.groups.forEach(te=>{let ne=s.current.get(te),K=0;ne.forEach(se=>{let re=W.get(se);K=Math.max(re,K)}),q.push([te,K])});let V=E.current;Q().sort((te,ne)=>{var K,se;let re=te.getAttribute("id"),oe=ne.getAttribute("id");return((K=W.get(oe))!=null?K:0)-((se=W.get(re))!=null?se:0)}).forEach(te=>{let ne=te.closest(uS);ne?ne.appendChild(te.parentElement===ne?te:te.closest(`${uS} > *`)):V.appendChild(te.parentElement===V?te:te.closest(`${uS} > *`))}),q.sort((te,ne)=>ne[1]-te[1]).forEach(te=>{var ne;let K=(ne=E.current)==null?void 0:ne.querySelector(`${$m}[${wh}="${encodeURIComponent(te[0])}"]`);K?.parentElement.appendChild(K)})}function H(){let W=Q().find(V=>V.getAttribute("aria-disabled")!=="true"),q=W?.getAttribute(wh);M.setState("value",q||void 0)}function U(){var W,q,V,te;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ne=0;for(let K of r.current){let se=(q=(W=i.current.get(K))==null?void 0:W.value)!=null?q:"",re=(te=(V=i.current.get(K))==null?void 0:V.keywords)!=null?te:[],oe=P(se,re);n.current.filtered.items.set(K,oe),oe>0&&ne++}for(let[K,se]of s.current)for(let re of se)if(n.current.filtered.items.get(re)>0){n.current.filtered.groups.add(K);break}n.current.filtered.count=ne}function ee(){var W,q,V;let te=z();te&&(((W=te.parentElement)==null?void 0:W.firstChild)===te&&((V=(q=te.closest($m))==null?void 0:q.querySelector(F0e))==null||V.scrollIntoView({block:"nearest"})),te.scrollIntoView({block:"nearest"}))}function z(){var W;return(W=E.current)==null?void 0:W.querySelector(`${bH}[aria-selected="true"]`)}function Q(){var W;return Array.from(((W=E.current)==null?void 0:W.querySelectorAll(fM))||[])}function B(W){let q=Q()[W];q&&M.setState("value",q.getAttribute(wh))}function X(W){var q;let V=z(),te=Q(),ne=te.findIndex(se=>se===V),K=te[ne+W];(q=l.current)!=null&&q.loop&&(K=ne+W<0?te[te.length-1]:ne+W===te.length?te[0]:te[ne+W]),K&&M.setState("value",K.getAttribute(wh))}function J(W){let q=z(),V=q?.closest($m),te;for(;V&&!te;)V=W>0?Y0e(V,$m):K0e(V,$m),te=V?.querySelector(fM);te?M.setState("value",te.getAttribute(wh)):X(W)}let G=()=>B(Q().length-1),R=W=>{W.preventDefault(),W.metaKey?G():W.altKey?J(1):X(1)},ie=W=>{W.preventDefault(),W.metaKey?B(0):W.altKey?J(-1):X(-1)};return b.createElement(cu.div,{ref:e,tabIndex:-1,...k,"cmdk-root":"",onKeyDown:W=>{var q;(q=k.onKeyDown)==null||q.call(k,W);let V=W.nativeEvent.isComposing||W.keyCode===229;if(!(W.defaultPrevented||V))switch(W.key){case"n":case"j":{S&&W.ctrlKey&&R(W);break}case"ArrowDown":{R(W);break}case"p":case"k":{S&&W.ctrlKey&&ie(W);break}case"ArrowUp":{ie(W);break}case"Home":{W.preventDefault(),B(0);break}case"End":{W.preventDefault(),G();break}case"Enter":{W.preventDefault();let te=z();if(te){let ne=new Event(uO);te.dispatchEvent(ne)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:I.inputId,id:I.labelId,style:epe},c),xb(t,W=>b.createElement(SH.Provider,{value:M},b.createElement(wH.Provider,{value:I},W))))}),$0e=b.forwardRef((t,e)=>{var n,r;let s=Ui(),i=b.useRef(null),a=b.useContext(kH),l=Kp(),c=jH(t),d=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:a?.forceMount;dd(()=>{if(!d)return l.item(s,a?.id)},[d]);let h=NH(s,i,[t.value,t.children,i],t.keywords),m=I6(),g=Zc(_=>_.value&&_.value===h.current),x=Zc(_=>d||l.filter()===!1?!0:_.search?_.filtered.items.get(s)>0:!0);b.useEffect(()=>{let _=i.current;if(!(!_||t.disabled))return _.addEventListener(uO,y),()=>_.removeEventListener(uO,y)},[x,t.onSelect,t.disabled]);function y(){var _,M;w(),(M=(_=c.current).onSelect)==null||M.call(_,h.current)}function w(){m.setState("value",h.current,!0)}if(!x)return null;let{disabled:S,value:k,onSelect:j,forceMount:N,keywords:T,...E}=t;return b.createElement(cu.div,{ref:Hc(i,e),...E,id:s,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!g,"data-disabled":!!S,"data-selected":!!g,onPointerMove:S||l.getDisablePointerSelection()?void 0:w,onClick:S?void 0:y},t.children)}),H0e=b.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:s,...i}=t,a=Ui(),l=b.useRef(null),c=b.useRef(null),d=Ui(),h=Kp(),m=Zc(x=>s||h.filter()===!1?!0:x.search?x.filtered.groups.has(a):!0);dd(()=>h.group(a),[]),NH(a,l,[t.value,t.heading,c]);let g=b.useMemo(()=>({id:a,forceMount:s}),[s]);return b.createElement(cu.div,{ref:Hc(l,e),...i,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&b.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),xb(t,x=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},b.createElement(kH.Provider,{value:g},x))))}),Q0e=b.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,s=b.useRef(null),i=Zc(a=>!a.search);return!n&&!i?null:b.createElement(cu.div,{ref:Hc(s,e),...r,"cmdk-separator":"",role:"separator"})}),V0e=b.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,s=t.value!=null,i=I6(),a=Zc(d=>d.search),l=Zc(d=>d.selectedItemId),c=Kp();return b.useEffect(()=>{t.value!=null&&i.setState("search",t.value)},[t.value]),b.createElement(cu.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:s?t.value:a,onChange:d=>{s||i.setState("search",d.target.value),n?.(d.target.value)}})}),U0e=b.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...s}=t,i=b.useRef(null),a=b.useRef(null),l=Zc(d=>d.selectedItemId),c=Kp();return b.useEffect(()=>{if(a.current&&i.current){let d=a.current,h=i.current,m,g=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let x=d.offsetHeight;h.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return g.observe(d),()=>{cancelAnimationFrame(m),g.unobserve(d)}}},[]),b.createElement(cu.div,{ref:Hc(i,e),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},xb(t,d=>b.createElement("div",{ref:Hc(a,c.listInnerRef),"cmdk-list-sizer":""},d)))}),W0e=b.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:a,...l}=t;return b.createElement(Sj,{open:n,onOpenChange:r},b.createElement(yj,{container:a},b.createElement(Py,{"cmdk-overlay":"",className:s}),b.createElement(zy,{"aria-label":t.label,"cmdk-dialog":"",className:i},b.createElement(OH,{ref:e,...l}))))}),G0e=b.forwardRef((t,e)=>Zc(n=>n.filtered.count===0)?b.createElement(cu.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),X0e=b.forwardRef((t,e)=>{let{progress:n,children:r,label:s="Loading...",...i}=t;return b.createElement(cu.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},xb(t,a=>b.createElement("div",{"aria-hidden":!0},a)))}),Ci=Object.assign(OH,{List:U0e,Item:$0e,Input:V0e,Group:H0e,Separator:Q0e,Dialog:W0e,Empty:G0e,Loading:X0e});function Y0e(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function K0e(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function jH(t){let e=b.useRef(t);return dd(()=>{e.current=t}),e}var dd=typeof window>"u"?b.useEffect:b.useLayoutEffect;function Sh(t){let e=b.useRef();return e.current===void 0&&(e.current=t()),e}function Zc(t){let e=I6(),n=()=>t(e.snapshot());return b.useSyncExternalStore(e.subscribe,n,n)}function NH(t,e,n,r=[]){let s=b.useRef(),i=Kp();return dd(()=>{var a;let l=(()=>{var d;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(d=h.current.textContent)==null?void 0:d.trim():s.current}})(),c=r.map(d=>d.trim());i.value(t,l,c),(a=e.current)==null||a.setAttribute(wh,l),s.current=l}),s}var Z0e=()=>{let[t,e]=b.useState(),n=Sh(()=>new Map);return dd(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,s)=>{n.current.set(r,s),e({})}};function J0e(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function xb({asChild:t,children:e},n){return t&&b.isValidElement(e)?b.cloneElement(J0e(e),{ref:e.ref},n(e.props.children)):n(e)}var epe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const vb=b.forwardRef(({className:t,...e},n)=>o.jsx(Ci,{ref:n,className:ve("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));vb.displayName=Ci.displayName;const yb=b.forwardRef(({className:t,...e},n)=>o.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[o.jsx(Ni,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),o.jsx(Ci.Input,{ref:n,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",t),...e})]}));yb.displayName=Ci.Input.displayName;const bb=b.forwardRef(({className:t,...e},n)=>o.jsx(Ci.List,{ref:n,className:ve("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));bb.displayName=Ci.List.displayName;const wb=b.forwardRef((t,e)=>o.jsx(Ci.Empty,{ref:e,className:"py-6 text-center text-sm",...t}));wb.displayName=Ci.Empty.displayName;const rp=b.forwardRef(({className:t,...e},n)=>o.jsx(Ci.Group,{ref:n,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",t),...e}));rp.displayName=Ci.Group.displayName;const tpe=b.forwardRef(({className:t,...e},n)=>o.jsx(Ci.Separator,{ref:n,className:ve("-mx-1 h-px bg-border",t),...e}));tpe.displayName=Ci.Separator.displayName;const sp=b.forwardRef(({className:t,...e},n)=>o.jsx(Ci.Item,{ref:n,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",t),...e}));sp.displayName=Ci.Item.displayName;const Oi=b.forwardRef(({className:t,...e},n)=>o.jsx(cI,{ref:n,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",t),...e,children:o.jsx(xee,{className:ve("grid place-content-center text-current"),children:o.jsx(Ro,{className:"h-4 w-4"})})}));Oi.displayName=cI.displayName;const CH=b.createContext(null),TH="maibot-completed-tours";function npe(){try{const t=localStorage.getItem(TH);return t?new Set(JSON.parse(t)):new Set}catch{return new Set}}function mM(t){localStorage.setItem(TH,JSON.stringify([...t]))}function rpe({children:t}){const[e,n]=b.useState({activeTourId:null,stepIndex:0,isRunning:!1}),r=b.useRef(new Map),[,s]=b.useState(0),[i,a]=b.useState(npe),l=b.useCallback((N,T)=>{r.current.set(N,T),s(E=>E+1)},[]),c=b.useCallback(N=>{r.current.delete(N),n(T=>T.activeTourId===N?{...T,activeTourId:null,isRunning:!1,stepIndex:0}:T)},[]),d=b.useCallback((N,T=0)=>{r.current.has(N)&&n({activeTourId:N,stepIndex:T,isRunning:!0})},[]),h=b.useCallback(()=>{n(N=>({...N,isRunning:!1}))},[]),m=b.useCallback(N=>{n(T=>({...T,stepIndex:N}))},[]),g=b.useCallback(()=>{n(N=>({...N,stepIndex:N.stepIndex+1}))},[]),x=b.useCallback(()=>{n(N=>({...N,stepIndex:Math.max(0,N.stepIndex-1)}))},[]),y=b.useCallback(()=>e.activeTourId?r.current.get(e.activeTourId)||[]:[],[e.activeTourId]),w=b.useCallback(N=>{a(T=>{const E=new Set(T);return E.add(N),mM(E),E})},[]),S=b.useCallback(N=>{const{action:T,index:E,status:_,type:M}=N,I=["finished","skipped"];if(T==="close"){n(P=>({...P,isRunning:!1,stepIndex:0}));return}I.includes(_)?n(P=>(_==="finished"&&P.activeTourId&&setTimeout(()=>w(P.activeTourId),0),{...P,isRunning:!1,stepIndex:0})):M==="step:after"&&(T==="next"?n(P=>({...P,stepIndex:E+1})):T==="prev"&&n(P=>({...P,stepIndex:E-1})))},[w]),k=b.useCallback(N=>i.has(N),[i]),j=b.useCallback(N=>{a(T=>{const E=new Set(T);return E.delete(N),mM(E),E})},[]);return o.jsx(CH.Provider,{value:{state:e,tours:r.current,registerTour:l,unregisterTour:c,startTour:d,stopTour:h,goToStep:m,nextStep:g,prevStep:x,getCurrentSteps:y,handleJoyrideCallback:S,isTourCompleted:k,markTourCompleted:w,resetTourCompleted:j},children:t})}function EH(t){return e=>typeof e===t}var spe=EH("function"),ipe=t=>t===null,pM=t=>Object.prototype.toString.call(t).slice(8,-1)==="RegExp",gM=t=>!ape(t)&&!ipe(t)&&(spe(t)||typeof t=="object"),ape=EH("undefined");function ope(t,e){const{length:n}=t;if(n!==e.length)return!1;for(let r=n;r--!==0;)if(!Js(t[r],e[r]))return!1;return!0}function lpe(t,e){if(t.byteLength!==e.byteLength)return!1;const n=new DataView(t.buffer),r=new DataView(e.buffer);let s=t.byteLength;for(;s--;)if(n.getUint8(s)!==r.getUint8(s))return!1;return!0}function cpe(t,e){if(t.size!==e.size)return!1;for(const n of t.entries())if(!e.has(n[0]))return!1;for(const n of t.entries())if(!Js(n[1],e.get(n[0])))return!1;return!0}function upe(t,e){if(t.size!==e.size)return!1;for(const n of t.entries())if(!e.has(n[0]))return!1;return!0}function Js(t,e){if(t===e)return!0;if(t&&gM(t)&&e&&gM(e)){if(t.constructor!==e.constructor)return!1;if(Array.isArray(t)&&Array.isArray(e))return ope(t,e);if(t instanceof Map&&e instanceof Map)return cpe(t,e);if(t instanceof Set&&e instanceof Set)return upe(t,e);if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return lpe(t,e);if(pM(t)&&pM(e))return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(let s=n.length;s--!==0;)if(!Object.prototype.hasOwnProperty.call(e,n[s]))return!1;for(let s=n.length;s--!==0;){const i=n[s];if(!(i==="_owner"&&t.$$typeof)&&!Js(t[i],e[i]))return!1}return!0}return Number.isNaN(t)&&Number.isNaN(e)?!0:t===e}var dpe=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"],hpe=["bigint","boolean","null","number","string","symbol","undefined"];function Sb(t){const e=Object.prototype.toString.call(t).slice(8,-1);if(/HTML\w+Element/.test(e))return"HTMLElement";if(fpe(e))return e}function ro(t){return e=>Sb(e)===t}function fpe(t){return dpe.includes(t)}function Mf(t){return e=>typeof e===t}function mpe(t){return hpe.includes(t)}var ppe=["innerHTML","ownerDocument","style","attributes","nodeValue"];function ct(t){if(t===null)return"null";switch(typeof t){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(ct.array(t))return"Array";if(ct.plainFunction(t))return"Function";const e=Sb(t);return e||"Object"}ct.array=Array.isArray;ct.arrayOf=(t,e)=>!ct.array(t)&&!ct.function(e)?!1:t.every(n=>e(n));ct.asyncGeneratorFunction=t=>Sb(t)==="AsyncGeneratorFunction";ct.asyncFunction=ro("AsyncFunction");ct.bigint=Mf("bigint");ct.boolean=t=>t===!0||t===!1;ct.date=ro("Date");ct.defined=t=>!ct.undefined(t);ct.domElement=t=>ct.object(t)&&!ct.plainObject(t)&&t.nodeType===1&&ct.string(t.nodeName)&&ppe.every(e=>e in t);ct.empty=t=>ct.string(t)&&t.length===0||ct.array(t)&&t.length===0||ct.object(t)&&!ct.map(t)&&!ct.set(t)&&Object.keys(t).length===0||ct.set(t)&&t.size===0||ct.map(t)&&t.size===0;ct.error=ro("Error");ct.function=Mf("function");ct.generator=t=>ct.iterable(t)&&ct.function(t.next)&&ct.function(t.throw);ct.generatorFunction=ro("GeneratorFunction");ct.instanceOf=(t,e)=>!t||!e?!1:Object.getPrototypeOf(t)===e.prototype;ct.iterable=t=>!ct.nullOrUndefined(t)&&ct.function(t[Symbol.iterator]);ct.map=ro("Map");ct.nan=t=>Number.isNaN(t);ct.null=t=>t===null;ct.nullOrUndefined=t=>ct.null(t)||ct.undefined(t);ct.number=t=>Mf("number")(t)&&!ct.nan(t);ct.numericString=t=>ct.string(t)&&t.length>0&&!Number.isNaN(Number(t));ct.object=t=>!ct.nullOrUndefined(t)&&(ct.function(t)||typeof t=="object");ct.oneOf=(t,e)=>ct.array(t)?t.indexOf(e)>-1:!1;ct.plainFunction=ro("Function");ct.plainObject=t=>{if(Sb(t)!=="Object")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.getPrototypeOf({})};ct.primitive=t=>ct.null(t)||mpe(typeof t);ct.promise=ro("Promise");ct.propertyOf=(t,e,n)=>{if(!ct.object(t)||!e)return!1;const r=t[e];return ct.function(n)?n(r):ct.defined(r)};ct.regexp=ro("RegExp");ct.set=ro("Set");ct.string=Mf("string");ct.symbol=Mf("symbol");ct.undefined=Mf("undefined");ct.weakMap=ro("WeakMap");ct.weakSet=ro("WeakSet");var ft=ct;function gpe(...t){return t.every(e=>ft.string(e)||ft.array(e)||ft.plainObject(e))}function xpe(t,e,n){return _H(t,e)?[t,e].every(ft.array)?!t.some(wM(n))&&e.some(wM(n)):[t,e].every(ft.plainObject)?!Object.entries(t).some(bM(n))&&Object.entries(e).some(bM(n)):e===n:!1}function xM(t,e,n){const{actual:r,key:s,previous:i,type:a}=n,l=To(t,s),c=To(e,s);let d=[l,c].every(ft.number)&&(a==="increased"?lc);return ft.undefined(r)||(d=d&&c===r),ft.undefined(i)||(d=d&&l===i),d}function vM(t,e,n){const{key:r,type:s,value:i}=n,a=To(t,r),l=To(e,r),c=s==="added"?a:l,d=s==="added"?l:a;if(!ft.nullOrUndefined(i)){if(ft.defined(c)){if(ft.array(c)||ft.plainObject(c))return xpe(c,d,i)}else return Js(d,i);return!1}return[a,l].every(ft.array)?!d.every(L6(c)):[a,l].every(ft.plainObject)?vpe(Object.keys(c),Object.keys(d)):![a,l].every(h=>ft.primitive(h)&&ft.defined(h))&&(s==="added"?!ft.defined(a)&&ft.defined(l):ft.defined(a)&&!ft.defined(l))}function yM(t,e,{key:n}={}){let r=To(t,n),s=To(e,n);if(!_H(r,s))throw new TypeError("Inputs have different types");if(!gpe(r,s))throw new TypeError("Inputs don't have length");return[r,s].every(ft.plainObject)&&(r=Object.keys(r),s=Object.keys(s)),[r,s]}function bM(t){return([e,n])=>ft.array(t)?Js(t,n)||t.some(r=>Js(r,n)||ft.array(n)&&L6(n)(r)):ft.plainObject(t)&&t[e]?!!t[e]&&Js(t[e],n):Js(t,n)}function vpe(t,e){return e.some(n=>!t.includes(n))}function wM(t){return e=>ft.array(t)?t.some(n=>Js(n,e)||ft.array(e)&&L6(e)(n)):Js(t,e)}function Hm(t,e){return ft.array(t)?t.some(n=>Js(n,e)):Js(t,e)}function L6(t){return e=>t.some(n=>Js(n,e))}function _H(...t){return t.every(ft.array)||t.every(ft.number)||t.every(ft.plainObject)||t.every(ft.string)}function To(t,e){return ft.plainObject(t)||ft.array(t)?ft.string(e)?e.split(".").reduce((r,s)=>r&&r[s],t):ft.number(e)?t[e]:t:t}function iy(t,e){if([t,e].some(ft.nullOrUndefined))throw new Error("Missing required parameters");if(![t,e].every(h=>ft.plainObject(h)||ft.array(h)))throw new Error("Expected plain objects or array");return{added:(h,m)=>{try{return vM(t,e,{key:h,type:"added",value:m})}catch{return!1}},changed:(h,m,g)=>{try{const x=To(t,h),y=To(e,h),w=ft.defined(m),S=ft.defined(g);if(w||S){const k=S?Hm(g,x):!Hm(m,x),j=Hm(m,y);return k&&j}return[x,y].every(ft.array)||[x,y].every(ft.plainObject)?!Js(x,y):x!==y}catch{return!1}},changedFrom:(h,m,g)=>{if(!ft.defined(h))return!1;try{const x=To(t,h),y=To(e,h),w=ft.defined(g);return Hm(m,x)&&(w?Hm(g,y):!w)}catch{return!1}},decreased:(h,m,g)=>{if(!ft.defined(h))return!1;try{return xM(t,e,{key:h,actual:m,previous:g,type:"decreased"})}catch{return!1}},emptied:h=>{try{const[m,g]=yM(t,e,{key:h});return!!m.length&&!g.length}catch{return!1}},filled:h=>{try{const[m,g]=yM(t,e,{key:h});return!m.length&&!!g.length}catch{return!1}},increased:(h,m,g)=>{if(!ft.defined(h))return!1;try{return xM(t,e,{key:h,actual:m,previous:g,type:"increased"})}catch{return!1}},removed:(h,m)=>{try{return vM(t,e,{key:h,type:"removed",value:m})}catch{return!1}}}}var dS,SM;function ype(){if(SM)return dS;SM=1;var t=new Error("Element already at target scroll position"),e=new Error("Scroll cancelled"),n=Math.min,r=Date.now;dS={left:s("scrollLeft"),top:s("scrollTop")};function s(l){return function(d,h,m,g){m=m||{},typeof m=="function"&&(g=m,m={}),typeof g!="function"&&(g=a);var x=r(),y=d[l],w=m.ease||i,S=isNaN(m.duration)?350:+m.duration,k=!1;return y===h?g(t,d[l]):requestAnimationFrame(N),j;function j(){k=!0}function N(T){if(k)return g(e,d[l]);var E=r(),_=n(1,(E-x)/S),M=w(_);d[l]=M*(h-y)+y,_<1?requestAnimationFrame(N):requestAnimationFrame(function(){g(null,d[l])})}}}function i(l){return .5*(1-Math.cos(Math.PI*l))}function a(){}return dS}var bpe=ype();const wpe=gd(bpe);var xv={exports:{}},Spe=xv.exports,kM;function kpe(){return kM||(kM=1,(function(t){(function(e,n){t.exports?t.exports=n():e.Scrollparent=n()})(Spe,function(){function e(r){var s=getComputedStyle(r,null).getPropertyValue("overflow");return s.indexOf("scroll")>-1||s.indexOf("auto")>-1}function n(r){if(r instanceof HTMLElement||r instanceof SVGElement){for(var s=r.parentNode;s.parentNode;){if(e(s))return s;s=s.parentNode}return document.scrollingElement||document.documentElement}}return n})})(xv)),xv.exports}var Ope=kpe();const MH=gd(Ope);var hS,OM;function jpe(){if(OM)return hS;OM=1;var t=function(r){return Object.prototype.hasOwnProperty.call(r,"props")},e=function(r,s){return r+n(s)},n=function(r){return r===null||typeof r=="boolean"||typeof r>"u"?"":typeof r=="number"?r.toString():typeof r=="string"?r:Array.isArray(r)?r.reduce(e,""):t(r)&&Object.prototype.hasOwnProperty.call(r.props,"children")?n(r.props.children):""};return n.default=n,hS=n,hS}var Npe=jpe();const jM=gd(Npe);var fS,NM;function Cpe(){if(NM)return fS;NM=1;var t=function(j){return e(j)&&!n(j)};function e(k){return!!k&&typeof k=="object"}function n(k){var j=Object.prototype.toString.call(k);return j==="[object RegExp]"||j==="[object Date]"||i(k)}var r=typeof Symbol=="function"&&Symbol.for,s=r?Symbol.for("react.element"):60103;function i(k){return k.$$typeof===s}function a(k){return Array.isArray(k)?[]:{}}function l(k,j){return j.clone!==!1&&j.isMergeableObject(k)?w(a(k),k,j):k}function c(k,j,N){return k.concat(j).map(function(T){return l(T,N)})}function d(k,j){if(!j.customMerge)return w;var N=j.customMerge(k);return typeof N=="function"?N:w}function h(k){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(k).filter(function(j){return Object.propertyIsEnumerable.call(k,j)}):[]}function m(k){return Object.keys(k).concat(h(k))}function g(k,j){try{return j in k}catch{return!1}}function x(k,j){return g(k,j)&&!(Object.hasOwnProperty.call(k,j)&&Object.propertyIsEnumerable.call(k,j))}function y(k,j,N){var T={};return N.isMergeableObject(k)&&m(k).forEach(function(E){T[E]=l(k[E],N)}),m(j).forEach(function(E){x(k,E)||(g(k,E)&&N.isMergeableObject(j[E])?T[E]=d(E,N)(k[E],j[E],N):T[E]=l(j[E],N))}),T}function w(k,j,N){N=N||{},N.arrayMerge=N.arrayMerge||c,N.isMergeableObject=N.isMergeableObject||t,N.cloneUnlessOtherwiseSpecified=l;var T=Array.isArray(j),E=Array.isArray(k),_=T===E;return _?T?N.arrayMerge(k,j,N):y(k,j,N):l(j,N)}w.all=function(j,N){if(!Array.isArray(j))throw new Error("first argument should be an array");return j.reduce(function(T,E){return w(T,E,N)},{})};var S=w;return fS=S,fS}var Tpe=Cpe();const Va=gd(Tpe);var Zp=typeof window<"u"&&typeof document<"u"&&typeof navigator<"u",Epe=(function(){for(var t=["Edge","Trident","Firefox"],e=0;e=0)return 1;return 0})();function _pe(t){var e=!1;return function(){e||(e=!0,window.Promise.resolve().then(function(){e=!1,t()}))}}function Mpe(t){var e=!1;return function(){e||(e=!0,setTimeout(function(){e=!1,t()},Epe))}}var Ape=Zp&&window.Promise,Rpe=Ape?_pe:Mpe;function AH(t){var e={};return t&&e.toString.call(t)==="[object Function]"}function bd(t,e){if(t.nodeType!==1)return[];var n=t.ownerDocument.defaultView,r=n.getComputedStyle(t,null);return e?r[e]:r}function B6(t){return t.nodeName==="HTML"?t:t.parentNode||t.host}function Jp(t){if(!t)return document.body;switch(t.nodeName){case"HTML":case"BODY":return t.ownerDocument.body;case"#document":return t.body}var e=bd(t),n=e.overflow,r=e.overflowX,s=e.overflowY;return/(auto|scroll|overlay)/.test(n+s+r)?t:Jp(B6(t))}function RH(t){return t&&t.referenceNode?t.referenceNode:t}var CM=Zp&&!!(window.MSInputMethodContext&&document.documentMode),TM=Zp&&/MSIE 10/.test(navigator.userAgent);function Af(t){return t===11?CM:t===10?TM:CM||TM}function af(t){if(!t)return document.documentElement;for(var e=Af(10)?document.body:null,n=t.offsetParent||null;n===e&&t.nextElementSibling;)n=(t=t.nextElementSibling).offsetParent;var r=n&&n.nodeName;return!r||r==="BODY"||r==="HTML"?t?t.ownerDocument.documentElement:document.documentElement:["TH","TD","TABLE"].indexOf(n.nodeName)!==-1&&bd(n,"position")==="static"?af(n):n}function Dpe(t){var e=t.nodeName;return e==="BODY"?!1:e==="HTML"||af(t.firstElementChild)===t}function dO(t){return t.parentNode!==null?dO(t.parentNode):t}function ay(t,e){if(!t||!t.nodeType||!e||!e.nodeType)return document.documentElement;var n=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?t:e,s=n?e:t,i=document.createRange();i.setStart(r,0),i.setEnd(s,0);var a=i.commonAncestorContainer;if(t!==a&&e!==a||r.contains(s))return Dpe(a)?a:af(a);var l=dO(t);return l.host?ay(l.host,e):ay(t,dO(e).host)}function of(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"top",n=e==="top"?"scrollTop":"scrollLeft",r=t.nodeName;if(r==="BODY"||r==="HTML"){var s=t.ownerDocument.documentElement,i=t.ownerDocument.scrollingElement||s;return i[n]}return t[n]}function Ppe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=of(e,"top"),s=of(e,"left"),i=n?-1:1;return t.top+=r*i,t.bottom+=r*i,t.left+=s*i,t.right+=s*i,t}function EM(t,e){var n=e==="x"?"Left":"Top",r=n==="Left"?"Right":"Bottom";return parseFloat(t["border"+n+"Width"])+parseFloat(t["border"+r+"Width"])}function _M(t,e,n,r){return Math.max(e["offset"+t],e["scroll"+t],n["client"+t],n["offset"+t],n["scroll"+t],Af(10)?parseInt(n["offset"+t])+parseInt(r["margin"+(t==="Height"?"Top":"Left")])+parseInt(r["margin"+(t==="Height"?"Bottom":"Right")]):0)}function DH(t){var e=t.body,n=t.documentElement,r=Af(10)&&getComputedStyle(n);return{height:_M("Height",e,n,r),width:_M("Width",e,n,r)}}var zpe=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Ipe=(function(){function t(e,n){for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!1,r=Af(10),s=e.nodeName==="HTML",i=hO(t),a=hO(e),l=Jp(t),c=bd(e),d=parseFloat(c.borderTopWidth),h=parseFloat(c.borderLeftWidth);n&&s&&(a.top=Math.max(a.top,0),a.left=Math.max(a.left,0));var m=Jc({top:i.top-a.top-d,left:i.left-a.left-h,width:i.width,height:i.height});if(m.marginTop=0,m.marginLeft=0,!r&&s){var g=parseFloat(c.marginTop),x=parseFloat(c.marginLeft);m.top-=d-g,m.bottom-=d-g,m.left-=h-x,m.right-=h-x,m.marginTop=g,m.marginLeft=x}return(r&&!n?e.contains(l):e===l&&l.nodeName!=="BODY")&&(m=Ppe(m,e)),m}function Lpe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=t.ownerDocument.documentElement,r=F6(t,n),s=Math.max(n.clientWidth,window.innerWidth||0),i=Math.max(n.clientHeight,window.innerHeight||0),a=e?0:of(n),l=e?0:of(n,"left"),c={top:a-r.top+r.marginTop,left:l-r.left+r.marginLeft,width:s,height:i};return Jc(c)}function PH(t){var e=t.nodeName;if(e==="BODY"||e==="HTML")return!1;if(bd(t,"position")==="fixed")return!0;var n=B6(t);return n?PH(n):!1}function zH(t){if(!t||!t.parentElement||Af())return document.documentElement;for(var e=t.parentElement;e&&bd(e,"transform")==="none";)e=e.parentElement;return e||document.documentElement}function q6(t,e,n,r){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,i={top:0,left:0},a=s?zH(t):ay(t,RH(e));if(r==="viewport")i=Lpe(a,s);else{var l=void 0;r==="scrollParent"?(l=Jp(B6(e)),l.nodeName==="BODY"&&(l=t.ownerDocument.documentElement)):r==="window"?l=t.ownerDocument.documentElement:l=r;var c=F6(l,a,s);if(l.nodeName==="HTML"&&!PH(a)){var d=DH(t.ownerDocument),h=d.height,m=d.width;i.top+=c.top-c.marginTop,i.bottom=h+c.top,i.left+=c.left-c.marginLeft,i.right=m+c.left}else i=c}n=n||0;var g=typeof n=="number";return i.left+=g?n:n.left||0,i.top+=g?n:n.top||0,i.right-=g?n:n.right||0,i.bottom-=g?n:n.bottom||0,i}function Bpe(t){var e=t.width,n=t.height;return e*n}function IH(t,e,n,r,s){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0;if(t.indexOf("auto")===-1)return t;var a=q6(n,r,i,s),l={top:{width:a.width,height:e.top-a.top},right:{width:a.right-e.right,height:a.height},bottom:{width:a.width,height:a.bottom-e.bottom},left:{width:e.left-a.left,height:a.height}},c=Object.keys(l).map(function(g){return wa({key:g},l[g],{area:Bpe(l[g])})}).sort(function(g,x){return x.area-g.area}),d=c.filter(function(g){var x=g.width,y=g.height;return x>=n.clientWidth&&y>=n.clientHeight}),h=d.length>0?d[0].key:c[0].key,m=t.split("-")[1];return h+(m?"-"+m:"")}function LH(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,s=r?zH(e):ay(e,RH(n));return F6(n,s,r)}function BH(t){var e=t.ownerDocument.defaultView,n=e.getComputedStyle(t),r=parseFloat(n.marginTop||0)+parseFloat(n.marginBottom||0),s=parseFloat(n.marginLeft||0)+parseFloat(n.marginRight||0),i={width:t.offsetWidth+s,height:t.offsetHeight+r};return i}function oy(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,function(n){return e[n]})}function FH(t,e,n){n=n.split("-")[0];var r=BH(t),s={width:r.width,height:r.height},i=["right","left"].indexOf(n)!==-1,a=i?"top":"left",l=i?"left":"top",c=i?"height":"width",d=i?"width":"height";return s[a]=e[a]+e[c]/2-r[c]/2,n===l?s[l]=e[l]-r[d]:s[l]=e[oy(l)],s}function eg(t,e){return Array.prototype.find?t.find(e):t.filter(e)[0]}function Fpe(t,e,n){if(Array.prototype.findIndex)return t.findIndex(function(s){return s[e]===n});var r=eg(t,function(s){return s[e]===n});return t.indexOf(r)}function qH(t,e,n){var r=n===void 0?t:t.slice(0,Fpe(t,"name",n));return r.forEach(function(s){s.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var i=s.function||s.fn;s.enabled&&AH(i)&&(e.offsets.popper=Jc(e.offsets.popper),e.offsets.reference=Jc(e.offsets.reference),e=i(e,s))}),e}function qpe(){if(!this.state.isDestroyed){var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};t.offsets.reference=LH(this.state,this.popper,this.reference,this.options.positionFixed),t.placement=IH(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),t.originalPlacement=t.placement,t.positionFixed=this.options.positionFixed,t.offsets.popper=FH(this.popper,t.offsets.reference,t.placement),t.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",t=qH(this.modifiers,t),this.state.isCreated?this.options.onUpdate(t):(this.state.isCreated=!0,this.options.onCreate(t))}}function $H(t,e){return t.some(function(n){var r=n.name,s=n.enabled;return s&&r===e})}function $6(t){for(var e=[!1,"ms","Webkit","Moz","O"],n=t.charAt(0).toUpperCase()+t.slice(1),r=0;ra[x]&&(t.offsets.popper[m]+=l[m]+y-a[x]),t.offsets.popper=Jc(t.offsets.popper);var w=l[m]+l[d]/2-y/2,S=bd(t.instance.popper),k=parseFloat(S["margin"+h]),j=parseFloat(S["border"+h+"Width"]),N=w-t.offsets.popper[m]-k-j;return N=Math.max(Math.min(a[d]-y,N),0),t.arrowElement=r,t.offsets.arrow=(n={},lf(n,m,Math.round(N)),lf(n,g,""),n),t}function ege(t){return t==="end"?"start":t==="start"?"end":t}var UH=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],mS=UH.slice(3);function MM(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=mS.indexOf(t),r=mS.slice(n+1).concat(mS.slice(0,n));return e?r.reverse():r}var pS={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function tge(t,e){if($H(t.instance.modifiers,"inner")||t.flipped&&t.placement===t.originalPlacement)return t;var n=q6(t.instance.popper,t.instance.reference,e.padding,e.boundariesElement,t.positionFixed),r=t.placement.split("-")[0],s=oy(r),i=t.placement.split("-")[1]||"",a=[];switch(e.behavior){case pS.FLIP:a=[r,s];break;case pS.CLOCKWISE:a=MM(r);break;case pS.COUNTERCLOCKWISE:a=MM(r,!0);break;default:a=e.behavior}return a.forEach(function(l,c){if(r!==l||a.length===c+1)return t;r=t.placement.split("-")[0],s=oy(r);var d=t.offsets.popper,h=t.offsets.reference,m=Math.floor,g=r==="left"&&m(d.right)>m(h.left)||r==="right"&&m(d.left)m(h.top)||r==="bottom"&&m(d.top)m(n.right),w=m(d.top)m(n.bottom),k=r==="left"&&x||r==="right"&&y||r==="top"&&w||r==="bottom"&&S,j=["top","bottom"].indexOf(r)!==-1,N=!!e.flipVariations&&(j&&i==="start"&&x||j&&i==="end"&&y||!j&&i==="start"&&w||!j&&i==="end"&&S),T=!!e.flipVariationsByContent&&(j&&i==="start"&&y||j&&i==="end"&&x||!j&&i==="start"&&S||!j&&i==="end"&&w),E=N||T;(g||k||E)&&(t.flipped=!0,(g||k)&&(r=a[c+1]),E&&(i=ege(i)),t.placement=r+(i?"-"+i:""),t.offsets.popper=wa({},t.offsets.popper,FH(t.instance.popper,t.offsets.reference,t.placement)),t=qH(t.instance.modifiers,t,"flip"))}),t}function nge(t){var e=t.offsets,n=e.popper,r=e.reference,s=t.placement.split("-")[0],i=Math.floor,a=["top","bottom"].indexOf(s)!==-1,l=a?"right":"bottom",c=a?"left":"top",d=a?"width":"height";return n[l]i(r[l])&&(t.offsets.popper[c]=i(r[l])),t}function rge(t,e,n,r){var s=t.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),i=+s[1],a=s[2];if(!i)return t;if(a.indexOf("%")===0){var l=void 0;switch(a){case"%p":l=n;break;case"%":case"%r":default:l=r}var c=Jc(l);return c[e]/100*i}else if(a==="vh"||a==="vw"){var d=void 0;return a==="vh"?d=Math.max(document.documentElement.clientHeight,window.innerHeight||0):d=Math.max(document.documentElement.clientWidth,window.innerWidth||0),d/100*i}else return i}function sge(t,e,n,r){var s=[0,0],i=["right","left"].indexOf(r)!==-1,a=t.split(/(\+|\-)/).map(function(h){return h.trim()}),l=a.indexOf(eg(a,function(h){return h.search(/,|\s/)!==-1}));a[l]&&a[l].indexOf(",")===-1&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var c=/\s*,\s*|\s+/,d=l!==-1?[a.slice(0,l).concat([a[l].split(c)[0]]),[a[l].split(c)[1]].concat(a.slice(l+1))]:[a];return d=d.map(function(h,m){var g=(m===1?!i:i)?"height":"width",x=!1;return h.reduce(function(y,w){return y[y.length-1]===""&&["+","-"].indexOf(w)!==-1?(y[y.length-1]=w,x=!0,y):x?(y[y.length-1]+=w,x=!1,y):y.concat(w)},[]).map(function(y){return rge(y,g,e,n)})}),d.forEach(function(h,m){h.forEach(function(g,x){H6(g)&&(s[m]+=g*(h[x-1]==="-"?-1:1))})}),s}function ige(t,e){var n=e.offset,r=t.placement,s=t.offsets,i=s.popper,a=s.reference,l=r.split("-")[0],c=void 0;return H6(+n)?c=[+n,0]:c=sge(n,i,a,l),l==="left"?(i.top+=c[0],i.left-=c[1]):l==="right"?(i.top+=c[0],i.left+=c[1]):l==="top"?(i.left+=c[0],i.top-=c[1]):l==="bottom"&&(i.left+=c[0],i.top+=c[1]),t.popper=i,t}function age(t,e){var n=e.boundariesElement||af(t.instance.popper);t.instance.reference===n&&(n=af(n));var r=$6("transform"),s=t.instance.popper.style,i=s.top,a=s.left,l=s[r];s.top="",s.left="",s[r]="";var c=q6(t.instance.popper,t.instance.reference,e.padding,n,t.positionFixed);s.top=i,s.left=a,s[r]=l,e.boundaries=c;var d=e.priority,h=t.offsets.popper,m={primary:function(x){var y=h[x];return h[x]c[x]&&!e.escapeWithReference&&(w=Math.min(h[y],c[x]-(x==="right"?h.width:h.height))),lf({},y,w)}};return d.forEach(function(g){var x=["left","top"].indexOf(g)!==-1?"primary":"secondary";h=wa({},h,m[x](g))}),t.offsets.popper=h,t}function oge(t){var e=t.placement,n=e.split("-")[0],r=e.split("-")[1];if(r){var s=t.offsets,i=s.reference,a=s.popper,l=["bottom","top"].indexOf(n)!==-1,c=l?"left":"top",d=l?"width":"height",h={start:lf({},c,i[c]),end:lf({},c,i[c]+i[d]-a[d])};t.offsets.popper=wa({},a,h[r])}return t}function lge(t){if(!VH(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,n=eg(t.instance.modifiers,function(r){return r.name==="preventOverflow"}).boundaries;if(e.bottomn.right||e.top>n.bottom||e.right2&&arguments[2]!==void 0?arguments[2]:{};zpe(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=Rpe(this.update.bind(this)),this.options=wa({},t.Defaults,s),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(wa({},t.Defaults.modifiers,s.modifiers)).forEach(function(a){r.options.modifiers[a]=wa({},t.Defaults.modifiers[a]||{},s.modifiers?s.modifiers[a]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(a){return wa({name:a},r.options.modifiers[a])}).sort(function(a,l){return a.order-l.order}),this.modifiers.forEach(function(a){a.enabled&&AH(a.onLoad)&&a.onLoad(r.reference,r.popper,r.options,a,r.state)}),this.update();var i=this.options.eventsEnabled;i&&this.enableEventListeners(),this.state.eventsEnabled=i}return Ipe(t,[{key:"update",value:function(){return qpe.call(this)}},{key:"destroy",value:function(){return $pe.call(this)}},{key:"enableEventListeners",value:function(){return Qpe.call(this)}},{key:"disableEventListeners",value:function(){return Upe.call(this)}}]),t})();ip.Utils=(typeof window<"u"?window:global).PopperUtils;ip.placements=UH;ip.Defaults=dge;var hge=["innerHTML","ownerDocument","style","attributes","nodeValue"],fge=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"],mge=["bigint","boolean","null","number","string","symbol","undefined"];function kb(t){var e=Object.prototype.toString.call(t).slice(8,-1);if(/HTML\w+Element/.test(e))return"HTMLElement";if(pge(e))return e}function so(t){return function(e){return kb(e)===t}}function pge(t){return fge.includes(t)}function Rf(t){return function(e){return typeof e===t}}function gge(t){return mge.includes(t)}function _e(t){if(t===null)return"null";switch(typeof t){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(_e.array(t))return"Array";if(_e.plainFunction(t))return"Function";var e=kb(t);return e||"Object"}_e.array=Array.isArray;_e.arrayOf=function(t,e){return!_e.array(t)&&!_e.function(e)?!1:t.every(function(n){return e(n)})};_e.asyncGeneratorFunction=function(t){return kb(t)==="AsyncGeneratorFunction"};_e.asyncFunction=so("AsyncFunction");_e.bigint=Rf("bigint");_e.boolean=function(t){return t===!0||t===!1};_e.date=so("Date");_e.defined=function(t){return!_e.undefined(t)};_e.domElement=function(t){return _e.object(t)&&!_e.plainObject(t)&&t.nodeType===1&&_e.string(t.nodeName)&&hge.every(function(e){return e in t})};_e.empty=function(t){return _e.string(t)&&t.length===0||_e.array(t)&&t.length===0||_e.object(t)&&!_e.map(t)&&!_e.set(t)&&Object.keys(t).length===0||_e.set(t)&&t.size===0||_e.map(t)&&t.size===0};_e.error=so("Error");_e.function=Rf("function");_e.generator=function(t){return _e.iterable(t)&&_e.function(t.next)&&_e.function(t.throw)};_e.generatorFunction=so("GeneratorFunction");_e.instanceOf=function(t,e){return!t||!e?!1:Object.getPrototypeOf(t)===e.prototype};_e.iterable=function(t){return!_e.nullOrUndefined(t)&&_e.function(t[Symbol.iterator])};_e.map=so("Map");_e.nan=function(t){return Number.isNaN(t)};_e.null=function(t){return t===null};_e.nullOrUndefined=function(t){return _e.null(t)||_e.undefined(t)};_e.number=function(t){return Rf("number")(t)&&!_e.nan(t)};_e.numericString=function(t){return _e.string(t)&&t.length>0&&!Number.isNaN(Number(t))};_e.object=function(t){return!_e.nullOrUndefined(t)&&(_e.function(t)||typeof t=="object")};_e.oneOf=function(t,e){return _e.array(t)?t.indexOf(e)>-1:!1};_e.plainFunction=so("Function");_e.plainObject=function(t){if(kb(t)!=="Object")return!1;var e=Object.getPrototypeOf(t);return e===null||e===Object.getPrototypeOf({})};_e.primitive=function(t){return _e.null(t)||gge(typeof t)};_e.promise=so("Promise");_e.propertyOf=function(t,e,n){if(!_e.object(t)||!e)return!1;var r=t[e];return _e.function(n)?n(r):_e.defined(r)};_e.regexp=so("RegExp");_e.set=so("Set");_e.string=Rf("string");_e.symbol=Rf("symbol");_e.undefined=Rf("undefined");_e.weakMap=so("WeakMap");_e.weakSet=so("WeakSet");function WH(t){return function(e){return typeof e===t}}var xge=WH("function"),vge=function(t){return t===null},AM=function(t){return Object.prototype.toString.call(t).slice(8,-1)==="RegExp"},RM=function(t){return!yge(t)&&!vge(t)&&(xge(t)||typeof t=="object")},yge=WH("undefined"),mO=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function bge(t,e){var n=t.length;if(n!==e.length)return!1;for(var r=n;r--!==0;)if(!bi(t[r],e[r]))return!1;return!0}function wge(t,e){if(t.byteLength!==e.byteLength)return!1;for(var n=new DataView(t.buffer),r=new DataView(e.buffer),s=t.byteLength;s--;)if(n.getUint8(s)!==r.getUint8(s))return!1;return!0}function Sge(t,e){var n,r,s,i;if(t.size!==e.size)return!1;try{for(var a=mO(t.entries()),l=a.next();!l.done;l=a.next()){var c=l.value;if(!e.has(c[0]))return!1}}catch(m){n={error:m}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}try{for(var d=mO(t.entries()),h=d.next();!h.done;h=d.next()){var c=h.value;if(!bi(c[1],e.get(c[0])))return!1}}catch(m){s={error:m}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(s)throw s.error}}return!0}function kge(t,e){var n,r;if(t.size!==e.size)return!1;try{for(var s=mO(t.entries()),i=s.next();!i.done;i=s.next()){var a=i.value;if(!e.has(a[0]))return!1}}catch(l){n={error:l}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return!0}function bi(t,e){if(t===e)return!0;if(t&&RM(t)&&e&&RM(e)){if(t.constructor!==e.constructor)return!1;if(Array.isArray(t)&&Array.isArray(e))return bge(t,e);if(t instanceof Map&&e instanceof Map)return Sge(t,e);if(t instanceof Set&&e instanceof Set)return kge(t,e);if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return wge(t,e);if(AM(t)&&AM(e))return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var s=n.length;s--!==0;)if(!Object.prototype.hasOwnProperty.call(e,n[s]))return!1;for(var s=n.length;s--!==0;){var i=n[s];if(!(i==="_owner"&&t.$$typeof)&&!bi(t[i],e[i]))return!1}return!0}return Number.isNaN(t)&&Number.isNaN(e)?!0:t===e}function Oge(){for(var t=[],e=0;ec);return _e.undefined(r)||(d=d&&c===r),_e.undefined(i)||(d=d&&l===i),d}function PM(t,e,n){var r=n.key,s=n.type,i=n.value,a=Eo(t,r),l=Eo(e,r),c=s==="added"?a:l,d=s==="added"?l:a;if(!_e.nullOrUndefined(i)){if(_e.defined(c)){if(_e.array(c)||_e.plainObject(c))return jge(c,d,i)}else return bi(d,i);return!1}return[a,l].every(_e.array)?!d.every(Q6(c)):[a,l].every(_e.plainObject)?Nge(Object.keys(c),Object.keys(d)):![a,l].every(function(h){return _e.primitive(h)&&_e.defined(h)})&&(s==="added"?!_e.defined(a)&&_e.defined(l):_e.defined(a)&&!_e.defined(l))}function zM(t,e,n){var r=n===void 0?{}:n,s=r.key,i=Eo(t,s),a=Eo(e,s);if(!GH(i,a))throw new TypeError("Inputs have different types");if(!Oge(i,a))throw new TypeError("Inputs don't have length");return[i,a].every(_e.plainObject)&&(i=Object.keys(i),a=Object.keys(a)),[i,a]}function IM(t){return function(e){var n=e[0],r=e[1];return _e.array(t)?bi(t,r)||t.some(function(s){return bi(s,r)||_e.array(r)&&Q6(r)(s)}):_e.plainObject(t)&&t[n]?!!t[n]&&bi(t[n],r):bi(t,r)}}function Nge(t,e){return e.some(function(n){return!t.includes(n)})}function LM(t){return function(e){return _e.array(t)?t.some(function(n){return bi(n,e)||_e.array(e)&&Q6(e)(n)}):bi(t,e)}}function Qm(t,e){return _e.array(t)?t.some(function(n){return bi(n,e)}):bi(t,e)}function Q6(t){return function(e){return t.some(function(n){return bi(n,e)})}}function GH(){for(var t=[],e=0;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _ge(t,e){if(t==null)return{};var n={},r=Object.keys(t),s,i;for(i=0;i=0)&&(n[s]=t[s]);return n}function XH(t,e){if(t==null)return{};var n=_ge(t,e),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function jl(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Mge(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jl(t)}function sg(t){var e=Ege();return function(){var r=ly(t),s;if(e){var i=ly(this).constructor;s=Reflect.construct(r,arguments,i)}else s=r.apply(this,arguments);return Mge(this,s)}}function Age(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function YH(t){var e=Age(t,"string");return typeof e=="symbol"?e:String(e)}var Rge={flip:{padding:20},preventOverflow:{padding:10}},Dge="The typeValidator argument must be a function with the signature function(props, propName, componentName).",Pge="The error message is optional, but must be a string if provided.";function zge(t,e,n,r){return typeof t=="boolean"?t:typeof t=="function"?t(e,n,r):t?!!t:!1}function Ige(t,e){return Object.hasOwnProperty.call(t,e)}function Lge(t,e,n,r){return new Error("Required ".concat(t[e]," `").concat(e,"` was not specified in `").concat(n,"`."))}function Bge(t,e){if(typeof t!="function")throw new TypeError(Dge);if(e&&typeof e!="string")throw new TypeError(Pge)}function FM(t,e,n){return Bge(t,n),function(r,s,i){for(var a=arguments.length,l=new Array(a>3?a-3:0),c=3;c3&&arguments[3]!==void 0?arguments[3]:!1;t.addEventListener(e,n,r)}function qge(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;t.removeEventListener(e,n,r)}function $ge(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s;s=function(a){n(a),qge(t,e,s)},Fge(t,e,s,r)}function qM(){}var KH=(function(t){rg(n,t);var e=sg(n);function n(){return tg(this,n),e.apply(this,arguments)}return ng(n,[{key:"componentDidMount",value:function(){vo()&&(this.node||this.appendNode(),Vm||this.renderPortal())}},{key:"componentDidUpdate",value:function(){vo()&&(Vm||this.renderPortal())}},{key:"componentWillUnmount",value:function(){!vo()||!this.node||(Vm||K1.unmountComponentAtNode(this.node),this.node&&this.node.parentNode===document.body&&(document.body.removeChild(this.node),this.node=void 0))}},{key:"appendNode",value:function(){var s=this.props,i=s.id,a=s.zIndex;this.node||(this.node=document.createElement("div"),i&&(this.node.id=i),a&&(this.node.style.zIndex=a),document.body.appendChild(this.node))}},{key:"renderPortal",value:function(){if(!vo())return null;var s=this.props,i=s.children,a=s.setRef;if(this.node||this.appendNode(),Vm)return K1.createPortal(i,this.node);var l=K1.unstable_renderSubtreeIntoContainer(this,i.length>1?ae.createElement("div",null,i):i[0],this.node);return a(l),null}},{key:"renderReact16",value:function(){var s=this.props,i=s.hasChildren,a=s.placement,l=s.target;return i?this.renderPortal():l||a==="center"?this.renderPortal():null}},{key:"render",value:function(){return Vm?this.renderReact16():null}}]),n})(ae.Component);Bs(KH,"propTypes",{children:Ge.oneOfType([Ge.element,Ge.array]),hasChildren:Ge.bool,id:Ge.oneOfType([Ge.string,Ge.number]),placement:Ge.string,setRef:Ge.func.isRequired,target:Ge.oneOfType([Ge.object,Ge.string]),zIndex:Ge.number});var ZH=(function(t){rg(n,t);var e=sg(n);function n(){return tg(this,n),e.apply(this,arguments)}return ng(n,[{key:"parentStyle",get:function(){var s=this.props,i=s.placement,a=s.styles,l=a.arrow.length,c={pointerEvents:"none",position:"absolute",width:"100%"};return i.startsWith("top")?(c.bottom=0,c.left=0,c.right=0,c.height=l):i.startsWith("bottom")?(c.left=0,c.right=0,c.top=0,c.height=l):i.startsWith("left")?(c.right=0,c.top=0,c.bottom=0):i.startsWith("right")&&(c.left=0,c.top=0),c}},{key:"render",value:function(){var s=this.props,i=s.placement,a=s.setArrowRef,l=s.styles,c=l.arrow,d=c.color,h=c.display,m=c.length,g=c.margin,x=c.position,y=c.spread,w={display:h,position:x},S,k=y,j=m;return i.startsWith("top")?(S="0,0 ".concat(k/2,",").concat(j," ").concat(k,",0"),w.bottom=0,w.marginLeft=g,w.marginRight=g):i.startsWith("bottom")?(S="".concat(k,",").concat(j," ").concat(k/2,",0 0,").concat(j),w.top=0,w.marginLeft=g,w.marginRight=g):i.startsWith("left")?(j=y,k=m,S="0,0 ".concat(k,",").concat(j/2," 0,").concat(j),w.right=0,w.marginTop=g,w.marginBottom=g):i.startsWith("right")&&(j=y,k=m,S="".concat(k,",").concat(j," ").concat(k,",0 0,").concat(j/2),w.left=0,w.marginTop=g,w.marginBottom=g),ae.createElement("div",{className:"__floater__arrow",style:this.parentStyle},ae.createElement("span",{ref:a,style:w},ae.createElement("svg",{width:k,height:j,version:"1.1",xmlns:"http://www.w3.org/2000/svg"},ae.createElement("polygon",{points:S,fill:d}))))}}]),n})(ae.Component);Bs(ZH,"propTypes",{placement:Ge.string.isRequired,setArrowRef:Ge.func.isRequired,styles:Ge.object.isRequired});var Hge=["color","height","width"];function JH(t){var e=t.handleClick,n=t.styles,r=n.color,s=n.height,i=n.width,a=XH(n,Hge);return ae.createElement("button",{"aria-label":"close",onClick:e,style:a,type:"button"},ae.createElement("svg",{width:"".concat(i,"px"),height:"".concat(s,"px"),viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid"},ae.createElement("g",null,ae.createElement("path",{d:"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z",fill:r}))))}JH.propTypes={handleClick:Ge.func.isRequired,styles:Ge.object.isRequired};function eQ(t){var e=t.content,n=t.footer,r=t.handleClick,s=t.open,i=t.positionWrapper,a=t.showCloseButton,l=t.title,c=t.styles,d={content:ae.isValidElement(e)?e:ae.createElement("div",{className:"__floater__content",style:c.content},e)};return l&&(d.title=ae.isValidElement(l)?l:ae.createElement("div",{className:"__floater__title",style:c.title},l)),n&&(d.footer=ae.isValidElement(n)?n:ae.createElement("div",{className:"__floater__footer",style:c.footer},n)),(a||i)&&!_e.boolean(s)&&(d.close=ae.createElement(JH,{styles:c.close,handleClick:r})),ae.createElement("div",{className:"__floater__container",style:c.container},d.close,d.title,d.content,d.footer)}eQ.propTypes={content:Ge.node.isRequired,footer:Ge.node,handleClick:Ge.func.isRequired,open:Ge.bool,positionWrapper:Ge.bool.isRequired,showCloseButton:Ge.bool.isRequired,styles:Ge.object.isRequired,title:Ge.node};var tQ=(function(t){rg(n,t);var e=sg(n);function n(){return tg(this,n),e.apply(this,arguments)}return ng(n,[{key:"style",get:function(){var s=this.props,i=s.disableAnimation,a=s.component,l=s.placement,c=s.hideArrow,d=s.status,h=s.styles,m=h.arrow.length,g=h.floater,x=h.floaterCentered,y=h.floaterClosing,w=h.floaterOpening,S=h.floaterWithAnimation,k=h.floaterWithComponent,j={};return c||(l.startsWith("top")?j.padding="0 0 ".concat(m,"px"):l.startsWith("bottom")?j.padding="".concat(m,"px 0 0"):l.startsWith("left")?j.padding="0 ".concat(m,"px 0 0"):l.startsWith("right")&&(j.padding="0 0 0 ".concat(m,"px"))),[On.OPENING,On.OPEN].indexOf(d)!==-1&&(j=br(br({},j),w)),d===On.CLOSING&&(j=br(br({},j),y)),d===On.OPEN&&!i&&(j=br(br({},j),S)),l==="center"&&(j=br(br({},j),x)),a&&(j=br(br({},j),k)),br(br({},g),j)}},{key:"render",value:function(){var s=this.props,i=s.component,a=s.handleClick,l=s.hideArrow,c=s.setFloaterRef,d=s.status,h={},m=["__floater"];return i?ae.isValidElement(i)?h.content=ae.cloneElement(i,{closeFn:a}):h.content=i({closeFn:a}):h.content=ae.createElement(eQ,this.props),d===On.OPEN&&m.push("__floater__open"),l||(h.arrow=ae.createElement(ZH,this.props)),ae.createElement("div",{ref:c,className:m.join(" "),style:this.style},ae.createElement("div",{className:"__floater__body"},h.content,h.arrow))}}]),n})(ae.Component);Bs(tQ,"propTypes",{component:Ge.oneOfType([Ge.func,Ge.element]),content:Ge.node,disableAnimation:Ge.bool.isRequired,footer:Ge.node,handleClick:Ge.func.isRequired,hideArrow:Ge.bool.isRequired,open:Ge.bool,placement:Ge.string.isRequired,positionWrapper:Ge.bool.isRequired,setArrowRef:Ge.func.isRequired,setFloaterRef:Ge.func.isRequired,showCloseButton:Ge.bool,status:Ge.string.isRequired,styles:Ge.object.isRequired,title:Ge.node});var nQ=(function(t){rg(n,t);var e=sg(n);function n(){return tg(this,n),e.apply(this,arguments)}return ng(n,[{key:"render",value:function(){var s=this.props,i=s.children,a=s.handleClick,l=s.handleMouseEnter,c=s.handleMouseLeave,d=s.setChildRef,h=s.setWrapperRef,m=s.style,g=s.styles,x;if(i)if(ae.Children.count(i)===1)if(!ae.isValidElement(i))x=ae.createElement("span",null,i);else{var y=_e.function(i.type)?"innerRef":"ref";x=ae.cloneElement(ae.Children.only(i),Bs({},y,d))}else x=i;return x?ae.createElement("span",{ref:h,style:br(br({},g),m),onClick:a,onMouseEnter:l,onMouseLeave:c},x):null}}]),n})(ae.Component);Bs(nQ,"propTypes",{children:Ge.node,handleClick:Ge.func.isRequired,handleMouseEnter:Ge.func.isRequired,handleMouseLeave:Ge.func.isRequired,setChildRef:Ge.func.isRequired,setWrapperRef:Ge.func.isRequired,style:Ge.object,styles:Ge.object.isRequired});var Qge={zIndex:100};function Vge(t){var e=Va(Qge,t.options||{});return{wrapper:{cursor:"help",display:"inline-flex",flexDirection:"column",zIndex:e.zIndex},wrapperPosition:{left:-1e3,position:"absolute",top:-1e3,visibility:"hidden"},floater:{display:"inline-block",filter:"drop-shadow(0 0 3px rgba(0, 0, 0, 0.3))",maxWidth:300,opacity:0,position:"relative",transition:"opacity 0.3s",visibility:"hidden",zIndex:e.zIndex},floaterOpening:{opacity:1,visibility:"visible"},floaterWithAnimation:{opacity:1,transition:"opacity 0.3s, transform 0.2s",visibility:"visible"},floaterWithComponent:{maxWidth:"100%"},floaterClosing:{opacity:0,visibility:"visible"},floaterCentered:{left:"50%",position:"fixed",top:"50%",transform:"translate(-50%, -50%)"},container:{backgroundColor:"#fff",color:"#666",minHeight:60,minWidth:200,padding:20,position:"relative",zIndex:10},title:{borderBottom:"1px solid #555",color:"#555",fontSize:18,marginBottom:5,paddingBottom:6,paddingRight:18},content:{fontSize:15},close:{backgroundColor:"transparent",border:0,borderRadius:0,color:"#555",fontSize:0,height:15,outline:"none",padding:10,position:"absolute",right:0,top:0,width:15,WebkitAppearance:"none"},footer:{borderTop:"1px solid #ccc",fontSize:13,marginTop:10,paddingTop:5},arrow:{color:"#fff",display:"inline-flex",length:16,margin:8,position:"absolute",spread:32},options:e}}var Uge=["arrow","flip","offset"],Wge=["position","top","right","bottom","left"],V6=(function(t){rg(n,t);var e=sg(n);function n(r){var s;return tg(this,n),s=e.call(this,r),Bs(jl(s),"setArrowRef",function(i){s.arrowRef=i}),Bs(jl(s),"setChildRef",function(i){s.childRef=i}),Bs(jl(s),"setFloaterRef",function(i){s.floaterRef=i}),Bs(jl(s),"setWrapperRef",function(i){s.wrapperRef=i}),Bs(jl(s),"handleTransitionEnd",function(){var i=s.state.status,a=s.props.callback;s.wrapperPopper&&s.wrapperPopper.instance.update(),s.setState({status:i===On.OPENING?On.OPEN:On.IDLE},function(){var l=s.state.status;a(l===On.OPEN?"open":"close",s.props)})}),Bs(jl(s),"handleClick",function(){var i=s.props,a=i.event,l=i.open;if(!_e.boolean(l)){var c=s.state,d=c.positionWrapper,h=c.status;(s.event==="click"||s.event==="hover"&&d)&&(S1({title:"click",data:[{event:a,status:h===On.OPEN?"closing":"opening"}],debug:s.debug}),s.toggle())}}),Bs(jl(s),"handleMouseEnter",function(){var i=s.props,a=i.event,l=i.open;if(!(_e.boolean(l)||gS())){var c=s.state.status;s.event==="hover"&&c===On.IDLE&&(S1({title:"mouseEnter",data:[{key:"originalEvent",value:a}],debug:s.debug}),clearTimeout(s.eventDelayTimeout),s.toggle())}}),Bs(jl(s),"handleMouseLeave",function(){var i=s.props,a=i.event,l=i.eventDelay,c=i.open;if(!(_e.boolean(c)||gS())){var d=s.state,h=d.status,m=d.positionWrapper;s.event==="hover"&&(S1({title:"mouseLeave",data:[{key:"originalEvent",value:a}],debug:s.debug}),l?[On.OPENING,On.OPEN].indexOf(h)!==-1&&!m&&!s.eventDelayTimeout&&(s.eventDelayTimeout=setTimeout(function(){delete s.eventDelayTimeout,s.toggle()},l*1e3)):s.toggle(On.IDLE))}}),s.state={currentPlacement:r.placement,needsUpdate:!1,positionWrapper:r.wrapperOptions.position&&!!r.target,status:On.INIT,statusWrapper:On.INIT},s._isMounted=!1,s.hasMounted=!1,vo()&&window.addEventListener("load",function(){s.popper&&s.popper.instance.update(),s.wrapperPopper&&s.wrapperPopper.instance.update()}),s}return ng(n,[{key:"componentDidMount",value:function(){if(vo()){var s=this.state.positionWrapper,i=this.props,a=i.children,l=i.open,c=i.target;this._isMounted=!0,S1({title:"init",data:{hasChildren:!!a,hasTarget:!!c,isControlled:_e.boolean(l),positionWrapper:s,target:this.target,floater:this.floaterRef},debug:this.debug}),this.hasMounted||(this.initPopper(),this.hasMounted=!0),!a&&c&&_e.boolean(l)}}},{key:"componentDidUpdate",value:function(s,i){if(vo()){var a=this.props,l=a.autoOpen,c=a.open,d=a.target,h=a.wrapperOptions,m=Cge(i,this.state),g=m.changedFrom,x=m.changed;if(s.open!==c){var y;_e.boolean(c)&&(y=c?On.OPENING:On.CLOSING),this.toggle(y)}(s.wrapperOptions.position!==h.position||s.target!==d)&&this.changeWrapperPosition(this.props),x("status",On.IDLE)&&c?this.toggle(On.OPEN):g("status",On.INIT,On.IDLE)&&l&&this.toggle(On.OPEN),this.popper&&x("status",On.OPENING)&&this.popper.instance.update(),this.floaterRef&&(x("status",On.OPENING)||x("status",On.CLOSING))&&$ge(this.floaterRef,"transitionend",this.handleTransitionEnd),x("needsUpdate",!0)&&this.rebuildPopper()}}},{key:"componentWillUnmount",value:function(){vo()&&(this._isMounted=!1,this.popper&&this.popper.instance.destroy(),this.wrapperPopper&&this.wrapperPopper.instance.destroy())}},{key:"initPopper",value:function(){var s=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.target,a=this.state.positionWrapper,l=this.props,c=l.disableFlip,d=l.getPopper,h=l.hideArrow,m=l.offset,g=l.placement,x=l.wrapperOptions,y=g==="top"||g==="bottom"?"flip":["right","bottom-end","top-end","left","top-start","bottom-start"];if(g==="center")this.setState({status:On.IDLE});else if(i&&this.floaterRef){var w=this.options,S=w.arrow,k=w.flip,j=w.offset,N=XH(w,Uge);new ip(i,this.floaterRef,{placement:g,modifiers:br({arrow:br({enabled:!h,element:this.arrowRef},S),flip:br({enabled:!c,behavior:y},k),offset:br({offset:"0, ".concat(m,"px")},j)},N),onCreate:function(_){var M;if(s.popper=_,!((M=s.floaterRef)!==null&&M!==void 0&&M.isConnected)){s.setState({needsUpdate:!0});return}d(_,"floater"),s._isMounted&&s.setState({currentPlacement:_.placement,status:On.IDLE}),g!==_.placement&&setTimeout(function(){_.instance.update()},1)},onUpdate:function(_){s.popper=_;var M=s.state.currentPlacement;s._isMounted&&_.placement!==M&&s.setState({currentPlacement:_.placement})}})}if(a){var T=_e.undefined(x.offset)?0:x.offset;new ip(this.target,this.wrapperRef,{placement:x.placement||g,modifiers:{arrow:{enabled:!1},offset:{offset:"0, ".concat(T,"px")},flip:{enabled:!1}},onCreate:function(_){s.wrapperPopper=_,s._isMounted&&s.setState({statusWrapper:On.IDLE}),d(_,"wrapper"),g!==_.placement&&setTimeout(function(){_.instance.update()},1)}})}}},{key:"rebuildPopper",value:function(){var s=this;this.floaterRefInterval=setInterval(function(){var i;(i=s.floaterRef)!==null&&i!==void 0&&i.isConnected&&(clearInterval(s.floaterRefInterval),s.setState({needsUpdate:!1}),s.initPopper())},50)}},{key:"changeWrapperPosition",value:function(s){var i=s.target,a=s.wrapperOptions;this.setState({positionWrapper:a.position&&!!i})}},{key:"toggle",value:function(s){var i=this.state.status,a=i===On.OPEN?On.CLOSING:On.OPENING;_e.undefined(s)||(a=s),this.setState({status:a})}},{key:"debug",get:function(){var s=this.props.debug;return s||vo()&&"ReactFloaterDebug"in window&&!!window.ReactFloaterDebug}},{key:"event",get:function(){var s=this.props,i=s.disableHoverToClick,a=s.event;return a==="hover"&&gS()&&!i?"click":a}},{key:"options",get:function(){var s=this.props.options;return Va(Rge,s||{})}},{key:"styles",get:function(){var s=this,i=this.state,a=i.status,l=i.positionWrapper,c=i.statusWrapper,d=this.props.styles,h=Va(Vge(d),d);if(l){var m;[On.IDLE].indexOf(a)===-1||[On.IDLE].indexOf(c)===-1?m=h.wrapperPosition:m=this.wrapperPopper.styles,h.wrapper=br(br({},h.wrapper),m)}if(this.target){var g=window.getComputedStyle(this.target);this.wrapperStyles?h.wrapper=br(br({},h.wrapper),this.wrapperStyles):["relative","static"].indexOf(g.position)===-1&&(this.wrapperStyles={},l||(Wge.forEach(function(x){s.wrapperStyles[x]=g[x]}),h.wrapper=br(br({},h.wrapper),this.wrapperStyles),this.target.style.position="relative",this.target.style.top="auto",this.target.style.right="auto",this.target.style.bottom="auto",this.target.style.left="auto"))}return h}},{key:"target",get:function(){if(!vo())return null;var s=this.props.target;return s?_e.domElement(s)?s:document.querySelector(s):this.childRef||this.wrapperRef}},{key:"render",value:function(){var s=this.state,i=s.currentPlacement,a=s.positionWrapper,l=s.status,c=this.props,d=c.children,h=c.component,m=c.content,g=c.disableAnimation,x=c.footer,y=c.hideArrow,w=c.id,S=c.open,k=c.showCloseButton,j=c.style,N=c.target,T=c.title,E=ae.createElement(nQ,{handleClick:this.handleClick,handleMouseEnter:this.handleMouseEnter,handleMouseLeave:this.handleMouseLeave,setChildRef:this.setChildRef,setWrapperRef:this.setWrapperRef,style:j,styles:this.styles.wrapper},d),_={};return a?_.wrapperInPortal=E:_.wrapperAsChildren=E,ae.createElement("span",null,ae.createElement(KH,{hasChildren:!!d,id:w,placement:i,setRef:this.setFloaterRef,target:N,zIndex:this.styles.options.zIndex},ae.createElement(tQ,{component:h,content:m,disableAnimation:g,footer:x,handleClick:this.handleClick,hideArrow:y||i==="center",open:S,placement:i,positionWrapper:a,setArrowRef:this.setArrowRef,setFloaterRef:this.setFloaterRef,showCloseButton:k,status:l,styles:this.styles,title:T}),_.wrapperInPortal),_.wrapperAsChildren)}}]),n})(ae.Component);Bs(V6,"propTypes",{autoOpen:Ge.bool,callback:Ge.func,children:Ge.node,component:FM(Ge.oneOfType([Ge.func,Ge.element]),function(t){return!t.content}),content:FM(Ge.node,function(t){return!t.component}),debug:Ge.bool,disableAnimation:Ge.bool,disableFlip:Ge.bool,disableHoverToClick:Ge.bool,event:Ge.oneOf(["hover","click"]),eventDelay:Ge.number,footer:Ge.node,getPopper:Ge.func,hideArrow:Ge.bool,id:Ge.oneOfType([Ge.string,Ge.number]),offset:Ge.number,open:Ge.bool,options:Ge.object,placement:Ge.oneOf(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end","auto","center"]),showCloseButton:Ge.bool,style:Ge.object,styles:Ge.object,target:Ge.oneOfType([Ge.object,Ge.string]),title:Ge.node,wrapperOptions:Ge.shape({offset:Ge.number,placement:Ge.oneOf(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end","auto"]),position:Ge.bool})});Bs(V6,"defaultProps",{autoOpen:!1,callback:qM,debug:!1,disableAnimation:!1,disableFlip:!1,disableHoverToClick:!1,event:"click",eventDelay:.4,getPopper:qM,hideArrow:!1,offset:15,placement:"bottom",showCloseButton:!1,styles:{},target:null,wrapperOptions:{position:!1}});var Gge=Object.defineProperty,Xge=(t,e,n)=>e in t?Gge(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,gt=(t,e,n)=>Xge(t,typeof e!="symbol"?e+"":e,n),Qn={INIT:"init",START:"start",STOP:"stop",RESET:"reset",PREV:"prev",NEXT:"next",GO:"go",CLOSE:"close",SKIP:"skip",UPDATE:"update"},Qa={TOUR_START:"tour:start",STEP_BEFORE:"step:before",BEACON:"beacon",TOOLTIP:"tooltip",STEP_AFTER:"step:after",TOUR_END:"tour:end",TOUR_STATUS:"tour:status",TARGET_NOT_FOUND:"error:target_not_found"},Qt={INIT:"init",READY:"ready",BEACON:"beacon",TOOLTIP:"tooltip",COMPLETE:"complete",ERROR:"error"},mn={IDLE:"idle",READY:"ready",WAITING:"waiting",RUNNING:"running",PAUSED:"paused",SKIPPED:"skipped",FINISHED:"finished"};function zc(){var t;return!!(typeof window<"u"&&((t=window.document)!=null&&t.createElement))}function rQ(t){return t?t.getBoundingClientRect():null}function Yge(t=!1){const{body:e,documentElement:n}=document;if(!e||!n)return 0;if(t){const r=[e.scrollHeight,e.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight].sort((i,a)=>i-a),s=Math.floor(r.length/2);return r.length%2===0?(r[s-1]+r[s])/2:r[s]}return Math.max(e.scrollHeight,e.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight)}function Ml(t){if(typeof t=="string")try{return document.querySelector(t)}catch{return null}return t}function Kge(t){return!t||t.nodeType!==1?null:getComputedStyle(t)}function ap(t,e,n){if(!t)return Uu();const r=MH(t);if(r){if(r.isSameNode(Uu()))return n?document:Uu();if(!(r.scrollHeight>r.offsetHeight)&&!e)return r.style.overflow="initial",Uu()}return r}function Ob(t,e){if(!t)return!1;const n=ap(t,e);return n?!n.isSameNode(Uu()):!1}function Zge(t){return t.offsetParent!==document.body}function cf(t,e="fixed"){if(!t||!(t instanceof HTMLElement))return!1;const{nodeName:n}=t,r=Kge(t);return n==="BODY"||n==="HTML"?!1:r&&r.position===e?!0:t.parentNode?cf(t.parentNode,e):!1}function Jge(t){var e;if(!t)return!1;let n=t;for(;n&&n!==document.body;){if(n instanceof HTMLElement){const{display:r,visibility:s}=getComputedStyle(n);if(r==="none"||s==="hidden")return!1}n=(e=n.parentElement)!=null?e:null}return!0}function exe(t,e,n){var r,s,i;const a=rQ(t),l=ap(t,n),c=Ob(t,n),d=cf(t);let h=0,m=(r=a?.top)!=null?r:0;if(c&&d){const g=(s=t?.offsetTop)!=null?s:0,x=(i=l?.scrollTop)!=null?i:0;m=g-x}else l instanceof HTMLElement&&(h=l.scrollTop,!c&&!cf(t)&&(m+=h),l.isSameNode(Uu())||(m+=Uu().scrollTop));return Math.floor(m-e)}function txe(t,e,n){var r;if(!t)return 0;const{offsetTop:s=0,scrollTop:i=0}=(r=MH(t))!=null?r:{};let a=t.getBoundingClientRect().top+i;s&&(Ob(t,n)||Zge(t))&&(a-=s);const l=Math.floor(a-e);return l<0?0:l}function Uu(){var t;return(t=document.scrollingElement)!=null?t:document.documentElement}function nxe(t,e){const{duration:n,element:r}=e;return new Promise((s,i)=>{const{scrollTop:a}=r,l=t>a?t-a:a-t;wpe.top(r,t,{duration:l<100?50:n},c=>c&&c.message!=="Element already at target scroll position"?i(c):s())})}var Um=pa.createPortal!==void 0;function sQ(t=navigator.userAgent){let e=t;return typeof window>"u"?e="node":document.documentMode?e="ie":/Edge/.test(t)?e="edge":window.opera||t.includes(" OPR/")?e="opera":typeof window.InstallTrigger<"u"?e="firefox":window.chrome?e="chrome":/(Version\/([\d._]+).*Safari|CriOS|FxiOS| Mobile\/)/.test(t)&&(e="safari"),e}function vv(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function yo(t,e={}){const{defaultValue:n,step:r,steps:s}=e;let i=jM(t);if(i)(i.includes("{step}")||i.includes("{steps}"))&&r&&s&&(i=i.replace("{step}",r.toString()).replace("{steps}",s.toString()));else if(b.isValidElement(t)&&!Object.values(t.props).length&&vv(t.type)==="function"){const a=t.type({});i=yo(a,e)}else i=jM(n);return i}function rxe(t,e){return!ft.plainObject(t)||!ft.array(e)?!1:Object.keys(t).every(n=>e.includes(n))}function sxe(t){const e=/^#?([\da-f])([\da-f])([\da-f])$/i,n=t.replace(e,(s,i,a,l)=>i+i+a+a+l+l),r=/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(n);return r?[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)]:[]}function $M(t){return t.disableBeacon||t.placement==="center"}function HM(){return!["chrome","safari","firefox","opera"].includes(sQ())}function hd({data:t,debug:e=!1,title:n,warn:r=!1}){const s=r?console.warn||console.error:console.log;e&&(n&&t?(console.groupCollapsed(`%creact-joyride: ${n}`,"color: #ff0044; font-weight: bold; font-size: 12px;"),Array.isArray(t)?t.forEach(i=>{ft.plainObject(i)&&i.key?s.apply(console,[i.key,i.value]):s.apply(console,[i])}):s.apply(console,[t]),console.groupEnd()):console.error("Missing title or data props"))}function ixe(t){return Object.keys(t)}function iQ(t,...e){if(!ft.plainObject(t))throw new TypeError("Expected an object");const n={};for(const r in t)({}).hasOwnProperty.call(t,r)&&(e.includes(r)||(n[r]=t[r]));return n}function axe(t,...e){if(!ft.plainObject(t))throw new TypeError("Expected an object");if(!e.length)return t;const n={};for(const r in t)({}).hasOwnProperty.call(t,r)&&e.includes(r)&&(n[r]=t[r]);return n}function gO(t,e,n){const r=i=>i.replace("{step}",String(e)).replace("{steps}",String(n));if(vv(t)==="string")return r(t);if(!b.isValidElement(t))return t;const{children:s}=t.props;if(vv(s)==="string"&&s.includes("{step}"))return b.cloneElement(t,{children:r(s)});if(Array.isArray(s))return b.cloneElement(t,{children:s.map(i=>typeof i=="string"?r(i):gO(i,e,n))});if(vv(t.type)==="function"&&!Object.values(t.props).length){const i=t.type({});return gO(i,e,n)}return t}function oxe(t){const{isFirstStep:e,lifecycle:n,previousLifecycle:r,scrollToFirstStep:s,step:i,target:a}=t;return!i.disableScrolling&&(!e||s||n===Qt.TOOLTIP)&&i.placement!=="center"&&(!i.isFixed||!cf(a))&&r!==n&&[Qt.BEACON,Qt.TOOLTIP].includes(n)}var lxe={options:{preventOverflow:{boundariesElement:"scrollParent"}},wrapperOptions:{offset:-18,position:!0}},aQ={back:"Back",close:"Close",last:"Last",next:"Next",nextLabelWithProgress:"Next (Step {step} of {steps})",open:"Open the dialog",skip:"Skip"},cxe={event:"click",placement:"bottom",offset:10,disableBeacon:!1,disableCloseOnEsc:!1,disableOverlay:!1,disableOverlayClose:!1,disableScrollParentFix:!1,disableScrolling:!1,hideBackButton:!1,hideCloseButton:!1,hideFooter:!1,isFixed:!1,locale:aQ,showProgress:!1,showSkipButton:!1,spotlightClicks:!1,spotlightPadding:10},uxe={continuous:!1,debug:!1,disableCloseOnEsc:!1,disableOverlay:!1,disableOverlayClose:!1,disableScrolling:!1,disableScrollParentFix:!1,getHelpers:void 0,hideBackButton:!1,run:!0,scrollOffset:20,scrollDuration:300,scrollToFirstStep:!1,showSkipButton:!1,showProgress:!1,spotlightClicks:!1,spotlightPadding:10,steps:[]},dxe={arrowColor:"#fff",backgroundColor:"#fff",beaconSize:36,overlayColor:"rgba(0, 0, 0, 0.5)",primaryColor:"#f04",spotlightShadow:"0 0 15px rgba(0, 0, 0, 0.5)",textColor:"#333",width:380,zIndex:100},Wm={backgroundColor:"transparent",border:0,borderRadius:0,color:"#555",cursor:"pointer",fontSize:16,lineHeight:1,padding:8,WebkitAppearance:"none"},QM={borderRadius:4,position:"absolute"};function hxe(t,e){var n,r,s,i,a;const{floaterProps:l,styles:c}=t,d=Va((n=e.floaterProps)!=null?n:{},l??{}),h=Va(c??{},(r=e.styles)!=null?r:{}),m=Va(dxe,h.options||{}),g=e.placement==="center"||e.disableBeacon;let{width:x}=m;window.innerWidth>480&&(x=380),"width"in m&&(x=typeof m.width=="number"&&window.innerWidthoQ(n,e)):(hd({title:"validateSteps",data:"steps must be an array",warn:!0,debug:e}),!1)}var lQ={action:"init",controlled:!1,index:0,lifecycle:Qt.INIT,origin:null,size:0,status:mn.IDLE},UM=ixe(iQ(lQ,"controlled","size")),mxe=class{constructor(t){gt(this,"beaconPopper"),gt(this,"tooltipPopper"),gt(this,"data",new Map),gt(this,"listener"),gt(this,"store",new Map),gt(this,"addListener",s=>{this.listener=s}),gt(this,"setSteps",s=>{const{size:i,status:a}=this.getState(),l={size:s.length,status:a};this.data.set("steps",s),a===mn.WAITING&&!i&&s.length&&(l.status=mn.RUNNING),this.setState(l)}),gt(this,"getPopper",s=>s==="beacon"?this.beaconPopper:this.tooltipPopper),gt(this,"setPopper",(s,i)=>{s==="beacon"?this.beaconPopper=i:this.tooltipPopper=i}),gt(this,"cleanupPoppers",()=>{this.beaconPopper=null,this.tooltipPopper=null}),gt(this,"close",(s=null)=>{const{index:i,status:a}=this.getState();a===mn.RUNNING&&this.setState({...this.getNextState({action:Qn.CLOSE,index:i+1,origin:s})})}),gt(this,"go",s=>{const{controlled:i,status:a}=this.getState();if(i||a!==mn.RUNNING)return;const l=this.getSteps()[s];this.setState({...this.getNextState({action:Qn.GO,index:s}),status:l?a:mn.FINISHED})}),gt(this,"info",()=>this.getState()),gt(this,"next",()=>{const{index:s,status:i}=this.getState();i===mn.RUNNING&&this.setState(this.getNextState({action:Qn.NEXT,index:s+1}))}),gt(this,"open",()=>{const{status:s}=this.getState();s===mn.RUNNING&&this.setState({...this.getNextState({action:Qn.UPDATE,lifecycle:Qt.TOOLTIP})})}),gt(this,"prev",()=>{const{index:s,status:i}=this.getState();i===mn.RUNNING&&this.setState({...this.getNextState({action:Qn.PREV,index:s-1})})}),gt(this,"reset",(s=!1)=>{const{controlled:i}=this.getState();i||this.setState({...this.getNextState({action:Qn.RESET,index:0}),status:s?mn.RUNNING:mn.READY})}),gt(this,"skip",()=>{const{status:s}=this.getState();s===mn.RUNNING&&this.setState({action:Qn.SKIP,lifecycle:Qt.INIT,status:mn.SKIPPED})}),gt(this,"start",s=>{const{index:i,size:a}=this.getState();this.setState({...this.getNextState({action:Qn.START,index:ft.number(s)?s:i},!0),status:a?mn.RUNNING:mn.WAITING})}),gt(this,"stop",(s=!1)=>{const{index:i,status:a}=this.getState();[mn.FINISHED,mn.SKIPPED].includes(a)||this.setState({...this.getNextState({action:Qn.STOP,index:i+(s?1:0)}),status:mn.PAUSED})}),gt(this,"update",s=>{var i,a;if(!rxe(s,UM))throw new Error(`State is not valid. Valid keys: ${UM.join(", ")}`);this.setState({...this.getNextState({...this.getState(),...s,action:(i=s.action)!=null?i:Qn.UPDATE,origin:(a=s.origin)!=null?a:null},!0)})});const{continuous:e=!1,stepIndex:n,steps:r=[]}=t??{};this.setState({action:Qn.INIT,controlled:ft.number(n),continuous:e,index:ft.number(n)?n:0,lifecycle:Qt.INIT,origin:null,status:r.length?mn.READY:mn.IDLE},!0),this.beaconPopper=null,this.tooltipPopper=null,this.listener=null,this.setSteps(r)}getState(){return this.store.size?{action:this.store.get("action")||"",controlled:this.store.get("controlled")||!1,index:parseInt(this.store.get("index"),10),lifecycle:this.store.get("lifecycle")||"",origin:this.store.get("origin")||null,size:this.store.get("size")||0,status:this.store.get("status")||""}:{...lQ}}getNextState(t,e=!1){var n,r,s,i,a;const{action:l,controlled:c,index:d,size:h,status:m}=this.getState(),g=ft.number(t.index)?t.index:d,x=c&&!e?d:Math.min(Math.max(g,0),h);return{action:(n=t.action)!=null?n:l,controlled:c,index:x,lifecycle:(r=t.lifecycle)!=null?r:Qt.INIT,origin:(s=t.origin)!=null?s:null,size:(i=t.size)!=null?i:h,status:x===h?mn.FINISHED:(a=t.status)!=null?a:m}}getSteps(){const t=this.data.get("steps");return Array.isArray(t)?t:[]}hasUpdatedState(t){const e=JSON.stringify(t),n=JSON.stringify(this.getState());return e!==n}setState(t,e=!1){const n=this.getState(),{action:r,index:s,lifecycle:i,origin:a=null,size:l,status:c}={...n,...t};this.store.set("action",r),this.store.set("index",s),this.store.set("lifecycle",i),this.store.set("origin",a),this.store.set("size",l),this.store.set("status",c),e&&(this.store.set("controlled",t.controlled),this.store.set("continuous",t.continuous)),this.listener&&this.hasUpdatedState(n)&&this.listener(this.getState())}getHelpers(){return{close:this.close,go:this.go,info:this.info,next:this.next,open:this.open,prev:this.prev,reset:this.reset,skip:this.skip}}};function pxe(t){return new mxe(t)}function gxe({styles:t}){return b.createElement("div",{key:"JoyrideSpotlight",className:"react-joyride__spotlight","data-test-id":"spotlight",style:t})}var xxe=gxe,vxe=class extends b.Component{constructor(){super(...arguments),gt(this,"isActive",!1),gt(this,"resizeTimeout"),gt(this,"scrollTimeout"),gt(this,"scrollParent"),gt(this,"state",{isScrolling:!1,mouseOverSpotlight:!1,showSpotlight:!0}),gt(this,"hideSpotlight",()=>{const{continuous:t,disableOverlay:e,lifecycle:n}=this.props,r=[Qt.INIT,Qt.BEACON,Qt.COMPLETE,Qt.ERROR];return e||(t?r.includes(n):n!==Qt.TOOLTIP)}),gt(this,"handleMouseMove",t=>{const{mouseOverSpotlight:e}=this.state,{height:n,left:r,position:s,top:i,width:a}=this.spotlightStyles,l=s==="fixed"?t.clientY:t.pageY,c=s==="fixed"?t.clientX:t.pageX,d=l>=i&&l<=i+n,m=c>=r&&c<=r+a&&d;m!==e&&this.updateState({mouseOverSpotlight:m})}),gt(this,"handleScroll",()=>{const{target:t}=this.props,e=Ml(t);if(this.scrollParent!==document){const{isScrolling:n}=this.state;n||this.updateState({isScrolling:!0,showSpotlight:!1}),clearTimeout(this.scrollTimeout),this.scrollTimeout=window.setTimeout(()=>{this.updateState({isScrolling:!1,showSpotlight:!0})},50)}else cf(e,"sticky")&&this.updateState({})}),gt(this,"handleResize",()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(()=>{this.isActive&&this.forceUpdate()},100)})}componentDidMount(){const{debug:t,disableScrolling:e,disableScrollParentFix:n=!1,target:r}=this.props,s=Ml(r);this.scrollParent=ap(s??document.body,n,!0),this.isActive=!0,window.addEventListener("resize",this.handleResize)}componentDidUpdate(t){var e;const{disableScrollParentFix:n,lifecycle:r,spotlightClicks:s,target:i}=this.props,{changed:a}=iy(t,this.props);if(a("target")||a("disableScrollParentFix")){const l=Ml(i);this.scrollParent=ap(l??document.body,n,!0)}a("lifecycle",Qt.TOOLTIP)&&((e=this.scrollParent)==null||e.addEventListener("scroll",this.handleScroll,{passive:!0}),setTimeout(()=>{const{isScrolling:l}=this.state;l||this.updateState({showSpotlight:!0})},100)),(a("spotlightClicks")||a("disableOverlay")||a("lifecycle"))&&(s&&r===Qt.TOOLTIP?window.addEventListener("mousemove",this.handleMouseMove,!1):r!==Qt.TOOLTIP&&window.removeEventListener("mousemove",this.handleMouseMove))}componentWillUnmount(){var t;this.isActive=!1,window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("resize",this.handleResize),clearTimeout(this.resizeTimeout),clearTimeout(this.scrollTimeout),(t=this.scrollParent)==null||t.removeEventListener("scroll",this.handleScroll)}get overlayStyles(){const{mouseOverSpotlight:t}=this.state,{disableOverlayClose:e,placement:n,styles:r}=this.props;let s=r.overlay;return HM()&&(s=n==="center"?r.overlayLegacyCenter:r.overlayLegacy),{cursor:e?"default":"pointer",height:Yge(),pointerEvents:t?"none":"auto",...s}}get spotlightStyles(){var t,e,n;const{showSpotlight:r}=this.state,{disableScrollParentFix:s=!1,spotlightClicks:i,spotlightPadding:a=0,styles:l,target:c}=this.props,d=Ml(c),h=rQ(d),m=cf(d),g=exe(d,a,s);return{...HM()?l.spotlightLegacy:l.spotlight,height:Math.round(((t=h?.height)!=null?t:0)+a*2),left:Math.round(((e=h?.left)!=null?e:0)-a),opacity:r?1:0,pointerEvents:i?"none":"auto",position:m?"fixed":"absolute",top:g,transition:"opacity 0.2s",width:Math.round(((n=h?.width)!=null?n:0)+a*2)}}updateState(t){this.isActive&&this.setState(e=>({...e,...t}))}render(){const{showSpotlight:t}=this.state,{onClickOverlay:e,placement:n}=this.props,{hideSpotlight:r,overlayStyles:s,spotlightStyles:i}=this;if(r())return null;let a=n!=="center"&&t&&b.createElement(xxe,{styles:i});if(sQ()==="safari"){const{mixBlendMode:l,zIndex:c,...d}=s;a=b.createElement("div",{style:{...d}},a),delete s.backgroundColor}return b.createElement("div",{className:"react-joyride__overlay","data-test-id":"overlay",onClick:e,role:"presentation",style:s},a)}},yxe=class extends b.Component{constructor(){super(...arguments),gt(this,"node",null)}componentDidMount(){const{id:t}=this.props;zc()&&(this.node=document.createElement("div"),this.node.id=t,document.body.appendChild(this.node),Um||this.renderReact15())}componentDidUpdate(){zc()&&(Um||this.renderReact15())}componentWillUnmount(){!zc()||!this.node||(Um||pa.unmountComponentAtNode(this.node),this.node.parentNode===document.body&&(document.body.removeChild(this.node),this.node=null))}renderReact15(){if(!zc())return;const{children:t}=this.props;this.node&&pa.unstable_renderSubtreeIntoContainer(this,t,this.node)}renderReact16(){if(!zc()||!Um)return null;const{children:t}=this.props;return this.node?pa.createPortal(t,this.node):null}render(){return Um?this.renderReact16():null}},bxe=class{constructor(t,e){if(gt(this,"element"),gt(this,"options"),gt(this,"canBeTabbed",n=>{const{tabIndex:r}=n;return r===null||r<0?!1:this.canHaveFocus(n)}),gt(this,"canHaveFocus",n=>{const r=/input|select|textarea|button|object/,s=n.nodeName.toLowerCase();return(r.test(s)&&!n.getAttribute("disabled")||s==="a"&&!!n.getAttribute("href"))&&this.isVisible(n)}),gt(this,"findValidTabElements",()=>[].slice.call(this.element.querySelectorAll("*"),0).filter(this.canBeTabbed)),gt(this,"handleKeyDown",n=>{const{code:r="Tab"}=this.options;n.code===r&&this.interceptTab(n)}),gt(this,"interceptTab",n=>{n.preventDefault();const r=this.findValidTabElements(),{shiftKey:s}=n;if(!r.length)return;let i=document.activeElement?r.indexOf(document.activeElement):0;i===-1||!s&&i+1===r.length?i=0:s&&i===0?i=r.length-1:i+=s?-1:1,r[i].focus()}),gt(this,"isHidden",n=>{const r=n.offsetWidth<=0&&n.offsetHeight<=0,s=window.getComputedStyle(n);return r&&!n.innerHTML?!0:r&&s.getPropertyValue("overflow")!=="visible"||s.getPropertyValue("display")==="none"}),gt(this,"isVisible",n=>{let r=n;for(;r;)if(r instanceof HTMLElement){if(r===document.body)break;if(this.isHidden(r))return!1;r=r.parentNode}return!0}),gt(this,"removeScope",()=>{window.removeEventListener("keydown",this.handleKeyDown)}),gt(this,"checkFocus",n=>{document.activeElement!==n&&(n.focus(),window.requestAnimationFrame(()=>this.checkFocus(n)))}),gt(this,"setFocus",()=>{const{selector:n}=this.options;if(!n)return;const r=this.element.querySelector(n);r&&window.requestAnimationFrame(()=>this.checkFocus(r))}),!(t instanceof HTMLElement))throw new TypeError("Invalid parameter: element must be an HTMLElement");this.element=t,this.options=e,window.addEventListener("keydown",this.handleKeyDown,!1),this.setFocus()}},wxe=class extends b.Component{constructor(t){if(super(t),gt(this,"beacon",null),gt(this,"setBeaconRef",s=>{this.beacon=s}),t.beaconComponent)return;const e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.id="joyride-beacon-animation",t.nonce&&n.setAttribute("nonce",t.nonce),n.appendChild(document.createTextNode(` +reaction = "${T.reaction}"`;return o.jsxs(zo,{children:[o.jsx(Io,{asChild:!0,children:o.jsxs(de,{variant:"outline",size:"sm",children:[o.jsx(Ea,{className:"h-4 w-4 mr-1"}),"预览"]})}),o.jsx(Xa,{className:"w-[95vw] sm:w-[500px]",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),o.jsx(gn,{className:"h-60 rounded-md bg-muted p-3",children:o.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-all",children:E})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"关键词反应配置"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"配置触发特定反应的关键词和正则表达式规则"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-base font-semibold",children:"正则表达式规则"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用正则表达式匹配消息内容"})]}),o.jsxs(de,{onClick:c,size:"sm",variant:"outline",children:[o.jsx(Ls,{className:"h-4 w-4 mr-1"}),"添加正则规则"]})]}),o.jsxs("div",{className:"space-y-3",children:[t.regex_rules.map((T,E)=>o.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium",children:["正则规则 ",E+1]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(m,{regex:T.regex&&T.regex[0]||"",reaction:T.reaction,onRegexChange:_=>h(E,"regex",_),onReactionChange:_=>h(E,"reaction",_)}),o.jsx(j,{rule:T}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(de,{size:"sm",variant:"ghost",children:o.jsx(Sn,{className:"h-4 w-4"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:["确定要删除正则规则 ",E+1," 吗?此操作无法撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:()=>d(E),children:"删除"})]})]})]})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"正则表达式(Python 语法)"}),o.jsx(ze,{value:T.regex&&T.regex[0]||"",onChange:_=>h(E,"regex",_.target.value),placeholder:"例如:^(?P\\\\S{1,20})是这样的$ (点击正则编辑器按钮可视化构建)",className:"font-mono text-sm"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:'支持命名捕获组 (?Ppattern),可在 reaction 中使用 [name] 引用。点击"正则编辑器"可视化构建和测试!'})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"反应内容"}),o.jsx(Mr,{value:T.reaction,onChange:_=>h(E,"reaction",_.target.value),placeholder:`触发后麦麦的反应... +可以使用 [捕获组名] 来引用正则表达式中的内容`,rows:3,className:"text-sm"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"使用 [捕获组名] 引用正则表达式中的命名捕获组,例如 [n] 会被替换为捕获的内容"})]})]})]},E)),t.regex_rules.length===0&&o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无正则规则,点击"添加正则规则"开始配置'})]})]}),o.jsxs("div",{className:"space-y-4 border-t pt-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-base font-semibold",children:"关键词规则"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用关键词列表匹配消息内容"})]}),o.jsxs(de,{onClick:g,size:"sm",variant:"outline",children:[o.jsx(Ls,{className:"h-4 w-4 mr-1"}),"添加关键词规则"]})]}),o.jsxs("div",{className:"space-y-3",children:[t.keyword_rules.map((T,E)=>o.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-sm font-medium",children:["关键词规则 ",E+1]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(N,{rule:T}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(de,{size:"sm",variant:"ghost",children:o.jsx(Sn,{className:"h-4 w-4"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:["确定要删除关键词规则 ",E+1," 吗?此操作无法撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:()=>x(E),children:"删除"})]})]})]})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{className:"text-xs font-medium",children:"关键词列表"}),o.jsxs(de,{onClick:()=>w(E),size:"sm",variant:"ghost",children:[o.jsx(Ls,{className:"h-3 w-3 mr-1"}),"添加关键词"]})]}),o.jsxs("div",{className:"space-y-2",children:[(T.keywords||[]).map((_,A)=>o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ze,{value:_,onChange:L=>k(E,A,L.target.value),placeholder:"关键词",className:"flex-1"}),o.jsx(de,{onClick:()=>S(E,A),size:"sm",variant:"ghost",children:o.jsx(Sn,{className:"h-4 w-4"})})]},A)),(!T.keywords||T.keywords.length===0)&&o.jsx("p",{className:"text-xs text-muted-foreground text-center py-2",children:'暂无关键词,点击"添加关键词"开始配置'})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-xs font-medium",children:"反应内容"}),o.jsx(Mr,{value:T.reaction,onChange:_=>y(E,"reaction",_.target.value),placeholder:"触发后麦麦的反应...",rows:3,className:"text-sm"})]})]})]},E)),t.keyword_rules.length===0&&o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无关键词规则,点击"添加关键词规则"开始配置'})]})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"回复后处理配置"}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"enable_response_post_process",checked:e.enable_response_post_process,onCheckedChange:T=>i({...e,enable_response_post_process:T})}),o.jsx(he,{htmlFor:"enable_response_post_process",className:"cursor-pointer",children:"启用回复后处理"})]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"包括错别字生成器和回复分割器"})]}),e.enable_response_post_process&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"border-t pt-6 space-y-4",children:o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[o.jsx(Bt,{id:"enable_chinese_typo",checked:n.enable,onCheckedChange:T=>a({...n,enable:T})}),o.jsx(he,{htmlFor:"enable_chinese_typo",className:"cursor-pointer font-semibold",children:"中文错别字生成器"})]}),o.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"为回复添加随机错别字,让麦麦的回复更自然"}),n.enable&&o.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"error_rate",className:"text-xs font-medium",children:"单字替换概率"}),o.jsx(ze,{id:"error_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.error_rate,onChange:T=>a({...n,error_rate:parseFloat(T.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"min_freq",className:"text-xs font-medium",children:"最小字频阈值"}),o.jsx(ze,{id:"min_freq",type:"number",min:"0",value:n.min_freq,onChange:T=>a({...n,min_freq:parseInt(T.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"tone_error_rate",className:"text-xs font-medium",children:"声调错误概率"}),o.jsx(ze,{id:"tone_error_rate",type:"number",step:"0.01",min:"0",max:"1",value:n.tone_error_rate,onChange:T=>a({...n,tone_error_rate:parseFloat(T.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"word_replace_rate",className:"text-xs font-medium",children:"整词替换概率"}),o.jsx(ze,{id:"word_replace_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.word_replace_rate,onChange:T=>a({...n,word_replace_rate:parseFloat(T.target.value)})})]})]})]})}),o.jsx("div",{className:"border-t pt-6 space-y-4",children:o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[o.jsx(Bt,{id:"enable_response_splitter",checked:r.enable,onCheckedChange:T=>l({...r,enable:T})}),o.jsx(he,{htmlFor:"enable_response_splitter",className:"cursor-pointer font-semibold",children:"回复分割器"})]}),o.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"控制回复的长度和句子数量"}),r.enable&&o.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"max_length",className:"text-xs font-medium",children:"最大长度"}),o.jsx(ze,{id:"max_length",type:"number",min:"1",value:r.max_length,onChange:T=>l({...r,max_length:parseInt(T.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大字符数"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"max_sentence_num",className:"text-xs font-medium",children:"最大句子数"}),o.jsx(ze,{id:"max_sentence_num",type:"number",min:"1",value:r.max_sentence_num,onChange:T=>l({...r,max_sentence_num:parseInt(T.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大句子数量"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"enable_kaomoji_protection",checked:r.enable_kaomoji_protection,onCheckedChange:T=>l({...r,enable_kaomoji_protection:T})}),o.jsx(he,{htmlFor:"enable_kaomoji_protection",className:"cursor-pointer",children:"启用颜文字保护"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"enable_overflow_return_all",checked:r.enable_overflow_return_all,onCheckedChange:T=>l({...r,enable_overflow_return_all:T})}),o.jsx(he,{htmlFor:"enable_overflow_return_all",className:"cursor-pointer",children:"超出时一次性返回全部"})]}),o.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"当句子数量超出限制时,合并后一次性返回所有内容"})]})]})})]})]})]})}function F0e({config:t,onChange:e}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"情绪设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{checked:t.enable_mood,onCheckedChange:n=>e({...t,enable_mood:n})}),o.jsx(he,{className:"cursor-pointer",children:"启用情绪系统"})]}),t.enable_mood&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"情绪更新阈值"}),o.jsx(ze,{type:"number",min:"1",value:t.mood_update_threshold,onChange:n=>e({...t,mood_update_threshold:parseInt(n.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"越高,更新越慢"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"情感特征"}),o.jsx(Mr,{value:t.emotion_style,onChange:n=>e({...t,emotion_style:n.target.value}),placeholder:"影响情绪的变化情况",rows:2})]})]})]})]})}function q0e({config:t,onChange:e}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"语音设置"}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{checked:t.enable_asr,onCheckedChange:n=>e({...t,enable_asr:n})}),o.jsx(he,{className:"cursor-pointer",children:"启用语音识别"})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"启用后麦麦可以识别语音消息,需要配置语音识别模型"})]})}function $0e({config:t,onChange:e}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库设置"}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{checked:t.enable,onCheckedChange:n=>e({...t,enable:n})}),o.jsx(he,{className:"cursor-pointer",children:"启用 LPMM 知识库"})]}),t.enable&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"LPMM 模式"}),o.jsxs(Vt,{value:t.lpmm_mode,onValueChange:n=>e({...t,lpmm_mode:n}),children:[o.jsx($t,{children:o.jsx(Ut,{placeholder:"选择 LPMM 模式"})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"classic",children:"经典模式"}),o.jsx(De,{value:"agent",children:"Agent 模式"})]})]})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"同义词搜索 TopK"}),o.jsx(ze,{type:"number",min:"1",value:t.rag_synonym_search_top_k,onChange:n=>e({...t,rag_synonym_search_top_k:parseInt(n.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"同义词阈值"}),o.jsx(ze,{type:"number",step:"0.1",min:"0",max:"1",value:t.rag_synonym_threshold,onChange:n=>e({...t,rag_synonym_threshold:parseFloat(n.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"实体提取线程数"}),o.jsx(ze,{type:"number",min:"1",value:t.info_extraction_workers,onChange:n=>e({...t,info_extraction_workers:parseInt(n.target.value)})})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"嵌入向量维度"}),o.jsx(ze,{type:"number",min:"1",value:t.embedding_dimension,onChange:n=>e({...t,embedding_dimension:parseInt(n.target.value)})})]})]})]})]})]})}function H0e({config:t,onChange:e}){const[n,r]=b.useState(""),[s,i]=b.useState("WARNING"),a=()=>{n&&!t.suppress_libraries.includes(n)&&(e({...t,suppress_libraries:[...t.suppress_libraries,n]}),r(""))},l=x=>{e({...t,suppress_libraries:t.suppress_libraries.filter(y=>y!==x)})},c=()=>{n&&!t.library_log_levels[n]&&(e({...t,library_log_levels:{...t.library_log_levels,[n]:s}}),r(""),i("WARNING"))},d=x=>{const y={...t.library_log_levels};delete y[x],e({...t,library_log_levels:y})},h=["DEBUG","INFO","WARNING","ERROR","CRITICAL"],m=["FULL","compact","lite"],g=["none","title","full"];return o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"日志配置"}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"日期格式"}),o.jsx(ze,{value:t.date_style,onChange:x=>e({...t,date_style:x.target.value}),placeholder:"例如: m-d H:i:s"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"m=月, d=日, H=时, i=分, s=秒"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"日志级别样式"}),o.jsxs(Vt,{value:t.log_level_style,onValueChange:x=>e({...t,log_level_style:x}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:m.map(x=>o.jsx(De,{value:x,children:x},x))})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"日志文本颜色"}),o.jsxs(Vt,{value:t.color_text,onValueChange:x=>e({...t,color_text:x}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:g.map(x=>o.jsx(De,{value:x,children:x},x))})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"全局日志级别"}),o.jsxs(Vt,{value:t.log_level,onValueChange:x=>e({...t,log_level:x}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:h.map(x=>o.jsx(De,{value:x,children:x},x))})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"控制台日志级别"}),o.jsxs(Vt,{value:t.console_log_level,onValueChange:x=>e({...t,console_log_level:x}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:h.map(x=>o.jsx(De,{value:x,children:x},x))})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"文件日志级别"}),o.jsxs(Vt,{value:t.file_log_level,onValueChange:x=>e({...t,file_log_level:x}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsx(Ht,{children:h.map(x=>o.jsx(De,{value:x,children:x},x))})]})]})]})]}),o.jsxs("div",{children:[o.jsx(he,{className:"mb-2 block",children:"完全屏蔽的库"}),o.jsxs("div",{className:"flex gap-2 mb-2",children:[o.jsx(ze,{value:n,onChange:x=>r(x.target.value),placeholder:"输入库名",className:"flex-1",onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),a())}}),o.jsx(de,{onClick:a,size:"sm",className:"flex-shrink-0",children:o.jsx(Ls,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),o.jsx("div",{className:"flex flex-wrap gap-2",children:t.suppress_libraries.map(x=>o.jsxs("div",{className:"flex items-center gap-1 bg-secondary px-3 py-1 rounded-md",children:[o.jsx("span",{className:"text-sm",children:x}),o.jsx(de,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>l(x),children:o.jsx(Sn,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},x))})]}),o.jsxs("div",{children:[o.jsx(he,{className:"mb-2 block",children:"特定库的日志级别"}),o.jsxs("div",{className:"flex gap-2 mb-2",children:[o.jsx(ze,{value:n,onChange:x=>r(x.target.value),placeholder:"输入库名",className:"flex-1"}),o.jsxs(Vt,{value:s,onValueChange:i,children:[o.jsx($t,{className:"w-32",children:o.jsx(Ut,{})}),o.jsx(Ht,{children:h.map(x=>o.jsx(De,{value:x,children:x},x))})]}),o.jsx(de,{onClick:c,size:"sm",children:o.jsx(Ls,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),o.jsx("div",{className:"space-y-2",children:Object.entries(t.library_log_levels).map(([x,y])=>o.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[o.jsx("span",{className:"text-sm font-medium",children:x}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-sm text-muted-foreground",children:y}),o.jsx(de,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>d(x),children:o.jsx(Sn,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]})]},x))})]})]})}function Q0e({config:t,onChange:e}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"调试配置"}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"显示 Prompt"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否在日志中显示提示词"})]}),o.jsx(Bt,{checked:t.show_prompt,onCheckedChange:n=>e({...t,show_prompt:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"显示回复器 Prompt"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的提示词"})]}),o.jsx(Bt,{checked:t.show_replyer_prompt,onCheckedChange:n=>e({...t,show_replyer_prompt:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"显示回复器推理"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的推理过程"})]}),o.jsx(Bt,{checked:t.show_replyer_reasoning,onCheckedChange:n=>e({...t,show_replyer_reasoning:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"显示 Jargon Prompt"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示术语相关的提示词"})]}),o.jsx(Bt,{checked:t.show_jargon_prompt,onCheckedChange:n=>e({...t,show_jargon_prompt:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"显示记忆检索 Prompt"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示记忆检索相关的提示词"})]}),o.jsx(Bt,{checked:t.show_memory_prompt,onCheckedChange:n=>e({...t,show_memory_prompt:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"显示 Planner Prompt"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示 Planner 的提示词和原始返回结果"})]}),o.jsx(Bt,{checked:t.show_planner_prompt,onCheckedChange:n=>e({...t,show_planner_prompt:n})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"显示 LPMM 相关文段"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示 LPMM 知识库找到的相关文段日志"})]}),o.jsx(Bt,{checked:t.show_lpmm_paragraph,onCheckedChange:n=>e({...t,show_lpmm_paragraph:n})})]})]})]})}function V0e({config:t,onChange:e}){const[n,r]=b.useState(""),s=()=>{n&&!t.auth_token.includes(n)&&(e({...t,auth_token:[...t.auth_token,n]}),r(""))},i=a=>{e({...t,auth_token:t.auth_token.filter((l,c)=>c!==a)})};return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-semibold mb-4",children:"MaimMessage 服务配置"}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"启用自定义服务器"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"是否使用自定义的 MaimMessage 服务器"})]}),o.jsx(Bt,{checked:t.use_custom,onCheckedChange:a=>e({...t,use_custom:a})})]}),t.use_custom&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"主机地址"}),o.jsx(ze,{value:t.host,onChange:a=>e({...t,host:a.target.value}),placeholder:"127.0.0.1"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"端口号"}),o.jsx(ze,{type:"number",value:t.port,onChange:a=>e({...t,port:parseInt(a.target.value)}),placeholder:"8090"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"连接模式"}),o.jsxs(Vt,{value:t.mode,onValueChange:a=>e({...t,mode:a}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"ws",children:"WebSocket (ws)"}),o.jsx(De,{value:"tcp",children:"TCP"})]})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{checked:t.use_wss,onCheckedChange:a=>e({...t,use_wss:a}),disabled:t.mode!=="ws"}),o.jsx(he,{children:"使用 WSS 安全连接"})]})]}),t.use_wss&&t.mode==="ws"&&o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"SSL 证书文件路径"}),o.jsx(ze,{value:t.cert_file,onChange:a=>e({...t,cert_file:a.target.value}),placeholder:"cert.pem"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"SSL 密钥文件路径"}),o.jsx(ze,{value:t.key_file,onChange:a=>e({...t,key_file:a.target.value}),placeholder:"key.pem"})]})]})]})]})]}),o.jsxs("div",{children:[o.jsx(he,{className:"mb-2 block",children:"认证令牌"}),o.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"用于 API 验证,为空则不启用验证"}),o.jsxs("div",{className:"flex gap-2 mb-2",children:[o.jsx(ze,{value:n,onChange:a=>r(a.target.value),placeholder:"输入认证令牌",onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),s())}}),o.jsx(de,{onClick:s,size:"sm",children:o.jsx(Ls,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),o.jsx("div",{className:"space-y-2",children:t.auth_token.map((a,l)=>o.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[o.jsx("span",{className:"text-sm font-mono",children:a}),o.jsx(de,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>i(l),children:o.jsx(Sn,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},l))})]})]})}function U0e({config:t,onChange:e}){return o.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"统计信息"}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(he,{children:"启用统计信息发送"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"发送匿名统计信息,帮助我们了解全球有多少只麦麦在运行"})]}),o.jsx(Bt,{checked:t.enable,onCheckedChange:n=>e({...t,enable:n})})]})]})}const _f=b.forwardRef(({className:t,...e},n)=>o.jsx("div",{className:"relative w-full overflow-auto",children:o.jsx("table",{ref:n,className:xe("w-full caption-bottom text-sm",t),...e})}));_f.displayName="Table";const Af=b.forwardRef(({className:t,...e},n)=>o.jsx("thead",{ref:n,className:xe("[&_tr]:border-b",t),...e}));Af.displayName="TableHeader";const Mf=b.forwardRef(({className:t,...e},n)=>o.jsx("tbody",{ref:n,className:xe("[&_tr:last-child]:border-0",t),...e}));Mf.displayName="TableBody";const W0e=b.forwardRef(({className:t,...e},n)=>o.jsx("tfoot",{ref:n,className:xe("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));W0e.displayName="TableFooter";const Is=b.forwardRef(({className:t,...e},n)=>o.jsx("tr",{ref:n,className:xe("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...e}));Is.displayName="TableRow";const pn=b.forwardRef(({className:t,...e},n)=>o.jsx("th",{ref:n,className:xe("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e}));pn.displayName="TableHead";const Gt=b.forwardRef(({className:t,...e},n)=>o.jsx("td",{ref:n,className:xe("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e}));Gt.displayName="TableCell";const G0e=b.forwardRef(({className:t,...e},n)=>o.jsx("caption",{ref:n,className:xe("mt-4 text-sm text-muted-foreground",t),...e}));G0e.displayName="TableCaption";var xA=1,X0e=.9,Y0e=.8,K0e=.17,mS=.1,pS=.999,Z0e=.9999,J0e=.99,epe=/[\\\/_+.#"@\[\(\{&]/,tpe=/[\\\/_+.#"@\[\(\{&]/g,npe=/[\s-]/,jH=/[\s-]/g;function pO(t,e,n,r,s,i,a){if(i===e.length)return s===t.length?xA:J0e;var l=`${s},${i}`;if(a[l]!==void 0)return a[l];for(var c=r.charAt(i),d=n.indexOf(c,s),h=0,m,g,x,y;d>=0;)m=pO(t,e,n,r,d+1,i+1,a),m>h&&(d===s?m*=xA:epe.test(t.charAt(d-1))?(m*=Y0e,x=t.slice(s,d-1).match(tpe),x&&s>0&&(m*=Math.pow(pS,x.length))):npe.test(t.charAt(d-1))?(m*=X0e,y=t.slice(s,d-1).match(jH),y&&s>0&&(m*=Math.pow(pS,y.length))):(m*=K0e,s>0&&(m*=Math.pow(pS,d-s))),t.charAt(d)!==e.charAt(i)&&(m*=Z0e)),(mm&&(m=g*mS)),m>h&&(h=m),d=n.indexOf(c,d+1);return a[l]=h,h}function vA(t){return t.toLowerCase().replace(jH," ")}function rpe(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,pO(t,e,vA(t),vA(e),0,0,{})}var spe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],cu=spe.reduce((t,e)=>{const n=Fy(`Primitive.${e}`),r=b.forwardRef((s,i)=>{const{asChild:a,...l}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),Qm='[cmdk-group=""]',gS='[cmdk-group-items=""]',ipe='[cmdk-group-heading=""]',NH='[cmdk-item=""]',yA=`${NH}:not([aria-disabled="true"])`,gO="cmdk-item-select",wh="data-value",ape=(t,e,n)=>rpe(t,e,n),CH=b.createContext(void 0),Jp=()=>b.useContext(CH),TH=b.createContext(void 0),q6=()=>b.useContext(TH),EH=b.createContext(void 0),_H=b.forwardRef((t,e)=>{let n=Sh(()=>{var G,I;return{search:"",value:(I=(G=t.value)!=null?G:t.defaultValue)!=null?I:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Sh(()=>new Set),s=Sh(()=>new Map),i=Sh(()=>new Map),a=Sh(()=>new Set),l=AH(t),{label:c,children:d,value:h,onValueChange:m,filter:g,shouldFilter:x,loop:y,disablePointerSelection:w=!1,vimBindings:S=!0,...k}=t,j=Ui(),N=Ui(),T=Ui(),E=b.useRef(null),_=xpe();dd(()=>{if(h!==void 0){let G=h.trim();n.current.value=G,A.emit()}},[h]),dd(()=>{_(6,te)},[]);let A=b.useMemo(()=>({subscribe:G=>(a.current.add(G),()=>a.current.delete(G)),snapshot:()=>n.current,setState:(G,I,V)=>{var ee,ne,W,se;if(!Object.is(n.current[G],I)){if(n.current[G]=I,G==="search")U(),B(),_(1,$);else if(G==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let re=document.getElementById(T);re?re.focus():(ee=document.getElementById(j))==null||ee.focus()}if(_(7,()=>{var re;n.current.selectedItemId=(re=z())==null?void 0:re.id,A.emit()}),V||_(5,te),((ne=l.current)==null?void 0:ne.value)!==void 0){let re=I??"";(se=(W=l.current).onValueChange)==null||se.call(W,re);return}}A.emit()}},emit:()=>{a.current.forEach(G=>G())}}),[]),L=b.useMemo(()=>({value:(G,I,V)=>{var ee;I!==((ee=i.current.get(G))==null?void 0:ee.value)&&(i.current.set(G,{value:I,keywords:V}),n.current.filtered.items.set(G,P(I,V)),_(2,()=>{B(),A.emit()}))},item:(G,I)=>(r.current.add(G),I&&(s.current.has(I)?s.current.get(I).add(G):s.current.set(I,new Set([G]))),_(3,()=>{U(),B(),n.current.value||$(),A.emit()}),()=>{i.current.delete(G),r.current.delete(G),n.current.filtered.items.delete(G);let V=z();_(4,()=>{U(),V?.getAttribute("id")===G&&$(),A.emit()})}),group:G=>(s.current.has(G)||s.current.set(G,new Set),()=>{i.current.delete(G),s.current.delete(G)}),filter:()=>l.current.shouldFilter,label:c||t["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:j,inputId:T,labelId:N,listInnerRef:E}),[]);function P(G,I){var V,ee;let ne=(ee=(V=l.current)==null?void 0:V.filter)!=null?ee:ape;return G?ne(G,n.current.search,I):0}function B(){if(!n.current.search||l.current.shouldFilter===!1)return;let G=n.current.filtered.items,I=[];n.current.filtered.groups.forEach(ee=>{let ne=s.current.get(ee),W=0;ne.forEach(se=>{let re=G.get(se);W=Math.max(re,W)}),I.push([ee,W])});let V=E.current;Q().sort((ee,ne)=>{var W,se;let re=ee.getAttribute("id"),oe=ne.getAttribute("id");return((W=G.get(oe))!=null?W:0)-((se=G.get(re))!=null?se:0)}).forEach(ee=>{let ne=ee.closest(gS);ne?ne.appendChild(ee.parentElement===ne?ee:ee.closest(`${gS} > *`)):V.appendChild(ee.parentElement===V?ee:ee.closest(`${gS} > *`))}),I.sort((ee,ne)=>ne[1]-ee[1]).forEach(ee=>{var ne;let W=(ne=E.current)==null?void 0:ne.querySelector(`${Qm}[${wh}="${encodeURIComponent(ee[0])}"]`);W?.parentElement.appendChild(W)})}function $(){let G=Q().find(V=>V.getAttribute("aria-disabled")!=="true"),I=G?.getAttribute(wh);A.setState("value",I||void 0)}function U(){var G,I,V,ee;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ne=0;for(let W of r.current){let se=(I=(G=i.current.get(W))==null?void 0:G.value)!=null?I:"",re=(ee=(V=i.current.get(W))==null?void 0:V.keywords)!=null?ee:[],oe=P(se,re);n.current.filtered.items.set(W,oe),oe>0&&ne++}for(let[W,se]of s.current)for(let re of se)if(n.current.filtered.items.get(re)>0){n.current.filtered.groups.add(W);break}n.current.filtered.count=ne}function te(){var G,I,V;let ee=z();ee&&(((G=ee.parentElement)==null?void 0:G.firstChild)===ee&&((V=(I=ee.closest(Qm))==null?void 0:I.querySelector(ipe))==null||V.scrollIntoView({block:"nearest"})),ee.scrollIntoView({block:"nearest"}))}function z(){var G;return(G=E.current)==null?void 0:G.querySelector(`${NH}[aria-selected="true"]`)}function Q(){var G;return Array.from(((G=E.current)==null?void 0:G.querySelectorAll(yA))||[])}function F(G){let I=Q()[G];I&&A.setState("value",I.getAttribute(wh))}function Y(G){var I;let V=z(),ee=Q(),ne=ee.findIndex(se=>se===V),W=ee[ne+G];(I=l.current)!=null&&I.loop&&(W=ne+G<0?ee[ee.length-1]:ne+G===ee.length?ee[0]:ee[ne+G]),W&&A.setState("value",W.getAttribute(wh))}function J(G){let I=z(),V=I?.closest(Qm),ee;for(;V&&!ee;)V=G>0?ppe(V,Qm):gpe(V,Qm),ee=V?.querySelector(yA);ee?A.setState("value",ee.getAttribute(wh)):Y(G)}let X=()=>F(Q().length-1),R=G=>{G.preventDefault(),G.metaKey?X():G.altKey?J(1):Y(1)},ie=G=>{G.preventDefault(),G.metaKey?F(0):G.altKey?J(-1):Y(-1)};return b.createElement(cu.div,{ref:e,tabIndex:-1,...k,"cmdk-root":"",onKeyDown:G=>{var I;(I=k.onKeyDown)==null||I.call(k,G);let V=G.nativeEvent.isComposing||G.keyCode===229;if(!(G.defaultPrevented||V))switch(G.key){case"n":case"j":{S&&G.ctrlKey&&R(G);break}case"ArrowDown":{R(G);break}case"p":case"k":{S&&G.ctrlKey&&ie(G);break}case"ArrowUp":{ie(G);break}case"Home":{G.preventDefault(),F(0);break}case"End":{G.preventDefault(),X();break}case"Enter":{G.preventDefault();let ee=z();if(ee){let ne=new Event(gO);ee.dispatchEvent(ne)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:L.inputId,id:L.labelId,style:ype},c),kb(t,G=>b.createElement(TH.Provider,{value:A},b.createElement(CH.Provider,{value:L},G))))}),ope=b.forwardRef((t,e)=>{var n,r;let s=Ui(),i=b.useRef(null),a=b.useContext(EH),l=Jp(),c=AH(t),d=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:a?.forceMount;dd(()=>{if(!d)return l.item(s,a?.id)},[d]);let h=MH(s,i,[t.value,t.children,i],t.keywords),m=q6(),g=Zc(_=>_.value&&_.value===h.current),x=Zc(_=>d||l.filter()===!1?!0:_.search?_.filtered.items.get(s)>0:!0);b.useEffect(()=>{let _=i.current;if(!(!_||t.disabled))return _.addEventListener(gO,y),()=>_.removeEventListener(gO,y)},[x,t.onSelect,t.disabled]);function y(){var _,A;w(),(A=(_=c.current).onSelect)==null||A.call(_,h.current)}function w(){m.setState("value",h.current,!0)}if(!x)return null;let{disabled:S,value:k,onSelect:j,forceMount:N,keywords:T,...E}=t;return b.createElement(cu.div,{ref:Qc(i,e),...E,id:s,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!g,"data-disabled":!!S,"data-selected":!!g,onPointerMove:S||l.getDisablePointerSelection()?void 0:w,onClick:S?void 0:y},t.children)}),lpe=b.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:s,...i}=t,a=Ui(),l=b.useRef(null),c=b.useRef(null),d=Ui(),h=Jp(),m=Zc(x=>s||h.filter()===!1?!0:x.search?x.filtered.groups.has(a):!0);dd(()=>h.group(a),[]),MH(a,l,[t.value,t.heading,c]);let g=b.useMemo(()=>({id:a,forceMount:s}),[s]);return b.createElement(cu.div,{ref:Qc(l,e),...i,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&b.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),kb(t,x=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},b.createElement(EH.Provider,{value:g},x))))}),cpe=b.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,s=b.useRef(null),i=Zc(a=>!a.search);return!n&&!i?null:b.createElement(cu.div,{ref:Qc(s,e),...r,"cmdk-separator":"",role:"separator"})}),upe=b.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,s=t.value!=null,i=q6(),a=Zc(d=>d.search),l=Zc(d=>d.selectedItemId),c=Jp();return b.useEffect(()=>{t.value!=null&&i.setState("search",t.value)},[t.value]),b.createElement(cu.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:s?t.value:a,onChange:d=>{s||i.setState("search",d.target.value),n?.(d.target.value)}})}),dpe=b.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...s}=t,i=b.useRef(null),a=b.useRef(null),l=Zc(d=>d.selectedItemId),c=Jp();return b.useEffect(()=>{if(a.current&&i.current){let d=a.current,h=i.current,m,g=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let x=d.offsetHeight;h.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return g.observe(d),()=>{cancelAnimationFrame(m),g.unobserve(d)}}},[]),b.createElement(cu.div,{ref:Qc(i,e),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},kb(t,d=>b.createElement("div",{ref:Qc(a,c.listInnerRef),"cmdk-list-sizer":""},d)))}),hpe=b.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:a,...l}=t;return b.createElement(Nj,{open:n,onOpenChange:r},b.createElement(kj,{container:a},b.createElement(qy,{"cmdk-overlay":"",className:s}),b.createElement($y,{"aria-label":t.label,"cmdk-dialog":"",className:i},b.createElement(_H,{ref:e,...l}))))}),fpe=b.forwardRef((t,e)=>Zc(n=>n.filtered.count===0)?b.createElement(cu.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),mpe=b.forwardRef((t,e)=>{let{progress:n,children:r,label:s="Loading...",...i}=t;return b.createElement(cu.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},kb(t,a=>b.createElement("div",{"aria-hidden":!0},a)))}),Ci=Object.assign(_H,{List:dpe,Item:ope,Input:upe,Group:lpe,Separator:cpe,Dialog:hpe,Empty:fpe,Loading:mpe});function ppe(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function gpe(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function AH(t){let e=b.useRef(t);return dd(()=>{e.current=t}),e}var dd=typeof window>"u"?b.useEffect:b.useLayoutEffect;function Sh(t){let e=b.useRef();return e.current===void 0&&(e.current=t()),e}function Zc(t){let e=q6(),n=()=>t(e.snapshot());return b.useSyncExternalStore(e.subscribe,n,n)}function MH(t,e,n,r=[]){let s=b.useRef(),i=Jp();return dd(()=>{var a;let l=(()=>{var d;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(d=h.current.textContent)==null?void 0:d.trim():s.current}})(),c=r.map(d=>d.trim());i.value(t,l,c),(a=e.current)==null||a.setAttribute(wh,l),s.current=l}),s}var xpe=()=>{let[t,e]=b.useState(),n=Sh(()=>new Map);return dd(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,s)=>{n.current.set(r,s),e({})}};function vpe(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function kb({asChild:t,children:e},n){return t&&b.isValidElement(e)?b.cloneElement(vpe(e),{ref:e.ref},n(e.props.children)):n(e)}var ype={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ob=b.forwardRef(({className:t,...e},n)=>o.jsx(Ci,{ref:n,className:xe("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));Ob.displayName=Ci.displayName;const jb=b.forwardRef(({className:t,...e},n)=>o.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[o.jsx(Ni,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),o.jsx(Ci.Input,{ref:n,className:xe("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",t),...e})]}));jb.displayName=Ci.Input.displayName;const Nb=b.forwardRef(({className:t,...e},n)=>o.jsx(Ci.List,{ref:n,className:xe("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));Nb.displayName=Ci.List.displayName;const Cb=b.forwardRef((t,e)=>o.jsx(Ci.Empty,{ref:e,className:"py-6 text-center text-sm",...t}));Cb.displayName=Ci.Empty.displayName;const ap=b.forwardRef(({className:t,...e},n)=>o.jsx(Ci.Group,{ref:n,className:xe("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",t),...e}));ap.displayName=Ci.Group.displayName;const bpe=b.forwardRef(({className:t,...e},n)=>o.jsx(Ci.Separator,{ref:n,className:xe("-mx-1 h-px bg-border",t),...e}));bpe.displayName=Ci.Separator.displayName;const op=b.forwardRef(({className:t,...e},n)=>o.jsx(Ci.Item,{ref:n,className:xe("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",t),...e}));op.displayName=Ci.Item.displayName;const Oi=b.forwardRef(({className:t,...e},n)=>o.jsx(gI,{ref:n,className:xe("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",t),...e,children:o.jsx(Ree,{className:xe("grid place-content-center text-current"),children:o.jsx(Ro,{className:"h-4 w-4"})})}));Oi.displayName=gI.displayName;const RH=b.createContext(null),DH="maibot-completed-tours";function wpe(){try{const t=localStorage.getItem(DH);return t?new Set(JSON.parse(t)):new Set}catch{return new Set}}function bA(t){localStorage.setItem(DH,JSON.stringify([...t]))}function Spe({children:t}){const[e,n]=b.useState({activeTourId:null,stepIndex:0,isRunning:!1}),r=b.useRef(new Map),[,s]=b.useState(0),[i,a]=b.useState(wpe),l=b.useCallback((N,T)=>{r.current.set(N,T),s(E=>E+1)},[]),c=b.useCallback(N=>{r.current.delete(N),n(T=>T.activeTourId===N?{...T,activeTourId:null,isRunning:!1,stepIndex:0}:T)},[]),d=b.useCallback((N,T=0)=>{r.current.has(N)&&n({activeTourId:N,stepIndex:T,isRunning:!0})},[]),h=b.useCallback(()=>{n(N=>({...N,isRunning:!1}))},[]),m=b.useCallback(N=>{n(T=>({...T,stepIndex:N}))},[]),g=b.useCallback(()=>{n(N=>({...N,stepIndex:N.stepIndex+1}))},[]),x=b.useCallback(()=>{n(N=>({...N,stepIndex:Math.max(0,N.stepIndex-1)}))},[]),y=b.useCallback(()=>e.activeTourId?r.current.get(e.activeTourId)||[]:[],[e.activeTourId]),w=b.useCallback(N=>{a(T=>{const E=new Set(T);return E.add(N),bA(E),E})},[]),S=b.useCallback(N=>{const{action:T,index:E,status:_,type:A}=N,L=["finished","skipped"];if(T==="close"){n(P=>({...P,isRunning:!1,stepIndex:0}));return}L.includes(_)?n(P=>(_==="finished"&&P.activeTourId&&setTimeout(()=>w(P.activeTourId),0),{...P,isRunning:!1,stepIndex:0})):A==="step:after"&&(T==="next"?n(P=>({...P,stepIndex:E+1})):T==="prev"&&n(P=>({...P,stepIndex:E-1})))},[w]),k=b.useCallback(N=>i.has(N),[i]),j=b.useCallback(N=>{a(T=>{const E=new Set(T);return E.delete(N),bA(E),E})},[]);return o.jsx(RH.Provider,{value:{state:e,tours:r.current,registerTour:l,unregisterTour:c,startTour:d,stopTour:h,goToStep:m,nextStep:g,prevStep:x,getCurrentSteps:y,handleJoyrideCallback:S,isTourCompleted:k,markTourCompleted:w,resetTourCompleted:j},children:t})}function PH(t){return e=>typeof e===t}var kpe=PH("function"),Ope=t=>t===null,wA=t=>Object.prototype.toString.call(t).slice(8,-1)==="RegExp",SA=t=>!jpe(t)&&!Ope(t)&&(kpe(t)||typeof t=="object"),jpe=PH("undefined");function Npe(t,e){const{length:n}=t;if(n!==e.length)return!1;for(let r=n;r--!==0;)if(!ei(t[r],e[r]))return!1;return!0}function Cpe(t,e){if(t.byteLength!==e.byteLength)return!1;const n=new DataView(t.buffer),r=new DataView(e.buffer);let s=t.byteLength;for(;s--;)if(n.getUint8(s)!==r.getUint8(s))return!1;return!0}function Tpe(t,e){if(t.size!==e.size)return!1;for(const n of t.entries())if(!e.has(n[0]))return!1;for(const n of t.entries())if(!ei(n[1],e.get(n[0])))return!1;return!0}function Epe(t,e){if(t.size!==e.size)return!1;for(const n of t.entries())if(!e.has(n[0]))return!1;return!0}function ei(t,e){if(t===e)return!0;if(t&&SA(t)&&e&&SA(e)){if(t.constructor!==e.constructor)return!1;if(Array.isArray(t)&&Array.isArray(e))return Npe(t,e);if(t instanceof Map&&e instanceof Map)return Tpe(t,e);if(t instanceof Set&&e instanceof Set)return Epe(t,e);if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return Cpe(t,e);if(wA(t)&&wA(e))return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(let s=n.length;s--!==0;)if(!Object.prototype.hasOwnProperty.call(e,n[s]))return!1;for(let s=n.length;s--!==0;){const i=n[s];if(!(i==="_owner"&&t.$$typeof)&&!ei(t[i],e[i]))return!1}return!0}return Number.isNaN(t)&&Number.isNaN(e)?!0:t===e}var _pe=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"],Ape=["bigint","boolean","null","number","string","symbol","undefined"];function Tb(t){const e=Object.prototype.toString.call(t).slice(8,-1);if(/HTML\w+Element/.test(e))return"HTMLElement";if(Mpe(e))return e}function ro(t){return e=>Tb(e)===t}function Mpe(t){return _pe.includes(t)}function Rf(t){return e=>typeof e===t}function Rpe(t){return Ape.includes(t)}var Dpe=["innerHTML","ownerDocument","style","attributes","nodeValue"];function ct(t){if(t===null)return"null";switch(typeof t){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(ct.array(t))return"Array";if(ct.plainFunction(t))return"Function";const e=Tb(t);return e||"Object"}ct.array=Array.isArray;ct.arrayOf=(t,e)=>!ct.array(t)&&!ct.function(e)?!1:t.every(n=>e(n));ct.asyncGeneratorFunction=t=>Tb(t)==="AsyncGeneratorFunction";ct.asyncFunction=ro("AsyncFunction");ct.bigint=Rf("bigint");ct.boolean=t=>t===!0||t===!1;ct.date=ro("Date");ct.defined=t=>!ct.undefined(t);ct.domElement=t=>ct.object(t)&&!ct.plainObject(t)&&t.nodeType===1&&ct.string(t.nodeName)&&Dpe.every(e=>e in t);ct.empty=t=>ct.string(t)&&t.length===0||ct.array(t)&&t.length===0||ct.object(t)&&!ct.map(t)&&!ct.set(t)&&Object.keys(t).length===0||ct.set(t)&&t.size===0||ct.map(t)&&t.size===0;ct.error=ro("Error");ct.function=Rf("function");ct.generator=t=>ct.iterable(t)&&ct.function(t.next)&&ct.function(t.throw);ct.generatorFunction=ro("GeneratorFunction");ct.instanceOf=(t,e)=>!t||!e?!1:Object.getPrototypeOf(t)===e.prototype;ct.iterable=t=>!ct.nullOrUndefined(t)&&ct.function(t[Symbol.iterator]);ct.map=ro("Map");ct.nan=t=>Number.isNaN(t);ct.null=t=>t===null;ct.nullOrUndefined=t=>ct.null(t)||ct.undefined(t);ct.number=t=>Rf("number")(t)&&!ct.nan(t);ct.numericString=t=>ct.string(t)&&t.length>0&&!Number.isNaN(Number(t));ct.object=t=>!ct.nullOrUndefined(t)&&(ct.function(t)||typeof t=="object");ct.oneOf=(t,e)=>ct.array(t)?t.indexOf(e)>-1:!1;ct.plainFunction=ro("Function");ct.plainObject=t=>{if(Tb(t)!=="Object")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.getPrototypeOf({})};ct.primitive=t=>ct.null(t)||Rpe(typeof t);ct.promise=ro("Promise");ct.propertyOf=(t,e,n)=>{if(!ct.object(t)||!e)return!1;const r=t[e];return ct.function(n)?n(r):ct.defined(r)};ct.regexp=ro("RegExp");ct.set=ro("Set");ct.string=Rf("string");ct.symbol=Rf("symbol");ct.undefined=Rf("undefined");ct.weakMap=ro("WeakMap");ct.weakSet=ro("WeakSet");var ft=ct;function Ppe(...t){return t.every(e=>ft.string(e)||ft.array(e)||ft.plainObject(e))}function zpe(t,e,n){return zH(t,e)?[t,e].every(ft.array)?!t.some(CA(n))&&e.some(CA(n)):[t,e].every(ft.plainObject)?!Object.entries(t).some(NA(n))&&Object.entries(e).some(NA(n)):e===n:!1}function kA(t,e,n){const{actual:r,key:s,previous:i,type:a}=n,l=To(t,s),c=To(e,s);let d=[l,c].every(ft.number)&&(a==="increased"?lc);return ft.undefined(r)||(d=d&&c===r),ft.undefined(i)||(d=d&&l===i),d}function OA(t,e,n){const{key:r,type:s,value:i}=n,a=To(t,r),l=To(e,r),c=s==="added"?a:l,d=s==="added"?l:a;if(!ft.nullOrUndefined(i)){if(ft.defined(c)){if(ft.array(c)||ft.plainObject(c))return zpe(c,d,i)}else return ei(d,i);return!1}return[a,l].every(ft.array)?!d.every($6(c)):[a,l].every(ft.plainObject)?Ipe(Object.keys(c),Object.keys(d)):![a,l].every(h=>ft.primitive(h)&&ft.defined(h))&&(s==="added"?!ft.defined(a)&&ft.defined(l):ft.defined(a)&&!ft.defined(l))}function jA(t,e,{key:n}={}){let r=To(t,n),s=To(e,n);if(!zH(r,s))throw new TypeError("Inputs have different types");if(!Ppe(r,s))throw new TypeError("Inputs don't have length");return[r,s].every(ft.plainObject)&&(r=Object.keys(r),s=Object.keys(s)),[r,s]}function NA(t){return([e,n])=>ft.array(t)?ei(t,n)||t.some(r=>ei(r,n)||ft.array(n)&&$6(n)(r)):ft.plainObject(t)&&t[e]?!!t[e]&&ei(t[e],n):ei(t,n)}function Ipe(t,e){return e.some(n=>!t.includes(n))}function CA(t){return e=>ft.array(t)?t.some(n=>ei(n,e)||ft.array(e)&&$6(e)(n)):ei(t,e)}function Vm(t,e){return ft.array(t)?t.some(n=>ei(n,e)):ei(t,e)}function $6(t){return e=>t.some(n=>ei(n,e))}function zH(...t){return t.every(ft.array)||t.every(ft.number)||t.every(ft.plainObject)||t.every(ft.string)}function To(t,e){return ft.plainObject(t)||ft.array(t)?ft.string(e)?e.split(".").reduce((r,s)=>r&&r[s],t):ft.number(e)?t[e]:t:t}function uy(t,e){if([t,e].some(ft.nullOrUndefined))throw new Error("Missing required parameters");if(![t,e].every(h=>ft.plainObject(h)||ft.array(h)))throw new Error("Expected plain objects or array");return{added:(h,m)=>{try{return OA(t,e,{key:h,type:"added",value:m})}catch{return!1}},changed:(h,m,g)=>{try{const x=To(t,h),y=To(e,h),w=ft.defined(m),S=ft.defined(g);if(w||S){const k=S?Vm(g,x):!Vm(m,x),j=Vm(m,y);return k&&j}return[x,y].every(ft.array)||[x,y].every(ft.plainObject)?!ei(x,y):x!==y}catch{return!1}},changedFrom:(h,m,g)=>{if(!ft.defined(h))return!1;try{const x=To(t,h),y=To(e,h),w=ft.defined(g);return Vm(m,x)&&(w?Vm(g,y):!w)}catch{return!1}},decreased:(h,m,g)=>{if(!ft.defined(h))return!1;try{return kA(t,e,{key:h,actual:m,previous:g,type:"decreased"})}catch{return!1}},emptied:h=>{try{const[m,g]=jA(t,e,{key:h});return!!m.length&&!g.length}catch{return!1}},filled:h=>{try{const[m,g]=jA(t,e,{key:h});return!m.length&&!!g.length}catch{return!1}},increased:(h,m,g)=>{if(!ft.defined(h))return!1;try{return kA(t,e,{key:h,actual:m,previous:g,type:"increased"})}catch{return!1}},removed:(h,m)=>{try{return OA(t,e,{key:h,type:"removed",value:m})}catch{return!1}}}}var xS,TA;function Lpe(){if(TA)return xS;TA=1;var t=new Error("Element already at target scroll position"),e=new Error("Scroll cancelled"),n=Math.min,r=Date.now;xS={left:s("scrollLeft"),top:s("scrollTop")};function s(l){return function(d,h,m,g){m=m||{},typeof m=="function"&&(g=m,m={}),typeof g!="function"&&(g=a);var x=r(),y=d[l],w=m.ease||i,S=isNaN(m.duration)?350:+m.duration,k=!1;return y===h?g(t,d[l]):requestAnimationFrame(N),j;function j(){k=!0}function N(T){if(k)return g(e,d[l]);var E=r(),_=n(1,(E-x)/S),A=w(_);d[l]=A*(h-y)+y,_<1?requestAnimationFrame(N):requestAnimationFrame(function(){g(null,d[l])})}}}function i(l){return .5*(1-Math.cos(Math.PI*l))}function a(){}return xS}var Bpe=Lpe();const Fpe=gd(Bpe);var yv={exports:{}},qpe=yv.exports,EA;function $pe(){return EA||(EA=1,(function(t){(function(e,n){t.exports?t.exports=n():e.Scrollparent=n()})(qpe,function(){function e(r){var s=getComputedStyle(r,null).getPropertyValue("overflow");return s.indexOf("scroll")>-1||s.indexOf("auto")>-1}function n(r){if(r instanceof HTMLElement||r instanceof SVGElement){for(var s=r.parentNode;s.parentNode;){if(e(s))return s;s=s.parentNode}return document.scrollingElement||document.documentElement}}return n})})(yv)),yv.exports}var Hpe=$pe();const IH=gd(Hpe);var vS,_A;function Qpe(){if(_A)return vS;_A=1;var t=function(r){return Object.prototype.hasOwnProperty.call(r,"props")},e=function(r,s){return r+n(s)},n=function(r){return r===null||typeof r=="boolean"||typeof r>"u"?"":typeof r=="number"?r.toString():typeof r=="string"?r:Array.isArray(r)?r.reduce(e,""):t(r)&&Object.prototype.hasOwnProperty.call(r.props,"children")?n(r.props.children):""};return n.default=n,vS=n,vS}var Vpe=Qpe();const AA=gd(Vpe);var yS,MA;function Upe(){if(MA)return yS;MA=1;var t=function(j){return e(j)&&!n(j)};function e(k){return!!k&&typeof k=="object"}function n(k){var j=Object.prototype.toString.call(k);return j==="[object RegExp]"||j==="[object Date]"||i(k)}var r=typeof Symbol=="function"&&Symbol.for,s=r?Symbol.for("react.element"):60103;function i(k){return k.$$typeof===s}function a(k){return Array.isArray(k)?[]:{}}function l(k,j){return j.clone!==!1&&j.isMergeableObject(k)?w(a(k),k,j):k}function c(k,j,N){return k.concat(j).map(function(T){return l(T,N)})}function d(k,j){if(!j.customMerge)return w;var N=j.customMerge(k);return typeof N=="function"?N:w}function h(k){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(k).filter(function(j){return Object.propertyIsEnumerable.call(k,j)}):[]}function m(k){return Object.keys(k).concat(h(k))}function g(k,j){try{return j in k}catch{return!1}}function x(k,j){return g(k,j)&&!(Object.hasOwnProperty.call(k,j)&&Object.propertyIsEnumerable.call(k,j))}function y(k,j,N){var T={};return N.isMergeableObject(k)&&m(k).forEach(function(E){T[E]=l(k[E],N)}),m(j).forEach(function(E){x(k,E)||(g(k,E)&&N.isMergeableObject(j[E])?T[E]=d(E,N)(k[E],j[E],N):T[E]=l(j[E],N))}),T}function w(k,j,N){N=N||{},N.arrayMerge=N.arrayMerge||c,N.isMergeableObject=N.isMergeableObject||t,N.cloneUnlessOtherwiseSpecified=l;var T=Array.isArray(j),E=Array.isArray(k),_=T===E;return _?T?N.arrayMerge(k,j,N):y(k,j,N):l(j,N)}w.all=function(j,N){if(!Array.isArray(j))throw new Error("first argument should be an array");return j.reduce(function(T,E){return w(T,E,N)},{})};var S=w;return yS=S,yS}var Wpe=Upe();const Va=gd(Wpe);var eg=typeof window<"u"&&typeof document<"u"&&typeof navigator<"u",Gpe=(function(){for(var t=["Edge","Trident","Firefox"],e=0;e=0)return 1;return 0})();function Xpe(t){var e=!1;return function(){e||(e=!0,window.Promise.resolve().then(function(){e=!1,t()}))}}function Ype(t){var e=!1;return function(){e||(e=!0,setTimeout(function(){e=!1,t()},Gpe))}}var Kpe=eg&&window.Promise,Zpe=Kpe?Xpe:Ype;function LH(t){var e={};return t&&e.toString.call(t)==="[object Function]"}function bd(t,e){if(t.nodeType!==1)return[];var n=t.ownerDocument.defaultView,r=n.getComputedStyle(t,null);return e?r[e]:r}function H6(t){return t.nodeName==="HTML"?t:t.parentNode||t.host}function tg(t){if(!t)return document.body;switch(t.nodeName){case"HTML":case"BODY":return t.ownerDocument.body;case"#document":return t.body}var e=bd(t),n=e.overflow,r=e.overflowX,s=e.overflowY;return/(auto|scroll|overlay)/.test(n+s+r)?t:tg(H6(t))}function BH(t){return t&&t.referenceNode?t.referenceNode:t}var RA=eg&&!!(window.MSInputMethodContext&&document.documentMode),DA=eg&&/MSIE 10/.test(navigator.userAgent);function Df(t){return t===11?RA:t===10?DA:RA||DA}function lf(t){if(!t)return document.documentElement;for(var e=Df(10)?document.body:null,n=t.offsetParent||null;n===e&&t.nextElementSibling;)n=(t=t.nextElementSibling).offsetParent;var r=n&&n.nodeName;return!r||r==="BODY"||r==="HTML"?t?t.ownerDocument.documentElement:document.documentElement:["TH","TD","TABLE"].indexOf(n.nodeName)!==-1&&bd(n,"position")==="static"?lf(n):n}function Jpe(t){var e=t.nodeName;return e==="BODY"?!1:e==="HTML"||lf(t.firstElementChild)===t}function xO(t){return t.parentNode!==null?xO(t.parentNode):t}function dy(t,e){if(!t||!t.nodeType||!e||!e.nodeType)return document.documentElement;var n=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?t:e,s=n?e:t,i=document.createRange();i.setStart(r,0),i.setEnd(s,0);var a=i.commonAncestorContainer;if(t!==a&&e!==a||r.contains(s))return Jpe(a)?a:lf(a);var l=xO(t);return l.host?dy(l.host,e):dy(t,xO(e).host)}function cf(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"top",n=e==="top"?"scrollTop":"scrollLeft",r=t.nodeName;if(r==="BODY"||r==="HTML"){var s=t.ownerDocument.documentElement,i=t.ownerDocument.scrollingElement||s;return i[n]}return t[n]}function ege(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=cf(e,"top"),s=cf(e,"left"),i=n?-1:1;return t.top+=r*i,t.bottom+=r*i,t.left+=s*i,t.right+=s*i,t}function PA(t,e){var n=e==="x"?"Left":"Top",r=n==="Left"?"Right":"Bottom";return parseFloat(t["border"+n+"Width"])+parseFloat(t["border"+r+"Width"])}function zA(t,e,n,r){return Math.max(e["offset"+t],e["scroll"+t],n["client"+t],n["offset"+t],n["scroll"+t],Df(10)?parseInt(n["offset"+t])+parseInt(r["margin"+(t==="Height"?"Top":"Left")])+parseInt(r["margin"+(t==="Height"?"Bottom":"Right")]):0)}function FH(t){var e=t.body,n=t.documentElement,r=Df(10)&&getComputedStyle(n);return{height:zA("Height",e,n,r),width:zA("Width",e,n,r)}}var tge=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},nge=(function(){function t(e,n){for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!1,r=Df(10),s=e.nodeName==="HTML",i=vO(t),a=vO(e),l=tg(t),c=bd(e),d=parseFloat(c.borderTopWidth),h=parseFloat(c.borderLeftWidth);n&&s&&(a.top=Math.max(a.top,0),a.left=Math.max(a.left,0));var m=Jc({top:i.top-a.top-d,left:i.left-a.left-h,width:i.width,height:i.height});if(m.marginTop=0,m.marginLeft=0,!r&&s){var g=parseFloat(c.marginTop),x=parseFloat(c.marginLeft);m.top-=d-g,m.bottom-=d-g,m.left-=h-x,m.right-=h-x,m.marginTop=g,m.marginLeft=x}return(r&&!n?e.contains(l):e===l&&l.nodeName!=="BODY")&&(m=ege(m,e)),m}function rge(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=t.ownerDocument.documentElement,r=Q6(t,n),s=Math.max(n.clientWidth,window.innerWidth||0),i=Math.max(n.clientHeight,window.innerHeight||0),a=e?0:cf(n),l=e?0:cf(n,"left"),c={top:a-r.top+r.marginTop,left:l-r.left+r.marginLeft,width:s,height:i};return Jc(c)}function qH(t){var e=t.nodeName;if(e==="BODY"||e==="HTML")return!1;if(bd(t,"position")==="fixed")return!0;var n=H6(t);return n?qH(n):!1}function $H(t){if(!t||!t.parentElement||Df())return document.documentElement;for(var e=t.parentElement;e&&bd(e,"transform")==="none";)e=e.parentElement;return e||document.documentElement}function V6(t,e,n,r){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,i={top:0,left:0},a=s?$H(t):dy(t,BH(e));if(r==="viewport")i=rge(a,s);else{var l=void 0;r==="scrollParent"?(l=tg(H6(e)),l.nodeName==="BODY"&&(l=t.ownerDocument.documentElement)):r==="window"?l=t.ownerDocument.documentElement:l=r;var c=Q6(l,a,s);if(l.nodeName==="HTML"&&!qH(a)){var d=FH(t.ownerDocument),h=d.height,m=d.width;i.top+=c.top-c.marginTop,i.bottom=h+c.top,i.left+=c.left-c.marginLeft,i.right=m+c.left}else i=c}n=n||0;var g=typeof n=="number";return i.left+=g?n:n.left||0,i.top+=g?n:n.top||0,i.right-=g?n:n.right||0,i.bottom-=g?n:n.bottom||0,i}function sge(t){var e=t.width,n=t.height;return e*n}function HH(t,e,n,r,s){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0;if(t.indexOf("auto")===-1)return t;var a=V6(n,r,i,s),l={top:{width:a.width,height:e.top-a.top},right:{width:a.right-e.right,height:a.height},bottom:{width:a.width,height:a.bottom-e.bottom},left:{width:e.left-a.left,height:a.height}},c=Object.keys(l).map(function(g){return wa({key:g},l[g],{area:sge(l[g])})}).sort(function(g,x){return x.area-g.area}),d=c.filter(function(g){var x=g.width,y=g.height;return x>=n.clientWidth&&y>=n.clientHeight}),h=d.length>0?d[0].key:c[0].key,m=t.split("-")[1];return h+(m?"-"+m:"")}function QH(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,s=r?$H(e):dy(e,BH(n));return Q6(n,s,r)}function VH(t){var e=t.ownerDocument.defaultView,n=e.getComputedStyle(t),r=parseFloat(n.marginTop||0)+parseFloat(n.marginBottom||0),s=parseFloat(n.marginLeft||0)+parseFloat(n.marginRight||0),i={width:t.offsetWidth+s,height:t.offsetHeight+r};return i}function hy(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,function(n){return e[n]})}function UH(t,e,n){n=n.split("-")[0];var r=VH(t),s={width:r.width,height:r.height},i=["right","left"].indexOf(n)!==-1,a=i?"top":"left",l=i?"left":"top",c=i?"height":"width",d=i?"width":"height";return s[a]=e[a]+e[c]/2-r[c]/2,n===l?s[l]=e[l]-r[d]:s[l]=e[hy(l)],s}function ng(t,e){return Array.prototype.find?t.find(e):t.filter(e)[0]}function ige(t,e,n){if(Array.prototype.findIndex)return t.findIndex(function(s){return s[e]===n});var r=ng(t,function(s){return s[e]===n});return t.indexOf(r)}function WH(t,e,n){var r=n===void 0?t:t.slice(0,ige(t,"name",n));return r.forEach(function(s){s.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var i=s.function||s.fn;s.enabled&&LH(i)&&(e.offsets.popper=Jc(e.offsets.popper),e.offsets.reference=Jc(e.offsets.reference),e=i(e,s))}),e}function age(){if(!this.state.isDestroyed){var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};t.offsets.reference=QH(this.state,this.popper,this.reference,this.options.positionFixed),t.placement=HH(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),t.originalPlacement=t.placement,t.positionFixed=this.options.positionFixed,t.offsets.popper=UH(this.popper,t.offsets.reference,t.placement),t.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",t=WH(this.modifiers,t),this.state.isCreated?this.options.onUpdate(t):(this.state.isCreated=!0,this.options.onCreate(t))}}function GH(t,e){return t.some(function(n){var r=n.name,s=n.enabled;return s&&r===e})}function U6(t){for(var e=[!1,"ms","Webkit","Moz","O"],n=t.charAt(0).toUpperCase()+t.slice(1),r=0;ra[x]&&(t.offsets.popper[m]+=l[m]+y-a[x]),t.offsets.popper=Jc(t.offsets.popper);var w=l[m]+l[d]/2-y/2,S=bd(t.instance.popper),k=parseFloat(S["margin"+h]),j=parseFloat(S["border"+h+"Width"]),N=w-t.offsets.popper[m]-k-j;return N=Math.max(Math.min(a[d]-y,N),0),t.arrowElement=r,t.offsets.arrow=(n={},uf(n,m,Math.round(N)),uf(n,g,""),n),t}function yge(t){return t==="end"?"start":t==="start"?"end":t}var ZH=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],bS=ZH.slice(3);function IA(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=bS.indexOf(t),r=bS.slice(n+1).concat(bS.slice(0,n));return e?r.reverse():r}var wS={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function bge(t,e){if(GH(t.instance.modifiers,"inner")||t.flipped&&t.placement===t.originalPlacement)return t;var n=V6(t.instance.popper,t.instance.reference,e.padding,e.boundariesElement,t.positionFixed),r=t.placement.split("-")[0],s=hy(r),i=t.placement.split("-")[1]||"",a=[];switch(e.behavior){case wS.FLIP:a=[r,s];break;case wS.CLOCKWISE:a=IA(r);break;case wS.COUNTERCLOCKWISE:a=IA(r,!0);break;default:a=e.behavior}return a.forEach(function(l,c){if(r!==l||a.length===c+1)return t;r=t.placement.split("-")[0],s=hy(r);var d=t.offsets.popper,h=t.offsets.reference,m=Math.floor,g=r==="left"&&m(d.right)>m(h.left)||r==="right"&&m(d.left)m(h.top)||r==="bottom"&&m(d.top)m(n.right),w=m(d.top)m(n.bottom),k=r==="left"&&x||r==="right"&&y||r==="top"&&w||r==="bottom"&&S,j=["top","bottom"].indexOf(r)!==-1,N=!!e.flipVariations&&(j&&i==="start"&&x||j&&i==="end"&&y||!j&&i==="start"&&w||!j&&i==="end"&&S),T=!!e.flipVariationsByContent&&(j&&i==="start"&&y||j&&i==="end"&&x||!j&&i==="start"&&S||!j&&i==="end"&&w),E=N||T;(g||k||E)&&(t.flipped=!0,(g||k)&&(r=a[c+1]),E&&(i=yge(i)),t.placement=r+(i?"-"+i:""),t.offsets.popper=wa({},t.offsets.popper,UH(t.instance.popper,t.offsets.reference,t.placement)),t=WH(t.instance.modifiers,t,"flip"))}),t}function wge(t){var e=t.offsets,n=e.popper,r=e.reference,s=t.placement.split("-")[0],i=Math.floor,a=["top","bottom"].indexOf(s)!==-1,l=a?"right":"bottom",c=a?"left":"top",d=a?"width":"height";return n[l]i(r[l])&&(t.offsets.popper[c]=i(r[l])),t}function Sge(t,e,n,r){var s=t.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),i=+s[1],a=s[2];if(!i)return t;if(a.indexOf("%")===0){var l=void 0;switch(a){case"%p":l=n;break;case"%":case"%r":default:l=r}var c=Jc(l);return c[e]/100*i}else if(a==="vh"||a==="vw"){var d=void 0;return a==="vh"?d=Math.max(document.documentElement.clientHeight,window.innerHeight||0):d=Math.max(document.documentElement.clientWidth,window.innerWidth||0),d/100*i}else return i}function kge(t,e,n,r){var s=[0,0],i=["right","left"].indexOf(r)!==-1,a=t.split(/(\+|\-)/).map(function(h){return h.trim()}),l=a.indexOf(ng(a,function(h){return h.search(/,|\s/)!==-1}));a[l]&&a[l].indexOf(",")===-1&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var c=/\s*,\s*|\s+/,d=l!==-1?[a.slice(0,l).concat([a[l].split(c)[0]]),[a[l].split(c)[1]].concat(a.slice(l+1))]:[a];return d=d.map(function(h,m){var g=(m===1?!i:i)?"height":"width",x=!1;return h.reduce(function(y,w){return y[y.length-1]===""&&["+","-"].indexOf(w)!==-1?(y[y.length-1]=w,x=!0,y):x?(y[y.length-1]+=w,x=!1,y):y.concat(w)},[]).map(function(y){return Sge(y,g,e,n)})}),d.forEach(function(h,m){h.forEach(function(g,x){W6(g)&&(s[m]+=g*(h[x-1]==="-"?-1:1))})}),s}function Oge(t,e){var n=e.offset,r=t.placement,s=t.offsets,i=s.popper,a=s.reference,l=r.split("-")[0],c=void 0;return W6(+n)?c=[+n,0]:c=kge(n,i,a,l),l==="left"?(i.top+=c[0],i.left-=c[1]):l==="right"?(i.top+=c[0],i.left+=c[1]):l==="top"?(i.left+=c[0],i.top-=c[1]):l==="bottom"&&(i.left+=c[0],i.top+=c[1]),t.popper=i,t}function jge(t,e){var n=e.boundariesElement||lf(t.instance.popper);t.instance.reference===n&&(n=lf(n));var r=U6("transform"),s=t.instance.popper.style,i=s.top,a=s.left,l=s[r];s.top="",s.left="",s[r]="";var c=V6(t.instance.popper,t.instance.reference,e.padding,n,t.positionFixed);s.top=i,s.left=a,s[r]=l,e.boundaries=c;var d=e.priority,h=t.offsets.popper,m={primary:function(x){var y=h[x];return h[x]c[x]&&!e.escapeWithReference&&(w=Math.min(h[y],c[x]-(x==="right"?h.width:h.height))),uf({},y,w)}};return d.forEach(function(g){var x=["left","top"].indexOf(g)!==-1?"primary":"secondary";h=wa({},h,m[x](g))}),t.offsets.popper=h,t}function Nge(t){var e=t.placement,n=e.split("-")[0],r=e.split("-")[1];if(r){var s=t.offsets,i=s.reference,a=s.popper,l=["bottom","top"].indexOf(n)!==-1,c=l?"left":"top",d=l?"width":"height",h={start:uf({},c,i[c]),end:uf({},c,i[c]+i[d]-a[d])};t.offsets.popper=wa({},a,h[r])}return t}function Cge(t){if(!KH(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,n=ng(t.instance.modifiers,function(r){return r.name==="preventOverflow"}).boundaries;if(e.bottomn.right||e.top>n.bottom||e.right2&&arguments[2]!==void 0?arguments[2]:{};tge(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=Zpe(this.update.bind(this)),this.options=wa({},t.Defaults,s),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(wa({},t.Defaults.modifiers,s.modifiers)).forEach(function(a){r.options.modifiers[a]=wa({},t.Defaults.modifiers[a]||{},s.modifiers?s.modifiers[a]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(a){return wa({name:a},r.options.modifiers[a])}).sort(function(a,l){return a.order-l.order}),this.modifiers.forEach(function(a){a.enabled&&LH(a.onLoad)&&a.onLoad(r.reference,r.popper,r.options,a,r.state)}),this.update();var i=this.options.eventsEnabled;i&&this.enableEventListeners(),this.state.eventsEnabled=i}return nge(t,[{key:"update",value:function(){return age.call(this)}},{key:"destroy",value:function(){return oge.call(this)}},{key:"enableEventListeners",value:function(){return cge.call(this)}},{key:"disableEventListeners",value:function(){return dge.call(this)}}]),t})();lp.Utils=(typeof window<"u"?window:global).PopperUtils;lp.placements=ZH;lp.Defaults=_ge;var Age=["innerHTML","ownerDocument","style","attributes","nodeValue"],Mge=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"],Rge=["bigint","boolean","null","number","string","symbol","undefined"];function Eb(t){var e=Object.prototype.toString.call(t).slice(8,-1);if(/HTML\w+Element/.test(e))return"HTMLElement";if(Dge(e))return e}function so(t){return function(e){return Eb(e)===t}}function Dge(t){return Mge.includes(t)}function Pf(t){return function(e){return typeof e===t}}function Pge(t){return Rge.includes(t)}function _e(t){if(t===null)return"null";switch(typeof t){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(_e.array(t))return"Array";if(_e.plainFunction(t))return"Function";var e=Eb(t);return e||"Object"}_e.array=Array.isArray;_e.arrayOf=function(t,e){return!_e.array(t)&&!_e.function(e)?!1:t.every(function(n){return e(n)})};_e.asyncGeneratorFunction=function(t){return Eb(t)==="AsyncGeneratorFunction"};_e.asyncFunction=so("AsyncFunction");_e.bigint=Pf("bigint");_e.boolean=function(t){return t===!0||t===!1};_e.date=so("Date");_e.defined=function(t){return!_e.undefined(t)};_e.domElement=function(t){return _e.object(t)&&!_e.plainObject(t)&&t.nodeType===1&&_e.string(t.nodeName)&&Age.every(function(e){return e in t})};_e.empty=function(t){return _e.string(t)&&t.length===0||_e.array(t)&&t.length===0||_e.object(t)&&!_e.map(t)&&!_e.set(t)&&Object.keys(t).length===0||_e.set(t)&&t.size===0||_e.map(t)&&t.size===0};_e.error=so("Error");_e.function=Pf("function");_e.generator=function(t){return _e.iterable(t)&&_e.function(t.next)&&_e.function(t.throw)};_e.generatorFunction=so("GeneratorFunction");_e.instanceOf=function(t,e){return!t||!e?!1:Object.getPrototypeOf(t)===e.prototype};_e.iterable=function(t){return!_e.nullOrUndefined(t)&&_e.function(t[Symbol.iterator])};_e.map=so("Map");_e.nan=function(t){return Number.isNaN(t)};_e.null=function(t){return t===null};_e.nullOrUndefined=function(t){return _e.null(t)||_e.undefined(t)};_e.number=function(t){return Pf("number")(t)&&!_e.nan(t)};_e.numericString=function(t){return _e.string(t)&&t.length>0&&!Number.isNaN(Number(t))};_e.object=function(t){return!_e.nullOrUndefined(t)&&(_e.function(t)||typeof t=="object")};_e.oneOf=function(t,e){return _e.array(t)?t.indexOf(e)>-1:!1};_e.plainFunction=so("Function");_e.plainObject=function(t){if(Eb(t)!=="Object")return!1;var e=Object.getPrototypeOf(t);return e===null||e===Object.getPrototypeOf({})};_e.primitive=function(t){return _e.null(t)||Pge(typeof t)};_e.promise=so("Promise");_e.propertyOf=function(t,e,n){if(!_e.object(t)||!e)return!1;var r=t[e];return _e.function(n)?n(r):_e.defined(r)};_e.regexp=so("RegExp");_e.set=so("Set");_e.string=Pf("string");_e.symbol=Pf("symbol");_e.undefined=Pf("undefined");_e.weakMap=so("WeakMap");_e.weakSet=so("WeakSet");function JH(t){return function(e){return typeof e===t}}var zge=JH("function"),Ige=function(t){return t===null},LA=function(t){return Object.prototype.toString.call(t).slice(8,-1)==="RegExp"},BA=function(t){return!Lge(t)&&!Ige(t)&&(zge(t)||typeof t=="object")},Lge=JH("undefined"),bO=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function Bge(t,e){var n=t.length;if(n!==e.length)return!1;for(var r=n;r--!==0;)if(!bi(t[r],e[r]))return!1;return!0}function Fge(t,e){if(t.byteLength!==e.byteLength)return!1;for(var n=new DataView(t.buffer),r=new DataView(e.buffer),s=t.byteLength;s--;)if(n.getUint8(s)!==r.getUint8(s))return!1;return!0}function qge(t,e){var n,r,s,i;if(t.size!==e.size)return!1;try{for(var a=bO(t.entries()),l=a.next();!l.done;l=a.next()){var c=l.value;if(!e.has(c[0]))return!1}}catch(m){n={error:m}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}try{for(var d=bO(t.entries()),h=d.next();!h.done;h=d.next()){var c=h.value;if(!bi(c[1],e.get(c[0])))return!1}}catch(m){s={error:m}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(s)throw s.error}}return!0}function $ge(t,e){var n,r;if(t.size!==e.size)return!1;try{for(var s=bO(t.entries()),i=s.next();!i.done;i=s.next()){var a=i.value;if(!e.has(a[0]))return!1}}catch(l){n={error:l}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return!0}function bi(t,e){if(t===e)return!0;if(t&&BA(t)&&e&&BA(e)){if(t.constructor!==e.constructor)return!1;if(Array.isArray(t)&&Array.isArray(e))return Bge(t,e);if(t instanceof Map&&e instanceof Map)return qge(t,e);if(t instanceof Set&&e instanceof Set)return $ge(t,e);if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return Fge(t,e);if(LA(t)&&LA(e))return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var s=n.length;s--!==0;)if(!Object.prototype.hasOwnProperty.call(e,n[s]))return!1;for(var s=n.length;s--!==0;){var i=n[s];if(!(i==="_owner"&&t.$$typeof)&&!bi(t[i],e[i]))return!1}return!0}return Number.isNaN(t)&&Number.isNaN(e)?!0:t===e}function Hge(){for(var t=[],e=0;ec);return _e.undefined(r)||(d=d&&c===r),_e.undefined(i)||(d=d&&l===i),d}function qA(t,e,n){var r=n.key,s=n.type,i=n.value,a=Eo(t,r),l=Eo(e,r),c=s==="added"?a:l,d=s==="added"?l:a;if(!_e.nullOrUndefined(i)){if(_e.defined(c)){if(_e.array(c)||_e.plainObject(c))return Qge(c,d,i)}else return bi(d,i);return!1}return[a,l].every(_e.array)?!d.every(G6(c)):[a,l].every(_e.plainObject)?Vge(Object.keys(c),Object.keys(d)):![a,l].every(function(h){return _e.primitive(h)&&_e.defined(h)})&&(s==="added"?!_e.defined(a)&&_e.defined(l):_e.defined(a)&&!_e.defined(l))}function $A(t,e,n){var r=n===void 0?{}:n,s=r.key,i=Eo(t,s),a=Eo(e,s);if(!eQ(i,a))throw new TypeError("Inputs have different types");if(!Hge(i,a))throw new TypeError("Inputs don't have length");return[i,a].every(_e.plainObject)&&(i=Object.keys(i),a=Object.keys(a)),[i,a]}function HA(t){return function(e){var n=e[0],r=e[1];return _e.array(t)?bi(t,r)||t.some(function(s){return bi(s,r)||_e.array(r)&&G6(r)(s)}):_e.plainObject(t)&&t[n]?!!t[n]&&bi(t[n],r):bi(t,r)}}function Vge(t,e){return e.some(function(n){return!t.includes(n)})}function QA(t){return function(e){return _e.array(t)?t.some(function(n){return bi(n,e)||_e.array(e)&&G6(e)(n)}):bi(t,e)}}function Um(t,e){return _e.array(t)?t.some(function(n){return bi(n,e)}):bi(t,e)}function G6(t){return function(e){return t.some(function(n){return bi(n,e)})}}function eQ(){for(var t=[],e=0;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Xge(t,e){if(t==null)return{};var n={},r=Object.keys(t),s,i;for(i=0;i=0)&&(n[s]=t[s]);return n}function tQ(t,e){if(t==null)return{};var n=Xge(t,e),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Nl(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Yge(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nl(t)}function ag(t){var e=Gge();return function(){var r=fy(t),s;if(e){var i=fy(this).constructor;s=Reflect.construct(r,arguments,i)}else s=r.apply(this,arguments);return Yge(this,s)}}function Kge(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nQ(t){var e=Kge(t,"string");return typeof e=="symbol"?e:String(e)}var Zge={flip:{padding:20},preventOverflow:{padding:10}},Jge="The typeValidator argument must be a function with the signature function(props, propName, componentName).",exe="The error message is optional, but must be a string if provided.";function txe(t,e,n,r){return typeof t=="boolean"?t:typeof t=="function"?t(e,n,r):t?!!t:!1}function nxe(t,e){return Object.hasOwnProperty.call(t,e)}function rxe(t,e,n,r){return new Error("Required ".concat(t[e]," `").concat(e,"` was not specified in `").concat(n,"`."))}function sxe(t,e){if(typeof t!="function")throw new TypeError(Jge);if(e&&typeof e!="string")throw new TypeError(exe)}function UA(t,e,n){return sxe(t,n),function(r,s,i){for(var a=arguments.length,l=new Array(a>3?a-3:0),c=3;c3&&arguments[3]!==void 0?arguments[3]:!1;t.addEventListener(e,n,r)}function axe(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;t.removeEventListener(e,n,r)}function oxe(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s;s=function(a){n(a),axe(t,e,s)},ixe(t,e,s,r)}function WA(){}var rQ=(function(t){ig(n,t);var e=ag(n);function n(){return rg(this,n),e.apply(this,arguments)}return sg(n,[{key:"componentDidMount",value:function(){vo()&&(this.node||this.appendNode(),Wm||this.renderPortal())}},{key:"componentDidUpdate",value:function(){vo()&&(Wm||this.renderPortal())}},{key:"componentWillUnmount",value:function(){!vo()||!this.node||(Wm||J1.unmountComponentAtNode(this.node),this.node&&this.node.parentNode===document.body&&(document.body.removeChild(this.node),this.node=void 0))}},{key:"appendNode",value:function(){var s=this.props,i=s.id,a=s.zIndex;this.node||(this.node=document.createElement("div"),i&&(this.node.id=i),a&&(this.node.style.zIndex=a),document.body.appendChild(this.node))}},{key:"renderPortal",value:function(){if(!vo())return null;var s=this.props,i=s.children,a=s.setRef;if(this.node||this.appendNode(),Wm)return J1.createPortal(i,this.node);var l=J1.unstable_renderSubtreeIntoContainer(this,i.length>1?ae.createElement("div",null,i):i[0],this.node);return a(l),null}},{key:"renderReact16",value:function(){var s=this.props,i=s.hasChildren,a=s.placement,l=s.target;return i?this.renderPortal():l||a==="center"?this.renderPortal():null}},{key:"render",value:function(){return Wm?this.renderReact16():null}}]),n})(ae.Component);qs(rQ,"propTypes",{children:Ge.oneOfType([Ge.element,Ge.array]),hasChildren:Ge.bool,id:Ge.oneOfType([Ge.string,Ge.number]),placement:Ge.string,setRef:Ge.func.isRequired,target:Ge.oneOfType([Ge.object,Ge.string]),zIndex:Ge.number});var sQ=(function(t){ig(n,t);var e=ag(n);function n(){return rg(this,n),e.apply(this,arguments)}return sg(n,[{key:"parentStyle",get:function(){var s=this.props,i=s.placement,a=s.styles,l=a.arrow.length,c={pointerEvents:"none",position:"absolute",width:"100%"};return i.startsWith("top")?(c.bottom=0,c.left=0,c.right=0,c.height=l):i.startsWith("bottom")?(c.left=0,c.right=0,c.top=0,c.height=l):i.startsWith("left")?(c.right=0,c.top=0,c.bottom=0):i.startsWith("right")&&(c.left=0,c.top=0),c}},{key:"render",value:function(){var s=this.props,i=s.placement,a=s.setArrowRef,l=s.styles,c=l.arrow,d=c.color,h=c.display,m=c.length,g=c.margin,x=c.position,y=c.spread,w={display:h,position:x},S,k=y,j=m;return i.startsWith("top")?(S="0,0 ".concat(k/2,",").concat(j," ").concat(k,",0"),w.bottom=0,w.marginLeft=g,w.marginRight=g):i.startsWith("bottom")?(S="".concat(k,",").concat(j," ").concat(k/2,",0 0,").concat(j),w.top=0,w.marginLeft=g,w.marginRight=g):i.startsWith("left")?(j=y,k=m,S="0,0 ".concat(k,",").concat(j/2," 0,").concat(j),w.right=0,w.marginTop=g,w.marginBottom=g):i.startsWith("right")&&(j=y,k=m,S="".concat(k,",").concat(j," ").concat(k,",0 0,").concat(j/2),w.left=0,w.marginTop=g,w.marginBottom=g),ae.createElement("div",{className:"__floater__arrow",style:this.parentStyle},ae.createElement("span",{ref:a,style:w},ae.createElement("svg",{width:k,height:j,version:"1.1",xmlns:"http://www.w3.org/2000/svg"},ae.createElement("polygon",{points:S,fill:d}))))}}]),n})(ae.Component);qs(sQ,"propTypes",{placement:Ge.string.isRequired,setArrowRef:Ge.func.isRequired,styles:Ge.object.isRequired});var lxe=["color","height","width"];function iQ(t){var e=t.handleClick,n=t.styles,r=n.color,s=n.height,i=n.width,a=tQ(n,lxe);return ae.createElement("button",{"aria-label":"close",onClick:e,style:a,type:"button"},ae.createElement("svg",{width:"".concat(i,"px"),height:"".concat(s,"px"),viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid"},ae.createElement("g",null,ae.createElement("path",{d:"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z",fill:r}))))}iQ.propTypes={handleClick:Ge.func.isRequired,styles:Ge.object.isRequired};function aQ(t){var e=t.content,n=t.footer,r=t.handleClick,s=t.open,i=t.positionWrapper,a=t.showCloseButton,l=t.title,c=t.styles,d={content:ae.isValidElement(e)?e:ae.createElement("div",{className:"__floater__content",style:c.content},e)};return l&&(d.title=ae.isValidElement(l)?l:ae.createElement("div",{className:"__floater__title",style:c.title},l)),n&&(d.footer=ae.isValidElement(n)?n:ae.createElement("div",{className:"__floater__footer",style:c.footer},n)),(a||i)&&!_e.boolean(s)&&(d.close=ae.createElement(iQ,{styles:c.close,handleClick:r})),ae.createElement("div",{className:"__floater__container",style:c.container},d.close,d.title,d.content,d.footer)}aQ.propTypes={content:Ge.node.isRequired,footer:Ge.node,handleClick:Ge.func.isRequired,open:Ge.bool,positionWrapper:Ge.bool.isRequired,showCloseButton:Ge.bool.isRequired,styles:Ge.object.isRequired,title:Ge.node};var oQ=(function(t){ig(n,t);var e=ag(n);function n(){return rg(this,n),e.apply(this,arguments)}return sg(n,[{key:"style",get:function(){var s=this.props,i=s.disableAnimation,a=s.component,l=s.placement,c=s.hideArrow,d=s.status,h=s.styles,m=h.arrow.length,g=h.floater,x=h.floaterCentered,y=h.floaterClosing,w=h.floaterOpening,S=h.floaterWithAnimation,k=h.floaterWithComponent,j={};return c||(l.startsWith("top")?j.padding="0 0 ".concat(m,"px"):l.startsWith("bottom")?j.padding="".concat(m,"px 0 0"):l.startsWith("left")?j.padding="0 ".concat(m,"px 0 0"):l.startsWith("right")&&(j.padding="0 0 0 ".concat(m,"px"))),[On.OPENING,On.OPEN].indexOf(d)!==-1&&(j=br(br({},j),w)),d===On.CLOSING&&(j=br(br({},j),y)),d===On.OPEN&&!i&&(j=br(br({},j),S)),l==="center"&&(j=br(br({},j),x)),a&&(j=br(br({},j),k)),br(br({},g),j)}},{key:"render",value:function(){var s=this.props,i=s.component,a=s.handleClick,l=s.hideArrow,c=s.setFloaterRef,d=s.status,h={},m=["__floater"];return i?ae.isValidElement(i)?h.content=ae.cloneElement(i,{closeFn:a}):h.content=i({closeFn:a}):h.content=ae.createElement(aQ,this.props),d===On.OPEN&&m.push("__floater__open"),l||(h.arrow=ae.createElement(sQ,this.props)),ae.createElement("div",{ref:c,className:m.join(" "),style:this.style},ae.createElement("div",{className:"__floater__body"},h.content,h.arrow))}}]),n})(ae.Component);qs(oQ,"propTypes",{component:Ge.oneOfType([Ge.func,Ge.element]),content:Ge.node,disableAnimation:Ge.bool.isRequired,footer:Ge.node,handleClick:Ge.func.isRequired,hideArrow:Ge.bool.isRequired,open:Ge.bool,placement:Ge.string.isRequired,positionWrapper:Ge.bool.isRequired,setArrowRef:Ge.func.isRequired,setFloaterRef:Ge.func.isRequired,showCloseButton:Ge.bool,status:Ge.string.isRequired,styles:Ge.object.isRequired,title:Ge.node});var lQ=(function(t){ig(n,t);var e=ag(n);function n(){return rg(this,n),e.apply(this,arguments)}return sg(n,[{key:"render",value:function(){var s=this.props,i=s.children,a=s.handleClick,l=s.handleMouseEnter,c=s.handleMouseLeave,d=s.setChildRef,h=s.setWrapperRef,m=s.style,g=s.styles,x;if(i)if(ae.Children.count(i)===1)if(!ae.isValidElement(i))x=ae.createElement("span",null,i);else{var y=_e.function(i.type)?"innerRef":"ref";x=ae.cloneElement(ae.Children.only(i),qs({},y,d))}else x=i;return x?ae.createElement("span",{ref:h,style:br(br({},g),m),onClick:a,onMouseEnter:l,onMouseLeave:c},x):null}}]),n})(ae.Component);qs(lQ,"propTypes",{children:Ge.node,handleClick:Ge.func.isRequired,handleMouseEnter:Ge.func.isRequired,handleMouseLeave:Ge.func.isRequired,setChildRef:Ge.func.isRequired,setWrapperRef:Ge.func.isRequired,style:Ge.object,styles:Ge.object.isRequired});var cxe={zIndex:100};function uxe(t){var e=Va(cxe,t.options||{});return{wrapper:{cursor:"help",display:"inline-flex",flexDirection:"column",zIndex:e.zIndex},wrapperPosition:{left:-1e3,position:"absolute",top:-1e3,visibility:"hidden"},floater:{display:"inline-block",filter:"drop-shadow(0 0 3px rgba(0, 0, 0, 0.3))",maxWidth:300,opacity:0,position:"relative",transition:"opacity 0.3s",visibility:"hidden",zIndex:e.zIndex},floaterOpening:{opacity:1,visibility:"visible"},floaterWithAnimation:{opacity:1,transition:"opacity 0.3s, transform 0.2s",visibility:"visible"},floaterWithComponent:{maxWidth:"100%"},floaterClosing:{opacity:0,visibility:"visible"},floaterCentered:{left:"50%",position:"fixed",top:"50%",transform:"translate(-50%, -50%)"},container:{backgroundColor:"#fff",color:"#666",minHeight:60,minWidth:200,padding:20,position:"relative",zIndex:10},title:{borderBottom:"1px solid #555",color:"#555",fontSize:18,marginBottom:5,paddingBottom:6,paddingRight:18},content:{fontSize:15},close:{backgroundColor:"transparent",border:0,borderRadius:0,color:"#555",fontSize:0,height:15,outline:"none",padding:10,position:"absolute",right:0,top:0,width:15,WebkitAppearance:"none"},footer:{borderTop:"1px solid #ccc",fontSize:13,marginTop:10,paddingTop:5},arrow:{color:"#fff",display:"inline-flex",length:16,margin:8,position:"absolute",spread:32},options:e}}var dxe=["arrow","flip","offset"],hxe=["position","top","right","bottom","left"],X6=(function(t){ig(n,t);var e=ag(n);function n(r){var s;return rg(this,n),s=e.call(this,r),qs(Nl(s),"setArrowRef",function(i){s.arrowRef=i}),qs(Nl(s),"setChildRef",function(i){s.childRef=i}),qs(Nl(s),"setFloaterRef",function(i){s.floaterRef=i}),qs(Nl(s),"setWrapperRef",function(i){s.wrapperRef=i}),qs(Nl(s),"handleTransitionEnd",function(){var i=s.state.status,a=s.props.callback;s.wrapperPopper&&s.wrapperPopper.instance.update(),s.setState({status:i===On.OPENING?On.OPEN:On.IDLE},function(){var l=s.state.status;a(l===On.OPEN?"open":"close",s.props)})}),qs(Nl(s),"handleClick",function(){var i=s.props,a=i.event,l=i.open;if(!_e.boolean(l)){var c=s.state,d=c.positionWrapper,h=c.status;(s.event==="click"||s.event==="hover"&&d)&&(O1({title:"click",data:[{event:a,status:h===On.OPEN?"closing":"opening"}],debug:s.debug}),s.toggle())}}),qs(Nl(s),"handleMouseEnter",function(){var i=s.props,a=i.event,l=i.open;if(!(_e.boolean(l)||SS())){var c=s.state.status;s.event==="hover"&&c===On.IDLE&&(O1({title:"mouseEnter",data:[{key:"originalEvent",value:a}],debug:s.debug}),clearTimeout(s.eventDelayTimeout),s.toggle())}}),qs(Nl(s),"handleMouseLeave",function(){var i=s.props,a=i.event,l=i.eventDelay,c=i.open;if(!(_e.boolean(c)||SS())){var d=s.state,h=d.status,m=d.positionWrapper;s.event==="hover"&&(O1({title:"mouseLeave",data:[{key:"originalEvent",value:a}],debug:s.debug}),l?[On.OPENING,On.OPEN].indexOf(h)!==-1&&!m&&!s.eventDelayTimeout&&(s.eventDelayTimeout=setTimeout(function(){delete s.eventDelayTimeout,s.toggle()},l*1e3)):s.toggle(On.IDLE))}}),s.state={currentPlacement:r.placement,needsUpdate:!1,positionWrapper:r.wrapperOptions.position&&!!r.target,status:On.INIT,statusWrapper:On.INIT},s._isMounted=!1,s.hasMounted=!1,vo()&&window.addEventListener("load",function(){s.popper&&s.popper.instance.update(),s.wrapperPopper&&s.wrapperPopper.instance.update()}),s}return sg(n,[{key:"componentDidMount",value:function(){if(vo()){var s=this.state.positionWrapper,i=this.props,a=i.children,l=i.open,c=i.target;this._isMounted=!0,O1({title:"init",data:{hasChildren:!!a,hasTarget:!!c,isControlled:_e.boolean(l),positionWrapper:s,target:this.target,floater:this.floaterRef},debug:this.debug}),this.hasMounted||(this.initPopper(),this.hasMounted=!0),!a&&c&&_e.boolean(l)}}},{key:"componentDidUpdate",value:function(s,i){if(vo()){var a=this.props,l=a.autoOpen,c=a.open,d=a.target,h=a.wrapperOptions,m=Uge(i,this.state),g=m.changedFrom,x=m.changed;if(s.open!==c){var y;_e.boolean(c)&&(y=c?On.OPENING:On.CLOSING),this.toggle(y)}(s.wrapperOptions.position!==h.position||s.target!==d)&&this.changeWrapperPosition(this.props),x("status",On.IDLE)&&c?this.toggle(On.OPEN):g("status",On.INIT,On.IDLE)&&l&&this.toggle(On.OPEN),this.popper&&x("status",On.OPENING)&&this.popper.instance.update(),this.floaterRef&&(x("status",On.OPENING)||x("status",On.CLOSING))&&oxe(this.floaterRef,"transitionend",this.handleTransitionEnd),x("needsUpdate",!0)&&this.rebuildPopper()}}},{key:"componentWillUnmount",value:function(){vo()&&(this._isMounted=!1,this.popper&&this.popper.instance.destroy(),this.wrapperPopper&&this.wrapperPopper.instance.destroy())}},{key:"initPopper",value:function(){var s=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.target,a=this.state.positionWrapper,l=this.props,c=l.disableFlip,d=l.getPopper,h=l.hideArrow,m=l.offset,g=l.placement,x=l.wrapperOptions,y=g==="top"||g==="bottom"?"flip":["right","bottom-end","top-end","left","top-start","bottom-start"];if(g==="center")this.setState({status:On.IDLE});else if(i&&this.floaterRef){var w=this.options,S=w.arrow,k=w.flip,j=w.offset,N=tQ(w,dxe);new lp(i,this.floaterRef,{placement:g,modifiers:br({arrow:br({enabled:!h,element:this.arrowRef},S),flip:br({enabled:!c,behavior:y},k),offset:br({offset:"0, ".concat(m,"px")},j)},N),onCreate:function(_){var A;if(s.popper=_,!((A=s.floaterRef)!==null&&A!==void 0&&A.isConnected)){s.setState({needsUpdate:!0});return}d(_,"floater"),s._isMounted&&s.setState({currentPlacement:_.placement,status:On.IDLE}),g!==_.placement&&setTimeout(function(){_.instance.update()},1)},onUpdate:function(_){s.popper=_;var A=s.state.currentPlacement;s._isMounted&&_.placement!==A&&s.setState({currentPlacement:_.placement})}})}if(a){var T=_e.undefined(x.offset)?0:x.offset;new lp(this.target,this.wrapperRef,{placement:x.placement||g,modifiers:{arrow:{enabled:!1},offset:{offset:"0, ".concat(T,"px")},flip:{enabled:!1}},onCreate:function(_){s.wrapperPopper=_,s._isMounted&&s.setState({statusWrapper:On.IDLE}),d(_,"wrapper"),g!==_.placement&&setTimeout(function(){_.instance.update()},1)}})}}},{key:"rebuildPopper",value:function(){var s=this;this.floaterRefInterval=setInterval(function(){var i;(i=s.floaterRef)!==null&&i!==void 0&&i.isConnected&&(clearInterval(s.floaterRefInterval),s.setState({needsUpdate:!1}),s.initPopper())},50)}},{key:"changeWrapperPosition",value:function(s){var i=s.target,a=s.wrapperOptions;this.setState({positionWrapper:a.position&&!!i})}},{key:"toggle",value:function(s){var i=this.state.status,a=i===On.OPEN?On.CLOSING:On.OPENING;_e.undefined(s)||(a=s),this.setState({status:a})}},{key:"debug",get:function(){var s=this.props.debug;return s||vo()&&"ReactFloaterDebug"in window&&!!window.ReactFloaterDebug}},{key:"event",get:function(){var s=this.props,i=s.disableHoverToClick,a=s.event;return a==="hover"&&SS()&&!i?"click":a}},{key:"options",get:function(){var s=this.props.options;return Va(Zge,s||{})}},{key:"styles",get:function(){var s=this,i=this.state,a=i.status,l=i.positionWrapper,c=i.statusWrapper,d=this.props.styles,h=Va(uxe(d),d);if(l){var m;[On.IDLE].indexOf(a)===-1||[On.IDLE].indexOf(c)===-1?m=h.wrapperPosition:m=this.wrapperPopper.styles,h.wrapper=br(br({},h.wrapper),m)}if(this.target){var g=window.getComputedStyle(this.target);this.wrapperStyles?h.wrapper=br(br({},h.wrapper),this.wrapperStyles):["relative","static"].indexOf(g.position)===-1&&(this.wrapperStyles={},l||(hxe.forEach(function(x){s.wrapperStyles[x]=g[x]}),h.wrapper=br(br({},h.wrapper),this.wrapperStyles),this.target.style.position="relative",this.target.style.top="auto",this.target.style.right="auto",this.target.style.bottom="auto",this.target.style.left="auto"))}return h}},{key:"target",get:function(){if(!vo())return null;var s=this.props.target;return s?_e.domElement(s)?s:document.querySelector(s):this.childRef||this.wrapperRef}},{key:"render",value:function(){var s=this.state,i=s.currentPlacement,a=s.positionWrapper,l=s.status,c=this.props,d=c.children,h=c.component,m=c.content,g=c.disableAnimation,x=c.footer,y=c.hideArrow,w=c.id,S=c.open,k=c.showCloseButton,j=c.style,N=c.target,T=c.title,E=ae.createElement(lQ,{handleClick:this.handleClick,handleMouseEnter:this.handleMouseEnter,handleMouseLeave:this.handleMouseLeave,setChildRef:this.setChildRef,setWrapperRef:this.setWrapperRef,style:j,styles:this.styles.wrapper},d),_={};return a?_.wrapperInPortal=E:_.wrapperAsChildren=E,ae.createElement("span",null,ae.createElement(rQ,{hasChildren:!!d,id:w,placement:i,setRef:this.setFloaterRef,target:N,zIndex:this.styles.options.zIndex},ae.createElement(oQ,{component:h,content:m,disableAnimation:g,footer:x,handleClick:this.handleClick,hideArrow:y||i==="center",open:S,placement:i,positionWrapper:a,setArrowRef:this.setArrowRef,setFloaterRef:this.setFloaterRef,showCloseButton:k,status:l,styles:this.styles,title:T}),_.wrapperInPortal),_.wrapperAsChildren)}}]),n})(ae.Component);qs(X6,"propTypes",{autoOpen:Ge.bool,callback:Ge.func,children:Ge.node,component:UA(Ge.oneOfType([Ge.func,Ge.element]),function(t){return!t.content}),content:UA(Ge.node,function(t){return!t.component}),debug:Ge.bool,disableAnimation:Ge.bool,disableFlip:Ge.bool,disableHoverToClick:Ge.bool,event:Ge.oneOf(["hover","click"]),eventDelay:Ge.number,footer:Ge.node,getPopper:Ge.func,hideArrow:Ge.bool,id:Ge.oneOfType([Ge.string,Ge.number]),offset:Ge.number,open:Ge.bool,options:Ge.object,placement:Ge.oneOf(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end","auto","center"]),showCloseButton:Ge.bool,style:Ge.object,styles:Ge.object,target:Ge.oneOfType([Ge.object,Ge.string]),title:Ge.node,wrapperOptions:Ge.shape({offset:Ge.number,placement:Ge.oneOf(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end","auto"]),position:Ge.bool})});qs(X6,"defaultProps",{autoOpen:!1,callback:WA,debug:!1,disableAnimation:!1,disableFlip:!1,disableHoverToClick:!1,event:"click",eventDelay:.4,getPopper:WA,hideArrow:!1,offset:15,placement:"bottom",showCloseButton:!1,styles:{},target:null,wrapperOptions:{position:!1}});var fxe=Object.defineProperty,mxe=(t,e,n)=>e in t?fxe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,gt=(t,e,n)=>mxe(t,typeof e!="symbol"?e+"":e,n),Qn={INIT:"init",START:"start",STOP:"stop",RESET:"reset",PREV:"prev",NEXT:"next",GO:"go",CLOSE:"close",SKIP:"skip",UPDATE:"update"},Qa={TOUR_START:"tour:start",STEP_BEFORE:"step:before",BEACON:"beacon",TOOLTIP:"tooltip",STEP_AFTER:"step:after",TOUR_END:"tour:end",TOUR_STATUS:"tour:status",TARGET_NOT_FOUND:"error:target_not_found"},Qt={INIT:"init",READY:"ready",BEACON:"beacon",TOOLTIP:"tooltip",COMPLETE:"complete",ERROR:"error"},mn={IDLE:"idle",READY:"ready",WAITING:"waiting",RUNNING:"running",PAUSED:"paused",SKIPPED:"skipped",FINISHED:"finished"};function Ic(){var t;return!!(typeof window<"u"&&((t=window.document)!=null&&t.createElement))}function cQ(t){return t?t.getBoundingClientRect():null}function pxe(t=!1){const{body:e,documentElement:n}=document;if(!e||!n)return 0;if(t){const r=[e.scrollHeight,e.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight].sort((i,a)=>i-a),s=Math.floor(r.length/2);return r.length%2===0?(r[s-1]+r[s])/2:r[s]}return Math.max(e.scrollHeight,e.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight)}function Ml(t){if(typeof t=="string")try{return document.querySelector(t)}catch{return null}return t}function gxe(t){return!t||t.nodeType!==1?null:getComputedStyle(t)}function cp(t,e,n){if(!t)return Uu();const r=IH(t);if(r){if(r.isSameNode(Uu()))return n?document:Uu();if(!(r.scrollHeight>r.offsetHeight)&&!e)return r.style.overflow="initial",Uu()}return r}function _b(t,e){if(!t)return!1;const n=cp(t,e);return n?!n.isSameNode(Uu()):!1}function xxe(t){return t.offsetParent!==document.body}function df(t,e="fixed"){if(!t||!(t instanceof HTMLElement))return!1;const{nodeName:n}=t,r=gxe(t);return n==="BODY"||n==="HTML"?!1:r&&r.position===e?!0:t.parentNode?df(t.parentNode,e):!1}function vxe(t){var e;if(!t)return!1;let n=t;for(;n&&n!==document.body;){if(n instanceof HTMLElement){const{display:r,visibility:s}=getComputedStyle(n);if(r==="none"||s==="hidden")return!1}n=(e=n.parentElement)!=null?e:null}return!0}function yxe(t,e,n){var r,s,i;const a=cQ(t),l=cp(t,n),c=_b(t,n),d=df(t);let h=0,m=(r=a?.top)!=null?r:0;if(c&&d){const g=(s=t?.offsetTop)!=null?s:0,x=(i=l?.scrollTop)!=null?i:0;m=g-x}else l instanceof HTMLElement&&(h=l.scrollTop,!c&&!df(t)&&(m+=h),l.isSameNode(Uu())||(m+=Uu().scrollTop));return Math.floor(m-e)}function bxe(t,e,n){var r;if(!t)return 0;const{offsetTop:s=0,scrollTop:i=0}=(r=IH(t))!=null?r:{};let a=t.getBoundingClientRect().top+i;s&&(_b(t,n)||xxe(t))&&(a-=s);const l=Math.floor(a-e);return l<0?0:l}function Uu(){var t;return(t=document.scrollingElement)!=null?t:document.documentElement}function wxe(t,e){const{duration:n,element:r}=e;return new Promise((s,i)=>{const{scrollTop:a}=r,l=t>a?t-a:a-t;Fpe.top(r,t,{duration:l<100?50:n},c=>c&&c.message!=="Element already at target scroll position"?i(c):s())})}var Gm=pa.createPortal!==void 0;function uQ(t=navigator.userAgent){let e=t;return typeof window>"u"?e="node":document.documentMode?e="ie":/Edge/.test(t)?e="edge":window.opera||t.includes(" OPR/")?e="opera":typeof window.InstallTrigger<"u"?e="firefox":window.chrome?e="chrome":/(Version\/([\d._]+).*Safari|CriOS|FxiOS| Mobile\/)/.test(t)&&(e="safari"),e}function bv(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function yo(t,e={}){const{defaultValue:n,step:r,steps:s}=e;let i=AA(t);if(i)(i.includes("{step}")||i.includes("{steps}"))&&r&&s&&(i=i.replace("{step}",r.toString()).replace("{steps}",s.toString()));else if(b.isValidElement(t)&&!Object.values(t.props).length&&bv(t.type)==="function"){const a=t.type({});i=yo(a,e)}else i=AA(n);return i}function Sxe(t,e){return!ft.plainObject(t)||!ft.array(e)?!1:Object.keys(t).every(n=>e.includes(n))}function kxe(t){const e=/^#?([\da-f])([\da-f])([\da-f])$/i,n=t.replace(e,(s,i,a,l)=>i+i+a+a+l+l),r=/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(n);return r?[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)]:[]}function GA(t){return t.disableBeacon||t.placement==="center"}function XA(){return!["chrome","safari","firefox","opera"].includes(uQ())}function hd({data:t,debug:e=!1,title:n,warn:r=!1}){const s=r?console.warn||console.error:console.log;e&&(n&&t?(console.groupCollapsed(`%creact-joyride: ${n}`,"color: #ff0044; font-weight: bold; font-size: 12px;"),Array.isArray(t)?t.forEach(i=>{ft.plainObject(i)&&i.key?s.apply(console,[i.key,i.value]):s.apply(console,[i])}):s.apply(console,[t]),console.groupEnd()):console.error("Missing title or data props"))}function Oxe(t){return Object.keys(t)}function dQ(t,...e){if(!ft.plainObject(t))throw new TypeError("Expected an object");const n={};for(const r in t)({}).hasOwnProperty.call(t,r)&&(e.includes(r)||(n[r]=t[r]));return n}function jxe(t,...e){if(!ft.plainObject(t))throw new TypeError("Expected an object");if(!e.length)return t;const n={};for(const r in t)({}).hasOwnProperty.call(t,r)&&e.includes(r)&&(n[r]=t[r]);return n}function SO(t,e,n){const r=i=>i.replace("{step}",String(e)).replace("{steps}",String(n));if(bv(t)==="string")return r(t);if(!b.isValidElement(t))return t;const{children:s}=t.props;if(bv(s)==="string"&&s.includes("{step}"))return b.cloneElement(t,{children:r(s)});if(Array.isArray(s))return b.cloneElement(t,{children:s.map(i=>typeof i=="string"?r(i):SO(i,e,n))});if(bv(t.type)==="function"&&!Object.values(t.props).length){const i=t.type({});return SO(i,e,n)}return t}function Nxe(t){const{isFirstStep:e,lifecycle:n,previousLifecycle:r,scrollToFirstStep:s,step:i,target:a}=t;return!i.disableScrolling&&(!e||s||n===Qt.TOOLTIP)&&i.placement!=="center"&&(!i.isFixed||!df(a))&&r!==n&&[Qt.BEACON,Qt.TOOLTIP].includes(n)}var Cxe={options:{preventOverflow:{boundariesElement:"scrollParent"}},wrapperOptions:{offset:-18,position:!0}},hQ={back:"Back",close:"Close",last:"Last",next:"Next",nextLabelWithProgress:"Next (Step {step} of {steps})",open:"Open the dialog",skip:"Skip"},Txe={event:"click",placement:"bottom",offset:10,disableBeacon:!1,disableCloseOnEsc:!1,disableOverlay:!1,disableOverlayClose:!1,disableScrollParentFix:!1,disableScrolling:!1,hideBackButton:!1,hideCloseButton:!1,hideFooter:!1,isFixed:!1,locale:hQ,showProgress:!1,showSkipButton:!1,spotlightClicks:!1,spotlightPadding:10},Exe={continuous:!1,debug:!1,disableCloseOnEsc:!1,disableOverlay:!1,disableOverlayClose:!1,disableScrolling:!1,disableScrollParentFix:!1,getHelpers:void 0,hideBackButton:!1,run:!0,scrollOffset:20,scrollDuration:300,scrollToFirstStep:!1,showSkipButton:!1,showProgress:!1,spotlightClicks:!1,spotlightPadding:10,steps:[]},_xe={arrowColor:"#fff",backgroundColor:"#fff",beaconSize:36,overlayColor:"rgba(0, 0, 0, 0.5)",primaryColor:"#f04",spotlightShadow:"0 0 15px rgba(0, 0, 0, 0.5)",textColor:"#333",width:380,zIndex:100},Xm={backgroundColor:"transparent",border:0,borderRadius:0,color:"#555",cursor:"pointer",fontSize:16,lineHeight:1,padding:8,WebkitAppearance:"none"},YA={borderRadius:4,position:"absolute"};function Axe(t,e){var n,r,s,i,a;const{floaterProps:l,styles:c}=t,d=Va((n=e.floaterProps)!=null?n:{},l??{}),h=Va(c??{},(r=e.styles)!=null?r:{}),m=Va(_xe,h.options||{}),g=e.placement==="center"||e.disableBeacon;let{width:x}=m;window.innerWidth>480&&(x=380),"width"in m&&(x=typeof m.width=="number"&&window.innerWidthfQ(n,e)):(hd({title:"validateSteps",data:"steps must be an array",warn:!0,debug:e}),!1)}var mQ={action:"init",controlled:!1,index:0,lifecycle:Qt.INIT,origin:null,size:0,status:mn.IDLE},ZA=Oxe(dQ(mQ,"controlled","size")),Rxe=class{constructor(t){gt(this,"beaconPopper"),gt(this,"tooltipPopper"),gt(this,"data",new Map),gt(this,"listener"),gt(this,"store",new Map),gt(this,"addListener",s=>{this.listener=s}),gt(this,"setSteps",s=>{const{size:i,status:a}=this.getState(),l={size:s.length,status:a};this.data.set("steps",s),a===mn.WAITING&&!i&&s.length&&(l.status=mn.RUNNING),this.setState(l)}),gt(this,"getPopper",s=>s==="beacon"?this.beaconPopper:this.tooltipPopper),gt(this,"setPopper",(s,i)=>{s==="beacon"?this.beaconPopper=i:this.tooltipPopper=i}),gt(this,"cleanupPoppers",()=>{this.beaconPopper=null,this.tooltipPopper=null}),gt(this,"close",(s=null)=>{const{index:i,status:a}=this.getState();a===mn.RUNNING&&this.setState({...this.getNextState({action:Qn.CLOSE,index:i+1,origin:s})})}),gt(this,"go",s=>{const{controlled:i,status:a}=this.getState();if(i||a!==mn.RUNNING)return;const l=this.getSteps()[s];this.setState({...this.getNextState({action:Qn.GO,index:s}),status:l?a:mn.FINISHED})}),gt(this,"info",()=>this.getState()),gt(this,"next",()=>{const{index:s,status:i}=this.getState();i===mn.RUNNING&&this.setState(this.getNextState({action:Qn.NEXT,index:s+1}))}),gt(this,"open",()=>{const{status:s}=this.getState();s===mn.RUNNING&&this.setState({...this.getNextState({action:Qn.UPDATE,lifecycle:Qt.TOOLTIP})})}),gt(this,"prev",()=>{const{index:s,status:i}=this.getState();i===mn.RUNNING&&this.setState({...this.getNextState({action:Qn.PREV,index:s-1})})}),gt(this,"reset",(s=!1)=>{const{controlled:i}=this.getState();i||this.setState({...this.getNextState({action:Qn.RESET,index:0}),status:s?mn.RUNNING:mn.READY})}),gt(this,"skip",()=>{const{status:s}=this.getState();s===mn.RUNNING&&this.setState({action:Qn.SKIP,lifecycle:Qt.INIT,status:mn.SKIPPED})}),gt(this,"start",s=>{const{index:i,size:a}=this.getState();this.setState({...this.getNextState({action:Qn.START,index:ft.number(s)?s:i},!0),status:a?mn.RUNNING:mn.WAITING})}),gt(this,"stop",(s=!1)=>{const{index:i,status:a}=this.getState();[mn.FINISHED,mn.SKIPPED].includes(a)||this.setState({...this.getNextState({action:Qn.STOP,index:i+(s?1:0)}),status:mn.PAUSED})}),gt(this,"update",s=>{var i,a;if(!Sxe(s,ZA))throw new Error(`State is not valid. Valid keys: ${ZA.join(", ")}`);this.setState({...this.getNextState({...this.getState(),...s,action:(i=s.action)!=null?i:Qn.UPDATE,origin:(a=s.origin)!=null?a:null},!0)})});const{continuous:e=!1,stepIndex:n,steps:r=[]}=t??{};this.setState({action:Qn.INIT,controlled:ft.number(n),continuous:e,index:ft.number(n)?n:0,lifecycle:Qt.INIT,origin:null,status:r.length?mn.READY:mn.IDLE},!0),this.beaconPopper=null,this.tooltipPopper=null,this.listener=null,this.setSteps(r)}getState(){return this.store.size?{action:this.store.get("action")||"",controlled:this.store.get("controlled")||!1,index:parseInt(this.store.get("index"),10),lifecycle:this.store.get("lifecycle")||"",origin:this.store.get("origin")||null,size:this.store.get("size")||0,status:this.store.get("status")||""}:{...mQ}}getNextState(t,e=!1){var n,r,s,i,a;const{action:l,controlled:c,index:d,size:h,status:m}=this.getState(),g=ft.number(t.index)?t.index:d,x=c&&!e?d:Math.min(Math.max(g,0),h);return{action:(n=t.action)!=null?n:l,controlled:c,index:x,lifecycle:(r=t.lifecycle)!=null?r:Qt.INIT,origin:(s=t.origin)!=null?s:null,size:(i=t.size)!=null?i:h,status:x===h?mn.FINISHED:(a=t.status)!=null?a:m}}getSteps(){const t=this.data.get("steps");return Array.isArray(t)?t:[]}hasUpdatedState(t){const e=JSON.stringify(t),n=JSON.stringify(this.getState());return e!==n}setState(t,e=!1){const n=this.getState(),{action:r,index:s,lifecycle:i,origin:a=null,size:l,status:c}={...n,...t};this.store.set("action",r),this.store.set("index",s),this.store.set("lifecycle",i),this.store.set("origin",a),this.store.set("size",l),this.store.set("status",c),e&&(this.store.set("controlled",t.controlled),this.store.set("continuous",t.continuous)),this.listener&&this.hasUpdatedState(n)&&this.listener(this.getState())}getHelpers(){return{close:this.close,go:this.go,info:this.info,next:this.next,open:this.open,prev:this.prev,reset:this.reset,skip:this.skip}}};function Dxe(t){return new Rxe(t)}function Pxe({styles:t}){return b.createElement("div",{key:"JoyrideSpotlight",className:"react-joyride__spotlight","data-test-id":"spotlight",style:t})}var zxe=Pxe,Ixe=class extends b.Component{constructor(){super(...arguments),gt(this,"isActive",!1),gt(this,"resizeTimeout"),gt(this,"scrollTimeout"),gt(this,"scrollParent"),gt(this,"state",{isScrolling:!1,mouseOverSpotlight:!1,showSpotlight:!0}),gt(this,"hideSpotlight",()=>{const{continuous:t,disableOverlay:e,lifecycle:n}=this.props,r=[Qt.INIT,Qt.BEACON,Qt.COMPLETE,Qt.ERROR];return e||(t?r.includes(n):n!==Qt.TOOLTIP)}),gt(this,"handleMouseMove",t=>{const{mouseOverSpotlight:e}=this.state,{height:n,left:r,position:s,top:i,width:a}=this.spotlightStyles,l=s==="fixed"?t.clientY:t.pageY,c=s==="fixed"?t.clientX:t.pageX,d=l>=i&&l<=i+n,m=c>=r&&c<=r+a&&d;m!==e&&this.updateState({mouseOverSpotlight:m})}),gt(this,"handleScroll",()=>{const{target:t}=this.props,e=Ml(t);if(this.scrollParent!==document){const{isScrolling:n}=this.state;n||this.updateState({isScrolling:!0,showSpotlight:!1}),clearTimeout(this.scrollTimeout),this.scrollTimeout=window.setTimeout(()=>{this.updateState({isScrolling:!1,showSpotlight:!0})},50)}else df(e,"sticky")&&this.updateState({})}),gt(this,"handleResize",()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(()=>{this.isActive&&this.forceUpdate()},100)})}componentDidMount(){const{debug:t,disableScrolling:e,disableScrollParentFix:n=!1,target:r}=this.props,s=Ml(r);this.scrollParent=cp(s??document.body,n,!0),this.isActive=!0,window.addEventListener("resize",this.handleResize)}componentDidUpdate(t){var e;const{disableScrollParentFix:n,lifecycle:r,spotlightClicks:s,target:i}=this.props,{changed:a}=uy(t,this.props);if(a("target")||a("disableScrollParentFix")){const l=Ml(i);this.scrollParent=cp(l??document.body,n,!0)}a("lifecycle",Qt.TOOLTIP)&&((e=this.scrollParent)==null||e.addEventListener("scroll",this.handleScroll,{passive:!0}),setTimeout(()=>{const{isScrolling:l}=this.state;l||this.updateState({showSpotlight:!0})},100)),(a("spotlightClicks")||a("disableOverlay")||a("lifecycle"))&&(s&&r===Qt.TOOLTIP?window.addEventListener("mousemove",this.handleMouseMove,!1):r!==Qt.TOOLTIP&&window.removeEventListener("mousemove",this.handleMouseMove))}componentWillUnmount(){var t;this.isActive=!1,window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("resize",this.handleResize),clearTimeout(this.resizeTimeout),clearTimeout(this.scrollTimeout),(t=this.scrollParent)==null||t.removeEventListener("scroll",this.handleScroll)}get overlayStyles(){const{mouseOverSpotlight:t}=this.state,{disableOverlayClose:e,placement:n,styles:r}=this.props;let s=r.overlay;return XA()&&(s=n==="center"?r.overlayLegacyCenter:r.overlayLegacy),{cursor:e?"default":"pointer",height:pxe(),pointerEvents:t?"none":"auto",...s}}get spotlightStyles(){var t,e,n;const{showSpotlight:r}=this.state,{disableScrollParentFix:s=!1,spotlightClicks:i,spotlightPadding:a=0,styles:l,target:c}=this.props,d=Ml(c),h=cQ(d),m=df(d),g=yxe(d,a,s);return{...XA()?l.spotlightLegacy:l.spotlight,height:Math.round(((t=h?.height)!=null?t:0)+a*2),left:Math.round(((e=h?.left)!=null?e:0)-a),opacity:r?1:0,pointerEvents:i?"none":"auto",position:m?"fixed":"absolute",top:g,transition:"opacity 0.2s",width:Math.round(((n=h?.width)!=null?n:0)+a*2)}}updateState(t){this.isActive&&this.setState(e=>({...e,...t}))}render(){const{showSpotlight:t}=this.state,{onClickOverlay:e,placement:n}=this.props,{hideSpotlight:r,overlayStyles:s,spotlightStyles:i}=this;if(r())return null;let a=n!=="center"&&t&&b.createElement(zxe,{styles:i});if(uQ()==="safari"){const{mixBlendMode:l,zIndex:c,...d}=s;a=b.createElement("div",{style:{...d}},a),delete s.backgroundColor}return b.createElement("div",{className:"react-joyride__overlay","data-test-id":"overlay",onClick:e,role:"presentation",style:s},a)}},Lxe=class extends b.Component{constructor(){super(...arguments),gt(this,"node",null)}componentDidMount(){const{id:t}=this.props;Ic()&&(this.node=document.createElement("div"),this.node.id=t,document.body.appendChild(this.node),Gm||this.renderReact15())}componentDidUpdate(){Ic()&&(Gm||this.renderReact15())}componentWillUnmount(){!Ic()||!this.node||(Gm||pa.unmountComponentAtNode(this.node),this.node.parentNode===document.body&&(document.body.removeChild(this.node),this.node=null))}renderReact15(){if(!Ic())return;const{children:t}=this.props;this.node&&pa.unstable_renderSubtreeIntoContainer(this,t,this.node)}renderReact16(){if(!Ic()||!Gm)return null;const{children:t}=this.props;return this.node?pa.createPortal(t,this.node):null}render(){return Gm?this.renderReact16():null}},Bxe=class{constructor(t,e){if(gt(this,"element"),gt(this,"options"),gt(this,"canBeTabbed",n=>{const{tabIndex:r}=n;return r===null||r<0?!1:this.canHaveFocus(n)}),gt(this,"canHaveFocus",n=>{const r=/input|select|textarea|button|object/,s=n.nodeName.toLowerCase();return(r.test(s)&&!n.getAttribute("disabled")||s==="a"&&!!n.getAttribute("href"))&&this.isVisible(n)}),gt(this,"findValidTabElements",()=>[].slice.call(this.element.querySelectorAll("*"),0).filter(this.canBeTabbed)),gt(this,"handleKeyDown",n=>{const{code:r="Tab"}=this.options;n.code===r&&this.interceptTab(n)}),gt(this,"interceptTab",n=>{n.preventDefault();const r=this.findValidTabElements(),{shiftKey:s}=n;if(!r.length)return;let i=document.activeElement?r.indexOf(document.activeElement):0;i===-1||!s&&i+1===r.length?i=0:s&&i===0?i=r.length-1:i+=s?-1:1,r[i].focus()}),gt(this,"isHidden",n=>{const r=n.offsetWidth<=0&&n.offsetHeight<=0,s=window.getComputedStyle(n);return r&&!n.innerHTML?!0:r&&s.getPropertyValue("overflow")!=="visible"||s.getPropertyValue("display")==="none"}),gt(this,"isVisible",n=>{let r=n;for(;r;)if(r instanceof HTMLElement){if(r===document.body)break;if(this.isHidden(r))return!1;r=r.parentNode}return!0}),gt(this,"removeScope",()=>{window.removeEventListener("keydown",this.handleKeyDown)}),gt(this,"checkFocus",n=>{document.activeElement!==n&&(n.focus(),window.requestAnimationFrame(()=>this.checkFocus(n)))}),gt(this,"setFocus",()=>{const{selector:n}=this.options;if(!n)return;const r=this.element.querySelector(n);r&&window.requestAnimationFrame(()=>this.checkFocus(r))}),!(t instanceof HTMLElement))throw new TypeError("Invalid parameter: element must be an HTMLElement");this.element=t,this.options=e,window.addEventListener("keydown",this.handleKeyDown,!1),this.setFocus()}},Fxe=class extends b.Component{constructor(t){if(super(t),gt(this,"beacon",null),gt(this,"setBeaconRef",s=>{this.beacon=s}),t.beaconComponent)return;const e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.id="joyride-beacon-animation",t.nonce&&n.setAttribute("nonce",t.nonce),n.appendChild(document.createTextNode(` @keyframes joyride-beacon-inner { 20% { opacity: 0.9; @@ -85,45 +85,45 @@ reaction = "${T.reaction}"`;return o.jsxs(Po,{children:[o.jsx(zo,{asChild:!0,chi transform: scale(1); } } - `)),e.appendChild(n)}componentDidMount(){const{shouldFocus:t}=this.props;setTimeout(()=>{ft.domElement(this.beacon)&&t&&this.beacon.focus()},0)}componentWillUnmount(){const t=document.getElementById("joyride-beacon-animation");t?.parentNode&&t.parentNode.removeChild(t)}render(){const{beaconComponent:t,continuous:e,index:n,isLastStep:r,locale:s,onClickOrHover:i,size:a,step:l,styles:c}=this.props,d=yo(s.open),h={"aria-label":d,onClick:i,onMouseEnter:i,ref:this.setBeaconRef,title:d};let m;if(t){const g=t;m=b.createElement(g,{continuous:e,index:n,isLastStep:r,size:a,step:l,...h})}else m=b.createElement("button",{key:"JoyrideBeacon",className:"react-joyride__beacon","data-test-id":"button-beacon",style:c.beacon,type:"button",...h},b.createElement("span",{style:c.beaconInner}),b.createElement("span",{style:c.beaconOuter}));return m}};function Sxe({styles:t,...e}){const{color:n,height:r,width:s,...i}=t;return ae.createElement("button",{style:i,type:"button",...e},ae.createElement("svg",{height:typeof r=="number"?`${r}px`:r,preserveAspectRatio:"xMidYMid",version:"1.1",viewBox:"0 0 18 18",width:typeof s=="number"?`${s}px`:s,xmlns:"http://www.w3.org/2000/svg"},ae.createElement("g",null,ae.createElement("path",{d:"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z",fill:n}))))}var kxe=Sxe;function Oxe(t){const{backProps:e,closeProps:n,index:r,isLastStep:s,primaryProps:i,skipProps:a,step:l,tooltipProps:c}=t,{content:d,hideBackButton:h,hideCloseButton:m,hideFooter:g,showSkipButton:x,styles:y,title:w}=l,S={};return S.primary=b.createElement("button",{"data-test-id":"button-primary",style:y.buttonNext,type:"button",...i}),x&&!s&&(S.skip=b.createElement("button",{"aria-live":"off","data-test-id":"button-skip",style:y.buttonSkip,type:"button",...a})),!h&&r>0&&(S.back=b.createElement("button",{"data-test-id":"button-back",style:y.buttonBack,type:"button",...e})),S.close=!m&&b.createElement(kxe,{"data-test-id":"button-close",styles:y.buttonClose,...n}),b.createElement("div",{key:"JoyrideTooltip","aria-label":yo(w??d),className:"react-joyride__tooltip",style:y.tooltip,...c},b.createElement("div",{style:y.tooltipContainer},w&&b.createElement("h1",{"aria-label":yo(w),style:y.tooltipTitle},w),b.createElement("div",{style:y.tooltipContent},d)),!g&&b.createElement("div",{style:y.tooltipFooter},b.createElement("div",{style:y.tooltipFooterSpacer},S.skip),S.back,S.primary),S.close)}var jxe=Oxe,Nxe=class extends b.Component{constructor(){super(...arguments),gt(this,"handleClickBack",t=>{t.preventDefault();const{helpers:e}=this.props;e.prev()}),gt(this,"handleClickClose",t=>{t.preventDefault();const{helpers:e}=this.props;e.close("button_close")}),gt(this,"handleClickPrimary",t=>{t.preventDefault();const{continuous:e,helpers:n}=this.props;if(!e){n.close("button_primary");return}n.next()}),gt(this,"handleClickSkip",t=>{t.preventDefault();const{helpers:e}=this.props;e.skip()}),gt(this,"getElementsProps",()=>{const{continuous:t,index:e,isLastStep:n,setTooltipRef:r,size:s,step:i}=this.props,{back:a,close:l,last:c,next:d,nextLabelWithProgress:h,skip:m}=i.locale,g=yo(a),x=yo(l),y=yo(c),w=yo(d),S=yo(m);let k=l,j=x;if(t){if(k=d,j=w,i.showProgress&&!n){const N=yo(h,{step:e+1,steps:s});k=gO(h,e+1,s),j=N}n&&(k=c,j=y)}return{backProps:{"aria-label":g,children:a,"data-action":"back",onClick:this.handleClickBack,role:"button",title:g},closeProps:{"aria-label":x,children:l,"data-action":"close",onClick:this.handleClickClose,role:"button",title:x},primaryProps:{"aria-label":j,children:k,"data-action":"primary",onClick:this.handleClickPrimary,role:"button",title:j},skipProps:{"aria-label":S,children:m,"data-action":"skip",onClick:this.handleClickSkip,role:"button",title:S},tooltipProps:{"aria-modal":!0,ref:r,role:"alertdialog"}}})}render(){const{continuous:t,index:e,isLastStep:n,setTooltipRef:r,size:s,step:i}=this.props,{beaconComponent:a,tooltipComponent:l,...c}=i;let d;if(l){const h={...this.getElementsProps(),continuous:t,index:e,isLastStep:n,size:s,step:c,setTooltipRef:r},m=l;d=b.createElement(m,{...h})}else d=b.createElement(jxe,{...this.getElementsProps(),continuous:t,index:e,isLastStep:n,size:s,step:i});return d}},Cxe=class extends b.Component{constructor(){super(...arguments),gt(this,"scope",null),gt(this,"tooltip",null),gt(this,"handleClickHoverBeacon",t=>{const{step:e,store:n}=this.props;t.type==="mouseenter"&&e.event!=="hover"||n.update({lifecycle:Qt.TOOLTIP})}),gt(this,"setTooltipRef",t=>{this.tooltip=t}),gt(this,"setPopper",(t,e)=>{var n;const{action:r,lifecycle:s,step:i,store:a}=this.props;e==="wrapper"?a.setPopper("beacon",t):a.setPopper("tooltip",t),a.getPopper("beacon")&&(a.getPopper("tooltip")||i.placement==="center")&&s===Qt.INIT&&a.update({action:r,lifecycle:Qt.READY}),(n=i.floaterProps)!=null&&n.getPopper&&i.floaterProps.getPopper(t,e)}),gt(this,"renderTooltip",t=>{const{continuous:e,helpers:n,index:r,size:s,step:i}=this.props;return b.createElement(Nxe,{continuous:e,helpers:n,index:r,isLastStep:r+1===s,setTooltipRef:this.setTooltipRef,size:s,step:i,...t})})}componentDidMount(){const{debug:t,index:e}=this.props;hd({title:`step:${e}`,data:[{key:"props",value:this.props}],debug:t})}componentDidUpdate(t){var e;const{action:n,callback:r,continuous:s,controlled:i,debug:a,helpers:l,index:c,lifecycle:d,shouldScroll:h,status:m,step:g,store:x}=this.props,{changed:y,changedFrom:w}=iy(t,this.props),S=l.info(),k=s&&n!==Qn.CLOSE&&(c>0||n===Qn.PREV),j=y("action")||y("index")||y("lifecycle")||y("status"),N=w("lifecycle",[Qt.TOOLTIP,Qt.INIT],Qt.INIT),T=y("action",[Qn.NEXT,Qn.PREV,Qn.SKIP,Qn.CLOSE]),E=i&&c===t.index;if(T&&(N||E)&&r({...S,index:t.index,lifecycle:Qt.COMPLETE,step:t.step,type:Qa.STEP_AFTER}),g.placement==="center"&&m===mn.RUNNING&&y("index")&&n!==Qn.START&&d===Qt.INIT&&x.update({lifecycle:Qt.READY}),j){const _=Ml(g.target),M=!!_;M&&Jge(_)?(w("status",mn.READY,mn.RUNNING)||w("lifecycle",Qt.INIT,Qt.READY))&&r({...S,step:g,type:Qa.STEP_BEFORE}):(console.warn(M?"Target not visible":"Target not mounted",g),r({...S,type:Qa.TARGET_NOT_FOUND,step:g}),i||x.update({index:c+(n===Qn.PREV?-1:1)}))}w("lifecycle",Qt.INIT,Qt.READY)&&x.update({lifecycle:$M(g)||k?Qt.TOOLTIP:Qt.BEACON}),y("index")&&hd({title:`step:${d}`,data:[{key:"props",value:this.props}],debug:a}),y("lifecycle",Qt.BEACON)&&r({...S,step:g,type:Qa.BEACON}),y("lifecycle",Qt.TOOLTIP)&&(r({...S,step:g,type:Qa.TOOLTIP}),h&&this.tooltip&&(this.scope=new bxe(this.tooltip,{selector:"[data-action=primary]"}),this.scope.setFocus())),w("lifecycle",[Qt.TOOLTIP,Qt.INIT],Qt.INIT)&&((e=this.scope)==null||e.removeScope(),x.cleanupPoppers())}componentWillUnmount(){var t;(t=this.scope)==null||t.removeScope()}get open(){const{lifecycle:t,step:e}=this.props;return $M(e)||t===Qt.TOOLTIP}render(){const{continuous:t,debug:e,index:n,nonce:r,shouldScroll:s,size:i,step:a}=this.props,l=Ml(a.target);return!oQ(a)||!ft.domElement(l)?null:b.createElement("div",{key:`JoyrideStep-${n}`,className:"react-joyride__step"},b.createElement(V6,{...a.floaterProps,component:this.renderTooltip,debug:e,getPopper:this.setPopper,id:`react-joyride-step-${n}`,open:this.open,placement:a.placement,target:a.target},b.createElement(wxe,{beaconComponent:a.beaconComponent,continuous:t,index:n,isLastStep:n+1===i,locale:a.locale,nonce:r,onClickOrHover:this.handleClickHoverBeacon,shouldFocus:s,size:i,step:a,styles:a.styles})))}},cQ=class extends b.Component{constructor(t){super(t),gt(this,"helpers"),gt(this,"store"),gt(this,"callback",a=>{const{callback:l}=this.props;ft.function(l)&&l(a)}),gt(this,"handleKeyboard",a=>{const{index:l,lifecycle:c}=this.state,{steps:d}=this.props,h=d[l];c===Qt.TOOLTIP&&a.code==="Escape"&&h&&!h.disableCloseOnEsc&&this.store.close("keyboard")}),gt(this,"handleClickOverlay",()=>{const{index:a}=this.state,{steps:l}=this.props;ah(this.props,l[a]).disableOverlayClose||this.helpers.close("overlay")}),gt(this,"syncState",a=>{this.setState(a)});const{debug:e,getHelpers:n,run:r=!0,stepIndex:s}=t;this.store=pxe({...t,controlled:r&&ft.number(s)}),this.helpers=this.store.getHelpers();const{addListener:i}=this.store;hd({title:"init",data:[{key:"props",value:this.props},{key:"state",value:this.state}],debug:e}),i(this.syncState),n&&n(this.helpers),this.state=this.store.getState()}componentDidMount(){if(!zc())return;const{debug:t,disableCloseOnEsc:e,run:n,steps:r}=this.props,{start:s}=this.store;VM(r,t)&&n&&s(),e||document.body.addEventListener("keydown",this.handleKeyboard,{passive:!0})}componentDidUpdate(t,e){if(!zc())return;const{action:n,controlled:r,index:s,status:i}=this.state,{debug:a,run:l,stepIndex:c,steps:d}=this.props,{stepIndex:h,steps:m}=t,{reset:g,setSteps:x,start:y,stop:w,update:S}=this.store,{changed:k}=iy(t,this.props),{changed:j,changedFrom:N}=iy(e,this.state),T=ah(this.props,d[s]),E=!Js(m,d),_=ft.number(c)&&k("stepIndex"),M=Ml(T.target);if(E&&(VM(d,a)?x(d):console.warn("Steps are not valid",d)),k("run")&&(l?y(c):w()),_){let L=ft.number(h)&&h=0?w:0,r===mn.RUNNING&&nxe(w,{element:y,duration:a}).then(()=>{setTimeout(()=>{var j;(j=this.store.getPopper("tooltip"))==null||j.instance.update()},10)})}}render(){if(!zc())return null;const{index:t,lifecycle:e,status:n}=this.state,{continuous:r=!1,debug:s=!1,nonce:i,scrollToFirstStep:a=!1,steps:l}=this.props,c=n===mn.RUNNING,d={};if(c&&l[t]){const h=ah(this.props,l[t]);d.step=b.createElement(Cxe,{...this.state,callback:this.callback,continuous:r,debug:s,helpers:this.helpers,nonce:i,shouldScroll:!h.disableScrolling&&(t!==0||a),step:h,store:this.store}),d.overlay=b.createElement(yxe,{id:"react-joyride-portal"},b.createElement(vxe,{...h,continuous:r,debug:s,lifecycle:e,onClickOverlay:this.handleClickOverlay}))}return b.createElement("div",{className:"react-joyride"},d.step,d.overlay)}};gt(cQ,"defaultProps",uxe);var Txe=cQ;function U6(){const t=b.useContext(CH);if(!t)throw new Error("useTour must be used within a TourProvider");return t}const Exe={options:{zIndex:1e4,primaryColor:"hsl(var(--primary))",textColor:"hsl(var(--foreground))",backgroundColor:"hsl(var(--background))",arrowColor:"hsl(var(--background))",overlayColor:"rgba(0, 0, 0, 0.5)"},tooltip:{borderRadius:"var(--radius)",padding:"1rem"},tooltipContainer:{textAlign:"left"},tooltipTitle:{fontSize:"1rem",fontWeight:600,marginBottom:"0.5rem"},tooltipContent:{fontSize:"0.875rem",padding:"0.5rem 0"},buttonNext:{backgroundColor:"hsl(var(--primary))",color:"hsl(var(--primary-foreground))",borderRadius:"calc(var(--radius) - 2px)",fontSize:"0.875rem",padding:"0.5rem 1rem"},buttonBack:{color:"hsl(var(--muted-foreground))",fontSize:"0.875rem",marginRight:"0.5rem"},buttonSkip:{color:"hsl(var(--muted-foreground))",fontSize:"0.875rem"},buttonClose:{color:"hsl(var(--muted-foreground))"},spotlight:{borderRadius:"var(--radius)"}},_xe={back:"上一步",close:"关闭",last:"完成",next:"下一步",nextLabelWithProgress:"下一步 ({step}/{steps})",open:"打开对话框",skip:"跳过"};function Mxe(){const{state:t,getCurrentSteps:e,handleJoyrideCallback:n}=U6(),r=e(),[s,i]=b.useState(!1),a=b.useRef(t.stepIndex),l=b.useRef(null);b.useEffect(()=>{a.current!==t.stepIndex&&(i(!1),a.current=t.stepIndex)},[t.stepIndex]),b.useEffect(()=>{if(!t.isRunning||r.length===0){i(!1);return}const h=r[t.stepIndex];if(!h){i(!1);return}const m=h.target;if(m==="body"){i(!0);return}i(!1);const g=setTimeout(()=>{const x=()=>{const k=document.querySelector(m);if(k){const j=k.getBoundingClientRect();if(j.width>0&&j.height>0)return!0}return!1};if(x()){setTimeout(()=>i(!0),100);return}const y=setInterval(()=>{x()&&(clearInterval(y),setTimeout(()=>i(!0),100))},100),w=setTimeout(()=>{clearInterval(y),i(!0)},5e3),S=()=>{clearInterval(y),clearTimeout(w)};l.current=S},150);return()=>{clearTimeout(g),l.current&&(l.current(),l.current=null)}},[t.isRunning,t.stepIndex,r]);const c=b.useRef(null);if(b.useEffect(()=>{let h=document.getElementById("tour-portal-container");return h||(h=document.createElement("div"),h.id="tour-portal-container",h.style.cssText="position: fixed; top: 0; left: 0; z-index: 99999; pointer-events: none;",document.body.appendChild(h)),c.current=h,()=>{}},[]),!t.isRunning||r.length===0||!s)return null;const d=o.jsx(Txe,{steps:r,stepIndex:t.stepIndex,run:t.isRunning,continuous:!0,showSkipButton:!0,showProgress:!0,disableOverlayClose:!0,disableScrolling:!1,disableScrollParentFix:!1,callback:n,styles:Exe,locale:_xe,scrollOffset:80,scrollToFirstStep:!0,floaterProps:{styles:{floater:{zIndex:99999}},disableAnimation:!0}},`tour-step-${t.stepIndex}`);return c.current?pa.createPortal(d,c.current):d}const El="model-assignment-tour",uQ=[{target:"body",content:"本引导旨在帮助你配置模型提供商和对应的模型,并为麦麦的各个组件分配合适的模型。",placement:"center",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="sidebar-model-provider"]',content:'第一步,你需要配置模型提供商。模型提供商决定了你要使用谁家的模型,无论是单一厂商(如 DeepSeek),还是模型平台(如 Siliconflow),都可以在这里进行配置。点击"下一步"进入配置页面。',placement:"right",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="add-provider-button"]',content:'点击"添加提供商"按钮,开始配置你的模型提供商。',placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="provider-dialog"]',content:"在这里,你可以选择你想要配置的模型提供商,填写相关信息后保存即可。",placement:"left",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-name-input"]',content:"这里的名称是你为这个模型提供商起的一个名字,方便你在后续使用时识别它。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-apikey-input"]',content:"这里需要填写你从模型提供商那里获取的 API 密钥,用于验证和调用模型服务。对于不同的提供商,获取 API 密钥的方式可能有所不同,请参考对应提供商的文档。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-url-input"]',content:"这里需要填写模型提供商的 API 访问地址,确保填写正确以便系统能够连接到模型服务。对于不同的提供商,API 地址可能有所不同,请参考对应提供商的文档。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-template-select"]',content:"当然,如果你不知道如何填写这些信息,很多模型提供商在这里都提供了预设的模板供你选择,选择对应的模板后,相关信息会自动填充。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-save-button"]',content:"填写完所有信息后,点击保存按钮,模型提供商就配置完成了。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-cancel-button"]',content:"因为这次咱们什么都没有填写,所以点击取消按钮退出吧。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="sidebar-model-management"]',content:'配置好模型提供商后,接下来我们需要为麦麦添加模型并分配功能。点击"下一步"进入模型管理页面。',placement:"right",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="add-model-button"]',content:'在为麦麦的组件分配模型之前,首先需要添加你想要分配的模型,点击"添加模型"按钮开始添加。',placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="model-dialog"]',content:"在这里,你可以选择你之前配置好的模型提供商,然后选择对应的模型来添加。",placement:"left",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-name-input"]',content:"这里的模型名称是你为这个模型起的一个名字,方便你在后续使用时识别它。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-provider-select"]',content:"在这里选择你之前配置好的模型提供商,这样系统才能知道你要添加哪个提供商的模型。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-identifier-input"]',content:"这里需要填写你想要添加的模型的标识符,不同的模型提供商可能有不同的标识符格式,请参考对应提供商的文档。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-save-button"]',content:"填写完所有信息后,点击保存按钮,模型就添加完成了。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-cancel-button"]',content:"当然,因为这次咱们什么都没有填写,所以直接点击取消按钮退出吧,等你准备好了再来添加模型。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="tasks-tab-trigger"]',content:'最后一步,添加好模型后,切换到"为模型分配功能"标签页,为麦麦的各个组件分配合适的模型。',placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="task-model-select"]',content:"在这里,你可以为每个组件选择一个或多个合适的模型,选择完成后配置会自动保存。恭喜你完成了模型配置的学习!",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1}],dQ={0:"/config/model",1:"/config/model",2:"/config/modelProvider",3:"/config/modelProvider",4:"/config/modelProvider",5:"/config/modelProvider",6:"/config/modelProvider",7:"/config/modelProvider",8:"/config/modelProvider",9:"/config/modelProvider",10:"/config/modelProvider",11:"/config/model",12:"/config/model",13:"/config/model",14:"/config/model",15:"/config/model",16:"/config/model",17:"/config/model",18:"/config/model",19:"/config/model"},l0=[{id:"siliconflow",name:"SiliconFlow",base_url:"https://api.siliconflow.cn/v1",client_type:"openai",display_name:"硅基流动 (SiliconFlow)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"deepseek",name:"DeepSeek",base_url:"https://api.deepseek.com",client_type:"openai",display_name:"DeepSeek",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"rinkoai",name:"RinkoAI",base_url:"https://rinkoai.com/v1",client_type:"openai",display_name:"RinkoAI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"zhipu",name:"ZhipuAI",base_url:"https://open.bigmodel.cn/api/paas/v4",client_type:"openai",display_name:"智谱 AI (ZhipuAI / GLM)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"moonshot",name:"Moonshot",base_url:"https://api.moonshot.cn/v1",client_type:"openai",display_name:"月之暗面 (Moonshot / Kimi)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"doubao",name:"Doubao",base_url:"https://ark.cn-beijing.volces.com/api/v3",client_type:"openai",display_name:"字节豆包 (Doubao)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"alibaba",name:"Alibaba",base_url:"https://dashscope.aliyuncs.com/compatible-mode/v1",client_type:"openai",display_name:"阿里云百炼 (Alibaba Qwen)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"baichuan",name:"Baichuan",base_url:"https://api.baichuan-ai.com/v1",client_type:"openai",display_name:"百川智能 (Baichuan)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"minimax",name:"MiniMax",base_url:"https://api.minimax.chat/v1",client_type:"openai",display_name:"MiniMax (海螺 AI)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"stepfun",name:"StepFun",base_url:"https://api.stepfun.com/v1",client_type:"openai",display_name:"阶跃星辰 (StepFun)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"lingyi",name:"Lingyi",base_url:"https://api.lingyiwanwu.com/v1",client_type:"openai",display_name:"零一万物 (Lingyi / Yi)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"openai",name:"OpenAI",base_url:"https://api.openai.com/v1",client_type:"openai",display_name:"OpenAI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"xai",name:"xAI",base_url:"https://api.x.ai/v1",client_type:"openai",display_name:"xAI (Grok)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"anthropic",name:"Anthropic",base_url:"https://api.anthropic.com/v1",client_type:"openai",display_name:"Anthropic (Claude)"},{id:"gemini",name:"Gemini",base_url:"https://generativelanguage.googleapis.com/v1beta",client_type:"gemini",display_name:"Google Gemini",modelFetcher:{endpoint:"/models",parser:"gemini"}},{id:"cohere",name:"Cohere",base_url:"https://api.cohere.ai/v1",client_type:"openai",display_name:"Cohere"},{id:"groq",name:"Groq",base_url:"https://api.groq.com/openai/v1",client_type:"openai",display_name:"Groq",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"together",name:"Together AI",base_url:"https://api.together.xyz/v1",client_type:"openai",display_name:"Together AI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"fireworks",name:"Fireworks",base_url:"https://api.fireworks.ai/inference/v1",client_type:"openai",display_name:"Fireworks AI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"mistral",name:"Mistral",base_url:"https://api.mistral.ai/v1",client_type:"openai",display_name:"Mistral AI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"perplexity",name:"Perplexity",base_url:"https://api.perplexity.ai",client_type:"openai",display_name:"Perplexity AI"},{id:"custom",name:"",base_url:"",client_type:"openai",display_name:"自定义"}];function WM(t){return t?t.replace(/\/+$/,"").toLowerCase():""}function Axe(t){if(!t)return null;const e=WM(t);return l0.find(n=>n.id!=="custom"&&WM(n.base_url)===e)||null}function Rxe(){const[t,e]=b.useState([]),[n,r]=b.useState(!0),[s,i]=b.useState(!1),[a,l]=b.useState(!1),[c,d]=b.useState(!1),[h,m]=b.useState(!1),[g,x]=b.useState(!1),[y,w]=b.useState(!1),[S,k]=b.useState(null),[j,N]=b.useState(null),[T,E]=b.useState("custom"),[_,M]=b.useState(!1),[I,P]=b.useState(!1),[L,H]=b.useState(null),[U,ee]=b.useState(!1),[z,Q]=b.useState(""),[B,X]=b.useState(new Set),[J,G]=b.useState(!1),[R,ie]=b.useState(1),[W,q]=b.useState(20),[V,te]=b.useState(""),{toast:ne}=fs(),K=Zi(),{state:se,goToStep:re,registerTour:oe}=U6(),Te=b.useRef(null),We=b.useRef(!0);b.useEffect(()=>{oe(El,uQ)},[oe]),b.useEffect(()=>{if(se.activeTourId===El&&se.isRunning){const ke=dQ[se.stepIndex];ke&&!window.location.pathname.endsWith(ke.replace("/config/",""))&&K({to:ke})}},[se.stepIndex,se.activeTourId,se.isRunning,K]);const Ye=b.useRef(se.stepIndex);b.useEffect(()=>{if(se.activeTourId===El&&se.isRunning){const ke=Ye.current,Pe=se.stepIndex;ke>=3&&ke<=9&&Pe<3&&w(!1),Ye.current=Pe}},[se.stepIndex,se.activeTourId,se.isRunning]),b.useEffect(()=>{if(se.activeTourId!==El||!se.isRunning)return;const ke=Pe=>{const it=Pe.target,ot=se.stepIndex;ot===2&&it.closest('[data-tour="add-provider-button"]')?setTimeout(()=>re(3),300):ot===9&&it.closest('[data-tour="provider-cancel-button"]')&&setTimeout(()=>re(10),300)};return document.addEventListener("click",ke,!0),()=>document.removeEventListener("click",ke,!0)},[se,re]),b.useEffect(()=>{Je()},[]);const Je=async()=>{try{r(!0);const ke=await Rh();e(ke.api_providers||[]),d(!1),We.current=!1}catch(ke){console.error("加载配置失败:",ke)}finally{r(!1)}},Oe=async()=>{try{m(!0),Jy().catch(()=>{}),x(!0)}catch(ke){console.error("重启失败:",ke),x(!1),ne({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),m(!1)}},Ve=async()=>{try{i(!0),Te.current&&clearTimeout(Te.current);const ke=await Rh();ke.api_providers=t,await zv(ke),d(!1),ne({title:"保存成功",description:"正在重启麦麦..."}),await Oe()}catch(ke){console.error("保存配置失败:",ke),ne({title:"保存失败",description:ke.message,variant:"destructive"}),i(!1)}},Ue=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},He=()=>{x(!1),m(!1),ne({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},Ot=b.useCallback(async ke=>{if(!We.current)try{l(!0),await dk("api_providers",ke),d(!1)}catch(Pe){console.error("自动保存失败:",Pe),d(!0)}finally{l(!1)}},[]);b.useEffect(()=>{if(!We.current)return d(!0),Te.current&&clearTimeout(Te.current),Te.current=setTimeout(()=>{Ot(t)},2e3),()=>{Te.current&&clearTimeout(Te.current)}},[t,Ot]);const xt=async()=>{try{i(!0),Te.current&&clearTimeout(Te.current);const ke=await Rh();ke.api_providers=t,await zv(ke),d(!1),ne({title:"保存成功",description:"模型提供商配置已保存"})}catch(ke){console.error("保存配置失败:",ke),ne({title:"保存失败",description:ke.message,variant:"destructive"})}finally{i(!1)}},kn=(ke,Pe)=>{if(ke){const it=l0.find(ot=>ot.base_url===ke.base_url&&ot.client_type===ke.client_type);E(it?.id||"custom"),k(ke)}else E("custom"),k({name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10});N(Pe),ee(!1),w(!0)},It=ke=>{E(ke),M(!1);const Pe=l0.find(it=>it.id===ke);Pe&&Pe.id!=="custom"?k(it=>({...it,name:Pe.name,base_url:Pe.base_url,client_type:Pe.client_type})):Pe?.id==="custom"&&k(it=>({...it,name:"",base_url:"",client_type:"openai"}))},Yt=b.useMemo(()=>T!=="custom",[T]),_t=async()=>{if(S?.api_key)try{await navigator.clipboard.writeText(S.api_key),ne({title:"复制成功",description:"API Key 已复制到剪贴板"})}catch{ne({title:"复制失败",description:"无法访问剪贴板",variant:"destructive"})}},mt=()=>{if(!S)return;const ke={...S,max_retry:S.max_retry??2,timeout:S.timeout??30,retry_interval:S.retry_interval??10};if(j!==null){const Pe=[...t];Pe[j]=ke,e(Pe)}else e([...t,ke]);w(!1),k(null),N(null)},Ne=ke=>{if(!ke&&S){const Pe={...S,max_retry:S.max_retry??2,timeout:S.timeout??30,retry_interval:S.retry_interval??10};k(Pe)}w(ke)},Ie=ke=>{H(ke),P(!0)},st=()=>{if(L!==null){const ke=t.filter((Pe,it)=>it!==L);e(ke),ne({title:"删除成功",description:"提供商已从列表中移除"})}P(!1),H(null)},yt=ke=>{const Pe=new Set(B);Pe.has(ke)?Pe.delete(ke):Pe.add(ke),X(Pe)},Pt=()=>{if(B.size===Fe.length)X(new Set);else{const ke=Fe.map((Pe,it)=>t.findIndex(ot=>ot===Fe[it]));X(new Set(ke))}},At=()=>{if(B.size===0){ne({title:"提示",description:"请先选择要删除的提供商",variant:"default"});return}G(!0)},zn=()=>{const ke=t.filter((Pe,it)=>!B.has(it));e(ke),X(new Set),G(!1),ne({title:"批量删除成功",description:`已删除 ${B.size} 个提供商`})},Fe=t.filter(ke=>{if(!z)return!0;const Pe=z.toLowerCase();return ke.name.toLowerCase().includes(Pe)||ke.base_url.toLowerCase().includes(Pe)||ke.client_type.toLowerCase().includes(Pe)}),rt=Math.ceil(Fe.length/W),tn=Fe.slice((R-1)*W,R*W),Rt=()=>{const ke=parseInt(V);ke>=1&&ke<=rt&&(ie(ke),te(""))};return n?o.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"AI模型厂商配置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理 AI 模型厂商的 API 配置"})]}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[B.size>0&&o.jsxs(he,{onClick:At,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[o.jsx(Sn,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",B.size,")"]}),o.jsxs(he,{onClick:()=>kn(null,null),size:"sm",className:"w-full sm:w-auto","data-tour":"add-provider-button",children:[o.jsx(zs,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加提供商"]}),o.jsxs(he,{onClick:xt,disabled:s||a||!c||h,size:"sm",variant:"outline",className:"w-full sm:w-auto sm:min-w-[120px]",children:[o.jsx($y,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),s?"保存中...":a?"自动保存中...":c?"保存配置":"已保存"]}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsxs(he,{disabled:s||a||h,size:"sm",className:"w-full sm:w-auto sm:min-w-[120px]",children:[o.jsx(Cj,{className:"mr-2 h-4 w-4"}),h?"重启中...":c?"保存并重启":"重启麦麦"]})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认重启麦麦?"}),o.jsx(_n,{className:"space-y-3",asChild:!0,children:o.jsxs("div",{children:[o.jsx("p",{children:c?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"}),o.jsxs(ga,{className:"border-yellow-500/50 bg-yellow-500/10",children:[o.jsx(Oa,{className:"h-4 w-4 text-yellow-600"}),o.jsxs(xa,{className:"text-yellow-900 dark:text-yellow-100",children:[o.jsx("strong",{children:"重要提示:"}),"由于技术原因,使用重启功能后,将无法再使用 ",o.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。",o.jsxs(Dr,{children:[o.jsx(Sf,{asChild:!0,children:o.jsxs("button",{className:"ml-1 text-yellow-700 dark:text-yellow-300 underline hover:text-yellow-800 dark:hover:text-yellow-200 inline-flex items-center gap-1",children:[o.jsx(qy,{className:"h-3 w-3"}),"如何结束程序?"]})}),o.jsxs(Sr,{className:"max-w-2xl",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"如何结束使用重启功能后的麦麦程序"}),o.jsx(ss,{children:"由于重启功能会使程序脱离终端控制,需要通过系统命令来结束进程"})]}),o.jsxs(ja,{defaultValue:"windows",className:"w-full",children:[o.jsxs(Wi,{className:"grid w-full grid-cols-3",children:[o.jsx(Lt,{value:"windows",children:"Windows"}),o.jsx(Lt,{value:"macos",children:"macOS"}),o.jsx(Lt,{value:"linux",children:"Linux"})]}),o.jsxs(un,{value:"windows",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用任务管理器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Ctrl + Shift + Esc"})," 打开任务管理器"]}),o.jsxs("li",{children:["在“进程”或“详细信息”标签页中找到 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"python.exe"})]}),o.jsx("li",{children:"右键点击并选择“结束任务”"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用命令行"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开 PowerShell 或命令提示符,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:'Get-Process python | Where-Object {$_.MainWindowTitle -eq ""}'}),o.jsx("p",{className:"mt-2",children:"# 结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"Stop-Process -Name python -Force"})]})]})]}),o.jsxs(un,{value:"macos",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用活动监视器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Cmd + Space"})," 打开 Spotlight,搜索“活动监视器”"]}),o.jsxs("li",{children:["在进程列表中找到 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Python"})]}),o.jsx("li",{children:"选中后点击左上角的 X 按钮结束进程"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用终端"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 "}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]})]}),o.jsxs(un,{value:"linux",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用终端命令"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 "}),o.jsx("p",{className:"mt-2",children:"# 或使用 pkill 按名称结束"}),o.jsx("p",{children:'pkill -9 -f "bot.py"'}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用 htop(如已安装)"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["在终端输入 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"htop"})]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F3"})," 搜索 python"]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F9"})," 发送信号,选择 SIGKILL"]})]})]})]})]}),o.jsx(bs,{children:o.jsx(Qj,{asChild:!0,children:o.jsx(he,{variant:"outline",children:"关闭"})})})]})]})]})]})]})})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:c?Ve:Oe,children:c?"保存并重启":"确认重启"})]})]})]})]})]}),o.jsxs(ga,{children:[o.jsx(Oa,{className:"h-4 w-4"}),o.jsxs(xa,{children:["配置更新后需要",o.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),o.jsxs(wn,{className:"h-[calc(100vh-260px)]",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 mb-4",children:[o.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[o.jsx(Ni,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(ze,{placeholder:"搜索提供商名称、URL 或类型...",value:z,onChange:ke=>Q(ke.target.value),className:"pl-9"})]}),z&&o.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",Fe.length," 个结果"]})]}),o.jsx("div",{className:"md:hidden space-y-3",children:Fe.length===0?o.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:z?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'}):tn.map((ke,Pe)=>{const it=t.findIndex(ot=>ot===ke);return o.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("h3",{className:"font-semibold text-base truncate",children:ke.name}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:ke.base_url})]}),o.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[o.jsxs(he,{variant:"default",size:"sm",onClick:()=>kn(ke,it),children:[o.jsx(Yu,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),o.jsxs(he,{size:"sm",onClick:()=>Ie(it),className:"bg-red-600 hover:bg-red-700 text-white",children:[o.jsx(Sn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"客户端类型"}),o.jsx("p",{className:"font-medium",children:ke.client_type})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"最大重试"}),o.jsx("p",{className:"font-medium",children:ke.max_retry})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"超时(秒)"}),o.jsx("p",{className:"font-medium",children:ke.timeout})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"重试间隔(秒)"}),o.jsx("p",{className:"font-medium",children:ke.retry_interval})]})]})]},Pe)})}),o.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs(Tf,{children:[o.jsx(Ef,{children:o.jsxs(Ps,{children:[o.jsx(pn,{className:"w-12",children:o.jsx(Oi,{checked:B.size===Fe.length&&Fe.length>0,onCheckedChange:Pt})}),o.jsx(pn,{children:"名称"}),o.jsx(pn,{children:"基础URL"}),o.jsx(pn,{children:"客户端类型"}),o.jsx(pn,{className:"text-right",children:"最大重试"}),o.jsx(pn,{className:"text-right",children:"超时(秒)"}),o.jsx(pn,{className:"text-right",children:"重试间隔(秒)"}),o.jsx(pn,{className:"text-right",children:"操作"})]})}),o.jsx(_f,{children:tn.length===0?o.jsx(Ps,{children:o.jsx(Gt,{colSpan:8,className:"text-center text-muted-foreground py-8",children:z?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'})}):tn.map((ke,Pe)=>{const it=t.findIndex(ot=>ot===ke);return o.jsxs(Ps,{children:[o.jsx(Gt,{children:o.jsx(Oi,{checked:B.has(it),onCheckedChange:()=>yt(it)})}),o.jsx(Gt,{className:"font-medium",children:ke.name}),o.jsx(Gt,{className:"max-w-xs truncate",title:ke.base_url,children:ke.base_url}),o.jsx(Gt,{children:ke.client_type}),o.jsx(Gt,{className:"text-right",children:ke.max_retry}),o.jsx(Gt,{className:"text-right",children:ke.timeout}),o.jsx(Gt,{className:"text-right",children:ke.retry_interval}),o.jsx(Gt,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsxs(he,{variant:"default",size:"sm",onClick:()=>kn(ke,it),children:[o.jsx(Yu,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),o.jsxs(he,{size:"sm",onClick:()=>Ie(it),className:"bg-red-600 hover:bg-red-700 text-white",children:[o.jsx(Sn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},Pe)})})]})})}),Fe.length>0&&o.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(de,{htmlFor:"page-size-provider",className:"text-sm whitespace-nowrap",children:"每页显示"}),o.jsxs(Vt,{value:W.toString(),onValueChange:ke=>{q(parseInt(ke)),ie(1),X(new Set)},children:[o.jsx($t,{id:"page-size-provider",className:"w-20",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"10",children:"10"}),o.jsx(De,{value:"20",children:"20"}),o.jsx(De,{value:"50",children:"50"}),o.jsx(De,{value:"100",children:"100"})]})]}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(R-1)*W+1," 到"," ",Math.min(R*W,Fe.length)," 条,共 ",Fe.length," 条"]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{variant:"outline",size:"sm",onClick:()=>ie(1),disabled:R===1,className:"hidden sm:flex",children:o.jsx(Ep,{className:"h-4 w-4"})}),o.jsxs(he,{variant:"outline",size:"sm",onClick:()=>ie(ke=>Math.max(1,ke-1)),disabled:R===1,children:[o.jsx(vd,{className:"h-4 w-4 sm:mr-1"}),o.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ze,{type:"number",value:V,onChange:ke=>te(ke.target.value),onKeyDown:ke=>ke.key==="Enter"&&Rt(),placeholder:R.toString(),className:"w-16 h-8 text-center",min:1,max:rt}),o.jsx(he,{variant:"outline",size:"sm",onClick:Rt,disabled:!V,className:"h-8",children:"跳转"})]}),o.jsxs(he,{variant:"outline",size:"sm",onClick:()=>ie(ke=>ke+1),disabled:R>=rt,children:[o.jsx("span",{className:"hidden sm:inline",children:"下一页"}),o.jsx(yd,{className:"h-4 w-4 sm:ml-1"})]}),o.jsx(he,{variant:"outline",size:"sm",onClick:()=>ie(rt),disabled:R>=rt,className:"hidden sm:flex",children:o.jsx(_p,{className:"h-4 w-4"})})]})]})]}),o.jsx(Dr,{open:y,onOpenChange:Ne,children:o.jsxs(Sr,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto","data-tour":"provider-dialog",preventOutsideClose:se.isRunning,children:[o.jsxs(kr,{children:[o.jsx(Or,{children:j!==null?"编辑提供商":"添加提供商"}),o.jsx(ss,{children:"配置 API 提供商的连接信息和参数"})]}),o.jsxs("form",{onSubmit:ke=>{ke.preventDefault(),mt()},autoComplete:"off",children:[o.jsxs("div",{className:"grid gap-4 py-4",children:[o.jsxs("div",{className:"grid gap-2","data-tour":"provider-template-select",children:[o.jsx(de,{htmlFor:"template",children:"提供商模板"}),o.jsxs(Po,{open:_,onOpenChange:M,children:[o.jsx(zo,{asChild:!0,children:o.jsxs(he,{variant:"outline",role:"combobox","aria-expanded":_,className:"w-full justify-between",children:[T?l0.find(ke=>ke.id===T)?.display_name:"选择提供商模板...",o.jsx(Tj,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o.jsx(Xa,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:o.jsxs(vb,{children:[o.jsx(yb,{placeholder:"搜索提供商模板..."}),o.jsx(wn,{className:"h-[300px]",children:o.jsxs(bb,{className:"max-h-none overflow-visible",children:[o.jsx(wb,{children:"未找到匹配的模板"}),o.jsx(rp,{children:l0.map(ke=>o.jsxs(sp,{value:ke.display_name,onSelect:()=>It(ke.id),children:[o.jsx(Ro,{className:`mr-2 h-4 w-4 ${T===ke.id?"opacity-100":"opacity-0"}`}),ke.display_name]},ke.id))})]})})]})})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"选择预设模板可自动填充 URL 和客户端类型,支持搜索"})]}),o.jsxs("div",{className:"grid gap-2","data-tour":"provider-name-input",children:[o.jsx(de,{htmlFor:"name",children:"名称 *"}),o.jsx(ze,{id:"name",value:S?.name||"",onChange:ke=>k(Pe=>Pe?{...Pe,name:ke.target.value}:null),placeholder:"例如: DeepSeek, SiliconFlow"})]}),o.jsxs("div",{className:"grid gap-2","data-tour":"provider-url-input",children:[o.jsx(de,{htmlFor:"base_url",children:"基础 URL *"}),o.jsx(ze,{id:"base_url",value:S?.base_url||"",onChange:ke=>k(Pe=>Pe?{...Pe,base_url:ke.target.value}:null),placeholder:"https://api.example.com/v1",disabled:Yt,className:Yt?"bg-muted cursor-not-allowed":""}),Yt&&o.jsx("p",{className:"text-xs text-muted-foreground",children:'使用模板时 URL 不可编辑,切换到"自定义"以手动配置'})]}),o.jsxs("div",{className:"grid gap-2","data-tour":"provider-apikey-input",children:[o.jsx(de,{htmlFor:"api_key",children:"API Key *"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ze,{id:"api_key",type:U?"text":"password",value:S?.api_key||"",onChange:ke=>k(Pe=>Pe?{...Pe,api_key:ke.target.value}:null),placeholder:"sk-...",className:"flex-1"}),o.jsx(he,{type:"button",variant:"outline",size:"icon",onClick:()=>ee(!U),title:U?"隐藏密钥":"显示密钥",children:U?o.jsx(Ev,{className:"h-4 w-4"}):o.jsx(Ea,{className:"h-4 w-4"})}),o.jsx(he,{type:"button",variant:"outline",size:"icon",onClick:_t,title:"复制密钥",children:o.jsx(Tv,{className:"h-4 w-4"})})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"client_type",children:"客户端类型"}),o.jsxs(Vt,{value:S?.client_type||"openai",onValueChange:ke=>k(Pe=>Pe?{...Pe,client_type:ke}:null),disabled:Yt,children:[o.jsx($t,{id:"client_type",className:Yt?"bg-muted cursor-not-allowed":"",children:o.jsx(Ut,{placeholder:"选择客户端类型"})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"openai",children:"OpenAI"}),o.jsx(De,{value:"gemini",children:"Gemini"})]})]}),Yt&&o.jsx("p",{className:"text-xs text-muted-foreground",children:'使用模板时客户端类型不可编辑,切换到"自定义"以手动配置'})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"max_retry",children:"最大重试"}),o.jsx(ze,{id:"max_retry",type:"number",min:"0",value:S?.max_retry??"",onChange:ke=>{const Pe=ke.target.value===""?null:parseInt(ke.target.value);k(it=>it?{...it,max_retry:Pe}:null)},placeholder:"默认: 2"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"timeout",children:"超时(秒)"}),o.jsx(ze,{id:"timeout",type:"number",min:"1",value:S?.timeout??"",onChange:ke=>{const Pe=ke.target.value===""?null:parseInt(ke.target.value);k(it=>it?{...it,timeout:Pe}:null)},placeholder:"默认: 30"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"retry_interval",children:"重试间隔(秒)"}),o.jsx(ze,{id:"retry_interval",type:"number",min:"1",value:S?.retry_interval??"",onChange:ke=>{const Pe=ke.target.value===""?null:parseInt(ke.target.value);k(it=>it?{...it,retry_interval:Pe}:null)},placeholder:"默认: 10"})]})]})]}),o.jsxs(bs,{children:[o.jsx(he,{type:"button",variant:"outline",onClick:()=>w(!1),"data-tour":"provider-cancel-button",children:"取消"}),o.jsx(he,{type:"submit","data-tour":"provider-save-button",children:"保存"})]})]})]})}),o.jsx(Dn,{open:I,onOpenChange:P,children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:['确定要删除提供商 "',L!==null?t[L]?.name:"",'" 吗? 此操作无法撤销。']})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:st,children:"删除"})]})]})}),o.jsx(Dn,{open:J,onOpenChange:G,children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认批量删除"}),o.jsxs(_n,{children:["确定要删除选中的 ",B.size," 个提供商吗? 此操作无法撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:zn,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),g&&o.jsx(Wj,{onRestartComplete:Ue,onRestartFailed:He})]})}function Dxe(){for(var t=arguments.length,e=new Array(t),n=0;nr=>{e.forEach(s=>s(r))},e)}const jb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Df(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function W6(t){return"nodeType"in t}function Ti(t){var e,n;return t?Df(t)?t:W6(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function G6(t){const{Document:e}=Ti(t);return t instanceof e}function ig(t){return Df(t)?!1:t instanceof Ti(t).HTMLElement}function hQ(t){return t instanceof Ti(t).SVGElement}function Pf(t){return t?Df(t)?t.document:W6(t)?G6(t)?t:ig(t)||hQ(t)?t.ownerDocument:document:document:document}const Lo=jb?b.useLayoutEffect:b.useEffect;function X6(t){const e=b.useRef(t);return Lo(()=>{e.current=t}),b.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s{t.current=setInterval(r,s)},[]),n=b.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function op(t,e){e===void 0&&(e=[t]);const n=b.useRef(t);return Lo(()=>{n.current!==t&&(n.current=t)},e),n}function ag(t,e){const n=b.useRef();return b.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function cy(t){const e=X6(t),n=b.useRef(null),r=b.useCallback(s=>{s!==n.current&&e?.(s,n.current),n.current=s},[]);return[n,r]}function xO(t){const e=b.useRef();return b.useEffect(()=>{e.current=t},[t]),e.current}let xS={};function og(t,e){return b.useMemo(()=>{if(e)return e;const n=xS[t]==null?0:xS[t]+1;return xS[t]=n,t+"-"+n},[t,e])}function fQ(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s{const l=Object.entries(a);for(const[c,d]of l){const h=i[c];h!=null&&(i[c]=h+t*d)}return i},{...e})}}const Fh=fQ(1),lp=fQ(-1);function zxe(t){return"clientX"in t&&"clientY"in t}function Y6(t){if(!t)return!1;const{KeyboardEvent:e}=Ti(t.target);return e&&t instanceof e}function Ixe(t){if(!t)return!1;const{TouchEvent:e}=Ti(t.target);return e&&t instanceof e}function vO(t){if(Ixe(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return zxe(t)?{x:t.clientX,y:t.clientY}:null}const cp=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[cp.Translate.toString(t),cp.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),GM="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Lxe(t){return t.matches(GM)?t:t.querySelector(GM)}const Bxe={display:"none"};function Fxe(t){let{id:e,value:n}=t;return ae.createElement("div",{id:e,style:Bxe},n)}function qxe(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return ae.createElement("div",{id:e,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function $xe(){const[t,e]=b.useState("");return{announce:b.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const mQ=b.createContext(null);function Hxe(t){const e=b.useContext(mQ);b.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of ");return e(t)},[t,e])}function Qxe(){const[t]=b.useState(()=>new Set),e=b.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[b.useCallback(r=>{let{type:s,event:i}=r;t.forEach(a=>{var l;return(l=a[s])==null?void 0:l.call(a,i)})},[t]),e]}const Vxe={draggable:` + `)),e.appendChild(n)}componentDidMount(){const{shouldFocus:t}=this.props;setTimeout(()=>{ft.domElement(this.beacon)&&t&&this.beacon.focus()},0)}componentWillUnmount(){const t=document.getElementById("joyride-beacon-animation");t?.parentNode&&t.parentNode.removeChild(t)}render(){const{beaconComponent:t,continuous:e,index:n,isLastStep:r,locale:s,onClickOrHover:i,size:a,step:l,styles:c}=this.props,d=yo(s.open),h={"aria-label":d,onClick:i,onMouseEnter:i,ref:this.setBeaconRef,title:d};let m;if(t){const g=t;m=b.createElement(g,{continuous:e,index:n,isLastStep:r,size:a,step:l,...h})}else m=b.createElement("button",{key:"JoyrideBeacon",className:"react-joyride__beacon","data-test-id":"button-beacon",style:c.beacon,type:"button",...h},b.createElement("span",{style:c.beaconInner}),b.createElement("span",{style:c.beaconOuter}));return m}};function qxe({styles:t,...e}){const{color:n,height:r,width:s,...i}=t;return ae.createElement("button",{style:i,type:"button",...e},ae.createElement("svg",{height:typeof r=="number"?`${r}px`:r,preserveAspectRatio:"xMidYMid",version:"1.1",viewBox:"0 0 18 18",width:typeof s=="number"?`${s}px`:s,xmlns:"http://www.w3.org/2000/svg"},ae.createElement("g",null,ae.createElement("path",{d:"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z",fill:n}))))}var $xe=qxe;function Hxe(t){const{backProps:e,closeProps:n,index:r,isLastStep:s,primaryProps:i,skipProps:a,step:l,tooltipProps:c}=t,{content:d,hideBackButton:h,hideCloseButton:m,hideFooter:g,showSkipButton:x,styles:y,title:w}=l,S={};return S.primary=b.createElement("button",{"data-test-id":"button-primary",style:y.buttonNext,type:"button",...i}),x&&!s&&(S.skip=b.createElement("button",{"aria-live":"off","data-test-id":"button-skip",style:y.buttonSkip,type:"button",...a})),!h&&r>0&&(S.back=b.createElement("button",{"data-test-id":"button-back",style:y.buttonBack,type:"button",...e})),S.close=!m&&b.createElement($xe,{"data-test-id":"button-close",styles:y.buttonClose,...n}),b.createElement("div",{key:"JoyrideTooltip","aria-label":yo(w??d),className:"react-joyride__tooltip",style:y.tooltip,...c},b.createElement("div",{style:y.tooltipContainer},w&&b.createElement("h1",{"aria-label":yo(w),style:y.tooltipTitle},w),b.createElement("div",{style:y.tooltipContent},d)),!g&&b.createElement("div",{style:y.tooltipFooter},b.createElement("div",{style:y.tooltipFooterSpacer},S.skip),S.back,S.primary),S.close)}var Qxe=Hxe,Vxe=class extends b.Component{constructor(){super(...arguments),gt(this,"handleClickBack",t=>{t.preventDefault();const{helpers:e}=this.props;e.prev()}),gt(this,"handleClickClose",t=>{t.preventDefault();const{helpers:e}=this.props;e.close("button_close")}),gt(this,"handleClickPrimary",t=>{t.preventDefault();const{continuous:e,helpers:n}=this.props;if(!e){n.close("button_primary");return}n.next()}),gt(this,"handleClickSkip",t=>{t.preventDefault();const{helpers:e}=this.props;e.skip()}),gt(this,"getElementsProps",()=>{const{continuous:t,index:e,isLastStep:n,setTooltipRef:r,size:s,step:i}=this.props,{back:a,close:l,last:c,next:d,nextLabelWithProgress:h,skip:m}=i.locale,g=yo(a),x=yo(l),y=yo(c),w=yo(d),S=yo(m);let k=l,j=x;if(t){if(k=d,j=w,i.showProgress&&!n){const N=yo(h,{step:e+1,steps:s});k=SO(h,e+1,s),j=N}n&&(k=c,j=y)}return{backProps:{"aria-label":g,children:a,"data-action":"back",onClick:this.handleClickBack,role:"button",title:g},closeProps:{"aria-label":x,children:l,"data-action":"close",onClick:this.handleClickClose,role:"button",title:x},primaryProps:{"aria-label":j,children:k,"data-action":"primary",onClick:this.handleClickPrimary,role:"button",title:j},skipProps:{"aria-label":S,children:m,"data-action":"skip",onClick:this.handleClickSkip,role:"button",title:S},tooltipProps:{"aria-modal":!0,ref:r,role:"alertdialog"}}})}render(){const{continuous:t,index:e,isLastStep:n,setTooltipRef:r,size:s,step:i}=this.props,{beaconComponent:a,tooltipComponent:l,...c}=i;let d;if(l){const h={...this.getElementsProps(),continuous:t,index:e,isLastStep:n,size:s,step:c,setTooltipRef:r},m=l;d=b.createElement(m,{...h})}else d=b.createElement(Qxe,{...this.getElementsProps(),continuous:t,index:e,isLastStep:n,size:s,step:i});return d}},Uxe=class extends b.Component{constructor(){super(...arguments),gt(this,"scope",null),gt(this,"tooltip",null),gt(this,"handleClickHoverBeacon",t=>{const{step:e,store:n}=this.props;t.type==="mouseenter"&&e.event!=="hover"||n.update({lifecycle:Qt.TOOLTIP})}),gt(this,"setTooltipRef",t=>{this.tooltip=t}),gt(this,"setPopper",(t,e)=>{var n;const{action:r,lifecycle:s,step:i,store:a}=this.props;e==="wrapper"?a.setPopper("beacon",t):a.setPopper("tooltip",t),a.getPopper("beacon")&&(a.getPopper("tooltip")||i.placement==="center")&&s===Qt.INIT&&a.update({action:r,lifecycle:Qt.READY}),(n=i.floaterProps)!=null&&n.getPopper&&i.floaterProps.getPopper(t,e)}),gt(this,"renderTooltip",t=>{const{continuous:e,helpers:n,index:r,size:s,step:i}=this.props;return b.createElement(Vxe,{continuous:e,helpers:n,index:r,isLastStep:r+1===s,setTooltipRef:this.setTooltipRef,size:s,step:i,...t})})}componentDidMount(){const{debug:t,index:e}=this.props;hd({title:`step:${e}`,data:[{key:"props",value:this.props}],debug:t})}componentDidUpdate(t){var e;const{action:n,callback:r,continuous:s,controlled:i,debug:a,helpers:l,index:c,lifecycle:d,shouldScroll:h,status:m,step:g,store:x}=this.props,{changed:y,changedFrom:w}=uy(t,this.props),S=l.info(),k=s&&n!==Qn.CLOSE&&(c>0||n===Qn.PREV),j=y("action")||y("index")||y("lifecycle")||y("status"),N=w("lifecycle",[Qt.TOOLTIP,Qt.INIT],Qt.INIT),T=y("action",[Qn.NEXT,Qn.PREV,Qn.SKIP,Qn.CLOSE]),E=i&&c===t.index;if(T&&(N||E)&&r({...S,index:t.index,lifecycle:Qt.COMPLETE,step:t.step,type:Qa.STEP_AFTER}),g.placement==="center"&&m===mn.RUNNING&&y("index")&&n!==Qn.START&&d===Qt.INIT&&x.update({lifecycle:Qt.READY}),j){const _=Ml(g.target),A=!!_;A&&vxe(_)?(w("status",mn.READY,mn.RUNNING)||w("lifecycle",Qt.INIT,Qt.READY))&&r({...S,step:g,type:Qa.STEP_BEFORE}):(console.warn(A?"Target not visible":"Target not mounted",g),r({...S,type:Qa.TARGET_NOT_FOUND,step:g}),i||x.update({index:c+(n===Qn.PREV?-1:1)}))}w("lifecycle",Qt.INIT,Qt.READY)&&x.update({lifecycle:GA(g)||k?Qt.TOOLTIP:Qt.BEACON}),y("index")&&hd({title:`step:${d}`,data:[{key:"props",value:this.props}],debug:a}),y("lifecycle",Qt.BEACON)&&r({...S,step:g,type:Qa.BEACON}),y("lifecycle",Qt.TOOLTIP)&&(r({...S,step:g,type:Qa.TOOLTIP}),h&&this.tooltip&&(this.scope=new Bxe(this.tooltip,{selector:"[data-action=primary]"}),this.scope.setFocus())),w("lifecycle",[Qt.TOOLTIP,Qt.INIT],Qt.INIT)&&((e=this.scope)==null||e.removeScope(),x.cleanupPoppers())}componentWillUnmount(){var t;(t=this.scope)==null||t.removeScope()}get open(){const{lifecycle:t,step:e}=this.props;return GA(e)||t===Qt.TOOLTIP}render(){const{continuous:t,debug:e,index:n,nonce:r,shouldScroll:s,size:i,step:a}=this.props,l=Ml(a.target);return!fQ(a)||!ft.domElement(l)?null:b.createElement("div",{key:`JoyrideStep-${n}`,className:"react-joyride__step"},b.createElement(X6,{...a.floaterProps,component:this.renderTooltip,debug:e,getPopper:this.setPopper,id:`react-joyride-step-${n}`,open:this.open,placement:a.placement,target:a.target},b.createElement(Fxe,{beaconComponent:a.beaconComponent,continuous:t,index:n,isLastStep:n+1===i,locale:a.locale,nonce:r,onClickOrHover:this.handleClickHoverBeacon,shouldFocus:s,size:i,step:a,styles:a.styles})))}},pQ=class extends b.Component{constructor(t){super(t),gt(this,"helpers"),gt(this,"store"),gt(this,"callback",a=>{const{callback:l}=this.props;ft.function(l)&&l(a)}),gt(this,"handleKeyboard",a=>{const{index:l,lifecycle:c}=this.state,{steps:d}=this.props,h=d[l];c===Qt.TOOLTIP&&a.code==="Escape"&&h&&!h.disableCloseOnEsc&&this.store.close("keyboard")}),gt(this,"handleClickOverlay",()=>{const{index:a}=this.state,{steps:l}=this.props;ah(this.props,l[a]).disableOverlayClose||this.helpers.close("overlay")}),gt(this,"syncState",a=>{this.setState(a)});const{debug:e,getHelpers:n,run:r=!0,stepIndex:s}=t;this.store=Dxe({...t,controlled:r&&ft.number(s)}),this.helpers=this.store.getHelpers();const{addListener:i}=this.store;hd({title:"init",data:[{key:"props",value:this.props},{key:"state",value:this.state}],debug:e}),i(this.syncState),n&&n(this.helpers),this.state=this.store.getState()}componentDidMount(){if(!Ic())return;const{debug:t,disableCloseOnEsc:e,run:n,steps:r}=this.props,{start:s}=this.store;KA(r,t)&&n&&s(),e||document.body.addEventListener("keydown",this.handleKeyboard,{passive:!0})}componentDidUpdate(t,e){if(!Ic())return;const{action:n,controlled:r,index:s,status:i}=this.state,{debug:a,run:l,stepIndex:c,steps:d}=this.props,{stepIndex:h,steps:m}=t,{reset:g,setSteps:x,start:y,stop:w,update:S}=this.store,{changed:k}=uy(t,this.props),{changed:j,changedFrom:N}=uy(e,this.state),T=ah(this.props,d[s]),E=!ei(m,d),_=ft.number(c)&&k("stepIndex"),A=Ml(T.target);if(E&&(KA(d,a)?x(d):console.warn("Steps are not valid",d)),k("run")&&(l?y(c):w()),_){let B=ft.number(h)&&h=0?w:0,r===mn.RUNNING&&wxe(w,{element:y,duration:a}).then(()=>{setTimeout(()=>{var j;(j=this.store.getPopper("tooltip"))==null||j.instance.update()},10)})}}render(){if(!Ic())return null;const{index:t,lifecycle:e,status:n}=this.state,{continuous:r=!1,debug:s=!1,nonce:i,scrollToFirstStep:a=!1,steps:l}=this.props,c=n===mn.RUNNING,d={};if(c&&l[t]){const h=ah(this.props,l[t]);d.step=b.createElement(Uxe,{...this.state,callback:this.callback,continuous:r,debug:s,helpers:this.helpers,nonce:i,shouldScroll:!h.disableScrolling&&(t!==0||a),step:h,store:this.store}),d.overlay=b.createElement(Lxe,{id:"react-joyride-portal"},b.createElement(Ixe,{...h,continuous:r,debug:s,lifecycle:e,onClickOverlay:this.handleClickOverlay}))}return b.createElement("div",{className:"react-joyride"},d.step,d.overlay)}};gt(pQ,"defaultProps",Exe);var Wxe=pQ;function Y6(){const t=b.useContext(RH);if(!t)throw new Error("useTour must be used within a TourProvider");return t}const Gxe={options:{zIndex:1e4,primaryColor:"hsl(var(--primary))",textColor:"hsl(var(--foreground))",backgroundColor:"hsl(var(--background))",arrowColor:"hsl(var(--background))",overlayColor:"rgba(0, 0, 0, 0.5)"},tooltip:{borderRadius:"var(--radius)",padding:"1rem"},tooltipContainer:{textAlign:"left"},tooltipTitle:{fontSize:"1rem",fontWeight:600,marginBottom:"0.5rem"},tooltipContent:{fontSize:"0.875rem",padding:"0.5rem 0"},buttonNext:{backgroundColor:"hsl(var(--primary))",color:"hsl(var(--primary-foreground))",borderRadius:"calc(var(--radius) - 2px)",fontSize:"0.875rem",padding:"0.5rem 1rem"},buttonBack:{color:"hsl(var(--muted-foreground))",fontSize:"0.875rem",marginRight:"0.5rem"},buttonSkip:{color:"hsl(var(--muted-foreground))",fontSize:"0.875rem"},buttonClose:{color:"hsl(var(--muted-foreground))"},spotlight:{borderRadius:"var(--radius)"}},Xxe={back:"上一步",close:"关闭",last:"完成",next:"下一步",nextLabelWithProgress:"下一步 ({step}/{steps})",open:"打开对话框",skip:"跳过"};function Yxe(){const{state:t,getCurrentSteps:e,handleJoyrideCallback:n}=Y6(),r=e(),[s,i]=b.useState(!1),a=b.useRef(t.stepIndex),l=b.useRef(null);b.useEffect(()=>{a.current!==t.stepIndex&&(i(!1),a.current=t.stepIndex)},[t.stepIndex]),b.useEffect(()=>{if(!t.isRunning||r.length===0){i(!1);return}const h=r[t.stepIndex];if(!h){i(!1);return}const m=h.target;if(m==="body"){i(!0);return}i(!1);const g=setTimeout(()=>{const x=()=>{const k=document.querySelector(m);if(k){const j=k.getBoundingClientRect();if(j.width>0&&j.height>0)return!0}return!1};if(x()){setTimeout(()=>i(!0),100);return}const y=setInterval(()=>{x()&&(clearInterval(y),setTimeout(()=>i(!0),100))},100),w=setTimeout(()=>{clearInterval(y),i(!0)},5e3),S=()=>{clearInterval(y),clearTimeout(w)};l.current=S},150);return()=>{clearTimeout(g),l.current&&(l.current(),l.current=null)}},[t.isRunning,t.stepIndex,r]);const c=b.useRef(null);if(b.useEffect(()=>{let h=document.getElementById("tour-portal-container");return h||(h=document.createElement("div"),h.id="tour-portal-container",h.style.cssText="position: fixed; top: 0; left: 0; z-index: 99999; pointer-events: none;",document.body.appendChild(h)),c.current=h,()=>{}},[]),!t.isRunning||r.length===0||!s)return null;const d=o.jsx(Wxe,{steps:r,stepIndex:t.stepIndex,run:t.isRunning,continuous:!0,showSkipButton:!0,showProgress:!0,disableOverlayClose:!0,disableScrolling:!1,disableScrollParentFix:!1,callback:n,styles:Gxe,locale:Xxe,scrollOffset:80,scrollToFirstStep:!0,floaterProps:{styles:{floater:{zIndex:99999}},disableAnimation:!0}},`tour-step-${t.stepIndex}`);return c.current?pa.createPortal(d,c.current):d}const _l="model-assignment-tour",gQ=[{target:"body",content:"本引导旨在帮助你配置模型提供商和对应的模型,并为麦麦的各个组件分配合适的模型。",placement:"center",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="sidebar-model-provider"]',content:'第一步,你需要配置模型提供商。模型提供商决定了你要使用谁家的模型,无论是单一厂商(如 DeepSeek),还是模型平台(如 Siliconflow),都可以在这里进行配置。点击"下一步"进入配置页面。',placement:"right",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="add-provider-button"]',content:'点击"添加提供商"按钮,开始配置你的模型提供商。',placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="provider-dialog"]',content:"在这里,你可以选择你想要配置的模型提供商,填写相关信息后保存即可。",placement:"left",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-name-input"]',content:"这里的名称是你为这个模型提供商起的一个名字,方便你在后续使用时识别它。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-apikey-input"]',content:"这里需要填写你从模型提供商那里获取的 API 密钥,用于验证和调用模型服务。对于不同的提供商,获取 API 密钥的方式可能有所不同,请参考对应提供商的文档。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-url-input"]',content:"这里需要填写模型提供商的 API 访问地址,确保填写正确以便系统能够连接到模型服务。对于不同的提供商,API 地址可能有所不同,请参考对应提供商的文档。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-template-select"]',content:"当然,如果你不知道如何填写这些信息,很多模型提供商在这里都提供了预设的模板供你选择,选择对应的模板后,相关信息会自动填充。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-save-button"]',content:"填写完所有信息后,点击保存按钮,模型提供商就配置完成了。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="provider-cancel-button"]',content:"因为这次咱们什么都没有填写,所以点击取消按钮退出吧。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="sidebar-model-management"]',content:'配置好模型提供商后,接下来我们需要为麦麦添加模型并分配功能。点击"下一步"进入模型管理页面。',placement:"right",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="add-model-button"]',content:'在为麦麦的组件分配模型之前,首先需要添加你想要分配的模型,点击"添加模型"按钮开始添加。',placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="model-dialog"]',content:"在这里,你可以选择你之前配置好的模型提供商,然后选择对应的模型来添加。",placement:"left",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-name-input"]',content:"这里的模型名称是你为这个模型起的一个名字,方便你在后续使用时识别它。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-provider-select"]',content:"在这里选择你之前配置好的模型提供商,这样系统才能知道你要添加哪个提供商的模型。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-identifier-input"]',content:"这里需要填写你想要添加的模型的标识符,不同的模型提供商可能有不同的标识符格式,请参考对应提供商的文档。",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-save-button"]',content:"填写完所有信息后,点击保存按钮,模型就添加完成了。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1},{target:'[data-tour="model-cancel-button"]',content:"当然,因为这次咱们什么都没有填写,所以直接点击取消按钮退出吧,等你准备好了再来添加模型。",placement:"top",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="tasks-tab-trigger"]',content:'最后一步,添加好模型后,切换到"为模型分配功能"标签页,为麦麦的各个组件分配合适的模型。',placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!0,hideFooter:!0},{target:'[data-tour="task-model-select"]',content:"在这里,你可以为每个组件选择一个或多个合适的模型,选择完成后配置会自动保存。恭喜你完成了模型配置的学习!",placement:"bottom",disableBeacon:!0,disableOverlayClose:!0,hideCloseButton:!1,spotlightClicks:!1}],xQ={0:"/config/model",1:"/config/model",2:"/config/modelProvider",3:"/config/modelProvider",4:"/config/modelProvider",5:"/config/modelProvider",6:"/config/modelProvider",7:"/config/modelProvider",8:"/config/modelProvider",9:"/config/modelProvider",10:"/config/modelProvider",11:"/config/model",12:"/config/model",13:"/config/model",14:"/config/model",15:"/config/model",16:"/config/model",17:"/config/model",18:"/config/model",19:"/config/model"},d0=[{id:"siliconflow",name:"SiliconFlow",base_url:"https://api.siliconflow.cn/v1",client_type:"openai",display_name:"硅基流动 (SiliconFlow)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"deepseek",name:"DeepSeek",base_url:"https://api.deepseek.com",client_type:"openai",display_name:"DeepSeek",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"rinkoai",name:"RinkoAI",base_url:"https://rinkoai.com/v1",client_type:"openai",display_name:"RinkoAI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"zhipu",name:"ZhipuAI",base_url:"https://open.bigmodel.cn/api/paas/v4",client_type:"openai",display_name:"智谱 AI (ZhipuAI / GLM)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"moonshot",name:"Moonshot",base_url:"https://api.moonshot.cn/v1",client_type:"openai",display_name:"月之暗面 (Moonshot / Kimi)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"doubao",name:"Doubao",base_url:"https://ark.cn-beijing.volces.com/api/v3",client_type:"openai",display_name:"字节豆包 (Doubao)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"alibaba",name:"Alibaba",base_url:"https://dashscope.aliyuncs.com/compatible-mode/v1",client_type:"openai",display_name:"阿里云百炼 (Alibaba Qwen)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"baichuan",name:"Baichuan",base_url:"https://api.baichuan-ai.com/v1",client_type:"openai",display_name:"百川智能 (Baichuan)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"minimax",name:"MiniMax",base_url:"https://api.minimax.chat/v1",client_type:"openai",display_name:"MiniMax (海螺 AI)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"stepfun",name:"StepFun",base_url:"https://api.stepfun.com/v1",client_type:"openai",display_name:"阶跃星辰 (StepFun)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"lingyi",name:"Lingyi",base_url:"https://api.lingyiwanwu.com/v1",client_type:"openai",display_name:"零一万物 (Lingyi / Yi)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"openai",name:"OpenAI",base_url:"https://api.openai.com/v1",client_type:"openai",display_name:"OpenAI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"xai",name:"xAI",base_url:"https://api.x.ai/v1",client_type:"openai",display_name:"xAI (Grok)",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"anthropic",name:"Anthropic",base_url:"https://api.anthropic.com/v1",client_type:"openai",display_name:"Anthropic (Claude)"},{id:"gemini",name:"Gemini",base_url:"https://generativelanguage.googleapis.com/v1beta",client_type:"gemini",display_name:"Google Gemini",modelFetcher:{endpoint:"/models",parser:"gemini"}},{id:"cohere",name:"Cohere",base_url:"https://api.cohere.ai/v1",client_type:"openai",display_name:"Cohere"},{id:"groq",name:"Groq",base_url:"https://api.groq.com/openai/v1",client_type:"openai",display_name:"Groq",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"together",name:"Together AI",base_url:"https://api.together.xyz/v1",client_type:"openai",display_name:"Together AI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"fireworks",name:"Fireworks",base_url:"https://api.fireworks.ai/inference/v1",client_type:"openai",display_name:"Fireworks AI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"mistral",name:"Mistral",base_url:"https://api.mistral.ai/v1",client_type:"openai",display_name:"Mistral AI",modelFetcher:{endpoint:"/models",parser:"openai"}},{id:"perplexity",name:"Perplexity",base_url:"https://api.perplexity.ai",client_type:"openai",display_name:"Perplexity AI"},{id:"custom",name:"",base_url:"",client_type:"openai",display_name:"自定义"}];function JA(t){return t?t.replace(/\/+$/,"").toLowerCase():""}function Kxe(t){if(!t)return null;const e=JA(t);return d0.find(n=>n.id!=="custom"&&JA(n.base_url)===e)||null}function Zxe(){const[t,e]=b.useState([]),[n,r]=b.useState(!0),[s,i]=b.useState(!1),[a,l]=b.useState(!1),[c,d]=b.useState(!1),[h,m]=b.useState(!1),[g,x]=b.useState(!1),[y,w]=b.useState(!1),[S,k]=b.useState(null),[j,N]=b.useState(null),[T,E]=b.useState("custom"),[_,A]=b.useState(!1),[L,P]=b.useState(!1),[B,$]=b.useState(null),[U,te]=b.useState(!1),[z,Q]=b.useState(""),[F,Y]=b.useState(new Set),[J,X]=b.useState(!1),[R,ie]=b.useState(1),[G,I]=b.useState(20),[V,ee]=b.useState(""),{toast:ne}=as(),W=Zi(),{state:se,goToStep:re,registerTour:oe}=Y6(),Te=b.useRef(null),We=b.useRef(!0);b.useEffect(()=>{oe(_l,gQ)},[oe]),b.useEffect(()=>{if(se.activeTourId===_l&&se.isRunning){const ke=xQ[se.stepIndex];ke&&!window.location.pathname.endsWith(ke.replace("/config/",""))&&W({to:ke})}},[se.stepIndex,se.activeTourId,se.isRunning,W]);const Ye=b.useRef(se.stepIndex);b.useEffect(()=>{if(se.activeTourId===_l&&se.isRunning){const ke=Ye.current,Pe=se.stepIndex;ke>=3&&ke<=9&&Pe<3&&w(!1),Ye.current=Pe}},[se.stepIndex,se.activeTourId,se.isRunning]),b.useEffect(()=>{if(se.activeTourId!==_l||!se.isRunning)return;const ke=Pe=>{const it=Pe.target,ot=se.stepIndex;ot===2&&it.closest('[data-tour="add-provider-button"]')?setTimeout(()=>re(3),300):ot===9&&it.closest('[data-tour="provider-cancel-button"]')&&setTimeout(()=>re(10),300)};return document.addEventListener("click",ke,!0),()=>document.removeEventListener("click",ke,!0)},[se,re]),b.useEffect(()=>{Je()},[]);const Je=async()=>{try{r(!0);const ke=await Rh();e(ke.api_providers||[]),d(!1),We.current=!1}catch(ke){console.error("加载配置失败:",ke)}finally{r(!1)}},Oe=async()=>{try{m(!0),ib().catch(()=>{}),x(!0)}catch(ke){console.error("重启失败:",ke),x(!1),ne({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),m(!1)}},Ve=async()=>{try{i(!0),Te.current&&clearTimeout(Te.current);const ke=await Rh();ke.api_providers=t,await qv(ke),d(!1),ne({title:"保存成功",description:"正在重启麦麦..."}),await Oe()}catch(ke){console.error("保存配置失败:",ke),ne({title:"保存失败",description:ke.message,variant:"destructive"}),i(!1)}},Ue=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},He=()=>{x(!1),m(!1),ne({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},Ot=b.useCallback(async ke=>{if(!We.current)try{l(!0),await xk("api_providers",ke),d(!1)}catch(Pe){console.error("自动保存失败:",Pe),d(!0)}finally{l(!1)}},[]);b.useEffect(()=>{if(!We.current)return d(!0),Te.current&&clearTimeout(Te.current),Te.current=setTimeout(()=>{Ot(t)},2e3),()=>{Te.current&&clearTimeout(Te.current)}},[t,Ot]);const xt=async()=>{try{i(!0),Te.current&&clearTimeout(Te.current);const ke=await Rh();ke.api_providers=t,await qv(ke),d(!1),ne({title:"保存成功",description:"模型提供商配置已保存"})}catch(ke){console.error("保存配置失败:",ke),ne({title:"保存失败",description:ke.message,variant:"destructive"})}finally{i(!1)}},kn=(ke,Pe)=>{if(ke){const it=d0.find(ot=>ot.base_url===ke.base_url&&ot.client_type===ke.client_type);E(it?.id||"custom"),k(ke)}else E("custom"),k({name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10});N(Pe),te(!1),w(!0)},It=ke=>{E(ke),A(!1);const Pe=d0.find(it=>it.id===ke);Pe&&Pe.id!=="custom"?k(it=>({...it,name:Pe.name,base_url:Pe.base_url,client_type:Pe.client_type})):Pe?.id==="custom"&&k(it=>({...it,name:"",base_url:"",client_type:"openai"}))},Yt=b.useMemo(()=>T!=="custom",[T]),_t=async()=>{if(S?.api_key)try{await navigator.clipboard.writeText(S.api_key),ne({title:"复制成功",description:"API Key 已复制到剪贴板"})}catch{ne({title:"复制失败",description:"无法访问剪贴板",variant:"destructive"})}},mt=()=>{if(!S)return;const ke={...S,max_retry:S.max_retry??2,timeout:S.timeout??30,retry_interval:S.retry_interval??10};if(j!==null){const Pe=[...t];Pe[j]=ke,e(Pe)}else e([...t,ke]);w(!1),k(null),N(null)},Ne=ke=>{if(!ke&&S){const Pe={...S,max_retry:S.max_retry??2,timeout:S.timeout??30,retry_interval:S.retry_interval??10};k(Pe)}w(ke)},Ie=ke=>{$(ke),P(!0)},st=()=>{if(B!==null){const ke=t.filter((Pe,it)=>it!==B);e(ke),ne({title:"删除成功",description:"提供商已从列表中移除"})}P(!1),$(null)},yt=ke=>{const Pe=new Set(F);Pe.has(ke)?Pe.delete(ke):Pe.add(ke),Y(Pe)},Pt=()=>{if(F.size===Fe.length)Y(new Set);else{const ke=Fe.map((Pe,it)=>t.findIndex(ot=>ot===Fe[it]));Y(new Set(ke))}},Mt=()=>{if(F.size===0){ne({title:"提示",description:"请先选择要删除的提供商",variant:"default"});return}X(!0)},zn=()=>{const ke=t.filter((Pe,it)=>!F.has(it));e(ke),Y(new Set),X(!1),ne({title:"批量删除成功",description:`已删除 ${F.size} 个提供商`})},Fe=t.filter(ke=>{if(!z)return!0;const Pe=z.toLowerCase();return ke.name.toLowerCase().includes(Pe)||ke.base_url.toLowerCase().includes(Pe)||ke.client_type.toLowerCase().includes(Pe)}),rt=Math.ceil(Fe.length/G),tn=Fe.slice((R-1)*G,R*G),Rt=()=>{const ke=parseInt(V);ke>=1&&ke<=rt&&(ie(ke),ee(""))};return n?o.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"AI模型厂商配置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理 AI 模型厂商的 API 配置"})]}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[F.size>0&&o.jsxs(de,{onClick:Mt,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[o.jsx(Sn,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",F.size,")"]}),o.jsxs(de,{onClick:()=>kn(null,null),size:"sm",className:"w-full sm:w-auto","data-tour":"add-provider-button",children:[o.jsx(Ls,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加提供商"]}),o.jsxs(de,{onClick:xt,disabled:s||a||!c||h,size:"sm",variant:"outline",className:"w-full sm:w-auto sm:min-w-[120px]",children:[o.jsx(Gy,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),s?"保存中...":a?"自动保存中...":c?"保存配置":"已保存"]}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsxs(de,{disabled:s||a||h,size:"sm",className:"w-full sm:w-auto sm:min-w-[120px]",children:[o.jsx(Aj,{className:"mr-2 h-4 w-4"}),h?"重启中...":c?"保存并重启":"重启麦麦"]})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认重启麦麦?"}),o.jsx(_n,{className:"space-y-3",asChild:!0,children:o.jsxs("div",{children:[o.jsx("p",{children:c?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"}),o.jsxs(ga,{className:"border-yellow-500/50 bg-yellow-500/10",children:[o.jsx(Oa,{className:"h-4 w-4 text-yellow-600"}),o.jsxs(xa,{className:"text-yellow-900 dark:text-yellow-100",children:[o.jsx("strong",{children:"重要提示:"}),"由于技术原因,使用重启功能后,将无法再使用 ",o.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。",o.jsxs(Dr,{children:[o.jsx(Of,{asChild:!0,children:o.jsxs("button",{className:"ml-1 text-yellow-700 dark:text-yellow-300 underline hover:text-yellow-800 dark:hover:text-yellow-200 inline-flex items-center gap-1",children:[o.jsx(Wy,{className:"h-3 w-3"}),"如何结束程序?"]})}),o.jsxs(Sr,{className:"max-w-2xl",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"如何结束使用重启功能后的麦麦程序"}),o.jsx(ss,{children:"由于重启功能会使程序脱离终端控制,需要通过系统命令来结束进程"})]}),o.jsxs(ja,{defaultValue:"windows",className:"w-full",children:[o.jsxs(Wi,{className:"grid w-full grid-cols-3",children:[o.jsx(Lt,{value:"windows",children:"Windows"}),o.jsx(Lt,{value:"macos",children:"macOS"}),o.jsx(Lt,{value:"linux",children:"Linux"})]}),o.jsxs(un,{value:"windows",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用任务管理器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Ctrl + Shift + Esc"})," 打开任务管理器"]}),o.jsxs("li",{children:["在“进程”或“详细信息”标签页中找到 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"python.exe"})]}),o.jsx("li",{children:"右键点击并选择“结束任务”"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用命令行"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开 PowerShell 或命令提示符,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:'Get-Process python | Where-Object {$_.MainWindowTitle -eq ""}'}),o.jsx("p",{className:"mt-2",children:"# 结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"Stop-Process -Name python -Force"})]})]})]}),o.jsxs(un,{value:"macos",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用活动监视器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Cmd + Space"})," 打开 Spotlight,搜索“活动监视器”"]}),o.jsxs("li",{children:["在进程列表中找到 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Python"})]}),o.jsx("li",{children:"选中后点击左上角的 X 按钮结束进程"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用终端"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 "}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]})]}),o.jsxs(un,{value:"linux",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用终端命令"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 "}),o.jsx("p",{className:"mt-2",children:"# 或使用 pkill 按名称结束"}),o.jsx("p",{children:'pkill -9 -f "bot.py"'}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用 htop(如已安装)"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["在终端输入 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"htop"})]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F3"})," 搜索 python"]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F9"})," 发送信号,选择 SIGKILL"]})]})]})]})]}),o.jsx(ws,{children:o.jsx(Gj,{asChild:!0,children:o.jsx(de,{variant:"outline",children:"关闭"})})})]})]})]})]})]})})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:c?Ve:Oe,children:c?"保存并重启":"确认重启"})]})]})]})]})]}),o.jsxs(ga,{children:[o.jsx(Oa,{className:"h-4 w-4"}),o.jsxs(xa,{children:["配置更新后需要",o.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),o.jsxs(gn,{className:"h-[calc(100vh-260px)]",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 mb-4",children:[o.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[o.jsx(Ni,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(ze,{placeholder:"搜索提供商名称、URL 或类型...",value:z,onChange:ke=>Q(ke.target.value),className:"pl-9"})]}),z&&o.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",Fe.length," 个结果"]})]}),o.jsx("div",{className:"md:hidden space-y-3",children:Fe.length===0?o.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:z?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'}):tn.map((ke,Pe)=>{const it=t.findIndex(ot=>ot===ke);return o.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("h3",{className:"font-semibold text-base truncate",children:ke.name}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:ke.base_url})]}),o.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[o.jsxs(de,{variant:"default",size:"sm",onClick:()=>kn(ke,it),children:[o.jsx(Yu,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),o.jsxs(de,{size:"sm",onClick:()=>Ie(it),className:"bg-red-600 hover:bg-red-700 text-white",children:[o.jsx(Sn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"客户端类型"}),o.jsx("p",{className:"font-medium",children:ke.client_type})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"最大重试"}),o.jsx("p",{className:"font-medium",children:ke.max_retry})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"超时(秒)"}),o.jsx("p",{className:"font-medium",children:ke.timeout})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"重试间隔(秒)"}),o.jsx("p",{className:"font-medium",children:ke.retry_interval})]})]})]},Pe)})}),o.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs(_f,{children:[o.jsx(Af,{children:o.jsxs(Is,{children:[o.jsx(pn,{className:"w-12",children:o.jsx(Oi,{checked:F.size===Fe.length&&Fe.length>0,onCheckedChange:Pt})}),o.jsx(pn,{children:"名称"}),o.jsx(pn,{children:"基础URL"}),o.jsx(pn,{children:"客户端类型"}),o.jsx(pn,{className:"text-right",children:"最大重试"}),o.jsx(pn,{className:"text-right",children:"超时(秒)"}),o.jsx(pn,{className:"text-right",children:"重试间隔(秒)"}),o.jsx(pn,{className:"text-right",children:"操作"})]})}),o.jsx(Mf,{children:tn.length===0?o.jsx(Is,{children:o.jsx(Gt,{colSpan:8,className:"text-center text-muted-foreground py-8",children:z?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'})}):tn.map((ke,Pe)=>{const it=t.findIndex(ot=>ot===ke);return o.jsxs(Is,{children:[o.jsx(Gt,{children:o.jsx(Oi,{checked:F.has(it),onCheckedChange:()=>yt(it)})}),o.jsx(Gt,{className:"font-medium",children:ke.name}),o.jsx(Gt,{className:"max-w-xs truncate",title:ke.base_url,children:ke.base_url}),o.jsx(Gt,{children:ke.client_type}),o.jsx(Gt,{className:"text-right",children:ke.max_retry}),o.jsx(Gt,{className:"text-right",children:ke.timeout}),o.jsx(Gt,{className:"text-right",children:ke.retry_interval}),o.jsx(Gt,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsxs(de,{variant:"default",size:"sm",onClick:()=>kn(ke,it),children:[o.jsx(Yu,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),o.jsxs(de,{size:"sm",onClick:()=>Ie(it),className:"bg-red-600 hover:bg-red-700 text-white",children:[o.jsx(Sn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},Pe)})})]})})}),Fe.length>0&&o.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{htmlFor:"page-size-provider",className:"text-sm whitespace-nowrap",children:"每页显示"}),o.jsxs(Vt,{value:G.toString(),onValueChange:ke=>{I(parseInt(ke)),ie(1),Y(new Set)},children:[o.jsx($t,{id:"page-size-provider",className:"w-20",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"10",children:"10"}),o.jsx(De,{value:"20",children:"20"}),o.jsx(De,{value:"50",children:"50"}),o.jsx(De,{value:"100",children:"100"})]})]}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(R-1)*G+1," 到"," ",Math.min(R*G,Fe.length)," 条,共 ",Fe.length," 条"]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(de,{variant:"outline",size:"sm",onClick:()=>ie(1),disabled:R===1,className:"hidden sm:flex",children:o.jsx(Ap,{className:"h-4 w-4"})}),o.jsxs(de,{variant:"outline",size:"sm",onClick:()=>ie(ke=>Math.max(1,ke-1)),disabled:R===1,children:[o.jsx(vd,{className:"h-4 w-4 sm:mr-1"}),o.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ze,{type:"number",value:V,onChange:ke=>ee(ke.target.value),onKeyDown:ke=>ke.key==="Enter"&&Rt(),placeholder:R.toString(),className:"w-16 h-8 text-center",min:1,max:rt}),o.jsx(de,{variant:"outline",size:"sm",onClick:Rt,disabled:!V,className:"h-8",children:"跳转"})]}),o.jsxs(de,{variant:"outline",size:"sm",onClick:()=>ie(ke=>ke+1),disabled:R>=rt,children:[o.jsx("span",{className:"hidden sm:inline",children:"下一页"}),o.jsx(yd,{className:"h-4 w-4 sm:ml-1"})]}),o.jsx(de,{variant:"outline",size:"sm",onClick:()=>ie(rt),disabled:R>=rt,className:"hidden sm:flex",children:o.jsx(Mp,{className:"h-4 w-4"})})]})]})]}),o.jsx(Dr,{open:y,onOpenChange:Ne,children:o.jsxs(Sr,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto","data-tour":"provider-dialog",preventOutsideClose:se.isRunning,children:[o.jsxs(kr,{children:[o.jsx(Or,{children:j!==null?"编辑提供商":"添加提供商"}),o.jsx(ss,{children:"配置 API 提供商的连接信息和参数"})]}),o.jsxs("form",{onSubmit:ke=>{ke.preventDefault(),mt()},autoComplete:"off",children:[o.jsxs("div",{className:"grid gap-4 py-4",children:[o.jsxs("div",{className:"grid gap-2","data-tour":"provider-template-select",children:[o.jsx(he,{htmlFor:"template",children:"提供商模板"}),o.jsxs(zo,{open:_,onOpenChange:A,children:[o.jsx(Io,{asChild:!0,children:o.jsxs(de,{variant:"outline",role:"combobox","aria-expanded":_,className:"w-full justify-between",children:[T?d0.find(ke=>ke.id===T)?.display_name:"选择提供商模板...",o.jsx(Mj,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o.jsx(Xa,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:o.jsxs(Ob,{children:[o.jsx(jb,{placeholder:"搜索提供商模板..."}),o.jsx(gn,{className:"h-[300px]",children:o.jsxs(Nb,{className:"max-h-none overflow-visible",children:[o.jsx(Cb,{children:"未找到匹配的模板"}),o.jsx(ap,{children:d0.map(ke=>o.jsxs(op,{value:ke.display_name,onSelect:()=>It(ke.id),children:[o.jsx(Ro,{className:`mr-2 h-4 w-4 ${T===ke.id?"opacity-100":"opacity-0"}`}),ke.display_name]},ke.id))})]})})]})})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"选择预设模板可自动填充 URL 和客户端类型,支持搜索"})]}),o.jsxs("div",{className:"grid gap-2","data-tour":"provider-name-input",children:[o.jsx(he,{htmlFor:"name",children:"名称 *"}),o.jsx(ze,{id:"name",value:S?.name||"",onChange:ke=>k(Pe=>Pe?{...Pe,name:ke.target.value}:null),placeholder:"例如: DeepSeek, SiliconFlow"})]}),o.jsxs("div",{className:"grid gap-2","data-tour":"provider-url-input",children:[o.jsx(he,{htmlFor:"base_url",children:"基础 URL *"}),o.jsx(ze,{id:"base_url",value:S?.base_url||"",onChange:ke=>k(Pe=>Pe?{...Pe,base_url:ke.target.value}:null),placeholder:"https://api.example.com/v1",disabled:Yt,className:Yt?"bg-muted cursor-not-allowed":""}),Yt&&o.jsx("p",{className:"text-xs text-muted-foreground",children:'使用模板时 URL 不可编辑,切换到"自定义"以手动配置'})]}),o.jsxs("div",{className:"grid gap-2","data-tour":"provider-apikey-input",children:[o.jsx(he,{htmlFor:"api_key",children:"API Key *"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ze,{id:"api_key",type:U?"text":"password",value:S?.api_key||"",onChange:ke=>k(Pe=>Pe?{...Pe,api_key:ke.target.value}:null),placeholder:"sk-...",className:"flex-1"}),o.jsx(de,{type:"button",variant:"outline",size:"icon",onClick:()=>te(!U),title:U?"隐藏密钥":"显示密钥",children:U?o.jsx(Rv,{className:"h-4 w-4"}):o.jsx(Ea,{className:"h-4 w-4"})}),o.jsx(de,{type:"button",variant:"outline",size:"icon",onClick:_t,title:"复制密钥",children:o.jsx(Mv,{className:"h-4 w-4"})})]})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"client_type",children:"客户端类型"}),o.jsxs(Vt,{value:S?.client_type||"openai",onValueChange:ke=>k(Pe=>Pe?{...Pe,client_type:ke}:null),disabled:Yt,children:[o.jsx($t,{id:"client_type",className:Yt?"bg-muted cursor-not-allowed":"",children:o.jsx(Ut,{placeholder:"选择客户端类型"})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"openai",children:"OpenAI"}),o.jsx(De,{value:"gemini",children:"Gemini"})]})]}),Yt&&o.jsx("p",{className:"text-xs text-muted-foreground",children:'使用模板时客户端类型不可编辑,切换到"自定义"以手动配置'})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"max_retry",children:"最大重试"}),o.jsx(ze,{id:"max_retry",type:"number",min:"0",value:S?.max_retry??"",onChange:ke=>{const Pe=ke.target.value===""?null:parseInt(ke.target.value);k(it=>it?{...it,max_retry:Pe}:null)},placeholder:"默认: 2"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"timeout",children:"超时(秒)"}),o.jsx(ze,{id:"timeout",type:"number",min:"1",value:S?.timeout??"",onChange:ke=>{const Pe=ke.target.value===""?null:parseInt(ke.target.value);k(it=>it?{...it,timeout:Pe}:null)},placeholder:"默认: 30"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"retry_interval",children:"重试间隔(秒)"}),o.jsx(ze,{id:"retry_interval",type:"number",min:"1",value:S?.retry_interval??"",onChange:ke=>{const Pe=ke.target.value===""?null:parseInt(ke.target.value);k(it=>it?{...it,retry_interval:Pe}:null)},placeholder:"默认: 10"})]})]})]}),o.jsxs(ws,{children:[o.jsx(de,{type:"button",variant:"outline",onClick:()=>w(!1),"data-tour":"provider-cancel-button",children:"取消"}),o.jsx(de,{type:"submit","data-tour":"provider-save-button",children:"保存"})]})]})]})}),o.jsx(Dn,{open:L,onOpenChange:P,children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:['确定要删除提供商 "',B!==null?t[B]?.name:"",'" 吗? 此操作无法撤销。']})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:st,children:"删除"})]})]})}),o.jsx(Dn,{open:J,onOpenChange:X,children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认批量删除"}),o.jsxs(_n,{children:["确定要删除选中的 ",F.size," 个提供商吗? 此操作无法撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:zn,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),g&&o.jsx(Kj,{onRestartComplete:Ue,onRestartFailed:He})]})}function Jxe(){for(var t=arguments.length,e=new Array(t),n=0;nr=>{e.forEach(s=>s(r))},e)}const Ab=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function zf(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function K6(t){return"nodeType"in t}function Ti(t){var e,n;return t?zf(t)?t:K6(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function Z6(t){const{Document:e}=Ti(t);return t instanceof e}function og(t){return zf(t)?!1:t instanceof Ti(t).HTMLElement}function vQ(t){return t instanceof Ti(t).SVGElement}function If(t){return t?zf(t)?t.document:K6(t)?Z6(t)?t:og(t)||vQ(t)?t.ownerDocument:document:document:document}const Bo=Ab?b.useLayoutEffect:b.useEffect;function J6(t){const e=b.useRef(t);return Bo(()=>{e.current=t}),b.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s{t.current=setInterval(r,s)},[]),n=b.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function up(t,e){e===void 0&&(e=[t]);const n=b.useRef(t);return Bo(()=>{n.current!==t&&(n.current=t)},e),n}function lg(t,e){const n=b.useRef();return b.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function my(t){const e=J6(t),n=b.useRef(null),r=b.useCallback(s=>{s!==n.current&&e?.(s,n.current),n.current=s},[]);return[n,r]}function kO(t){const e=b.useRef();return b.useEffect(()=>{e.current=t},[t]),e.current}let kS={};function cg(t,e){return b.useMemo(()=>{if(e)return e;const n=kS[t]==null?0:kS[t]+1;return kS[t]=n,t+"-"+n},[t,e])}function yQ(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s{const l=Object.entries(a);for(const[c,d]of l){const h=i[c];h!=null&&(i[c]=h+t*d)}return i},{...e})}}const Fh=yQ(1),dp=yQ(-1);function t1e(t){return"clientX"in t&&"clientY"in t}function eN(t){if(!t)return!1;const{KeyboardEvent:e}=Ti(t.target);return e&&t instanceof e}function n1e(t){if(!t)return!1;const{TouchEvent:e}=Ti(t.target);return e&&t instanceof e}function OO(t){if(n1e(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return t1e(t)?{x:t.clientX,y:t.clientY}:null}const hp=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[hp.Translate.toString(t),hp.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),eM="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function r1e(t){return t.matches(eM)?t:t.querySelector(eM)}const s1e={display:"none"};function i1e(t){let{id:e,value:n}=t;return ae.createElement("div",{id:e,style:s1e},n)}function a1e(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return ae.createElement("div",{id:e,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function o1e(){const[t,e]=b.useState("");return{announce:b.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const bQ=b.createContext(null);function l1e(t){const e=b.useContext(bQ);b.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of ");return e(t)},[t,e])}function c1e(){const[t]=b.useState(()=>new Set),e=b.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[b.useCallback(r=>{let{type:s,event:i}=r;t.forEach(a=>{var l;return(l=a[s])==null?void 0:l.call(a,i)})},[t]),e]}const u1e={draggable:` To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel. - `},Uxe={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function Wxe(t){let{announcements:e=Uxe,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=Vxe}=t;const{announce:i,announcement:a}=$xe(),l=og("DndLiveRegion"),[c,d]=b.useState(!1);if(b.useEffect(()=>{d(!0)},[]),Hxe(b.useMemo(()=>({onDragStart(m){let{active:g}=m;i(e.onDragStart({active:g}))},onDragMove(m){let{active:g,over:x}=m;e.onDragMove&&i(e.onDragMove({active:g,over:x}))},onDragOver(m){let{active:g,over:x}=m;i(e.onDragOver({active:g,over:x}))},onDragEnd(m){let{active:g,over:x}=m;i(e.onDragEnd({active:g,over:x}))},onDragCancel(m){let{active:g,over:x}=m;i(e.onDragCancel({active:g,over:x}))}}),[i,e])),!c)return null;const h=ae.createElement(ae.Fragment,null,ae.createElement(Fxe,{id:r,value:s.draggable}),ae.createElement(qxe,{id:l,announcement:a}));return n?pa.createPortal(h,n):h}var us;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(us||(us={}));function uy(){}function XM(t,e){return b.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function Gxe(){for(var t=arguments.length,e=new Array(t),n=0;n[...e].filter(r=>r!=null),[...e])}const Za=Object.freeze({x:0,y:0});function pQ(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function gQ(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function Xxe(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function YM(t){let{left:e,top:n,height:r,width:s}=t;return[{x:e,y:n},{x:e+s,y:n},{x:e,y:n+r},{x:e+s,y:n+r}]}function xQ(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function KM(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const Yxe=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=KM(e,e.left,e.top),i=[];for(const a of r){const{id:l}=a,c=n.get(l);if(c){const d=pQ(KM(c),s);i.push({id:l,data:{droppableContainer:a,value:d}})}}return i.sort(gQ)},Kxe=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=YM(e),i=[];for(const a of r){const{id:l}=a,c=n.get(l);if(c){const d=YM(c),h=s.reduce((g,x,y)=>g+pQ(d[y],x),0),m=Number((h/4).toFixed(4));i.push({id:l,data:{droppableContainer:a,value:m}})}}return i.sort(gQ)};function Zxe(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),s=Math.min(e.left+e.width,t.left+t.width),i=Math.min(e.top+e.height,t.top+t.height),a=s-r,l=i-n;if(r{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=[];for(const i of r){const{id:a}=i,l=n.get(a);if(l){const c=Zxe(l,e);c>0&&s.push({id:a,data:{droppableContainer:i,value:c}})}}return s.sort(Xxe)};function e1e(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function vQ(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Za}function t1e(t){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i({...a,top:a.top+t*l.y,bottom:a.bottom+t*l.y,left:a.left+t*l.x,right:a.right+t*l.x}),{...n})}}const n1e=t1e(1);function r1e(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function s1e(t,e,n){const r=r1e(e);if(!r)return t;const{scaleX:s,scaleY:i,x:a,y:l}=r,c=t.left-a-(1-s)*parseFloat(n),d=t.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),h=s?t.width/s:t.width,m=i?t.height/i:t.height;return{width:h,height:m,top:d,right:c+h,bottom:d+m,left:c}}const i1e={ignoreTransform:!1};function zf(t,e){e===void 0&&(e=i1e);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:d,transformOrigin:h}=Ti(t).getComputedStyle(t);d&&(n=s1e(n,d,h))}const{top:r,left:s,width:i,height:a,bottom:l,right:c}=n;return{top:r,left:s,width:i,height:a,bottom:l,right:c}}function ZM(t){return zf(t,{ignoreTransform:!0})}function a1e(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function o1e(t,e){return e===void 0&&(e=Ti(t).getComputedStyle(t)),e.position==="fixed"}function l1e(t,e){e===void 0&&(e=Ti(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=e[s];return typeof i=="string"?n.test(i):!1})}function Nb(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if(G6(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!ig(s)||hQ(s)||n.includes(s))return n;const i=Ti(t).getComputedStyle(s);return s!==t&&l1e(s,i)&&n.push(s),o1e(s,i)?n:r(s.parentNode)}return t?r(t):n}function yQ(t){const[e]=Nb(t,1);return e??null}function vS(t){return!jb||!t?null:Df(t)?t:W6(t)?G6(t)||t===Pf(t).scrollingElement?window:ig(t)?t:null:null}function bQ(t){return Df(t)?t.scrollX:t.scrollLeft}function wQ(t){return Df(t)?t.scrollY:t.scrollTop}function yO(t){return{x:bQ(t),y:wQ(t)}}var vs;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(vs||(vs={}));function SQ(t){return!jb||!t?!1:t===document.scrollingElement}function kQ(t){const e={x:0,y:0},n=SQ(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},s=t.scrollTop<=e.y,i=t.scrollLeft<=e.x,a=t.scrollTop>=r.y,l=t.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:a,isRight:l,maxScroll:r,minScroll:e}}const c1e={x:.2,y:.2};function u1e(t,e,n,r,s){let{top:i,left:a,right:l,bottom:c}=n;r===void 0&&(r=10),s===void 0&&(s=c1e);const{isTop:d,isBottom:h,isLeft:m,isRight:g}=kQ(t),x={x:0,y:0},y={x:0,y:0},w={height:e.height*s.y,width:e.width*s.x};return!d&&i<=e.top+w.height?(x.y=vs.Backward,y.y=r*Math.abs((e.top+w.height-i)/w.height)):!h&&c>=e.bottom-w.height&&(x.y=vs.Forward,y.y=r*Math.abs((e.bottom-w.height-c)/w.height)),!g&&l>=e.right-w.width?(x.x=vs.Forward,y.x=r*Math.abs((e.right-w.width-l)/w.width)):!m&&a<=e.left+w.width&&(x.x=vs.Backward,y.x=r*Math.abs((e.left+w.width-a)/w.width)),{direction:x,speed:y}}function d1e(t){if(t===document.scrollingElement){const{innerWidth:i,innerHeight:a}=window;return{top:0,left:0,right:i,bottom:a,width:i,height:a}}const{top:e,left:n,right:r,bottom:s}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:s,width:t.clientWidth,height:t.clientHeight}}function OQ(t){return t.reduce((e,n)=>Fh(e,yO(n)),Za)}function h1e(t){return t.reduce((e,n)=>e+bQ(n),0)}function f1e(t){return t.reduce((e,n)=>e+wQ(n),0)}function m1e(t,e){if(e===void 0&&(e=zf),!t)return;const{top:n,left:r,bottom:s,right:i}=e(t);yQ(t)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const p1e=[["x",["left","right"],h1e],["y",["top","bottom"],f1e]];class K6{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Nb(n),s=OQ(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,a,l]of p1e)for(const c of a)Object.defineProperty(this,c,{get:()=>{const d=l(r),h=s[i]-d;return this.rect[c]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class O0{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var s;(s=this.target)==null||s.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function g1e(t){const{EventTarget:e}=Ti(t);return t instanceof e?t:Pf(t)}function yS(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var da;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(da||(da={}));function JM(t){t.preventDefault()}function x1e(t){t.stopPropagation()}var yn;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(yn||(yn={}));const jQ={start:[yn.Space,yn.Enter],cancel:[yn.Esc],end:[yn.Space,yn.Enter,yn.Tab]},v1e=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case yn.Right:return{...n,x:n.x+25};case yn.Left:return{...n,x:n.x-25};case yn.Down:return{...n,y:n.y+25};case yn.Up:return{...n,y:n.y-25}}};class Z6{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new O0(Pf(n)),this.windowListeners=new O0(Ti(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(da.Resize,this.handleCancel),this.windowListeners.add(da.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(da.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&m1e(r),n(Za)}handleKeyDown(e){if(Y6(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=jQ,coordinateGetter:a=v1e,scrollBehavior:l="smooth"}=s,{code:c}=e;if(i.end.includes(c)){this.handleEnd(e);return}if(i.cancel.includes(c)){this.handleCancel(e);return}const{collisionRect:d}=r.current,h=d?{x:d.left,y:d.top}:Za;this.referenceCoordinates||(this.referenceCoordinates=h);const m=a(e,{active:n,context:r.current,currentCoordinates:h});if(m){const g=lp(m,h),x={x:0,y:0},{scrollableAncestors:y}=r.current;for(const w of y){const S=e.code,{isTop:k,isRight:j,isLeft:N,isBottom:T,maxScroll:E,minScroll:_}=kQ(w),M=d1e(w),I={x:Math.min(S===yn.Right?M.right-M.width/2:M.right,Math.max(S===yn.Right?M.left:M.left+M.width/2,m.x)),y:Math.min(S===yn.Down?M.bottom-M.height/2:M.bottom,Math.max(S===yn.Down?M.top:M.top+M.height/2,m.y))},P=S===yn.Right&&!j||S===yn.Left&&!N,L=S===yn.Down&&!T||S===yn.Up&&!k;if(P&&I.x!==m.x){const H=w.scrollLeft+g.x,U=S===yn.Right&&H<=E.x||S===yn.Left&&H>=_.x;if(U&&!g.y){w.scrollTo({left:H,behavior:l});return}U?x.x=w.scrollLeft-H:x.x=S===yn.Right?w.scrollLeft-E.x:w.scrollLeft-_.x,x.x&&w.scrollBy({left:-x.x,behavior:l});break}else if(L&&I.y!==m.y){const H=w.scrollTop+g.y,U=S===yn.Down&&H<=E.y||S===yn.Up&&H>=_.y;if(U&&!g.x){w.scrollTo({top:H,behavior:l});return}U?x.y=w.scrollTop-H:x.y=S===yn.Down?w.scrollTop-E.y:w.scrollTop-_.y,x.y&&w.scrollBy({top:-x.y,behavior:l});break}}this.handleMove(e,Fh(lp(m,this.referenceCoordinates),x))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Z6.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=jQ,onActivation:s}=e,{active:i}=n;const{code:a}=t.nativeEvent;if(r.start.includes(a)){const l=i.activatorNode.current;return l&&t.target!==l?!1:(t.preventDefault(),s?.({event:t.nativeEvent}),!0)}return!1}}];function eA(t){return!!(t&&"distance"in t)}function tA(t){return!!(t&&"delay"in t)}class J6{constructor(e,n,r){var s;r===void 0&&(r=g1e(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:i}=e,{target:a}=i;this.props=e,this.events=n,this.document=Pf(a),this.documentListeners=new O0(this.document),this.listeners=new O0(r),this.windowListeners=new O0(Ti(a)),this.initialCoordinates=(s=vO(i))!=null?s:Za,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(da.Resize,this.handleCancel),this.windowListeners.add(da.DragStart,JM),this.windowListeners.add(da.VisibilityChange,this.handleCancel),this.windowListeners.add(da.ContextMenu,JM),this.documentListeners.add(da.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(tA(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(eA(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:r,onPending:s}=this.props;s(r,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(da.Click,x1e,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(da.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:a,options:{activationConstraint:l}}=i;if(!s)return;const c=(n=vO(e))!=null?n:Za,d=lp(s,c);if(!r&&l){if(eA(l)){if(l.tolerance!=null&&yS(d,l.tolerance))return this.handleCancel();if(yS(d,l.distance))return this.handleStart()}if(tA(l)&&yS(d,l.tolerance))return this.handleCancel();this.handlePending(l,d);return}e.cancelable&&e.preventDefault(),a(c)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===yn.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const y1e={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class eN extends J6{constructor(e){const{event:n}=e,r=Pf(n.target);super(e,y1e,r)}}eN.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const b1e={move:{name:"mousemove"},end:{name:"mouseup"}};var bO;(function(t){t[t.RightClick=2]="RightClick"})(bO||(bO={}));class w1e extends J6{constructor(e){super(e,b1e,Pf(e.event.target))}}w1e.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===bO.RightClick?!1:(r?.({event:n}),!0)}}];const bS={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class S1e extends J6{constructor(e){super(e,bS)}static setup(){return window.addEventListener(bS.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(bS.move.name,e)};function e(){}}}S1e.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;const{touches:s}=n;return s.length>1?!1:(r?.({event:n}),!0)}}];var j0;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(j0||(j0={}));var dy;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(dy||(dy={}));function k1e(t){let{acceleration:e,activator:n=j0.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:a=5,order:l=dy.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:h,delta:m,threshold:g}=t;const x=j1e({delta:m,disabled:!i}),[y,w]=Pxe(),S=b.useRef({x:0,y:0}),k=b.useRef({x:0,y:0}),j=b.useMemo(()=>{switch(n){case j0.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case j0.DraggableRect:return s}},[n,s,c]),N=b.useRef(null),T=b.useCallback(()=>{const _=N.current;if(!_)return;const M=S.current.x*k.current.x,I=S.current.y*k.current.y;_.scrollBy(M,I)},[]),E=b.useMemo(()=>l===dy.TreeOrder?[...d].reverse():d,[l,d]);b.useEffect(()=>{if(!i||!d.length||!j){w();return}for(const _ of E){if(r?.(_)===!1)continue;const M=d.indexOf(_),I=h[M];if(!I)continue;const{direction:P,speed:L}=u1e(_,I,j,e,g);for(const H of["x","y"])x[H][P[H]]||(L[H]=0,P[H]=0);if(L.x>0||L.y>0){w(),N.current=_,y(T,a),S.current=L,k.current=P;return}}S.current={x:0,y:0},k.current={x:0,y:0},w()},[e,T,r,w,i,a,JSON.stringify(j),JSON.stringify(x),y,d,E,h,JSON.stringify(g)])}const O1e={x:{[vs.Backward]:!1,[vs.Forward]:!1},y:{[vs.Backward]:!1,[vs.Forward]:!1}};function j1e(t){let{delta:e,disabled:n}=t;const r=xO(e);return ag(s=>{if(n||!r||!s)return O1e;const i={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[vs.Backward]:s.x[vs.Backward]||i.x===-1,[vs.Forward]:s.x[vs.Forward]||i.x===1},y:{[vs.Backward]:s.y[vs.Backward]||i.y===-1,[vs.Forward]:s.y[vs.Forward]||i.y===1}}},[n,e,r])}function N1e(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return ag(s=>{var i;return e==null?null:(i=r??s)!=null?i:null},[r,e])}function C1e(t,e){return b.useMemo(()=>t.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(a=>({eventName:a.eventName,handler:e(a.handler,r)}));return[...n,...i]},[]),[t,e])}var up;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(up||(up={}));var wO;(function(t){t.Optimized="optimized"})(wO||(wO={}));const nA=new Map;function T1e(t,e){let{dragging:n,dependencies:r,config:s}=e;const[i,a]=b.useState(null),{frequency:l,measure:c,strategy:d}=s,h=b.useRef(t),m=S(),g=op(m),x=b.useCallback(function(k){k===void 0&&(k=[]),!g.current&&a(j=>j===null?k:j.concat(k.filter(N=>!j.includes(N))))},[g]),y=b.useRef(null),w=ag(k=>{if(m&&!n)return nA;if(!k||k===nA||h.current!==t||i!=null){const j=new Map;for(let N of t){if(!N)continue;if(i&&i.length>0&&!i.includes(N.id)&&N.rect.current){j.set(N.id,N.rect.current);continue}const T=N.node.current,E=T?new K6(c(T),T):null;N.rect.current=E,E&&j.set(N.id,E)}return j}return k},[t,i,n,m,c]);return b.useEffect(()=>{h.current=t},[t]),b.useEffect(()=>{m||x()},[n,m]),b.useEffect(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),b.useEffect(()=>{m||typeof l!="number"||y.current!==null||(y.current=setTimeout(()=>{x(),y.current=null},l))},[l,m,x,...r]),{droppableRects:w,measureDroppableContainers:x,measuringScheduled:i!=null};function S(){switch(d){case up.Always:return!1;case up.BeforeDragging:return n;default:return!n}}}function NQ(t,e){return ag(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function E1e(t,e){return NQ(t,e)}function _1e(t){let{callback:e,disabled:n}=t;const r=X6(e),s=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return b.useEffect(()=>()=>s?.disconnect(),[s]),s}function Cb(t){let{callback:e,disabled:n}=t;const r=X6(e),s=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return b.useEffect(()=>()=>s?.disconnect(),[s]),s}function M1e(t){return new K6(zf(t),t)}function rA(t,e,n){e===void 0&&(e=M1e);const[r,s]=b.useState(null);function i(){s(c=>{if(!t)return null;if(t.isConnected===!1){var d;return(d=c??n)!=null?d:null}const h=e(t);return JSON.stringify(c)===JSON.stringify(h)?c:h})}const a=_1e({callback(c){if(t)for(const d of c){const{type:h,target:m}=d;if(h==="childList"&&m instanceof HTMLElement&&m.contains(t)){i();break}}}}),l=Cb({callback:i});return Lo(()=>{i(),t?(l?.observe(t),a?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),a?.disconnect())},[t]),r}function A1e(t){const e=NQ(t);return vQ(t,e)}const sA=[];function R1e(t){const e=b.useRef(t),n=ag(r=>t?r&&r!==sA&&t&&e.current&&t.parentNode===e.current.parentNode?r:Nb(t):sA,[t]);return b.useEffect(()=>{e.current=t},[t]),n}function D1e(t){const[e,n]=b.useState(null),r=b.useRef(t),s=b.useCallback(i=>{const a=vS(i.target);a&&n(l=>l?(l.set(a,yO(a)),new Map(l)):null)},[]);return b.useEffect(()=>{const i=r.current;if(t!==i){a(i);const l=t.map(c=>{const d=vS(c);return d?(d.addEventListener("scroll",s,{passive:!0}),[d,yO(d)]):null}).filter(c=>c!=null);n(l.length?new Map(l):null),r.current=t}return()=>{a(t),a(i)};function a(l){l.forEach(c=>{const d=vS(c);d?.removeEventListener("scroll",s)})}},[s,t]),b.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,a)=>Fh(i,a),Za):OQ(t):Za,[t,e])}function iA(t,e){e===void 0&&(e=[]);const n=b.useRef(null);return b.useEffect(()=>{n.current=null},e),b.useEffect(()=>{const r=t!==Za;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?lp(t,n.current):Za}function P1e(t){b.useEffect(()=>{if(!jb)return;const e=t.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n?.()}},t.map(e=>{let{sensor:n}=e;return n}))}function z1e(t,e){return b.useMemo(()=>t.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=a=>{i(a,e)},n},{}),[t,e])}function CQ(t){return b.useMemo(()=>t?a1e(t):null,[t])}const aA=[];function I1e(t,e){e===void 0&&(e=zf);const[n]=t,r=CQ(n?Ti(n):null),[s,i]=b.useState(aA);function a(){i(()=>t.length?t.map(c=>SQ(c)?r:new K6(e(c),c)):aA)}const l=Cb({callback:a});return Lo(()=>{l?.disconnect(),a(),t.forEach(c=>l?.observe(c))},[t]),s}function L1e(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return ig(e)?e:t}function B1e(t){let{measure:e}=t;const[n,r]=b.useState(null),s=b.useCallback(d=>{for(const{target:h}of d)if(ig(h)){r(m=>{const g=e(h);return m?{...m,width:g.width,height:g.height}:g});break}},[e]),i=Cb({callback:s}),a=b.useCallback(d=>{const h=L1e(d);i?.disconnect(),h&&i?.observe(h),r(h?e(h):null)},[e,i]),[l,c]=cy(a);return b.useMemo(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const F1e=[{sensor:eN,options:{}},{sensor:Z6,options:{}}],q1e={current:{}},yv={draggable:{measure:ZM},droppable:{measure:ZM,strategy:up.WhileDragging,frequency:wO.Optimized},dragOverlay:{measure:zf}};class N0 extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const $1e={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new N0,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:uy},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:yv,measureDroppableContainers:uy,windowRect:null,measuringScheduled:!1},H1e={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:uy,draggableNodes:new Map,over:null,measureDroppableContainers:uy},Tb=b.createContext(H1e),TQ=b.createContext($1e);function Q1e(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new N0}}}function V1e(t,e){switch(e.type){case us.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case us.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case us.DragEnd:case us.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case us.RegisterDroppable:{const{element:n}=e,{id:r}=n,s=new N0(t.droppable.containers);return s.set(r,n),{...t,droppable:{...t.droppable,containers:s}}}case us.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=e,i=t.droppable.containers.get(n);if(!i||r!==i.key)return t;const a=new N0(t.droppable.containers);return a.set(n,{...i,disabled:s}),{...t,droppable:{...t.droppable,containers:a}}}case us.UnregisterDroppable:{const{id:n,key:r}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const i=new N0(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function U1e(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=b.useContext(Tb),i=xO(r),a=xO(n?.id);return b.useEffect(()=>{if(!e&&!r&&i&&a!=null){if(!Y6(i)||document.activeElement===i.target)return;const l=s.get(a);if(!l)return;const{activatorNode:c,node:d}=l;if(!c.current&&!d.current)return;requestAnimationFrame(()=>{for(const h of[c.current,d.current]){if(!h)continue;const m=Lxe(h);if(m){m.focus();break}}})}},[r,e,s,a,i]),null}function W1e(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((s,i)=>i({transform:s,...r}),n):n}function G1e(t){return b.useMemo(()=>({draggable:{...yv.draggable,...t?.draggable},droppable:{...yv.droppable,...t?.droppable},dragOverlay:{...yv.dragOverlay,...t?.dragOverlay}}),[t?.draggable,t?.droppable,t?.dragOverlay])}function X1e(t){let{activeNode:e,measure:n,initialRect:r,config:s=!0}=t;const i=b.useRef(!1),{x:a,y:l}=typeof s=="boolean"?{x:s,y:s}:s;Lo(()=>{if(!a&&!l||!e){i.current=!1;return}if(i.current||!r)return;const d=e?.node.current;if(!d||d.isConnected===!1)return;const h=n(d),m=vQ(h,r);if(a||(m.x=0),l||(m.y=0),i.current=!0,Math.abs(m.x)>0||Math.abs(m.y)>0){const g=yQ(d);g&&g.scrollBy({top:m.y,left:m.x})}},[e,a,l,r,n])}const EQ=b.createContext({...Za,scaleX:1,scaleY:1});var Rc;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Rc||(Rc={}));const Y1e=b.memo(function(e){var n,r,s,i;let{id:a,accessibility:l,autoScroll:c=!0,children:d,sensors:h=F1e,collisionDetection:m=Jxe,measuring:g,modifiers:x,...y}=e;const w=b.useReducer(V1e,void 0,Q1e),[S,k]=w,[j,N]=Qxe(),[T,E]=b.useState(Rc.Uninitialized),_=T===Rc.Initialized,{draggable:{active:M,nodes:I,translate:P},droppable:{containers:L}}=S,H=M!=null?I.get(M):null,U=b.useRef({initial:null,translated:null}),ee=b.useMemo(()=>{var Kt;return M!=null?{id:M,data:(Kt=H?.data)!=null?Kt:q1e,rect:U}:null},[M,H]),z=b.useRef(null),[Q,B]=b.useState(null),[X,J]=b.useState(null),G=op(y,Object.values(y)),R=og("DndDescribedBy",a),ie=b.useMemo(()=>L.getEnabled(),[L]),W=G1e(g),{droppableRects:q,measureDroppableContainers:V,measuringScheduled:te}=T1e(ie,{dragging:_,dependencies:[P.x,P.y],config:W.droppable}),ne=N1e(I,M),K=b.useMemo(()=>X?vO(X):null,[X]),se=nn(),re=E1e(ne,W.draggable.measure);X1e({activeNode:M!=null?I.get(M):null,config:se.layoutShiftCompensation,initialRect:re,measure:W.draggable.measure});const oe=rA(ne,W.draggable.measure,re),Te=rA(ne?ne.parentElement:null),We=b.useRef({activatorEvent:null,active:null,activeNode:ne,collisionRect:null,collisions:null,droppableRects:q,draggableNodes:I,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ye=L.getNodeFor((n=We.current.over)==null?void 0:n.id),Je=B1e({measure:W.dragOverlay.measure}),Oe=(r=Je.nodeRef.current)!=null?r:ne,Ve=_?(s=Je.rect)!=null?s:oe:null,Ue=!!(Je.nodeRef.current&&Je.rect),He=A1e(Ue?null:oe),Ot=CQ(Oe?Ti(Oe):null),xt=R1e(_?Ye??ne:null),kn=I1e(xt),It=W1e(x,{transform:{x:P.x-He.x,y:P.y-He.y,scaleX:1,scaleY:1},activatorEvent:X,active:ee,activeNodeRect:oe,containerNodeRect:Te,draggingNodeRect:Ve,over:We.current.over,overlayNodeRect:Je.rect,scrollableAncestors:xt,scrollableAncestorRects:kn,windowRect:Ot}),Yt=K?Fh(K,P):null,_t=D1e(xt),mt=iA(_t),Ne=iA(_t,[oe]),Ie=Fh(It,mt),st=Ve?n1e(Ve,It):null,yt=ee&&st?m({active:ee,collisionRect:st,droppableRects:q,droppableContainers:ie,pointerCoordinates:Yt}):null,Pt=xQ(yt,"id"),[At,zn]=b.useState(null),Fe=Ue?It:Fh(It,Ne),rt=e1e(Fe,(i=At?.rect)!=null?i:null,oe),tn=b.useRef(null),Rt=b.useCallback((Kt,pt)=>{let{sensor:xr,options:Ur}=pt;if(z.current==null)return;const Wr=I.get(z.current);if(!Wr)return;const vr=Kt.nativeEvent,In=new xr({active:z.current,activeNode:Wr,event:vr,options:Ur,context:We,onAbort(nr){if(!I.get(nr))return;const{onDragAbort:gs}=G.current,js={id:nr};gs?.(js),j({type:"onDragAbort",event:js})},onPending(nr,ps,gs,js){if(!I.get(nr))return;const{onDragPending:Le}=G.current,Ct={id:nr,constraint:ps,initialCoordinates:gs,offset:js};Le?.(Ct),j({type:"onDragPending",event:Ct})},onStart(nr){const ps=z.current;if(ps==null)return;const gs=I.get(ps);if(!gs)return;const{onDragStart:js}=G.current,ge={activatorEvent:vr,active:{id:ps,data:gs.data,rect:U}};pa.unstable_batchedUpdates(()=>{js?.(ge),E(Rc.Initializing),k({type:us.DragStart,initialCoordinates:nr,active:ps}),j({type:"onDragStart",event:ge}),B(tn.current),J(vr)})},onMove(nr){k({type:us.DragMove,coordinates:nr})},onEnd:cr(us.DragEnd),onCancel:cr(us.DragCancel)});tn.current=In;function cr(nr){return async function(){const{active:gs,collisions:js,over:ge,scrollAdjustedTranslate:Le}=We.current;let Ct=null;if(gs&&Le){const{cancelDrop:xn}=G.current;Ct={activatorEvent:vr,active:gs,collisions:js,delta:Le,over:ge},nr===us.DragEnd&&typeof xn=="function"&&await Promise.resolve(xn(Ct))&&(nr=us.DragCancel)}z.current=null,pa.unstable_batchedUpdates(()=>{k({type:nr}),E(Rc.Uninitialized),zn(null),B(null),J(null),tn.current=null;const xn=nr===us.DragEnd?"onDragEnd":"onDragCancel";if(Ct){const Fr=G.current[xn];Fr?.(Ct),j({type:xn,event:Ct})}})}}},[I]),ke=b.useCallback((Kt,pt)=>(xr,Ur)=>{const Wr=xr.nativeEvent,vr=I.get(Ur);if(z.current!==null||!vr||Wr.dndKit||Wr.defaultPrevented)return;const In={active:vr};Kt(xr,pt.options,In)===!0&&(Wr.dndKit={capturedBy:pt.sensor},z.current=Ur,Rt(xr,pt))},[I,Rt]),Pe=C1e(h,ke);P1e(h),Lo(()=>{oe&&T===Rc.Initializing&&E(Rc.Initialized)},[oe,T]),b.useEffect(()=>{const{onDragMove:Kt}=G.current,{active:pt,activatorEvent:xr,collisions:Ur,over:Wr}=We.current;if(!pt||!xr)return;const vr={active:pt,activatorEvent:xr,collisions:Ur,delta:{x:Ie.x,y:Ie.y},over:Wr};pa.unstable_batchedUpdates(()=>{Kt?.(vr),j({type:"onDragMove",event:vr})})},[Ie.x,Ie.y]),b.useEffect(()=>{const{active:Kt,activatorEvent:pt,collisions:xr,droppableContainers:Ur,scrollAdjustedTranslate:Wr}=We.current;if(!Kt||z.current==null||!pt||!Wr)return;const{onDragOver:vr}=G.current,In=Ur.get(Pt),cr=In&&In.rect.current?{id:In.id,rect:In.rect.current,data:In.data,disabled:In.disabled}:null,nr={active:Kt,activatorEvent:pt,collisions:xr,delta:{x:Wr.x,y:Wr.y},over:cr};pa.unstable_batchedUpdates(()=>{zn(cr),vr?.(nr),j({type:"onDragOver",event:nr})})},[Pt]),Lo(()=>{We.current={activatorEvent:X,active:ee,activeNode:ne,collisionRect:st,collisions:yt,droppableRects:q,draggableNodes:I,draggingNode:Oe,draggingNodeRect:Ve,droppableContainers:L,over:At,scrollableAncestors:xt,scrollAdjustedTranslate:Ie},U.current={initial:Ve,translated:st}},[ee,ne,yt,st,I,Oe,Ve,q,L,At,xt,Ie]),k1e({...se,delta:P,draggingRect:st,pointerCoordinates:Yt,scrollableAncestors:xt,scrollableAncestorRects:kn});const it=b.useMemo(()=>({active:ee,activeNode:ne,activeNodeRect:oe,activatorEvent:X,collisions:yt,containerNodeRect:Te,dragOverlay:Je,draggableNodes:I,droppableContainers:L,droppableRects:q,over:At,measureDroppableContainers:V,scrollableAncestors:xt,scrollableAncestorRects:kn,measuringConfiguration:W,measuringScheduled:te,windowRect:Ot}),[ee,ne,oe,X,yt,Te,Je,I,L,q,At,V,xt,kn,W,te,Ot]),ot=b.useMemo(()=>({activatorEvent:X,activators:Pe,active:ee,activeNodeRect:oe,ariaDescribedById:{draggable:R},dispatch:k,draggableNodes:I,over:At,measureDroppableContainers:V}),[X,Pe,ee,oe,k,R,I,At,V]);return ae.createElement(mQ.Provider,{value:N},ae.createElement(Tb.Provider,{value:ot},ae.createElement(TQ.Provider,{value:it},ae.createElement(EQ.Provider,{value:rt},d)),ae.createElement(U1e,{disabled:l?.restoreFocus===!1})),ae.createElement(Wxe,{...l,hiddenTextDescribedById:R}));function nn(){const Kt=Q?.autoScrollEnabled===!1,pt=typeof c=="object"?c.enabled===!1:c===!1,xr=_&&!Kt&&!pt;return typeof c=="object"?{...c,enabled:xr}:{enabled:xr}}}),K1e=b.createContext(null),oA="button",Z1e="Draggable";function J1e(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const i=og(Z1e),{activators:a,activatorEvent:l,active:c,activeNodeRect:d,ariaDescribedById:h,draggableNodes:m,over:g}=b.useContext(Tb),{role:x=oA,roleDescription:y="draggable",tabIndex:w=0}=s??{},S=c?.id===e,k=b.useContext(S?EQ:K1e),[j,N]=cy(),[T,E]=cy(),_=z1e(a,e),M=op(n);Lo(()=>(m.set(e,{id:e,key:i,node:j,activatorNode:T,data:M}),()=>{const P=m.get(e);P&&P.key===i&&m.delete(e)}),[m,e]);const I=b.useMemo(()=>({role:x,tabIndex:w,"aria-disabled":r,"aria-pressed":S&&x===oA?!0:void 0,"aria-roledescription":y,"aria-describedby":h.draggable}),[r,x,w,S,y,h.draggable]);return{active:c,activatorEvent:l,activeNodeRect:d,attributes:I,isDragging:S,listeners:r?void 0:_,node:j,over:g,setNodeRef:N,setActivatorNodeRef:E,transform:k}}function eve(){return b.useContext(TQ)}const tve="Droppable",nve={timeout:25};function rve(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const i=og(tve),{active:a,dispatch:l,over:c,measureDroppableContainers:d}=b.useContext(Tb),h=b.useRef({disabled:n}),m=b.useRef(!1),g=b.useRef(null),x=b.useRef(null),{disabled:y,updateMeasurementsFor:w,timeout:S}={...nve,...s},k=op(w??r),j=b.useCallback(()=>{if(!m.current){m.current=!0;return}x.current!=null&&clearTimeout(x.current),x.current=setTimeout(()=>{d(Array.isArray(k.current)?k.current:[k.current]),x.current=null},S)},[S]),N=Cb({callback:j,disabled:y||!a}),T=b.useCallback((I,P)=>{N&&(P&&(N.unobserve(P),m.current=!1),I&&N.observe(I))},[N]),[E,_]=cy(T),M=op(e);return b.useEffect(()=>{!N||!E.current||(N.disconnect(),m.current=!1,N.observe(E.current))},[E,N]),b.useEffect(()=>(l({type:us.RegisterDroppable,element:{id:r,key:i,disabled:n,node:E,rect:g,data:M}}),()=>l({type:us.UnregisterDroppable,key:i,id:r})),[r]),b.useEffect(()=>{n!==h.current.disabled&&(l({type:us.SetDroppableDisabled,id:r,key:i,disabled:n}),h.current.disabled=n)},[r,i,n,l]),{active:a,rect:g,isOver:c?.id===r,node:E,over:c,setNodeRef:_}}function tN(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function sve(t,e){return t.reduce((n,r,s)=>{const i=e.get(r);return i&&(n[s]=i),n},Array(t.length))}function k1(t){return t!==null&&t>=0}function ive(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n{var e;let{rects:n,activeNodeRect:r,activeIndex:s,overIndex:i,index:a}=t;const l=(e=n[s])!=null?e:r;if(!l)return null;const c=lve(n,a,s);if(a===s){const d=n[i];return d?{x:ss&&a<=i?{x:-l.width-c,y:0,...O1}:a=i?{x:l.width+c,y:0,...O1}:{x:0,y:0,...O1}};function lve(t,e,n){const r=t[e],s=t[e-1],i=t[e+1];return!r||!s&&!i?0:n{let{rects:e,activeIndex:n,overIndex:r,index:s}=t;const i=tN(e,r,n),a=e[s],l=i[s];return!l||!a?null:{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}},MQ="Sortable",AQ=ae.createContext({activeIndex:-1,containerId:MQ,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:_Q,disabled:{draggable:!1,droppable:!1}});function cve(t){let{children:e,id:n,items:r,strategy:s=_Q,disabled:i=!1}=t;const{active:a,dragOverlay:l,droppableRects:c,over:d,measureDroppableContainers:h}=eve(),m=og(MQ,n),g=l.rect!==null,x=b.useMemo(()=>r.map(_=>typeof _=="object"&&"id"in _?_.id:_),[r]),y=a!=null,w=a?x.indexOf(a.id):-1,S=d?x.indexOf(d.id):-1,k=b.useRef(x),j=!ive(x,k.current),N=S!==-1&&w===-1||j,T=ave(i);Lo(()=>{j&&y&&h(x)},[j,x,y,h]),b.useEffect(()=>{k.current=x},[x]);const E=b.useMemo(()=>({activeIndex:w,containerId:m,disabled:T,disableTransforms:N,items:x,overIndex:S,useDragOverlay:g,sortedRects:sve(x,c),strategy:s}),[w,m,T.draggable,T.droppable,N,x,S,c,g,s]);return ae.createElement(AQ.Provider,{value:E},e)}const uve=t=>{let{id:e,items:n,activeIndex:r,overIndex:s}=t;return tN(n,r,s).indexOf(e)},dve=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:s,items:i,newIndex:a,previousItems:l,previousContainerId:c,transition:d}=t;return!d||!r||l!==i&&s===a?!1:n?!0:a!==s&&e===c},hve={duration:200,easing:"ease"},RQ="transform",fve=cp.Transition.toString({property:RQ,duration:0,easing:"linear"}),mve={roleDescription:"sortable"};function pve(t){let{disabled:e,index:n,node:r,rect:s}=t;const[i,a]=b.useState(null),l=b.useRef(n);return Lo(()=>{if(!e&&n!==l.current&&r.current){const c=s.current;if(c){const d=zf(r.current,{ignoreTransform:!0}),h={x:c.left-d.left,y:c.top-d.top,scaleX:c.width/d.width,scaleY:c.height/d.height};(h.x||h.y)&&a(h)}}n!==l.current&&(l.current=n)},[e,n,r,s]),b.useEffect(()=>{i&&a(null)},[i]),i}function gve(t){let{animateLayoutChanges:e=dve,attributes:n,disabled:r,data:s,getNewIndex:i=uve,id:a,strategy:l,resizeObserverConfig:c,transition:d=hve}=t;const{items:h,containerId:m,activeIndex:g,disabled:x,disableTransforms:y,sortedRects:w,overIndex:S,useDragOverlay:k,strategy:j}=b.useContext(AQ),N=xve(r,x),T=h.indexOf(a),E=b.useMemo(()=>({sortable:{containerId:m,index:T,items:h},...s}),[m,s,T,h]),_=b.useMemo(()=>h.slice(h.indexOf(a)),[h,a]),{rect:M,node:I,isOver:P,setNodeRef:L}=rve({id:a,data:E,disabled:N.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...c}}),{active:H,activatorEvent:U,activeNodeRect:ee,attributes:z,setNodeRef:Q,listeners:B,isDragging:X,over:J,setActivatorNodeRef:G,transform:R}=J1e({id:a,data:E,attributes:{...mve,...n},disabled:N.draggable}),ie=Dxe(L,Q),W=!!H,q=W&&!y&&k1(g)&&k1(S),V=!k&&X,te=V&&q?R:null,K=q?te??(l??j)({rects:w,activeNodeRect:ee,activeIndex:g,overIndex:S,index:T}):null,se=k1(g)&&k1(S)?i({id:a,items:h,activeIndex:g,overIndex:S}):T,re=H?.id,oe=b.useRef({activeId:re,items:h,newIndex:se,containerId:m}),Te=h!==oe.current.items,We=e({active:H,containerId:m,isDragging:X,isSorting:W,id:a,index:T,items:h,newIndex:oe.current.newIndex,previousItems:oe.current.items,previousContainerId:oe.current.containerId,transition:d,wasDragging:oe.current.activeId!=null}),Ye=pve({disabled:!We,index:T,node:I,rect:M});return b.useEffect(()=>{W&&oe.current.newIndex!==se&&(oe.current.newIndex=se),m!==oe.current.containerId&&(oe.current.containerId=m),h!==oe.current.items&&(oe.current.items=h)},[W,se,m,h]),b.useEffect(()=>{if(re===oe.current.activeId)return;if(re!=null&&oe.current.activeId==null){oe.current.activeId=re;return}const Oe=setTimeout(()=>{oe.current.activeId=re},50);return()=>clearTimeout(Oe)},[re]),{active:H,activeIndex:g,attributes:z,data:E,rect:M,index:T,newIndex:se,items:h,isOver:P,isSorting:W,isDragging:X,listeners:B,node:I,overIndex:S,over:J,setNodeRef:ie,setActivatorNodeRef:G,setDroppableNodeRef:L,setDraggableNodeRef:Q,transform:Ye??K,transition:Je()};function Je(){if(Ye||Te&&oe.current.newIndex===T)return fve;if(!(V&&!Y6(U)||!d)&&(W||We))return cp.Transition.toString({...d,property:RQ})}}function xve(t,e){var n,r;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t?.draggable)!=null?n:e.draggable,droppable:(r=t?.droppable)!=null?r:e.droppable}}function hy(t){if(!t)return!1;const e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const vve=[yn.Down,yn.Right,yn.Up,yn.Left],yve=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:i,over:a,scrollableAncestors:l}}=e;if(vve.includes(t.code)){if(t.preventDefault(),!n||!r)return;const c=[];i.getEnabled().forEach(m=>{if(!m||m!=null&&m.disabled)return;const g=s.get(m.id);if(g)switch(t.code){case yn.Down:r.topg.top&&c.push(m);break;case yn.Left:r.left>g.left&&c.push(m);break;case yn.Right:r.left1&&(h=d[1].id),h!=null){const m=i.get(n.id),g=i.get(h),x=g?s.get(g.id):null,y=g?.node.current;if(y&&x&&m&&g){const S=Nb(y).some((_,M)=>l[M]!==_),k=DQ(m,g),j=bve(m,g),N=S||!k?{x:0,y:0}:{x:j?r.width-x.width:0,y:j?r.height-x.height:0},T={x:x.left,y:x.top};return N.x&&N.y?T:lp(T,N)}}}};function DQ(t,e){return!hy(t)||!hy(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function bve(t,e){return!hy(t)||!hy(e)||!DQ(t,e)?!1:t.data.current.sortable.index{h.stopPropagation(),n(t)}})]})})}function Sve({options:t,selected:e,onChange:n,placeholder:r="选择选项...",emptyText:s="未找到选项",className:i}){const[a,l]=b.useState(!1),c=Gxe(XM(eN,{activationConstraint:{distance:8}}),XM(Z6,{coordinateGetter:yve})),d=g=>{e.includes(g)?n(e.filter(x=>x!==g)):n([...e,g])},h=g=>{n(e.filter(x=>x!==g))},m=g=>{const{active:x,over:y}=g;if(y&&x.id!==y.id){const w=e.indexOf(x.id),S=e.indexOf(y.id);n(tN(e,w,S))}};return o.jsxs(Po,{open:a,onOpenChange:l,children:[o.jsx(zo,{asChild:!0,children:o.jsxs(he,{variant:"outline",role:"combobox","aria-expanded":a,className:ve("w-full justify-between min-h-10 h-auto",i),children:[o.jsx(Y1e,{sensors:c,collisionDetection:Yxe,onDragEnd:m,children:o.jsx(cve,{items:e,strategy:ove,children:o.jsx("div",{className:"flex gap-1 flex-wrap flex-1",children:e.length===0?o.jsx("span",{className:"text-muted-foreground",children:r}):e.map(g=>{const x=t.find(y=>y.value===g);return o.jsx(wve,{value:g,label:x?.label||g,onRemove:h},g)})})})}),o.jsx(Tj,{className:"ml-2 h-4 w-4 shrink-0 opacity-50",strokeWidth:2,fill:"none"})]})}),o.jsx(Xa,{className:"w-full p-0",align:"start",children:o.jsxs(vb,{children:[o.jsx(yb,{placeholder:"搜索...",className:"h-9"}),o.jsxs(bb,{children:[o.jsx(wb,{children:s}),o.jsx(rp,{children:t.map(g=>{const x=e.includes(g.value);return o.jsxs(sp,{value:g.value,onSelect:()=>d(g.value),children:[o.jsx("div",{className:ve("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",x?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:o.jsx(Ro,{className:"h-3 w-3",strokeWidth:2,fill:"none"})}),o.jsx("span",{children:g.label})]},g.value)})})]})]})})]})}const lA=new Map,kve=300*1e3;function Ove(){const[t,e]=b.useState([]),[n,r]=b.useState([]),[s,i]=b.useState([]),[a,l]=b.useState([]),[c,d]=b.useState(null),[h,m]=b.useState(!0),[g,x]=b.useState(!1),[y,w]=b.useState(!1),[S,k]=b.useState(!1),[j,N]=b.useState(!1),[T,E]=b.useState(!1),[_,M]=b.useState(!1),[I,P]=b.useState(null),[L,H]=b.useState(null),[U,ee]=b.useState(!1),[z,Q]=b.useState(null),[B,X]=b.useState(""),[J,G]=b.useState(new Set),[R,ie]=b.useState(!1),[W,q]=b.useState(1),[V,te]=b.useState(20),[ne,K]=b.useState(""),[se,re]=b.useState([]),[oe,Te]=b.useState(!1),[We,Ye]=b.useState(null),[Je,Oe]=b.useState(!1),[Ve,Ue]=b.useState(null),{toast:He}=fs(),Ot=Zi(),{registerTour:xt,startTour:kn,state:It,goToStep:Yt}=U6(),_t=b.useRef(null),mt=b.useRef(null),Ne=b.useRef(!0);b.useEffect(()=>{xt(El,uQ)},[xt]),b.useEffect(()=>{if(It.activeTourId===El&&It.isRunning){const ge=dQ[It.stepIndex];ge&&!window.location.pathname.endsWith(ge.replace("/config/",""))&&Ot({to:ge})}},[It.stepIndex,It.activeTourId,It.isRunning,Ot]);const Ie=b.useRef(It.stepIndex);b.useEffect(()=>{if(It.activeTourId===El&&It.isRunning){const ge=Ie.current,Le=It.stepIndex;ge>=12&&ge<=17&&Le<12&&M(!1),Ie.current=Le}},[It.stepIndex,It.activeTourId,It.isRunning]),b.useEffect(()=>{if(It.activeTourId!==El||!It.isRunning)return;const ge=Le=>{const Ct=Le.target,xn=It.stepIndex;xn===2&&Ct.closest('[data-tour="add-provider-button"]')?setTimeout(()=>Yt(3),300):xn===9&&Ct.closest('[data-tour="provider-cancel-button"]')?setTimeout(()=>Yt(10),300):xn===11&&Ct.closest('[data-tour="add-model-button"]')?setTimeout(()=>Yt(12),300):xn===17&&Ct.closest('[data-tour="model-cancel-button"]')?setTimeout(()=>Yt(18),300):xn===18&&Ct.closest('[data-tour="tasks-tab-trigger"]')&&setTimeout(()=>Yt(19),300)};return document.addEventListener("click",ge,!0),()=>document.removeEventListener("click",ge,!0)},[It,Yt]);const st=()=>{kn(El)};b.useEffect(()=>{yt()},[]);const yt=async()=>{try{m(!0);const ge=await Rh(),Le=ge.models||[];e(Le),l(Le.map(xn=>xn.name));const Ct=ge.api_providers||[];r(Ct.map(xn=>xn.name)),i(Ct),d(ge.model_task_config||null),k(!1),Ne.current=!1}catch(ge){console.error("加载配置失败:",ge)}finally{m(!1)}},Pt=b.useCallback(ge=>s.find(Le=>Le.name===ge),[s]),At=b.useCallback(async(ge,Le=!1)=>{const Ct=Pt(ge);if(!Ct?.base_url){re([]),Ue(null),Ye('提供商配置不完整,请先在"模型提供商配置"中配置');return}if(!Ct.api_key){re([]),Ue(null),Ye('该提供商未配置 API Key,请先在"模型提供商配置"中填写');return}const xn=Axe(Ct.base_url);if(Ue(xn),!xn?.modelFetcher){re([]),Ye(null);return}const Fr=`${ge}:${Ct.base_url}`,Cr=lA.get(Fr);if(!Le&&Cr&&Date.now()-Cr.timestamp{_&&I?.api_provider&&At(I.api_provider)},[_,I?.api_provider,At]);const zn=async()=>{try{N(!0),Jy().catch(()=>{}),E(!0)}catch(ge){console.error("重启失败:",ge),E(!1),He({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),N(!1)}},Fe=async()=>{try{x(!0),_t.current&&clearTimeout(_t.current),mt.current&&clearTimeout(mt.current);const ge=await Rh();ge.models=t,ge.model_task_config=c,await zv(ge),k(!1),He({title:"保存成功",description:"正在重启麦麦..."}),await zn()}catch(ge){console.error("保存配置失败:",ge),He({title:"保存失败",description:ge.message,variant:"destructive"}),x(!1)}},rt=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},tn=()=>{E(!1),N(!1),He({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},Rt=b.useCallback(async ge=>{if(!Ne.current)try{w(!0),await dk("models",ge),k(!1)}catch(Le){console.error("自动保存模型列表失败:",Le),k(!0)}finally{w(!1)}},[]),ke=b.useCallback(async ge=>{if(!Ne.current)try{w(!0),await dk("model_task_config",ge),k(!1)}catch(Le){console.error("自动保存任务配置失败:",Le),k(!0)}finally{w(!1)}},[]);b.useEffect(()=>{if(!Ne.current)return k(!0),_t.current&&clearTimeout(_t.current),_t.current=setTimeout(()=>{Rt(t)},2e3),()=>{_t.current&&clearTimeout(_t.current)}},[t,Rt]),b.useEffect(()=>{if(!(Ne.current||!c))return k(!0),mt.current&&clearTimeout(mt.current),mt.current=setTimeout(()=>{ke(c)},2e3),()=>{mt.current&&clearTimeout(mt.current)}},[c,ke]);const Pe=async()=>{try{x(!0),_t.current&&clearTimeout(_t.current),mt.current&&clearTimeout(mt.current);const ge=await Rh();ge.models=t,ge.model_task_config=c,await zv(ge),k(!1),He({title:"保存成功",description:"模型配置已保存"}),await yt()}catch(ge){console.error("保存配置失败:",ge),He({title:"保存失败",description:ge.message,variant:"destructive"})}finally{x(!1)}},it=(ge,Le)=>{P(ge||{model_identifier:"",name:"",api_provider:n[0]||"",price_in:0,price_out:0,force_stream_mode:!1,extra_params:{}}),H(Le),M(!0)},ot=()=>{if(!I)return;const ge={...I,price_in:I.price_in??0,price_out:I.price_out??0};let Le;L!==null?(Le=[...t],Le[L]=ge):Le=[...t,ge],e(Le),l(Le.map(Ct=>Ct.name)),M(!1),P(null),H(null)},nn=ge=>{if(!ge&&I){const Le={...I,price_in:I.price_in??0,price_out:I.price_out??0};P(Le)}M(ge)},Kt=ge=>{Q(ge),ee(!0)},pt=()=>{if(z!==null){const ge=t.filter((Le,Ct)=>Ct!==z);e(ge),l(ge.map(Le=>Le.name)),He({title:"删除成功",description:"模型已从列表中移除"})}ee(!1),Q(null)},xr=ge=>{const Le=new Set(J);Le.has(ge)?Le.delete(ge):Le.add(ge),G(Le)},Ur=()=>{if(J.size===cr.length)G(new Set);else{const ge=cr.map((Le,Ct)=>t.findIndex(xn=>xn===cr[Ct]));G(new Set(ge))}},Wr=()=>{if(J.size===0){He({title:"提示",description:"请先选择要删除的模型",variant:"default"});return}ie(!0)},vr=()=>{const ge=t.filter((Le,Ct)=>!J.has(Ct));e(ge),l(ge.map(Le=>Le.name)),G(new Set),ie(!1),He({title:"批量删除成功",description:`已删除 ${J.size} 个模型`})},In=(ge,Le,Ct)=>{c&&d({...c,[ge]:{...c[ge],[Le]:Ct}})},cr=t.filter(ge=>{if(!B)return!0;const Le=B.toLowerCase();return ge.name.toLowerCase().includes(Le)||ge.model_identifier.toLowerCase().includes(Le)||ge.api_provider.toLowerCase().includes(Le)}),nr=Math.ceil(cr.length/V),ps=cr.slice((W-1)*V,W*V),gs=()=>{const ge=parseInt(ne);ge>=1&&ge<=nr&&(q(ge),K(""))},js=ge=>c?[c.utils?.model_list||[],c.utils_small?.model_list||[],c.tool_use?.model_list||[],c.replyer?.model_list||[],c.planner?.model_list||[],c.vlm?.model_list||[],c.voice?.model_list||[],c.embedding?.model_list||[],c.lpmm_entity_extract?.model_list||[],c.lpmm_rdf_build?.model_list||[],c.lpmm_qa?.model_list||[]].some(Ct=>Ct.includes(ge)):!1;return h?o.jsx(wn,{className:"h-full",children:o.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):o.jsx(wn,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型管理与分配"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"添加模型并为模型分配功能"})]}),o.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[o.jsxs(he,{onClick:Pe,disabled:g||y||!S||j,size:"sm",variant:"outline",className:"flex-1 sm:flex-none sm:min-w-[120px]",children:[o.jsx($y,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),g?"保存中...":y?"自动保存中...":S?"保存配置":"已保存"]}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsxs(he,{disabled:g||y||j,size:"sm",className:"flex-1 sm:flex-none sm:min-w-[120px]",children:[o.jsx(Cj,{className:"mr-2 h-4 w-4"}),j?"重启中...":S?"保存并重启":"重启麦麦"]})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认重启麦麦?"}),o.jsx(_n,{className:"space-y-3",asChild:!0,children:o.jsxs("div",{children:[o.jsx("p",{children:S?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"}),o.jsxs(ga,{className:"border-yellow-500/50 bg-yellow-500/10",children:[o.jsx(Oa,{className:"h-4 w-4 text-yellow-600"}),o.jsxs(xa,{className:"text-yellow-900 dark:text-yellow-100",children:[o.jsx("strong",{children:"重要提示:"}),"由于技术原因,使用重启功能后,将无法再使用 ",o.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。",o.jsxs(Dr,{children:[o.jsx(Sf,{asChild:!0,children:o.jsxs("button",{className:"ml-1 text-yellow-700 dark:text-yellow-300 underline hover:text-yellow-800 dark:hover:text-yellow-200 inline-flex items-center gap-1",children:[o.jsx(qy,{className:"h-3 w-3"}),"如何结束程序?"]})}),o.jsxs(Sr,{className:"max-w-2xl",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"如何结束使用重启功能后的麦麦程序"}),o.jsx(ss,{children:"由于重启功能会使程序脱离终端控制,需要通过系统命令来结束进程"})]}),o.jsxs(ja,{defaultValue:"windows",className:"w-full",children:[o.jsxs(Wi,{className:"grid w-full grid-cols-3",children:[o.jsx(Lt,{value:"windows",children:"Windows"}),o.jsx(Lt,{value:"macos",children:"macOS"}),o.jsx(Lt,{value:"linux",children:"Linux"})]}),o.jsxs(un,{value:"windows",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用任务管理器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Ctrl + Shift + Esc"})," 打开任务管理器"]}),o.jsxs("li",{children:['在"进程"或"详细信息"标签页中找到 ',o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"python.exe"})]}),o.jsx("li",{children:'右键点击并选择"结束任务"'})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用命令行"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开 PowerShell 或命令提示符,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:'Get-Process python | Where-Object {$_.MainWindowTitle -eq ""}'}),o.jsx("p",{className:"mt-2",children:"# 结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"Stop-Process -Name python -Force"})]})]})]}),o.jsxs(un,{value:"macos",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用活动监视器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Cmd + Space"}),' 打开 Spotlight,搜索"活动监视器"']}),o.jsxs("li",{children:["在进程列表中找到 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Python"})]}),o.jsx("li",{children:"选中后点击左上角的 X 按钮结束进程"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用终端"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 "}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]})]}),o.jsxs(un,{value:"linux",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用终端命令"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 "}),o.jsx("p",{className:"mt-2",children:"# 或使用 pkill 按名称结束"}),o.jsx("p",{children:'pkill -9 -f "bot.py"'}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用 htop(如已安装)"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["在终端输入 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"htop"})]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F3"})," 搜索 python"]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F9"})," 发送信号,选择 SIGKILL"]})]})]})]})]}),o.jsx(bs,{children:o.jsx(Qj,{asChild:!0,children:o.jsx(he,{variant:"outline",children:"关闭"})})})]})]})]})]})]})})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:S?Fe:zn,children:S?"保存并重启":"确认重启"})]})]})]})]})]}),o.jsxs(ga,{children:[o.jsx(Oa,{className:"h-4 w-4"}),o.jsxs(xa,{children:["配置更新后需要",o.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),o.jsxs(ga,{className:"hidden lg:flex border-primary/30 bg-primary/5 cursor-pointer hover:bg-primary/10 transition-colors",onClick:st,children:[o.jsx(Pee,{className:"h-4 w-4 text-primary"}),o.jsxs(xa,{className:"flex items-center justify-between",children:[o.jsxs("span",{children:[o.jsx("strong",{className:"text-primary",children:"新手引导:"}),"不知道如何配置模型?点击这里开始学习如何为麦麦的组件分配模型。"]}),o.jsx(he,{variant:"outline",size:"sm",className:"ml-4 shrink-0",children:"开始引导"})]})]}),o.jsxs(ja,{defaultValue:"models",className:"w-full",children:[o.jsxs(Wi,{className:"grid w-full max-w-full sm:max-w-md grid-cols-2",children:[o.jsx(Lt,{value:"models",children:"添加模型"}),o.jsx(Lt,{value:"tasks","data-tour":"tasks-tab-trigger",children:"为模型分配功能"})]}),o.jsxs(un,{value:"models",className:"space-y-4 mt-0",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:"配置可用的模型列表"}),o.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[J.size>0&&o.jsxs(he,{onClick:Wr,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[o.jsx(Sn,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",J.size,")"]}),o.jsxs(he,{onClick:()=>it(null,null),size:"sm",variant:"outline",className:"w-full sm:w-auto","data-tour":"add-model-button",children:[o.jsx(zs,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加模型"]})]})]}),o.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2",children:[o.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[o.jsx(Ni,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(ze,{placeholder:"搜索模型名称、标识符或提供商...",value:B,onChange:ge=>X(ge.target.value),className:"pl-9"})]}),B&&o.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",cr.length," 个结果"]})]}),o.jsx("div",{className:"md:hidden space-y-3",children:ps.length===0?o.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:B?"未找到匹配的模型":"暂无模型配置"}):ps.map((ge,Le)=>{const Ct=t.findIndex(Fr=>Fr===ge),xn=js(ge.name);return o.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx("h3",{className:"font-semibold text-base",children:ge.name}),o.jsx(Xn,{variant:xn?"default":"secondary",className:xn?"bg-green-600 hover:bg-green-700":"",children:xn?"已使用":"未使用"})]}),o.jsx("p",{className:"text-xs text-muted-foreground break-all",title:ge.model_identifier,children:ge.model_identifier})]}),o.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[o.jsxs(he,{variant:"default",size:"sm",onClick:()=>it(ge,Ct),children:[o.jsx(Yu,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),o.jsxs(he,{size:"sm",onClick:()=>Kt(Ct),className:"bg-red-600 hover:bg-red-700 text-white",children:[o.jsx(Sn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"提供商"}),o.jsx("p",{className:"font-medium",children:ge.api_provider})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"强制流式"}),o.jsx("p",{className:"font-medium",children:ge.force_stream_mode?"是":"否"})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"输入价格"}),o.jsxs("p",{className:"font-medium",children:["¥",ge.price_in,"/M"]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"输出价格"}),o.jsxs("p",{className:"font-medium",children:["¥",ge.price_out,"/M"]})]})]})]},Le)})}),o.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs(Tf,{children:[o.jsx(Ef,{children:o.jsxs(Ps,{children:[o.jsx(pn,{className:"w-12",children:o.jsx(Oi,{checked:J.size===cr.length&&cr.length>0,onCheckedChange:Ur})}),o.jsx(pn,{className:"w-24",children:"使用状态"}),o.jsx(pn,{children:"模型名称"}),o.jsx(pn,{children:"模型标识符"}),o.jsx(pn,{children:"提供商"}),o.jsx(pn,{className:"text-right",children:"输入价格"}),o.jsx(pn,{className:"text-right",children:"输出价格"}),o.jsx(pn,{className:"text-center",children:"强制流式"}),o.jsx(pn,{className:"text-right",children:"操作"})]})}),o.jsx(_f,{children:ps.length===0?o.jsx(Ps,{children:o.jsx(Gt,{colSpan:9,className:"text-center text-muted-foreground py-8",children:B?"未找到匹配的模型":"暂无模型配置"})}):ps.map((ge,Le)=>{const Ct=t.findIndex(Fr=>Fr===ge),xn=js(ge.name);return o.jsxs(Ps,{children:[o.jsx(Gt,{children:o.jsx(Oi,{checked:J.has(Ct),onCheckedChange:()=>xr(Ct)})}),o.jsx(Gt,{children:o.jsx(Xn,{variant:xn?"default":"secondary",className:xn?"bg-green-600 hover:bg-green-700":"",children:xn?"已使用":"未使用"})}),o.jsx(Gt,{className:"font-medium",children:ge.name}),o.jsx(Gt,{className:"max-w-xs truncate",title:ge.model_identifier,children:ge.model_identifier}),o.jsx(Gt,{children:ge.api_provider}),o.jsxs(Gt,{className:"text-right",children:["¥",ge.price_in,"/M"]}),o.jsxs(Gt,{className:"text-right",children:["¥",ge.price_out,"/M"]}),o.jsx(Gt,{className:"text-center",children:ge.force_stream_mode?"是":"否"}),o.jsx(Gt,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsxs(he,{variant:"default",size:"sm",onClick:()=>it(ge,Ct),children:[o.jsx(Yu,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),o.jsxs(he,{size:"sm",onClick:()=>Kt(Ct),className:"bg-red-600 hover:bg-red-700 text-white",children:[o.jsx(Sn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},Le)})})]})})}),cr.length>0&&o.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(de,{htmlFor:"page-size-model",className:"text-sm whitespace-nowrap",children:"每页显示"}),o.jsxs(Vt,{value:V.toString(),onValueChange:ge=>{te(parseInt(ge)),q(1),G(new Set)},children:[o.jsx($t,{id:"page-size-model",className:"w-20",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"10",children:"10"}),o.jsx(De,{value:"20",children:"20"}),o.jsx(De,{value:"50",children:"50"}),o.jsx(De,{value:"100",children:"100"})]})]}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(W-1)*V+1," 到"," ",Math.min(W*V,cr.length)," 条,共 ",cr.length," 条"]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{variant:"outline",size:"sm",onClick:()=>q(1),disabled:W===1,className:"hidden sm:flex",children:o.jsx(Ep,{className:"h-4 w-4"})}),o.jsxs(he,{variant:"outline",size:"sm",onClick:()=>q(ge=>Math.max(1,ge-1)),disabled:W===1,children:[o.jsx(vd,{className:"h-4 w-4 sm:mr-1"}),o.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ze,{type:"number",value:ne,onChange:ge=>K(ge.target.value),onKeyDown:ge=>ge.key==="Enter"&&gs(),placeholder:W.toString(),className:"w-16 h-8 text-center",min:1,max:nr}),o.jsx(he,{variant:"outline",size:"sm",onClick:gs,disabled:!ne,className:"h-8",children:"跳转"})]}),o.jsxs(he,{variant:"outline",size:"sm",onClick:()=>q(ge=>ge+1),disabled:W>=nr,children:[o.jsx("span",{className:"hidden sm:inline",children:"下一页"}),o.jsx(yd,{className:"h-4 w-4 sm:ml-1"})]}),o.jsx(he,{variant:"outline",size:"sm",onClick:()=>q(nr),disabled:W>=nr,className:"hidden sm:flex",children:o.jsx(_p,{className:"h-4 w-4"})})]})]})]}),o.jsxs(un,{value:"tasks",className:"space-y-6 mt-0",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:"为不同的任务配置使用的模型和参数"}),c&&o.jsxs("div",{className:"grid gap-4 sm:gap-6",children:[o.jsx(Fa,{title:"组件模型 (utils)",description:"用于表情包、取名、关系、情绪变化等组件",taskConfig:c.utils,modelNames:a,onChange:(ge,Le)=>In("utils",ge,Le),dataTour:"task-model-select"}),o.jsx(Fa,{title:"组件小模型 (utils_small)",description:"消耗量较大的组件,建议使用速度较快的小模型",taskConfig:c.utils_small,modelNames:a,onChange:(ge,Le)=>In("utils_small",ge,Le)}),o.jsx(Fa,{title:"工具调用模型 (tool_use)",description:"需要使用支持工具调用的模型",taskConfig:c.tool_use,modelNames:a,onChange:(ge,Le)=>In("tool_use",ge,Le)}),o.jsx(Fa,{title:"首要回复模型 (replyer)",description:"用于表达器和表达方式学习",taskConfig:c.replyer,modelNames:a,onChange:(ge,Le)=>In("replyer",ge,Le)}),o.jsx(Fa,{title:"决策模型 (planner)",description:"负责决定麦麦该什么时候回复",taskConfig:c.planner,modelNames:a,onChange:(ge,Le)=>In("planner",ge,Le)}),o.jsx(Fa,{title:"图像识别模型 (vlm)",description:"视觉语言模型",taskConfig:c.vlm,modelNames:a,onChange:(ge,Le)=>In("vlm",ge,Le),hideTemperature:!0}),o.jsx(Fa,{title:"语音识别模型 (voice)",description:"语音转文字",taskConfig:c.voice,modelNames:a,onChange:(ge,Le)=>In("voice",ge,Le),hideTemperature:!0,hideMaxTokens:!0}),o.jsx(Fa,{title:"嵌入模型 (embedding)",description:"用于向量化",taskConfig:c.embedding,modelNames:a,onChange:(ge,Le)=>In("embedding",ge,Le),hideTemperature:!0,hideMaxTokens:!0}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库模型"}),o.jsx(Fa,{title:"实体提取模型 (lpmm_entity_extract)",description:"从文本中提取实体",taskConfig:c.lpmm_entity_extract,modelNames:a,onChange:(ge,Le)=>In("lpmm_entity_extract",ge,Le)}),o.jsx(Fa,{title:"RDF 构建模型 (lpmm_rdf_build)",description:"构建知识图谱",taskConfig:c.lpmm_rdf_build,modelNames:a,onChange:(ge,Le)=>In("lpmm_rdf_build",ge,Le)}),o.jsx(Fa,{title:"问答模型 (lpmm_qa)",description:"知识库问答",taskConfig:c.lpmm_qa,modelNames:a,onChange:(ge,Le)=>In("lpmm_qa",ge,Le)})]})]})]})]}),o.jsx(Dr,{open:_,onOpenChange:nn,children:o.jsxs(Sr,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto","data-tour":"model-dialog",preventOutsideClose:It.isRunning,children:[o.jsxs(kr,{children:[o.jsx(Or,{children:L!==null?"编辑模型":"添加模型"}),o.jsx(ss,{children:"配置模型的基本信息和参数"})]}),o.jsxs("div",{className:"grid gap-4 py-4",children:[o.jsxs("div",{className:"grid gap-2","data-tour":"model-name-input",children:[o.jsx(de,{htmlFor:"model_name",children:"模型名称 *"}),o.jsx(ze,{id:"model_name",value:I?.name||"",onChange:ge=>P(Le=>Le?{...Le,name:ge.target.value}:null),placeholder:"例如: qwen3-30b"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"用于在任务配置中引用此模型"})]}),o.jsxs("div",{className:"grid gap-2","data-tour":"model-provider-select",children:[o.jsx(de,{htmlFor:"api_provider",children:"API 提供商 *"}),o.jsxs(Vt,{value:I?.api_provider||"",onValueChange:ge=>{P(Le=>Le?{...Le,api_provider:ge}:null),re([]),Ye(null)},children:[o.jsx($t,{id:"api_provider",children:o.jsx(Ut,{placeholder:"选择提供商"})}),o.jsx(Ht,{children:n.map(ge=>o.jsx(De,{value:ge,children:ge},ge))})]})]}),o.jsxs("div",{className:"grid gap-2","data-tour":"model-identifier-input",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(de,{htmlFor:"model_identifier",children:"模型标识符 *"}),Ve?.modelFetcher&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Xn,{variant:"secondary",className:"text-xs",children:Ve.display_name}),o.jsx(he,{variant:"ghost",size:"sm",className:"h-6 px-2",onClick:()=>I?.api_provider&&At(I.api_provider,!0),disabled:oe,children:oe?o.jsx(Uc,{className:"h-3 w-3 animate-spin"}):o.jsx(Qs,{className:"h-3 w-3"})})]})]}),Ve?.modelFetcher?o.jsxs(Po,{open:Je,onOpenChange:Oe,children:[o.jsx(zo,{asChild:!0,children:o.jsxs(he,{variant:"outline",role:"combobox","aria-expanded":Je,className:"w-full justify-between font-normal",disabled:oe||!!We,children:[oe?o.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx(Uc,{className:"h-4 w-4 animate-spin"}),"正在获取模型列表..."]}):We?o.jsx("span",{className:"text-muted-foreground text-sm",children:"点击下方输入框手动填写"}):I?.model_identifier?o.jsx("span",{className:"truncate",children:I.model_identifier}):o.jsx("span",{className:"text-muted-foreground",children:"搜索或选择模型..."}),o.jsx(Tj,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o.jsx(Xa,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:o.jsxs(vb,{children:[o.jsx(yb,{placeholder:"搜索模型..."}),o.jsx(wn,{className:"h-[300px]",children:o.jsxs(bb,{className:"max-h-none overflow-visible",children:[o.jsx(wb,{children:We?o.jsxs("div",{className:"py-4 px-2 text-center space-y-2",children:[o.jsx("p",{className:"text-sm text-destructive",children:We}),!We.includes("API Key")&&o.jsx(he,{variant:"link",size:"sm",onClick:()=>I?.api_provider&&At(I.api_provider,!0),children:"重试"})]}):"未找到匹配的模型"}),o.jsx(rp,{heading:"可用模型",children:se.map(ge=>o.jsxs(sp,{value:ge.id,onSelect:()=>{P(Le=>Le?{...Le,model_identifier:ge.id}:null),Oe(!1)},children:[o.jsx(Ro,{className:`mr-2 h-4 w-4 ${I?.model_identifier===ge.id?"opacity-100":"opacity-0"}`}),o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{children:ge.id}),ge.name!==ge.id&&o.jsx("span",{className:"text-xs text-muted-foreground",children:ge.name})]})]},ge.id))}),o.jsx(rp,{heading:"手动输入",children:o.jsxs(sp,{value:"__manual_input__",onSelect:()=>{Oe(!1)},children:[o.jsx(Yu,{className:"mr-2 h-4 w-4"}),"手动输入模型标识符..."]})})]})})]})})]}):o.jsx(ze,{id:"model_identifier",value:I?.model_identifier||"",onChange:ge=>P(Le=>Le?{...Le,model_identifier:ge.target.value}:null),placeholder:"Qwen/Qwen3-30B-A3B-Instruct-2507"}),We&&Ve?.modelFetcher&&o.jsxs(ga,{variant:"destructive",className:"mt-2 py-2",children:[o.jsx(Oa,{className:"h-4 w-4"}),o.jsx(xa,{className:"text-xs",children:We})]}),Ve?.modelFetcher&&o.jsx(ze,{value:I?.model_identifier||"",onChange:ge=>P(Le=>Le?{...Le,model_identifier:ge.target.value}:null),placeholder:"或手动输入模型标识符",className:"mt-2"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:We?'请手动输入模型标识符,或前往"模型提供商配置"检查 API Key':Ve?.modelFetcher?`已识别为 ${Ve.display_name},支持自动获取模型列表`:"API 提供商提供的模型 ID"})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"price_in",children:"输入价格 (¥/M token)"}),o.jsx(ze,{id:"price_in",type:"number",step:"0.1",min:"0",value:I?.price_in??"",onChange:ge=>{const Le=ge.target.value===""?null:parseFloat(ge.target.value);P(Ct=>Ct?{...Ct,price_in:Le}:null)},placeholder:"默认: 0"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"price_out",children:"输出价格 (¥/M token)"}),o.jsx(ze,{id:"price_out",type:"number",step:"0.1",min:"0",value:I?.price_out??"",onChange:ge=>{const Le=ge.target.value===""?null:parseFloat(ge.target.value);P(Ct=>Ct?{...Ct,price_out:Le}:null)},placeholder:"默认: 0"})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"force_stream_mode",checked:I?.force_stream_mode||!1,onCheckedChange:ge=>P(Le=>Le?{...Le,force_stream_mode:ge}:null)}),o.jsx(de,{htmlFor:"force_stream_mode",className:"cursor-pointer",children:"强制流式输出模式"})]})]}),o.jsxs(bs,{children:[o.jsx(he,{variant:"outline",onClick:()=>M(!1),"data-tour":"model-cancel-button",children:"取消"}),o.jsx(he,{onClick:ot,"data-tour":"model-save-button",children:"保存"})]})]})}),o.jsx(Dn,{open:U,onOpenChange:ee,children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:['确定要删除模型 "',z!==null?t[z]?.name:"",'" 吗? 此操作无法撤销。']})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:pt,children:"删除"})]})]})}),o.jsx(Dn,{open:R,onOpenChange:ie,children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认批量删除"}),o.jsxs(_n,{children:["确定要删除选中的 ",J.size," 个模型吗? 此操作无法撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:vr,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),T&&o.jsx(Wj,{onRestartComplete:rt,onRestartFailed:tn})]})})}function Fa({title:t,description:e,taskConfig:n,modelNames:r,onChange:s,hideTemperature:i=!1,hideMaxTokens:a=!1,dataTour:l}){const c=d=>{s("model_list",d)};return o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"font-semibold text-base sm:text-lg",children:t}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:e})]}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2","data-tour":l,children:[o.jsx(de,{children:"模型列表"}),o.jsx(Sve,{options:r.map(d=>({label:d,value:d})),selected:n.model_list||[],onChange:c,placeholder:"选择模型...",emptyText:"暂无可用模型"})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[!i&&o.jsxs("div",{className:"grid gap-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(de,{children:"温度"}),o.jsx(ze,{type:"number",step:"0.1",min:"0",max:"1",value:n.temperature??.3,onChange:d=>{const h=parseFloat(d.target.value);!isNaN(h)&&h>=0&&h<=1&&s("temperature",h)},className:"w-20 h-8 text-sm"})]}),o.jsx(Ip,{value:[n.temperature??.3],onValueChange:d=>s("temperature",d[0]),min:0,max:1,step:.1,className:"w-full"})]}),!a&&o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{children:"最大 Token"}),o.jsx(ze,{type:"number",step:"1",min:"1",value:n.max_tokens??1024,onChange:d=>s("max_tokens",parseInt(d.target.value))})]})]})]})]})}const Eb="/api/webui/config";async function jve(){const e=await(await St(`${Eb}/adapter-config/path`)).json();return!e.success||!e.path?null:{path:e.path,lastModified:e.lastModified}}async function cA(t){const n=await(await St(`${Eb}/adapter-config/path`,{method:"POST",headers:Dt(),body:JSON.stringify({path:t})})).json();if(!n.success)throw new Error(n.message||"保存路径失败")}async function uA(t){const n=await(await St(`${Eb}/adapter-config?path=${encodeURIComponent(t)}`)).json();if(!n.success)throw new Error("读取配置文件失败");return n.content}async function dA(t,e){const r=await(await St(`${Eb}/adapter-config`,{method:"POST",headers:Dt(),body:JSON.stringify({path:t,content:e})})).json();if(!r.success)throw new Error(r.message||"保存配置失败")}const Fi={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"}},wS={oneclick:{name:"一键包",description:"使用一键包部署的适配器配置",path:"../MaiBot-Napcat-Adapter/config.toml",icon:Uh},docker:{name:"Docker",description:"Docker Compose 部署的适配器配置",path:"/MaiMBot/adapters-config/config.toml",icon:zee}};function Nve(){const[t,e]=b.useState("upload"),[n,r]=b.useState(null),[s,i]=b.useState(""),[a,l]=b.useState(""),[c,d]=b.useState("oneclick"),[h,m]=b.useState(""),[g,x]=b.useState(!1),[y,w]=b.useState(!1),[S,k]=b.useState(!1),[j,N]=b.useState(!1),[T,E]=b.useState(null),_=b.useRef(null),{toast:M}=fs(),I=b.useRef(null),P=K=>{if(!K.trim())return{valid:!1,error:"路径不能为空"};if(!K.toLowerCase().endsWith(".toml"))return{valid:!1,error:"文件必须是 .toml 格式"};const se=/^([a-zA-Z]:\\|\\\\[^\\]+\\[^\\]+\\).+\.toml$/i,re=/^(\/|~\/).+\.toml$/i,oe=/^(\.{1,2}[\\/]|[^:\\/]).+\.toml$/i,Te=se.test(K),We=re.test(K),Ye=oe.test(K);return!Te&&!We&&!Ye?{valid:!1,error:"路径格式错误"}:/[<>"|?*\x00-\x1F]/.test(K)?{valid:!1,error:"路径包含非法字符"}:{valid:!0,error:""}},L=K=>{if(l(K),K.trim()){const se=P(K);m(se.error)}else m("")},H=b.useCallback(async K=>{const se=wS[K];w(!0);try{const re=await uA(se.path),oe=W(re);r(oe),d(K),l(se.path),await cA(se.path),M({title:"加载成功",description:`已从${se.name}预设加载配置`})}catch(re){console.error("加载预设配置失败:",re),M({title:"加载失败",description:re instanceof Error?re.message:"无法读取预设配置文件",variant:"destructive"})}finally{w(!1)}},[M]),U=b.useCallback(async K=>{const se=P(K);if(!se.valid){m(se.error),M({title:"路径无效",description:se.error,variant:"destructive"});return}m(""),w(!0);try{const re=await uA(K),oe=W(re);r(oe),l(K),await cA(K),M({title:"加载成功",description:"已从配置文件加载"})}catch(re){console.error("加载配置失败:",re),M({title:"加载失败",description:re instanceof Error?re.message:"无法读取配置文件",variant:"destructive"})}finally{w(!1)}},[M]);b.useEffect(()=>{(async()=>{try{const se=await jve();if(se&&se.path){l(se.path);const re=Object.entries(wS).find(([,oe])=>oe.path===se.path);re?(e("preset"),d(re[0]),await H(re[0])):(e("path"),await U(se.path))}}catch(se){console.error("加载保存的路径失败:",se)}})()},[U,H]);const ee=b.useCallback(K=>{t!=="path"&&t!=="preset"||!a||(I.current&&clearTimeout(I.current),I.current=setTimeout(async()=>{x(!0);try{const se=q(K);await dA(a,se),M({title:"自动保存成功",description:"配置已保存到文件"})}catch(se){console.error("自动保存失败:",se),M({title:"自动保存失败",description:se instanceof Error?se.message:"保存配置失败",variant:"destructive"})}finally{x(!1)}},1e3))},[t,a,M]),z=async()=>{if(!n||!a)return;const K=P(a);if(!K.valid){M({title:"保存失败",description:K.error,variant:"destructive"});return}x(!0);try{const se=q(n);await dA(a,se),M({title:"保存成功",description:"配置已保存到文件"})}catch(se){console.error("保存失败:",se),M({title:"保存失败",description:se instanceof Error?se.message:"保存配置失败",variant:"destructive"})}finally{x(!1)}},Q=async()=>{a&&await U(a)},B=K=>{if(K!==t){if(n){E(K),k(!0);return}X(K)}},X=K=>{r(null),i(""),m(""),e(K),K==="preset"&&H("oneclick"),M({title:"已切换模式",description:{upload:"现在可以上传配置文件",path:"现在可以指定配置文件路径",preset:"现在可以使用预设配置"}[K]})},J=()=>{T&&(X(T),E(null)),k(!1)},G=()=>{if(n){N(!0);return}R()},R=()=>{l(""),r(null),m(""),M({title:"已清空",description:"路径和配置已清空"})},ie=()=>{R(),N(!1)},W=K=>{const se=JSON.parse(JSON.stringify(Fi)),re=K.split(` -`);let oe="";for(const Te of re){const We=Te.trim();if(!We||We.startsWith("#"))continue;const Ye=We.match(/^\[(\w+)\]/);if(Ye){oe=Ye[1];continue}const Je=We.match(/^(\w+)\s*=\s*(.+)$/);if(Je&&oe){const[,Oe,Ve]=Je;let Ue=Ve.trim();const He=Ue.match(/^("[^"]*")/);if(He)Ue=He[1];else{const xt=Ue.indexOf("#");xt!==-1&&(Ue=Ue.substring(0,xt).trim())}let Ot;if(Ue==="true")Ot=!0;else if(Ue==="false")Ot=!1;else if(Ue.startsWith("[")&&Ue.endsWith("]")){const xt=Ue.slice(1,-1).trim();if(xt){const kn=xt.split(",").map(Yt=>{const _t=Yt.trim();return isNaN(Number(_t))?_t.replace(/"/g,""):Number(_t)}),It=typeof kn[0];Ot=kn.every(Yt=>typeof Yt===It)?kn:kn.filter(Yt=>typeof Yt=="number")}else Ot=[]}else Ue.startsWith('"')&&Ue.endsWith('"')?Ot=Ue.slice(1,-1):isNaN(Number(Ue))?Ot=Ue.replace(/"/g,""):Ot=Number(Ue);if(oe in se){const xt=se[oe];xt[Oe]=Ot}}}return se},q=K=>{const se=[],re=(oe,Te)=>oe===""||oe===null||oe===void 0?Te:oe;return se.push("[inner]"),se.push(`version = "${re(K.inner.version,Fi.inner.version)}" # 版本号`),se.push("# 请勿修改版本号,除非你知道自己在做什么"),se.push(""),se.push("[nickname] # 现在没用"),se.push(`nickname = "${re(K.nickname.nickname,Fi.nickname.nickname)}"`),se.push(""),se.push("[napcat_server] # Napcat连接的ws服务设置"),se.push(`host = "${re(K.napcat_server.host,Fi.napcat_server.host)}" # Napcat设定的主机地址`),se.push(`port = ${re(K.napcat_server.port||0,Fi.napcat_server.port)} # Napcat设定的端口`),se.push(`token = "${re(K.napcat_server.token,Fi.napcat_server.token)}" # Napcat设定的访问令牌,若无则留空`),se.push(`heartbeat_interval = ${re(K.napcat_server.heartbeat_interval||0,Fi.napcat_server.heartbeat_interval)} # 与Napcat设置的心跳相同(按秒计)`),se.push(""),se.push("[maibot_server] # 连接麦麦的ws服务设置"),se.push(`host = "${re(K.maibot_server.host,Fi.maibot_server.host)}" # 麦麦在.env文件中设置的主机地址,即HOST字段`),se.push(`port = ${re(K.maibot_server.port||0,Fi.maibot_server.port)} # 麦麦在.env文件中设置的端口,即PORT字段`),se.push(""),se.push("[chat] # 黑白名单功能"),se.push(`group_list_type = "${re(K.chat.group_list_type,Fi.chat.group_list_type)}" # 群组名单类型,可选为:whitelist, blacklist`),se.push(`group_list = [${K.chat.group_list.join(", ")}] # 群组名单`),se.push("# 当group_list_type为whitelist时,只有群组名单中的群组可以聊天"),se.push("# 当group_list_type为blacklist时,群组名单中的任何群组无法聊天"),se.push(`private_list_type = "${re(K.chat.private_list_type,Fi.chat.private_list_type)}" # 私聊名单类型,可选为:whitelist, blacklist`),se.push(`private_list = [${K.chat.private_list.join(", ")}] # 私聊名单`),se.push("# 当private_list_type为whitelist时,只有私聊名单中的用户可以聊天"),se.push("# 当private_list_type为blacklist时,私聊名单中的任何用户无法聊天"),se.push(`ban_user_id = [${K.chat.ban_user_id.join(", ")}] # 全局禁止名单(全局禁止名单中的用户无法进行任何聊天)`),se.push(`ban_qq_bot = ${K.chat.ban_qq_bot} # 是否屏蔽QQ官方机器人`),se.push(`enable_poke = ${K.chat.enable_poke} # 是否启用戳一戳功能`),se.push(""),se.push("[voice] # 发送语音设置"),se.push(`use_tts = ${K.voice.use_tts} # 是否使用tts语音(请确保你配置了tts并有对应的adapter)`),se.push(""),se.push("[debug]"),se.push(`level = "${re(K.debug.level,Fi.debug.level)}" # 日志等级(DEBUG, INFO, WARNING, ERROR, CRITICAL)`),se.join(` -`)},V=K=>{const se=K.target.files?.[0];if(!se)return;const re=new FileReader;re.onload=oe=>{try{const Te=oe.target?.result,We=W(Te);r(We),i(se.name),M({title:"上传成功",description:`已加载配置文件:${se.name}`})}catch(Te){console.error("解析配置文件失败:",Te),M({title:"解析失败",description:"配置文件格式错误,请检查文件内容",variant:"destructive"})}},re.readAsText(se)},te=()=>{if(!n)return;const K=q(n),se=new Blob([K],{type:"text/plain;charset=utf-8"}),re=URL.createObjectURL(se),oe=document.createElement("a");oe.href=re,oe.download=s||"config.toml",document.body.appendChild(oe),oe.click(),document.body.removeChild(oe),URL.revokeObjectURL(re),M({title:"下载成功",description:"配置文件已下载,请手动覆盖并重启适配器"})},ne=()=>{r(JSON.parse(JSON.stringify(Fi))),i("config.toml"),M({title:"已加载默认配置",description:"可以开始编辑配置"})};return o.jsx(wn,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦适配器配置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的 QQ 适配器的配置文件"})]})}),o.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg border border-amber-500/50 bg-amber-500/10 text-amber-700 dark:text-amber-400",children:[o.jsx(Vc,{className:"h-4 w-4 mt-0.5 flex-shrink-0"}),o.jsx("p",{className:"text-sm",children:"适配器配置保存之后使用 WebUI 的重启功能适配器并不会重启,需要手动重启适配器。"})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{children:[o.jsx(qn,{children:"工作模式"}),o.jsx(ts,{children:"选择配置文件的管理方式"})]}),o.jsxs(Gn,{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 md:gap-4",children:[o.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${t==="preset"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>B("preset"),children:o.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[o.jsx(Uh,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"预设模式"}),o.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"使用预设的部署配置"})]})]})}),o.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${t==="upload"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>B("upload"),children:o.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[o.jsx(m9,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"上传文件模式"}),o.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"上传配置文件,编辑后下载并手动覆盖"})]})]})}),o.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${t==="path"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>B("path"),children:o.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[o.jsx(Iee,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"指定路径模式"}),o.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"指定配置文件路径,自动加载和保存"})]})]})})]}),t==="preset"&&o.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[o.jsx(de,{className:"text-sm md:text-base",children:"选择部署方式"}),o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:Object.entries(wS).map(([K,se])=>{const re=se.icon,oe=c===K;return o.jsx("div",{className:`border-2 rounded-lg p-3 cursor-pointer transition-all ${oe?"border-primary bg-primary/5":"border-muted hover:border-primary/50"}`,onClick:()=>{d(K),H(K)},children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(re,{className:"h-5 w-5 mt-0.5 flex-shrink-0"}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("h4",{className:"font-semibold text-sm",children:se.name}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:se.description}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1 font-mono break-all",children:se.path})]})]})},K)})})]}),t==="path"&&o.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{htmlFor:"config-path",className:"text-sm md:text-base",children:"配置文件路径"}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[o.jsxs("div",{className:"flex-1 space-y-1",children:[o.jsx(ze,{id:"config-path",value:a,onChange:K=>L(K.target.value),placeholder:"例: C:\\Adapter\\config.toml",className:`text-sm ${h?"border-destructive":""}`}),h&&o.jsx("p",{className:"text-xs text-destructive",children:h})]}),o.jsx(he,{onClick:()=>U(a),disabled:y||!a||!!h,className:"w-full sm:w-auto",children:y?o.jsxs(o.Fragment,{children:[o.jsx(Qs,{className:"h-4 w-4 animate-spin mr-2"}),o.jsx("span",{className:"sm:hidden",children:"加载中..."})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sm:hidden",children:"加载配置"}),o.jsx("span",{className:"hidden sm:inline",children:"加载"})]})})]})]}),o.jsxs("details",{className:"rounded-lg bg-muted/50 p-3 group",children:[o.jsxs("summary",{className:"text-xs font-medium cursor-pointer select-none list-none flex items-center justify-between",children:[o.jsx("span",{children:"路径格式说明"}),o.jsx("svg",{className:"h-4 w-4 transition-transform group-open:rotate-180",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),o.jsxs("div",{className:"mt-2 space-y-2 text-xs text-muted-foreground",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("div",{className:"flex items-center gap-2",children:o.jsx("span",{className:"font-mono bg-background px-1.5 py-0.5 rounded text-[10px] md:text-xs whitespace-nowrap",children:"Windows"})}),o.jsxs("div",{className:"pl-2 space-y-0.5 text-[10px] md:text-xs break-all",children:[o.jsx("div",{children:"C:\\Adapter\\config.toml"}),o.jsx("div",{className:"hidden sm:block",children:"D:\\MaiBot\\adapter\\config.toml"}),o.jsx("div",{className:"hidden sm:block",children:"\\\\server\\share\\config.toml"})]})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("div",{className:"flex items-center gap-2",children:o.jsx("span",{className:"font-mono bg-background px-1.5 py-0.5 rounded text-[10px] md:text-xs whitespace-nowrap",children:"Linux"})}),o.jsxs("div",{className:"pl-2 space-y-0.5 text-[10px] md:text-xs break-all",children:[o.jsx("div",{children:"/opt/adapter/config.toml"}),o.jsx("div",{className:"hidden sm:block",children:"/home/user/adapter/config.toml"}),o.jsx("div",{className:"hidden sm:block",children:"~/adapter/config.toml"})]})]}),o.jsx("p",{className:"pt-1 border-t text-[10px] md:text-xs",children:"💡 配置会自动保存到指定文件,修改后 1 秒自动保存"})]})]})]})]})]}),o.jsxs(ga,{children:[o.jsx(Oa,{className:"h-4 w-4"}),o.jsx(xa,{children:t==="preset"?o.jsxs(o.Fragment,{children:[o.jsx("strong",{children:"预设模式:"}),"选择预设的部署方式,配置会自动加载,修改后 1 秒自动保存",g&&" (正在保存...)"]}):t==="upload"?o.jsxs(o.Fragment,{children:[o.jsx("strong",{children:"上传文件模式:"}),"上传配置文件 → 在线编辑 → 下载文件 → 手动覆盖并重启适配器"]}):o.jsxs(o.Fragment,{children:[o.jsx("strong",{children:"指定路径模式:"}),"指定配置文件路径后,配置会自动加载,修改后 1 秒自动保存",g&&" (正在保存...)"]})})]}),t==="upload"&&!n&&o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[o.jsx("input",{ref:_,type:"file",accept:".toml",className:"hidden",onChange:V}),o.jsxs(he,{onClick:()=>_.current?.click(),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[o.jsx(m9,{className:"mr-2 h-4 w-4"}),"上传配置"]}),o.jsxs(he,{onClick:ne,size:"sm",className:"w-full sm:w-auto",children:[o.jsx(Pl,{className:"mr-2 h-4 w-4"}),"使用默认配置"]})]}),t==="upload"&&n&&o.jsx("div",{className:"flex gap-2",children:o.jsxs(he,{onClick:te,size:"sm",className:"w-full sm:w-auto",children:[o.jsx(Ku,{className:"mr-2 h-4 w-4"}),"下载配置"]})}),(t==="preset"||t==="path")&&n&&o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[o.jsxs(he,{onClick:z,size:"sm",disabled:g||!!h,className:"w-full sm:w-auto",children:[o.jsx($y,{className:"mr-2 h-4 w-4"}),g?"保存中...":"立即保存"]}),o.jsxs(he,{onClick:Q,size:"sm",variant:"outline",disabled:y,className:"w-full sm:w-auto",children:[o.jsx(Qs,{className:`mr-2 h-4 w-4 ${y?"animate-spin":""}`}),"刷新"]}),t==="path"&&o.jsxs(he,{onClick:G,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[o.jsx(Sn,{className:"mr-2 h-4 w-4"}),"清空路径"]})]}),n?o.jsxs(ja,{defaultValue:"napcat",className:"w-full",children:[o.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:o.jsxs(Wi,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5",children:[o.jsxs(Lt,{value:"napcat",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[o.jsx("span",{className:"hidden sm:inline",children:"Napcat 连接"}),o.jsx("span",{className:"sm:hidden",children:"Napcat"})]}),o.jsxs(Lt,{value:"maibot",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[o.jsx("span",{className:"hidden sm:inline",children:"麦麦连接"}),o.jsx("span",{className:"sm:hidden",children:"麦麦"})]}),o.jsxs(Lt,{value:"chat",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[o.jsx("span",{className:"hidden sm:inline",children:"聊天控制"}),o.jsx("span",{className:"sm:hidden",children:"聊天"})]}),o.jsxs(Lt,{value:"voice",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[o.jsx("span",{className:"hidden sm:inline",children:"语音设置"}),o.jsx("span",{className:"sm:hidden",children:"语音"})]}),o.jsx(Lt,{value:"debug",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:"调试"})]})}),o.jsx(un,{value:"napcat",className:"space-y-4",children:o.jsx(Cve,{config:n,onChange:K=>{r(K),ee(K)}})}),o.jsx(un,{value:"maibot",className:"space-y-4",children:o.jsx(Tve,{config:n,onChange:K=>{r(K),ee(K)}})}),o.jsx(un,{value:"chat",className:"space-y-4",children:o.jsx(Eve,{config:n,onChange:K=>{r(K),ee(K)}})}),o.jsx(un,{value:"voice",className:"space-y-4",children:o.jsx(_ve,{config:n,onChange:K=>{r(K),ee(K)}})}),o.jsx(un,{value:"debug",className:"space-y-4",children:o.jsx(Mve,{config:n,onChange:K=>{r(K),ee(K)}})})]}):o.jsx("div",{className:"rounded-lg border bg-card p-6 md:p-12",children:o.jsxs("div",{className:"text-center space-y-3 md:space-y-4",children:[o.jsx(Pl,{className:"h-12 w-12 md:h-16 md:w-16 mx-auto text-muted-foreground"}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold",children:"尚未加载配置"}),o.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-2 px-4",children:t==="preset"?"请选择预设的部署方式":t==="upload"?"请上传现有配置文件,或使用默认配置开始编辑":"请指定配置文件路径并点击加载按钮"})]})]})}),o.jsx(Dn,{open:S,onOpenChange:k,children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认切换模式"}),o.jsxs(_n,{children:["切换模式将清空当前配置,确定要继续吗?",o.jsx("br",{}),o.jsx("span",{className:"text-destructive font-medium",children:"请确保已保存重要配置"})]})]}),o.jsxs(Tn,{children:[o.jsx(An,{onClick:()=>{k(!1),E(null)},children:"取消"}),o.jsx(Mn,{onClick:J,children:"确认切换"})]})]})}),o.jsx(Dn,{open:j,onOpenChange:N,children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认清空路径"}),o.jsxs(_n,{children:["清空路径将清除当前配置,确定要继续吗?",o.jsx("br",{}),o.jsx("span",{className:"text-muted-foreground text-sm",children:"此操作不会删除配置文件,只是清除界面中的配置"})]})]}),o.jsxs(Tn,{children:[o.jsx(An,{onClick:()=>N(!1),children:"取消"}),o.jsx(Mn,{onClick:ie,className:"bg-destructive hover:bg-destructive/90",children:"确认清空"})]})]})})]})})}function Cve({config:t,onChange:e}){return o.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"Napcat WebSocket 服务设置"}),o.jsxs("div",{className:"grid gap-3 md:gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"napcat-host",className:"text-sm md:text-base",children:"主机地址"}),o.jsx(ze,{id:"napcat-host",value:t.napcat_server.host,onChange:n=>e({...t,napcat_server:{...t.napcat_server,host:n.target.value}}),placeholder:"localhost",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的主机地址"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"napcat-port",className:"text-sm md:text-base",children:"端口"}),o.jsx(ze,{id:"napcat-port",type:"number",value:t.napcat_server.port||"",onChange:n=>e({...t,napcat_server:{...t.napcat_server,port:n.target.value?parseInt(n.target.value):0}}),placeholder:"8095",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的端口(留空使用默认值 8095)"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"napcat-token",className:"text-sm md:text-base",children:"访问令牌(Token)"}),o.jsx(ze,{id:"napcat-token",type:"password",value:t.napcat_server.token,onChange:n=>e({...t,napcat_server:{...t.napcat_server,token:n.target.value}}),placeholder:"留空表示无需令牌",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的访问令牌,若无则留空"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"napcat-heartbeat",className:"text-sm md:text-base",children:"心跳间隔(秒)"}),o.jsx(ze,{id:"napcat-heartbeat",type:"number",value:t.napcat_server.heartbeat_interval||"",onChange:n=>e({...t,napcat_server:{...t.napcat_server,heartbeat_interval:n.target.value?parseInt(n.target.value):0}}),placeholder:"30",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"与 Napcat 设置的心跳间隔保持一致(留空使用默认值 30)"})]})]})]})})}function Tve({config:t,onChange:e}){return o.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"麦麦 WebSocket 服务设置"}),o.jsxs("div",{className:"grid gap-3 md:gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"maibot-host",className:"text-sm md:text-base",children:"主机地址"}),o.jsx(ze,{id:"maibot-host",value:t.maibot_server.host,onChange:n=>e({...t,maibot_server:{...t.maibot_server,host:n.target.value}}),placeholder:"localhost",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 HOST 字段"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{htmlFor:"maibot-port",className:"text-sm md:text-base",children:"端口"}),o.jsx(ze,{id:"maibot-port",type:"number",value:t.maibot_server.port||"",onChange:n=>e({...t,maibot_server:{...t.maibot_server,port:n.target.value?parseInt(n.target.value):0}}),placeholder:"8000",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 PORT 字段(留空使用默认值 8000)"})]})]})]})})}function Eve({config:t,onChange:e}){const n=i=>{const a={...t};i==="group"?a.chat.group_list=[...a.chat.group_list,0]:i==="private"?a.chat.private_list=[...a.chat.private_list,0]:a.chat.ban_user_id=[...a.chat.ban_user_id,0],e(a)},r=(i,a)=>{const l={...t};i==="group"?l.chat.group_list=l.chat.group_list.filter((c,d)=>d!==a):i==="private"?l.chat.private_list=l.chat.private_list.filter((c,d)=>d!==a):l.chat.ban_user_id=l.chat.ban_user_id.filter((c,d)=>d!==a),e(l)},s=(i,a,l)=>{const c={...t};i==="group"?c.chat.group_list[a]=l:i==="private"?c.chat.private_list[a]=l:c.chat.ban_user_id[a]=l,e(c)};return o.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"聊天黑白名单功能"}),o.jsxs("div",{className:"grid gap-4 md:gap-6",children:[o.jsxs("div",{className:"space-y-3 md:space-y-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{className:"text-sm md:text-base",children:"群组名单类型"}),o.jsxs(Vt,{value:t.chat.group_list_type,onValueChange:i=>e({...t,chat:{...t.chat,group_list_type:i}}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),o.jsx(De,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[o.jsx(de,{className:"text-sm md:text-base",children:"群组列表"}),o.jsxs(he,{onClick:()=>n("group"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[o.jsx(Pl,{className:"mr-1 h-4 w-4"}),"添加群号"]})]}),t.chat.group_list.map((i,a)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ze,{type:"number",value:i,onChange:l=>s("group",a,parseInt(l.target.value)||0),placeholder:"输入群号",className:"text-sm md:text-base"}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(he,{size:"icon",variant:"outline",children:o.jsx(Sn,{className:"h-4 w-4"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:["确定要删除群号 ",i," 吗?此操作无法撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:()=>r("group",a),children:"删除"})]})]})]})]},a)),t.chat.group_list.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无群组"})]})]}),o.jsxs("div",{className:"space-y-3 md:space-y-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{className:"text-sm md:text-base",children:"私聊名单类型"}),o.jsxs(Vt,{value:t.chat.private_list_type,onValueChange:i=>e({...t,chat:{...t.chat,private_list_type:i}}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),o.jsx(De,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[o.jsx(de,{className:"text-sm md:text-base",children:"私聊列表"}),o.jsxs(he,{onClick:()=>n("private"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[o.jsx(Pl,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),t.chat.private_list.map((i,a)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ze,{type:"number",value:i,onChange:l=>s("private",a,parseInt(l.target.value)||0),placeholder:"输入QQ号",className:"text-sm md:text-base"}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(he,{size:"icon",variant:"outline",children:o.jsx(Sn,{className:"h-4 w-4"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:["确定要删除用户 ",i," 吗?此操作无法撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:()=>r("private",a),children:"删除"})]})]})]})]},a)),t.chat.private_list.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无用户"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[o.jsxs("div",{children:[o.jsx(de,{className:"text-sm md:text-base",children:"全局禁止名单"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"名单中的用户无法进行任何聊天"})]}),o.jsxs(he,{onClick:()=>n("ban"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[o.jsx(Pl,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),t.chat.ban_user_id.map((i,a)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ze,{type:"number",value:i,onChange:l=>s("ban",a,parseInt(l.target.value)||0),placeholder:"输入QQ号",className:"text-sm md:text-base"}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(he,{size:"icon",variant:"outline",children:o.jsx(Sn,{className:"h-4 w-4"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:["确定要从全局禁止名单中删除用户 ",i," 吗?此操作无法撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:()=>r("ban",a),children:"删除"})]})]})]})]},a)),t.chat.ban_user_id.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无禁止用户"})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx(de,{className:"text-sm md:text-base",children:"屏蔽QQ官方机器人"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否屏蔽来自QQ官方机器人的消息"})]}),o.jsx(Bt,{checked:t.chat.ban_qq_bot,onCheckedChange:i=>e({...t,chat:{...t.chat,ban_qq_bot:i}})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx(de,{className:"text-sm md:text-base",children:"启用戳一戳功能"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否响应戳一戳消息"})]}),o.jsx(Bt,{checked:t.chat.enable_poke,onCheckedChange:i=>e({...t,chat:{...t.chat,enable_poke:i}})})]})]})]})})}function _ve({config:t,onChange:e}){return o.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"发送语音设置"}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx(de,{className:"text-sm md:text-base",children:"使用 TTS 语音"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"请确保已配置 TTS 并有对应的适配器"})]}),o.jsx(Bt,{checked:t.voice.use_tts,onCheckedChange:n=>e({...t,voice:{use_tts:n}})})]})]})})}function Mve({config:t,onChange:e}){return o.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"调试设置"}),o.jsx("div",{className:"grid gap-3 md:gap-4",children:o.jsxs("div",{className:"grid gap-2",children:[o.jsx(de,{className:"text-sm md:text-base",children:"日志等级"}),o.jsxs(Vt,{value:t.debug.level,onValueChange:n=>e({...t,debug:{level:n}}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"DEBUG",children:"DEBUG(调试)"}),o.jsx(De,{value:"INFO",children:"INFO(信息)"}),o.jsx(De,{value:"WARNING",children:"WARNING(警告)"}),o.jsx(De,{value:"ERROR",children:"ERROR(错误)"}),o.jsx(De,{value:"CRITICAL",children:"CRITICAL(严重)"})]})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"设置适配器的日志输出等级"})]})})]})})}function hA(t){const e=[],n=String(t||"");let r=n.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const a=n.slice(s,r).trim();(a||!i)&&e.push(a),s=r+1,r=n.indexOf(",",s)}return e}function Ave(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Rve=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Dve=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pve={};function fA(t,e){return(Pve.jsx?Dve:Rve).test(t)}const zve=/[ \t\n\f\r]/g;function Ive(t){return typeof t=="object"?t.type==="text"?mA(t.value):!1:mA(t)}function mA(t){return t.replace(zve,"")===""}class lg{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}lg.prototype.normal={};lg.prototype.property={};lg.prototype.space=void 0;function PQ(t,e){const n={},r={};for(const s of t)Object.assign(n,s.property),Object.assign(r,s.normal);return new lg(n,r,e)}function dp(t){return t.toLowerCase()}class Ei{constructor(e,n){this.attribute=n,this.property=e}}Ei.prototype.attribute="";Ei.prototype.booleanish=!1;Ei.prototype.boolean=!1;Ei.prototype.commaOrSpaceSeparated=!1;Ei.prototype.commaSeparated=!1;Ei.prototype.defined=!1;Ei.prototype.mustUseProperty=!1;Ei.prototype.number=!1;Ei.prototype.overloadedBoolean=!1;Ei.prototype.property="";Ei.prototype.spaceSeparated=!1;Ei.prototype.space=void 0;let Lve=0;const Jt=wd(),Jr=wd(),SO=wd(),Qe=wd(),ur=wd(),qh=wd(),qi=wd();function wd(){return 2**++Lve}const kO=Object.freeze(Object.defineProperty({__proto__:null,boolean:Jt,booleanish:Jr,commaOrSpaceSeparated:qi,commaSeparated:qh,number:Qe,overloadedBoolean:SO,spaceSeparated:ur},Symbol.toStringTag,{value:"Module"})),SS=Object.keys(kO);class nN extends Ei{constructor(e,n,r,s){let i=-1;if(super(e,n),pA(this,"space",s),typeof r=="number")for(;++i4&&n.slice(0,4)==="data"&&Hve.test(e)){if(e.charAt(4)==="-"){const i=e.slice(5).replace(gA,Vve);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=e.slice(4);if(!gA.test(i)){let a=i.replace($ve,Qve);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}s=nN}return new s(r,e)}function Qve(t){return"-"+t.toLowerCase()}function Vve(t){return t.charAt(1).toUpperCase()}const HQ=PQ([zQ,Bve,BQ,FQ,qQ],"html"),_b=PQ([zQ,Fve,BQ,FQ,qQ],"svg");function xA(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function Uve(t){return t.join(" ").trim()}var oh={},kS,vA;function Wve(){if(vA)return kS;vA=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,l=/^\s+|\s+$/g,c=` -`,d="/",h="*",m="",g="comment",x="declaration";function y(S,k){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];k=k||{};var j=1,N=1;function T(z){var Q=z.match(e);Q&&(j+=Q.length);var B=z.lastIndexOf(c);N=~B?z.length-B:N+z.length}function E(){var z={line:j,column:N};return function(Q){return Q.position=new _(z),P(),Q}}function _(z){this.start=z,this.end={line:j,column:N},this.source=k.source}_.prototype.content=S;function M(z){var Q=new Error(k.source+":"+j+":"+N+": "+z);if(Q.reason=z,Q.filename=k.source,Q.line=j,Q.column=N,Q.source=S,!k.silent)throw Q}function I(z){var Q=z.exec(S);if(Q){var B=Q[0];return T(B),S=S.slice(B.length),Q}}function P(){I(n)}function L(z){var Q;for(z=z||[];Q=H();)Q!==!1&&z.push(Q);return z}function H(){var z=E();if(!(d!=S.charAt(0)||h!=S.charAt(1))){for(var Q=2;m!=S.charAt(Q)&&(h!=S.charAt(Q)||d!=S.charAt(Q+1));)++Q;if(Q+=2,m===S.charAt(Q-1))return M("End of comment missing");var B=S.slice(2,Q-2);return N+=2,T(B),S=S.slice(Q),N+=2,z({type:g,comment:B})}}function U(){var z=E(),Q=I(r);if(Q){if(H(),!I(s))return M("property missing ':'");var B=I(i),X=z({type:x,property:w(Q[0].replace(t,m)),value:B?w(B[0].replace(t,m)):m});return I(a),X}}function ee(){var z=[];L(z);for(var Q;Q=U();)Q!==!1&&(z.push(Q),L(z));return z}return P(),ee()}function w(S){return S?S.replace(l,m):m}return kS=y,kS}var yA;function Gve(){if(yA)return oh;yA=1;var t=oh&&oh.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(oh,"__esModule",{value:!0}),oh.default=n;const e=t(Wve());function n(r,s){let i=null;if(!r||typeof r!="string")return i;const a=(0,e.default)(r),l=typeof s=="function";return a.forEach(c=>{if(c.type!=="declaration")return;const{property:d,value:h}=c;l?s(d,h,c):h&&(i=i||{},i[d]=h)}),i}return oh}var Gm={},bA;function Xve(){if(bA)return Gm;bA=1,Object.defineProperty(Gm,"__esModule",{value:!0}),Gm.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(d){return!d||n.test(d)||t.test(d)},a=function(d,h){return h.toUpperCase()},l=function(d,h){return"".concat(h,"-")},c=function(d,h){return h===void 0&&(h={}),i(d)?d:(d=d.toLowerCase(),h.reactCompat?d=d.replace(s,l):d=d.replace(r,l),d.replace(e,a))};return Gm.camelCase=c,Gm}var Xm,wA;function Yve(){if(wA)return Xm;wA=1;var t=Xm&&Xm.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},e=t(Gve()),n=Xve();function r(s,i){var a={};return!s||typeof s!="string"||(0,e.default)(s,function(l,c){l&&c&&(a[(0,n.camelCase)(l,i)]=c)}),a}return r.default=r,Xm=r,Xm}var Kve=Yve();const Zve=gd(Kve),QQ=VQ("end"),rN=VQ("start");function VQ(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};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 Jve(t){const e=rN(t),n=QQ(t);if(e&&n)return{start:e,end:n}}function C0(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?SA(t.position):"start"in t||"end"in t?SA(t):"line"in t||"column"in t?OO(t):""}function OO(t){return kA(t&&t.line)+":"+kA(t&&t.column)}function SA(t){return OO(t&&t.start)+"-"+OO(t&&t.end)}function kA(t){return t&&typeof t=="number"?t:1}class Ws extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},a=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof e=="string"?s=e:!i.cause&&e&&(a=!0,s=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?i.ruleId=r:(i.source=r.slice(0,c),i.ruleId=r.slice(c+1))}if(!i.place&&i.ancestors&&i.ancestors){const c=i.ancestors[i.ancestors.length-1];c&&(i.place=c.position)}const l=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=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=C0(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=a&&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}}Ws.prototype.file="";Ws.prototype.name="";Ws.prototype.reason="";Ws.prototype.message="";Ws.prototype.stack="";Ws.prototype.column=void 0;Ws.prototype.line=void 0;Ws.prototype.ancestors=void 0;Ws.prototype.cause=void 0;Ws.prototype.fatal=void 0;Ws.prototype.place=void 0;Ws.prototype.ruleId=void 0;Ws.prototype.source=void 0;const sN={}.hasOwnProperty,eye=new Map,tye=/[A-Z]/g,nye=new Set(["table","tbody","thead","tfoot","tr"]),rye=new Set(["td","th"]),UQ="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function sye(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=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=hye(n,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=dye(n,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:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?_b:HQ,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},i=WQ(s,t,void 0);return i&&typeof i!="string"?i:s.create(t,s.Fragment,{children:i||void 0},void 0)}function WQ(t,e,n){if(e.type==="element")return iye(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return aye(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return lye(t,e,n);if(e.type==="mdxjsEsm")return oye(t,e);if(e.type==="root")return cye(t,e,n);if(e.type==="text")return uye(t,e)}function iye(t,e,n){const r=t.schema;let s=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=_b,t.schema=s),t.ancestors.push(e);const i=XQ(t,e.tagName,!1),a=fye(t,e);let l=aN(t,e);return nye.has(e.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!Ive(c):!0})),GQ(t,a,i,e),iN(a,l),t.ancestors.pop(),t.schema=r,t.create(e,i,a,n)}function aye(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}hp(t,e.position)}function oye(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);hp(t,e.position)}function lye(t,e,n){const r=t.schema;let s=r;e.name==="svg"&&r.space==="html"&&(s=_b,t.schema=s),t.ancestors.push(e);const i=e.name===null?t.Fragment:XQ(t,e.name,!0),a=mye(t,e),l=aN(t,e);return GQ(t,a,i,e),iN(a,l),t.ancestors.pop(),t.schema=r,t.create(e,i,a,n)}function cye(t,e,n){const r={};return iN(r,aN(t,e)),t.create(e,t.Fragment,r,n)}function uye(t,e){return e.value}function GQ(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function iN(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function dye(t,e,n){return r;function r(s,i,a,l){const d=Array.isArray(a.children)?n:e;return l?d(i,a,l):d(i,a)}}function hye(t,e){return n;function n(r,s,i,a){const l=Array.isArray(i.children),c=rN(r);return e(s,i,a,l,{columnNumber:c?c.column-1:void 0,fileName:t,lineNumber:c?c.line:void 0},void 0)}}function fye(t,e){const n={};let r,s;for(s in e.properties)if(s!=="children"&&sN.call(e.properties,s)){const i=pye(t,s,e.properties[s]);if(i){const[a,l]=i;t.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&rye.has(e.tagName)?r=l:n[a]=l}}if(r){const i=n.style||(n.style={});i[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function mye(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const l=a.properties[0];l.type,Object.assign(n,t.evaluater.evaluateExpression(l.argument))}else hp(t,e.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const l=r.value.data.estree.body[0];l.type,i=t.evaluater.evaluateExpression(l.expression)}else hp(t,e.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function aN(t,e){const n=[];let r=-1;const s=t.passKeys?new Map:eye;for(;++rs?0:s+e:e=e>s?s:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);i0?(Gi(t,t.length,0,e),t):e}const NA={}.hasOwnProperty;function KQ(t){const e={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Ga(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Zs=uu(/[A-Za-z]/),Vs=uu(/[\dA-Za-z]/),Oye=uu(/[#-'*+\--9=?A-Z^-~]/);function fy(t){return t!==null&&(t<32||t===127)}const jO=uu(/\d/),jye=uu(/[\dA-Fa-f]/),Nye=uu(/[!-/:-@[-`{-~]/);function bt(t){return t!==null&&t<-2}function or(t){return t!==null&&(t<0||t===32)}function dn(t){return t===-2||t===-1||t===32}const Mb=uu(new RegExp("\\p{P}|\\p{S}","u")),fd=uu(/\s/);function uu(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Lf(t){const e=[];let n=-1,r=0,s=0;for(;++n55295&&i<57344){const l=t.charCodeAt(n+1);i<56320&&l>56319&&l<57344?(a=String.fromCharCode(i,l),s=1):a="�"}else a=String.fromCharCode(i);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return e.join("")+t.slice(r)}function on(t,e,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(c){return dn(c)?(t.enter(n),l(c)):e(c)}function l(c){return dn(c)&&i++a))return;const M=e.events.length;let I=M,P,L;for(;I--;)if(e.events[I][0]==="exit"&&e.events[I][1].type==="chunkFlow"){if(P){L=e.events[I][1].end;break}P=!0}for(k(r),_=M;_N;){const E=n[T];e.containerState=E[1],E[0].exit.call(e,t)}n.length=N}function j(){s.write([null]),i=void 0,s=void 0,e.containerState._closeFlow=void 0}}function Mye(t,e,n){return on(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function uf(t){if(t===null||or(t)||fd(t))return 1;if(Mb(t))return 2}function Ab(t,e,n){const r=[];let s=-1;for(;++s1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const m={...t[r][1].end},g={...t[n][1].start};TA(m,-c),TA(g,c),a={type:c>1?"strongSequence":"emphasisSequence",start:m,end:{...t[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:g},i={type:c>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},s={type:c>1?"strong":"emphasis",start:{...a.start},end:{...l.end}},t[r][1].end={...a.start},t[n][1].start={...l.end},d=[],t[r][1].end.offset-t[r][1].start.offset&&(d=fa(d,[["enter",t[r][1],e],["exit",t[r][1],e]])),d=fa(d,[["enter",s,e],["enter",a,e],["exit",a,e],["enter",i,e]]),d=fa(d,Ab(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),d=fa(d,[["exit",i,e],["enter",l,e],["exit",l,e],["exit",s,e]]),t[n][1].end.offset-t[n][1].start.offset?(h=2,d=fa(d,[["enter",t[n][1],e],["exit",t[n][1],e]])):h=0,Gi(t,r-1,n-r+3,d),n=r+d.length-h-2;break}}for(n=-1;++n0&&dn(_)?on(t,j,"linePrefix",i+1)(_):j(_)}function j(_){return _===null||bt(_)?t.check(EA,w,T)(_):(t.enter("codeFlowValue"),N(_))}function N(_){return _===null||bt(_)?(t.exit("codeFlowValue"),j(_)):(t.consume(_),N)}function T(_){return t.exit("codeFenced"),e(_)}function E(_,M,I){let P=0;return L;function L(Q){return _.enter("lineEnding"),_.consume(Q),_.exit("lineEnding"),H}function H(Q){return _.enter("codeFencedFence"),dn(Q)?on(_,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q):U(Q)}function U(Q){return Q===l?(_.enter("codeFencedFenceSequence"),ee(Q)):I(Q)}function ee(Q){return Q===l?(P++,_.consume(Q),ee):P>=a?(_.exit("codeFencedFenceSequence"),dn(Q)?on(_,z,"whitespace")(Q):z(Q)):I(Q)}function z(Q){return Q===null||bt(Q)?(_.exit("codeFencedFence"),M(Q)):I(Q)}}}function Hye(t,e,n){const r=this;return s;function s(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const jS={name:"codeIndented",tokenize:Vye},Qye={partial:!0,tokenize:Uye};function Vye(t,e,n){const r=this;return s;function s(d){return t.enter("codeIndented"),on(t,i,"linePrefix",5)(d)}function i(d){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?a(d):n(d)}function a(d){return d===null?c(d):bt(d)?t.attempt(Qye,a,c)(d):(t.enter("codeFlowValue"),l(d))}function l(d){return d===null||bt(d)?(t.exit("codeFlowValue"),a(d)):(t.consume(d),l)}function c(d){return t.exit("codeIndented"),e(d)}}function Uye(t,e,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):bt(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s):on(t,i,"linePrefix",5)(a)}function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(a):bt(a)?s(a):n(a)}}const Wye={name:"codeText",previous:Xye,resolve:Gye,tokenize:Yye};function Gye(t){let e=t.length-4,n=3,r,s;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r=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 ethis.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,n,r){const s=n||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Ym(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),Ym(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Ym(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=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function rV(t,e,n,r,s,i,a,l,c){const d=c||Number.POSITIVE_INFINITY;let h=0;return m;function m(k){return k===60?(t.enter(r),t.enter(s),t.enter(i),t.consume(k),t.exit(i),g):k===null||k===32||k===41||fy(k)?n(k):(t.enter(r),t.enter(a),t.enter(l),t.enter("chunkString",{contentType:"string"}),w(k))}function g(k){return k===62?(t.enter(i),t.consume(k),t.exit(i),t.exit(s),t.exit(r),e):(t.enter(l),t.enter("chunkString",{contentType:"string"}),x(k))}function x(k){return k===62?(t.exit("chunkString"),t.exit(l),g(k)):k===null||k===60||bt(k)?n(k):(t.consume(k),k===92?y:x)}function y(k){return k===60||k===62||k===92?(t.consume(k),x):x(k)}function w(k){return!h&&(k===null||k===41||or(k))?(t.exit("chunkString"),t.exit(l),t.exit(a),t.exit(r),e(k)):h999||x===null||x===91||x===93&&!c||x===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(x):x===93?(t.exit(i),t.enter(s),t.consume(x),t.exit(s),t.exit(r),e):bt(x)?(t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),h):(t.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===null||x===91||x===93||bt(x)||l++>999?(t.exit("chunkString"),h(x)):(t.consume(x),c||(c=!dn(x)),x===92?g:m)}function g(x){return x===91||x===92||x===93?(t.consume(x),l++,m):m(x)}}function iV(t,e,n,r,s,i){let a;return l;function l(g){return g===34||g===39||g===40?(t.enter(r),t.enter(s),t.consume(g),t.exit(s),a=g===40?41:g,c):n(g)}function c(g){return g===a?(t.enter(s),t.consume(g),t.exit(s),t.exit(r),e):(t.enter(i),d(g))}function d(g){return g===a?(t.exit(i),c(a)):g===null?n(g):bt(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),on(t,d,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===a||g===null||bt(g)?(t.exit("chunkString"),d(g)):(t.consume(g),g===92?m:h)}function m(g){return g===a||g===92?(t.consume(g),h):h(g)}}function T0(t,e){let n;return r;function r(s){return bt(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),n=!0,r):dn(s)?on(t,r,n?"linePrefix":"lineSuffix")(s):e(s)}}const sbe={name:"definition",tokenize:abe},ibe={partial:!0,tokenize:obe};function abe(t,e,n){const r=this;let s;return i;function i(x){return t.enter("definition"),a(x)}function a(x){return sV.call(r,t,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function l(x){return s=Ga(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(t.enter("definitionMarker"),t.consume(x),t.exit("definitionMarker"),c):n(x)}function c(x){return or(x)?T0(t,d)(x):d(x)}function d(x){return rV(t,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function h(x){return t.attempt(ibe,m,m)(x)}function m(x){return dn(x)?on(t,g,"whitespace")(x):g(x)}function g(x){return x===null||bt(x)?(t.exit("definition"),r.parser.defined.push(s),e(x)):n(x)}}function obe(t,e,n){return r;function r(l){return or(l)?T0(t,s)(l):n(l)}function s(l){return iV(t,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function i(l){return dn(l)?on(t,a,"whitespace")(l):a(l)}function a(l){return l===null||bt(l)?e(l):n(l)}}const lbe={name:"hardBreakEscape",tokenize:cbe};function cbe(t,e,n){return r;function r(i){return t.enter("hardBreakEscape"),t.consume(i),s}function s(i){return bt(i)?(t.exit("hardBreakEscape"),e(i)):n(i)}}const ube={name:"headingAtx",resolve:dbe,tokenize:hbe};function dbe(t,e){let n=t.length-2,r=3,s,i;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},i={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},Gi(t,r,n-r+1,[["enter",s,e],["enter",i,e],["exit",i,e],["exit",s,e]])),t}function hbe(t,e,n){let r=0;return s;function s(h){return t.enter("atxHeading"),i(h)}function i(h){return t.enter("atxHeadingSequence"),a(h)}function a(h){return h===35&&r++<6?(t.consume(h),a):h===null||or(h)?(t.exit("atxHeadingSequence"),l(h)):n(h)}function l(h){return h===35?(t.enter("atxHeadingSequence"),c(h)):h===null||bt(h)?(t.exit("atxHeading"),e(h)):dn(h)?on(t,l,"whitespace")(h):(t.enter("atxHeadingText"),d(h))}function c(h){return h===35?(t.consume(h),c):(t.exit("atxHeadingSequence"),l(h))}function d(h){return h===null||h===35||or(h)?(t.exit("atxHeadingText"),l(h)):(t.consume(h),d)}}const fbe=["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"],MA=["pre","script","style","textarea"],mbe={concrete:!0,name:"htmlFlow",resolveTo:xbe,tokenize:vbe},pbe={partial:!0,tokenize:bbe},gbe={partial:!0,tokenize:ybe};function xbe(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function vbe(t,e,n){const r=this;let s,i,a,l,c;return d;function d(q){return h(q)}function h(q){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(q),m}function m(q){return q===33?(t.consume(q),g):q===47?(t.consume(q),i=!0,w):q===63?(t.consume(q),s=3,r.interrupt?e:R):Zs(q)?(t.consume(q),a=String.fromCharCode(q),S):n(q)}function g(q){return q===45?(t.consume(q),s=2,x):q===91?(t.consume(q),s=5,l=0,y):Zs(q)?(t.consume(q),s=4,r.interrupt?e:R):n(q)}function x(q){return q===45?(t.consume(q),r.interrupt?e:R):n(q)}function y(q){const V="CDATA[";return q===V.charCodeAt(l++)?(t.consume(q),l===V.length?r.interrupt?e:U:y):n(q)}function w(q){return Zs(q)?(t.consume(q),a=String.fromCharCode(q),S):n(q)}function S(q){if(q===null||q===47||q===62||or(q)){const V=q===47,te=a.toLowerCase();return!V&&!i&&MA.includes(te)?(s=1,r.interrupt?e(q):U(q)):fbe.includes(a.toLowerCase())?(s=6,V?(t.consume(q),k):r.interrupt?e(q):U(q)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(q):i?j(q):N(q))}return q===45||Vs(q)?(t.consume(q),a+=String.fromCharCode(q),S):n(q)}function k(q){return q===62?(t.consume(q),r.interrupt?e:U):n(q)}function j(q){return dn(q)?(t.consume(q),j):L(q)}function N(q){return q===47?(t.consume(q),L):q===58||q===95||Zs(q)?(t.consume(q),T):dn(q)?(t.consume(q),N):L(q)}function T(q){return q===45||q===46||q===58||q===95||Vs(q)?(t.consume(q),T):E(q)}function E(q){return q===61?(t.consume(q),_):dn(q)?(t.consume(q),E):N(q)}function _(q){return q===null||q===60||q===61||q===62||q===96?n(q):q===34||q===39?(t.consume(q),c=q,M):dn(q)?(t.consume(q),_):I(q)}function M(q){return q===c?(t.consume(q),c=null,P):q===null||bt(q)?n(q):(t.consume(q),M)}function I(q){return q===null||q===34||q===39||q===47||q===60||q===61||q===62||q===96||or(q)?E(q):(t.consume(q),I)}function P(q){return q===47||q===62||dn(q)?N(q):n(q)}function L(q){return q===62?(t.consume(q),H):n(q)}function H(q){return q===null||bt(q)?U(q):dn(q)?(t.consume(q),H):n(q)}function U(q){return q===45&&s===2?(t.consume(q),B):q===60&&s===1?(t.consume(q),X):q===62&&s===4?(t.consume(q),ie):q===63&&s===3?(t.consume(q),R):q===93&&s===5?(t.consume(q),G):bt(q)&&(s===6||s===7)?(t.exit("htmlFlowData"),t.check(pbe,W,ee)(q)):q===null||bt(q)?(t.exit("htmlFlowData"),ee(q)):(t.consume(q),U)}function ee(q){return t.check(gbe,z,W)(q)}function z(q){return t.enter("lineEnding"),t.consume(q),t.exit("lineEnding"),Q}function Q(q){return q===null||bt(q)?ee(q):(t.enter("htmlFlowData"),U(q))}function B(q){return q===45?(t.consume(q),R):U(q)}function X(q){return q===47?(t.consume(q),a="",J):U(q)}function J(q){if(q===62){const V=a.toLowerCase();return MA.includes(V)?(t.consume(q),ie):U(q)}return Zs(q)&&a.length<8?(t.consume(q),a+=String.fromCharCode(q),J):U(q)}function G(q){return q===93?(t.consume(q),R):U(q)}function R(q){return q===62?(t.consume(q),ie):q===45&&s===2?(t.consume(q),R):U(q)}function ie(q){return q===null||bt(q)?(t.exit("htmlFlowData"),W(q)):(t.consume(q),ie)}function W(q){return t.exit("htmlFlow"),e(q)}}function ybe(t,e,n){const r=this;return s;function s(a){return bt(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):n(a)}function i(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function bbe(t,e,n){return r;function r(s){return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),t.attempt(cg,e,n)}}const wbe={name:"htmlText",tokenize:Sbe};function Sbe(t,e,n){const r=this;let s,i,a;return l;function l(R){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(R),c}function c(R){return R===33?(t.consume(R),d):R===47?(t.consume(R),E):R===63?(t.consume(R),N):Zs(R)?(t.consume(R),I):n(R)}function d(R){return R===45?(t.consume(R),h):R===91?(t.consume(R),i=0,y):Zs(R)?(t.consume(R),j):n(R)}function h(R){return R===45?(t.consume(R),x):n(R)}function m(R){return R===null?n(R):R===45?(t.consume(R),g):bt(R)?(a=m,X(R)):(t.consume(R),m)}function g(R){return R===45?(t.consume(R),x):m(R)}function x(R){return R===62?B(R):R===45?g(R):m(R)}function y(R){const ie="CDATA[";return R===ie.charCodeAt(i++)?(t.consume(R),i===ie.length?w:y):n(R)}function w(R){return R===null?n(R):R===93?(t.consume(R),S):bt(R)?(a=w,X(R)):(t.consume(R),w)}function S(R){return R===93?(t.consume(R),k):w(R)}function k(R){return R===62?B(R):R===93?(t.consume(R),k):w(R)}function j(R){return R===null||R===62?B(R):bt(R)?(a=j,X(R)):(t.consume(R),j)}function N(R){return R===null?n(R):R===63?(t.consume(R),T):bt(R)?(a=N,X(R)):(t.consume(R),N)}function T(R){return R===62?B(R):N(R)}function E(R){return Zs(R)?(t.consume(R),_):n(R)}function _(R){return R===45||Vs(R)?(t.consume(R),_):M(R)}function M(R){return bt(R)?(a=M,X(R)):dn(R)?(t.consume(R),M):B(R)}function I(R){return R===45||Vs(R)?(t.consume(R),I):R===47||R===62||or(R)?P(R):n(R)}function P(R){return R===47?(t.consume(R),B):R===58||R===95||Zs(R)?(t.consume(R),L):bt(R)?(a=P,X(R)):dn(R)?(t.consume(R),P):B(R)}function L(R){return R===45||R===46||R===58||R===95||Vs(R)?(t.consume(R),L):H(R)}function H(R){return R===61?(t.consume(R),U):bt(R)?(a=H,X(R)):dn(R)?(t.consume(R),H):P(R)}function U(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(t.consume(R),s=R,ee):bt(R)?(a=U,X(R)):dn(R)?(t.consume(R),U):(t.consume(R),z)}function ee(R){return R===s?(t.consume(R),s=void 0,Q):R===null?n(R):bt(R)?(a=ee,X(R)):(t.consume(R),ee)}function z(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||or(R)?P(R):(t.consume(R),z)}function Q(R){return R===47||R===62||or(R)?P(R):n(R)}function B(R){return R===62?(t.consume(R),t.exit("htmlTextData"),t.exit("htmlText"),e):n(R)}function X(R){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),J}function J(R){return dn(R)?on(t,G,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):G(R)}function G(R){return t.enter("htmlTextData"),a(R)}}const cN={name:"labelEnd",resolveAll:Nbe,resolveTo:Cbe,tokenize:Tbe},kbe={tokenize:Ebe},Obe={tokenize:_be},jbe={tokenize:Mbe};function Nbe(t){let e=-1;const n=[];for(;++e=3&&(d===null||bt(d))?(t.exit("thematicBreak"),e(d)):n(d)}function c(d){return d===s?(t.consume(d),r++,c):(t.exit("thematicBreakSequence"),dn(d)?on(t,l,"whitespace")(d):l(d))}}const fi={continuation:{tokenize:qbe},exit:Hbe,name:"list",tokenize:Fbe},Lbe={partial:!0,tokenize:Qbe},Bbe={partial:!0,tokenize:$be};function Fbe(t,e,n){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,a=0;return l;function l(x){const y=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:jO(x)){if(r.containerState.type||(r.containerState.type=y,t.enter(y,{_container:!0})),y==="listUnordered")return t.enter("listItemPrefix"),x===42||x===45?t.check(bv,n,d)(x):d(x);if(!r.interrupt||x===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),c(x)}return n(x)}function c(x){return jO(x)&&++a<10?(t.consume(x),c):(!r.interrupt||a<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(t.exit("listItemValue"),d(x)):n(x)}function d(x){return t.enter("listItemMarker"),t.consume(x),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,t.check(cg,r.interrupt?n:h,t.attempt(Lbe,g,m))}function h(x){return r.containerState.initialBlankLine=!0,i++,g(x)}function m(x){return dn(x)?(t.enter("listItemPrefixWhitespace"),t.consume(x),t.exit("listItemPrefixWhitespace"),g):n(x)}function g(x){return r.containerState.size=i+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(x)}}function qbe(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(cg,s,i);function s(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,on(t,e,"listItemIndent",r.containerState.size+1)(l)}function i(l){return r.containerState.furtherBlankLines||!dn(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(Bbe,e,a)(l))}function a(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,on(t,t.attempt(fi,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function $be(t,e,n){const r=this;return on(t,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(i):n(i)}}function Hbe(t){t.exit(this.containerState.type)}function Qbe(t,e,n){const r=this;return on(t,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!dn(i)&&a&&a[1].type==="listItemPrefixWhitespace"?e(i):n(i)}}const AA={name:"setextUnderline",resolveTo:Vbe,tokenize:Ube};function Vbe(t,e){let n=t.length,r,s,i;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(s=n)}else t[n][1].type==="content"&&t.splice(n,1),!i&&t[n][1].type==="definition"&&(i=n);const a={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[s][1].type="setextHeadingText",i?(t.splice(s,0,["enter",a,e]),t.splice(i+1,0,["exit",t[r][1],e]),t[r][1].end={...t[i][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function Ube(t,e,n){const r=this;let s;return i;function i(d){let h=r.events.length,m;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){m=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(t.enter("setextHeadingLine"),s=d,a(d)):n(d)}function a(d){return t.enter("setextHeadingLineSequence"),l(d)}function l(d){return d===s?(t.consume(d),l):(t.exit("setextHeadingLineSequence"),dn(d)?on(t,c,"lineSuffix")(d):c(d))}function c(d){return d===null||bt(d)?(t.exit("setextHeadingLine"),e(d)):n(d)}}const Wbe={tokenize:Gbe};function Gbe(t){const e=this,n=t.attempt(cg,r,t.attempt(this.parser.constructs.flowInitial,s,on(t,t.attempt(this.parser.constructs.flow,s,t.attempt(Jye,s)),"linePrefix")));return n;function r(i){if(i===null){t.consume(i);return}return t.enter("lineEndingBlank"),t.consume(i),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function s(i){if(i===null){t.consume(i);return}return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const Xbe={resolveAll:oV()},Ybe=aV("string"),Kbe=aV("text");function aV(t){return{resolveAll:oV(t==="text"?Zbe:void 0),tokenize:e};function e(n){const r=this,s=this.parser.constructs[t],i=n.attempt(s,a,l);return a;function a(h){return d(h)?i(h):l(h)}function l(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),c}function c(h){return d(h)?(n.exit("data"),i(h)):(n.consume(h),c)}function d(h){if(h===null)return!0;const m=s[h];let g=-1;if(m)for(;++g-1){const l=a[0];typeof l=="string"?a[0]=l.slice(r):a.shift()}i>0&&a.push(t[s].slice(0,i))}return a}function dwe(t,e){let n=-1;const r=[];let s;for(;++n{d(!0)},[]),l1e(b.useMemo(()=>({onDragStart(m){let{active:g}=m;i(e.onDragStart({active:g}))},onDragMove(m){let{active:g,over:x}=m;e.onDragMove&&i(e.onDragMove({active:g,over:x}))},onDragOver(m){let{active:g,over:x}=m;i(e.onDragOver({active:g,over:x}))},onDragEnd(m){let{active:g,over:x}=m;i(e.onDragEnd({active:g,over:x}))},onDragCancel(m){let{active:g,over:x}=m;i(e.onDragCancel({active:g,over:x}))}}),[i,e])),!c)return null;const h=ae.createElement(ae.Fragment,null,ae.createElement(i1e,{id:r,value:s.draggable}),ae.createElement(a1e,{id:l,announcement:a}));return n?pa.createPortal(h,n):h}var ds;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(ds||(ds={}));function py(){}function tM(t,e){return b.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function f1e(){for(var t=arguments.length,e=new Array(t),n=0;n[...e].filter(r=>r!=null),[...e])}const Za=Object.freeze({x:0,y:0});function wQ(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function SQ(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function m1e(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function nM(t){let{left:e,top:n,height:r,width:s}=t;return[{x:e,y:n},{x:e+s,y:n},{x:e,y:n+r},{x:e+s,y:n+r}]}function kQ(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function rM(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const p1e=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=rM(e,e.left,e.top),i=[];for(const a of r){const{id:l}=a,c=n.get(l);if(c){const d=wQ(rM(c),s);i.push({id:l,data:{droppableContainer:a,value:d}})}}return i.sort(SQ)},g1e=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=nM(e),i=[];for(const a of r){const{id:l}=a,c=n.get(l);if(c){const d=nM(c),h=s.reduce((g,x,y)=>g+wQ(d[y],x),0),m=Number((h/4).toFixed(4));i.push({id:l,data:{droppableContainer:a,value:m}})}}return i.sort(SQ)};function x1e(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),s=Math.min(e.left+e.width,t.left+t.width),i=Math.min(e.top+e.height,t.top+t.height),a=s-r,l=i-n;if(r{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=[];for(const i of r){const{id:a}=i,l=n.get(a);if(l){const c=x1e(l,e);c>0&&s.push({id:a,data:{droppableContainer:i,value:c}})}}return s.sort(m1e)};function y1e(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function OQ(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Za}function b1e(t){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i({...a,top:a.top+t*l.y,bottom:a.bottom+t*l.y,left:a.left+t*l.x,right:a.right+t*l.x}),{...n})}}const w1e=b1e(1);function S1e(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function k1e(t,e,n){const r=S1e(e);if(!r)return t;const{scaleX:s,scaleY:i,x:a,y:l}=r,c=t.left-a-(1-s)*parseFloat(n),d=t.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),h=s?t.width/s:t.width,m=i?t.height/i:t.height;return{width:h,height:m,top:d,right:c+h,bottom:d+m,left:c}}const O1e={ignoreTransform:!1};function Lf(t,e){e===void 0&&(e=O1e);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:d,transformOrigin:h}=Ti(t).getComputedStyle(t);d&&(n=k1e(n,d,h))}const{top:r,left:s,width:i,height:a,bottom:l,right:c}=n;return{top:r,left:s,width:i,height:a,bottom:l,right:c}}function sM(t){return Lf(t,{ignoreTransform:!0})}function j1e(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function N1e(t,e){return e===void 0&&(e=Ti(t).getComputedStyle(t)),e.position==="fixed"}function C1e(t,e){e===void 0&&(e=Ti(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=e[s];return typeof i=="string"?n.test(i):!1})}function Mb(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if(Z6(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!og(s)||vQ(s)||n.includes(s))return n;const i=Ti(t).getComputedStyle(s);return s!==t&&C1e(s,i)&&n.push(s),N1e(s,i)?n:r(s.parentNode)}return t?r(t):n}function jQ(t){const[e]=Mb(t,1);return e??null}function OS(t){return!Ab||!t?null:zf(t)?t:K6(t)?Z6(t)||t===If(t).scrollingElement?window:og(t)?t:null:null}function NQ(t){return zf(t)?t.scrollX:t.scrollLeft}function CQ(t){return zf(t)?t.scrollY:t.scrollTop}function jO(t){return{x:NQ(t),y:CQ(t)}}var ys;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(ys||(ys={}));function TQ(t){return!Ab||!t?!1:t===document.scrollingElement}function EQ(t){const e={x:0,y:0},n=TQ(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},s=t.scrollTop<=e.y,i=t.scrollLeft<=e.x,a=t.scrollTop>=r.y,l=t.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:a,isRight:l,maxScroll:r,minScroll:e}}const T1e={x:.2,y:.2};function E1e(t,e,n,r,s){let{top:i,left:a,right:l,bottom:c}=n;r===void 0&&(r=10),s===void 0&&(s=T1e);const{isTop:d,isBottom:h,isLeft:m,isRight:g}=EQ(t),x={x:0,y:0},y={x:0,y:0},w={height:e.height*s.y,width:e.width*s.x};return!d&&i<=e.top+w.height?(x.y=ys.Backward,y.y=r*Math.abs((e.top+w.height-i)/w.height)):!h&&c>=e.bottom-w.height&&(x.y=ys.Forward,y.y=r*Math.abs((e.bottom-w.height-c)/w.height)),!g&&l>=e.right-w.width?(x.x=ys.Forward,y.x=r*Math.abs((e.right-w.width-l)/w.width)):!m&&a<=e.left+w.width&&(x.x=ys.Backward,y.x=r*Math.abs((e.left+w.width-a)/w.width)),{direction:x,speed:y}}function _1e(t){if(t===document.scrollingElement){const{innerWidth:i,innerHeight:a}=window;return{top:0,left:0,right:i,bottom:a,width:i,height:a}}const{top:e,left:n,right:r,bottom:s}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:s,width:t.clientWidth,height:t.clientHeight}}function _Q(t){return t.reduce((e,n)=>Fh(e,jO(n)),Za)}function A1e(t){return t.reduce((e,n)=>e+NQ(n),0)}function M1e(t){return t.reduce((e,n)=>e+CQ(n),0)}function R1e(t,e){if(e===void 0&&(e=Lf),!t)return;const{top:n,left:r,bottom:s,right:i}=e(t);jQ(t)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const D1e=[["x",["left","right"],A1e],["y",["top","bottom"],M1e]];class tN{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Mb(n),s=_Q(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,a,l]of D1e)for(const c of a)Object.defineProperty(this,c,{get:()=>{const d=l(r),h=s[i]-d;return this.rect[c]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class C0{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var s;(s=this.target)==null||s.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function P1e(t){const{EventTarget:e}=Ti(t);return t instanceof e?t:If(t)}function jS(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var da;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(da||(da={}));function iM(t){t.preventDefault()}function z1e(t){t.stopPropagation()}var bn;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(bn||(bn={}));const AQ={start:[bn.Space,bn.Enter],cancel:[bn.Esc],end:[bn.Space,bn.Enter,bn.Tab]},I1e=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case bn.Right:return{...n,x:n.x+25};case bn.Left:return{...n,x:n.x-25};case bn.Down:return{...n,y:n.y+25};case bn.Up:return{...n,y:n.y-25}}};class nN{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new C0(If(n)),this.windowListeners=new C0(Ti(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(da.Resize,this.handleCancel),this.windowListeners.add(da.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(da.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&R1e(r),n(Za)}handleKeyDown(e){if(eN(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=AQ,coordinateGetter:a=I1e,scrollBehavior:l="smooth"}=s,{code:c}=e;if(i.end.includes(c)){this.handleEnd(e);return}if(i.cancel.includes(c)){this.handleCancel(e);return}const{collisionRect:d}=r.current,h=d?{x:d.left,y:d.top}:Za;this.referenceCoordinates||(this.referenceCoordinates=h);const m=a(e,{active:n,context:r.current,currentCoordinates:h});if(m){const g=dp(m,h),x={x:0,y:0},{scrollableAncestors:y}=r.current;for(const w of y){const S=e.code,{isTop:k,isRight:j,isLeft:N,isBottom:T,maxScroll:E,minScroll:_}=EQ(w),A=_1e(w),L={x:Math.min(S===bn.Right?A.right-A.width/2:A.right,Math.max(S===bn.Right?A.left:A.left+A.width/2,m.x)),y:Math.min(S===bn.Down?A.bottom-A.height/2:A.bottom,Math.max(S===bn.Down?A.top:A.top+A.height/2,m.y))},P=S===bn.Right&&!j||S===bn.Left&&!N,B=S===bn.Down&&!T||S===bn.Up&&!k;if(P&&L.x!==m.x){const $=w.scrollLeft+g.x,U=S===bn.Right&&$<=E.x||S===bn.Left&&$>=_.x;if(U&&!g.y){w.scrollTo({left:$,behavior:l});return}U?x.x=w.scrollLeft-$:x.x=S===bn.Right?w.scrollLeft-E.x:w.scrollLeft-_.x,x.x&&w.scrollBy({left:-x.x,behavior:l});break}else if(B&&L.y!==m.y){const $=w.scrollTop+g.y,U=S===bn.Down&&$<=E.y||S===bn.Up&&$>=_.y;if(U&&!g.x){w.scrollTo({top:$,behavior:l});return}U?x.y=w.scrollTop-$:x.y=S===bn.Down?w.scrollTop-E.y:w.scrollTop-_.y,x.y&&w.scrollBy({top:-x.y,behavior:l});break}}this.handleMove(e,Fh(dp(m,this.referenceCoordinates),x))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}nN.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=AQ,onActivation:s}=e,{active:i}=n;const{code:a}=t.nativeEvent;if(r.start.includes(a)){const l=i.activatorNode.current;return l&&t.target!==l?!1:(t.preventDefault(),s?.({event:t.nativeEvent}),!0)}return!1}}];function aM(t){return!!(t&&"distance"in t)}function oM(t){return!!(t&&"delay"in t)}class rN{constructor(e,n,r){var s;r===void 0&&(r=P1e(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:i}=e,{target:a}=i;this.props=e,this.events=n,this.document=If(a),this.documentListeners=new C0(this.document),this.listeners=new C0(r),this.windowListeners=new C0(Ti(a)),this.initialCoordinates=(s=OO(i))!=null?s:Za,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(da.Resize,this.handleCancel),this.windowListeners.add(da.DragStart,iM),this.windowListeners.add(da.VisibilityChange,this.handleCancel),this.windowListeners.add(da.ContextMenu,iM),this.documentListeners.add(da.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(oM(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(aM(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:r,onPending:s}=this.props;s(r,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(da.Click,z1e,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(da.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:a,options:{activationConstraint:l}}=i;if(!s)return;const c=(n=OO(e))!=null?n:Za,d=dp(s,c);if(!r&&l){if(aM(l)){if(l.tolerance!=null&&jS(d,l.tolerance))return this.handleCancel();if(jS(d,l.distance))return this.handleStart()}if(oM(l)&&jS(d,l.tolerance))return this.handleCancel();this.handlePending(l,d);return}e.cancelable&&e.preventDefault(),a(c)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===bn.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const L1e={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class sN extends rN{constructor(e){const{event:n}=e,r=If(n.target);super(e,L1e,r)}}sN.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const B1e={move:{name:"mousemove"},end:{name:"mouseup"}};var NO;(function(t){t[t.RightClick=2]="RightClick"})(NO||(NO={}));class F1e extends rN{constructor(e){super(e,B1e,If(e.event.target))}}F1e.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===NO.RightClick?!1:(r?.({event:n}),!0)}}];const NS={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class q1e extends rN{constructor(e){super(e,NS)}static setup(){return window.addEventListener(NS.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(NS.move.name,e)};function e(){}}}q1e.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;const{touches:s}=n;return s.length>1?!1:(r?.({event:n}),!0)}}];var T0;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(T0||(T0={}));var gy;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(gy||(gy={}));function $1e(t){let{acceleration:e,activator:n=T0.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:a=5,order:l=gy.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:h,delta:m,threshold:g}=t;const x=Q1e({delta:m,disabled:!i}),[y,w]=e1e(),S=b.useRef({x:0,y:0}),k=b.useRef({x:0,y:0}),j=b.useMemo(()=>{switch(n){case T0.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case T0.DraggableRect:return s}},[n,s,c]),N=b.useRef(null),T=b.useCallback(()=>{const _=N.current;if(!_)return;const A=S.current.x*k.current.x,L=S.current.y*k.current.y;_.scrollBy(A,L)},[]),E=b.useMemo(()=>l===gy.TreeOrder?[...d].reverse():d,[l,d]);b.useEffect(()=>{if(!i||!d.length||!j){w();return}for(const _ of E){if(r?.(_)===!1)continue;const A=d.indexOf(_),L=h[A];if(!L)continue;const{direction:P,speed:B}=E1e(_,L,j,e,g);for(const $ of["x","y"])x[$][P[$]]||(B[$]=0,P[$]=0);if(B.x>0||B.y>0){w(),N.current=_,y(T,a),S.current=B,k.current=P;return}}S.current={x:0,y:0},k.current={x:0,y:0},w()},[e,T,r,w,i,a,JSON.stringify(j),JSON.stringify(x),y,d,E,h,JSON.stringify(g)])}const H1e={x:{[ys.Backward]:!1,[ys.Forward]:!1},y:{[ys.Backward]:!1,[ys.Forward]:!1}};function Q1e(t){let{delta:e,disabled:n}=t;const r=kO(e);return lg(s=>{if(n||!r||!s)return H1e;const i={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[ys.Backward]:s.x[ys.Backward]||i.x===-1,[ys.Forward]:s.x[ys.Forward]||i.x===1},y:{[ys.Backward]:s.y[ys.Backward]||i.y===-1,[ys.Forward]:s.y[ys.Forward]||i.y===1}}},[n,e,r])}function V1e(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return lg(s=>{var i;return e==null?null:(i=r??s)!=null?i:null},[r,e])}function U1e(t,e){return b.useMemo(()=>t.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(a=>({eventName:a.eventName,handler:e(a.handler,r)}));return[...n,...i]},[]),[t,e])}var fp;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(fp||(fp={}));var CO;(function(t){t.Optimized="optimized"})(CO||(CO={}));const lM=new Map;function W1e(t,e){let{dragging:n,dependencies:r,config:s}=e;const[i,a]=b.useState(null),{frequency:l,measure:c,strategy:d}=s,h=b.useRef(t),m=S(),g=up(m),x=b.useCallback(function(k){k===void 0&&(k=[]),!g.current&&a(j=>j===null?k:j.concat(k.filter(N=>!j.includes(N))))},[g]),y=b.useRef(null),w=lg(k=>{if(m&&!n)return lM;if(!k||k===lM||h.current!==t||i!=null){const j=new Map;for(let N of t){if(!N)continue;if(i&&i.length>0&&!i.includes(N.id)&&N.rect.current){j.set(N.id,N.rect.current);continue}const T=N.node.current,E=T?new tN(c(T),T):null;N.rect.current=E,E&&j.set(N.id,E)}return j}return k},[t,i,n,m,c]);return b.useEffect(()=>{h.current=t},[t]),b.useEffect(()=>{m||x()},[n,m]),b.useEffect(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),b.useEffect(()=>{m||typeof l!="number"||y.current!==null||(y.current=setTimeout(()=>{x(),y.current=null},l))},[l,m,x,...r]),{droppableRects:w,measureDroppableContainers:x,measuringScheduled:i!=null};function S(){switch(d){case fp.Always:return!1;case fp.BeforeDragging:return n;default:return!n}}}function MQ(t,e){return lg(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function G1e(t,e){return MQ(t,e)}function X1e(t){let{callback:e,disabled:n}=t;const r=J6(e),s=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return b.useEffect(()=>()=>s?.disconnect(),[s]),s}function Rb(t){let{callback:e,disabled:n}=t;const r=J6(e),s=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return b.useEffect(()=>()=>s?.disconnect(),[s]),s}function Y1e(t){return new tN(Lf(t),t)}function cM(t,e,n){e===void 0&&(e=Y1e);const[r,s]=b.useState(null);function i(){s(c=>{if(!t)return null;if(t.isConnected===!1){var d;return(d=c??n)!=null?d:null}const h=e(t);return JSON.stringify(c)===JSON.stringify(h)?c:h})}const a=X1e({callback(c){if(t)for(const d of c){const{type:h,target:m}=d;if(h==="childList"&&m instanceof HTMLElement&&m.contains(t)){i();break}}}}),l=Rb({callback:i});return Bo(()=>{i(),t?(l?.observe(t),a?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),a?.disconnect())},[t]),r}function K1e(t){const e=MQ(t);return OQ(t,e)}const uM=[];function Z1e(t){const e=b.useRef(t),n=lg(r=>t?r&&r!==uM&&t&&e.current&&t.parentNode===e.current.parentNode?r:Mb(t):uM,[t]);return b.useEffect(()=>{e.current=t},[t]),n}function J1e(t){const[e,n]=b.useState(null),r=b.useRef(t),s=b.useCallback(i=>{const a=OS(i.target);a&&n(l=>l?(l.set(a,jO(a)),new Map(l)):null)},[]);return b.useEffect(()=>{const i=r.current;if(t!==i){a(i);const l=t.map(c=>{const d=OS(c);return d?(d.addEventListener("scroll",s,{passive:!0}),[d,jO(d)]):null}).filter(c=>c!=null);n(l.length?new Map(l):null),r.current=t}return()=>{a(t),a(i)};function a(l){l.forEach(c=>{const d=OS(c);d?.removeEventListener("scroll",s)})}},[s,t]),b.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,a)=>Fh(i,a),Za):_Q(t):Za,[t,e])}function dM(t,e){e===void 0&&(e=[]);const n=b.useRef(null);return b.useEffect(()=>{n.current=null},e),b.useEffect(()=>{const r=t!==Za;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?dp(t,n.current):Za}function eve(t){b.useEffect(()=>{if(!Ab)return;const e=t.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n?.()}},t.map(e=>{let{sensor:n}=e;return n}))}function tve(t,e){return b.useMemo(()=>t.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=a=>{i(a,e)},n},{}),[t,e])}function RQ(t){return b.useMemo(()=>t?j1e(t):null,[t])}const hM=[];function nve(t,e){e===void 0&&(e=Lf);const[n]=t,r=RQ(n?Ti(n):null),[s,i]=b.useState(hM);function a(){i(()=>t.length?t.map(c=>TQ(c)?r:new tN(e(c),c)):hM)}const l=Rb({callback:a});return Bo(()=>{l?.disconnect(),a(),t.forEach(c=>l?.observe(c))},[t]),s}function rve(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return og(e)?e:t}function sve(t){let{measure:e}=t;const[n,r]=b.useState(null),s=b.useCallback(d=>{for(const{target:h}of d)if(og(h)){r(m=>{const g=e(h);return m?{...m,width:g.width,height:g.height}:g});break}},[e]),i=Rb({callback:s}),a=b.useCallback(d=>{const h=rve(d);i?.disconnect(),h&&i?.observe(h),r(h?e(h):null)},[e,i]),[l,c]=my(a);return b.useMemo(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const ive=[{sensor:sN,options:{}},{sensor:nN,options:{}}],ave={current:{}},wv={draggable:{measure:sM},droppable:{measure:sM,strategy:fp.WhileDragging,frequency:CO.Optimized},dragOverlay:{measure:Lf}};class E0 extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const ove={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new E0,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:py},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:wv,measureDroppableContainers:py,windowRect:null,measuringScheduled:!1},lve={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:py,draggableNodes:new Map,over:null,measureDroppableContainers:py},Db=b.createContext(lve),DQ=b.createContext(ove);function cve(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new E0}}}function uve(t,e){switch(e.type){case ds.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case ds.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case ds.DragEnd:case ds.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ds.RegisterDroppable:{const{element:n}=e,{id:r}=n,s=new E0(t.droppable.containers);return s.set(r,n),{...t,droppable:{...t.droppable,containers:s}}}case ds.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=e,i=t.droppable.containers.get(n);if(!i||r!==i.key)return t;const a=new E0(t.droppable.containers);return a.set(n,{...i,disabled:s}),{...t,droppable:{...t.droppable,containers:a}}}case ds.UnregisterDroppable:{const{id:n,key:r}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const i=new E0(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function dve(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=b.useContext(Db),i=kO(r),a=kO(n?.id);return b.useEffect(()=>{if(!e&&!r&&i&&a!=null){if(!eN(i)||document.activeElement===i.target)return;const l=s.get(a);if(!l)return;const{activatorNode:c,node:d}=l;if(!c.current&&!d.current)return;requestAnimationFrame(()=>{for(const h of[c.current,d.current]){if(!h)continue;const m=r1e(h);if(m){m.focus();break}}})}},[r,e,s,a,i]),null}function hve(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((s,i)=>i({transform:s,...r}),n):n}function fve(t){return b.useMemo(()=>({draggable:{...wv.draggable,...t?.draggable},droppable:{...wv.droppable,...t?.droppable},dragOverlay:{...wv.dragOverlay,...t?.dragOverlay}}),[t?.draggable,t?.droppable,t?.dragOverlay])}function mve(t){let{activeNode:e,measure:n,initialRect:r,config:s=!0}=t;const i=b.useRef(!1),{x:a,y:l}=typeof s=="boolean"?{x:s,y:s}:s;Bo(()=>{if(!a&&!l||!e){i.current=!1;return}if(i.current||!r)return;const d=e?.node.current;if(!d||d.isConnected===!1)return;const h=n(d),m=OQ(h,r);if(a||(m.x=0),l||(m.y=0),i.current=!0,Math.abs(m.x)>0||Math.abs(m.y)>0){const g=jQ(d);g&&g.scrollBy({top:m.y,left:m.x})}},[e,a,l,r,n])}const PQ=b.createContext({...Za,scaleX:1,scaleY:1});var Dc;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Dc||(Dc={}));const pve=b.memo(function(e){var n,r,s,i;let{id:a,accessibility:l,autoScroll:c=!0,children:d,sensors:h=ive,collisionDetection:m=v1e,measuring:g,modifiers:x,...y}=e;const w=b.useReducer(uve,void 0,cve),[S,k]=w,[j,N]=c1e(),[T,E]=b.useState(Dc.Uninitialized),_=T===Dc.Initialized,{draggable:{active:A,nodes:L,translate:P},droppable:{containers:B}}=S,$=A!=null?L.get(A):null,U=b.useRef({initial:null,translated:null}),te=b.useMemo(()=>{var Kt;return A!=null?{id:A,data:(Kt=$?.data)!=null?Kt:ave,rect:U}:null},[A,$]),z=b.useRef(null),[Q,F]=b.useState(null),[Y,J]=b.useState(null),X=up(y,Object.values(y)),R=cg("DndDescribedBy",a),ie=b.useMemo(()=>B.getEnabled(),[B]),G=fve(g),{droppableRects:I,measureDroppableContainers:V,measuringScheduled:ee}=W1e(ie,{dragging:_,dependencies:[P.x,P.y],config:G.droppable}),ne=V1e(L,A),W=b.useMemo(()=>Y?OO(Y):null,[Y]),se=nn(),re=G1e(ne,G.draggable.measure);mve({activeNode:A!=null?L.get(A):null,config:se.layoutShiftCompensation,initialRect:re,measure:G.draggable.measure});const oe=cM(ne,G.draggable.measure,re),Te=cM(ne?ne.parentElement:null),We=b.useRef({activatorEvent:null,active:null,activeNode:ne,collisionRect:null,collisions:null,droppableRects:I,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ye=B.getNodeFor((n=We.current.over)==null?void 0:n.id),Je=sve({measure:G.dragOverlay.measure}),Oe=(r=Je.nodeRef.current)!=null?r:ne,Ve=_?(s=Je.rect)!=null?s:oe:null,Ue=!!(Je.nodeRef.current&&Je.rect),He=K1e(Ue?null:oe),Ot=RQ(Oe?Ti(Oe):null),xt=Z1e(_?Ye??ne:null),kn=nve(xt),It=hve(x,{transform:{x:P.x-He.x,y:P.y-He.y,scaleX:1,scaleY:1},activatorEvent:Y,active:te,activeNodeRect:oe,containerNodeRect:Te,draggingNodeRect:Ve,over:We.current.over,overlayNodeRect:Je.rect,scrollableAncestors:xt,scrollableAncestorRects:kn,windowRect:Ot}),Yt=W?Fh(W,P):null,_t=J1e(xt),mt=dM(_t),Ne=dM(_t,[oe]),Ie=Fh(It,mt),st=Ve?w1e(Ve,It):null,yt=te&&st?m({active:te,collisionRect:st,droppableRects:I,droppableContainers:ie,pointerCoordinates:Yt}):null,Pt=kQ(yt,"id"),[Mt,zn]=b.useState(null),Fe=Ue?It:Fh(It,Ne),rt=y1e(Fe,(i=Mt?.rect)!=null?i:null,oe),tn=b.useRef(null),Rt=b.useCallback((Kt,pt)=>{let{sensor:xr,options:Ur}=pt;if(z.current==null)return;const Wr=L.get(z.current);if(!Wr)return;const vr=Kt.nativeEvent,In=new xr({active:z.current,activeNode:Wr,event:vr,options:Ur,context:We,onAbort(nr){if(!L.get(nr))return;const{onDragAbort:xs}=X.current,js={id:nr};xs?.(js),j({type:"onDragAbort",event:js})},onPending(nr,gs,xs,js){if(!L.get(nr))return;const{onDragPending:Le}=X.current,Ct={id:nr,constraint:gs,initialCoordinates:xs,offset:js};Le?.(Ct),j({type:"onDragPending",event:Ct})},onStart(nr){const gs=z.current;if(gs==null)return;const xs=L.get(gs);if(!xs)return;const{onDragStart:js}=X.current,ge={activatorEvent:vr,active:{id:gs,data:xs.data,rect:U}};pa.unstable_batchedUpdates(()=>{js?.(ge),E(Dc.Initializing),k({type:ds.DragStart,initialCoordinates:nr,active:gs}),j({type:"onDragStart",event:ge}),F(tn.current),J(vr)})},onMove(nr){k({type:ds.DragMove,coordinates:nr})},onEnd:cr(ds.DragEnd),onCancel:cr(ds.DragCancel)});tn.current=In;function cr(nr){return async function(){const{active:xs,collisions:js,over:ge,scrollAdjustedTranslate:Le}=We.current;let Ct=null;if(xs&&Le){const{cancelDrop:vn}=X.current;Ct={activatorEvent:vr,active:xs,collisions:js,delta:Le,over:ge},nr===ds.DragEnd&&typeof vn=="function"&&await Promise.resolve(vn(Ct))&&(nr=ds.DragCancel)}z.current=null,pa.unstable_batchedUpdates(()=>{k({type:nr}),E(Dc.Uninitialized),zn(null),F(null),J(null),tn.current=null;const vn=nr===ds.DragEnd?"onDragEnd":"onDragCancel";if(Ct){const Fr=X.current[vn];Fr?.(Ct),j({type:vn,event:Ct})}})}}},[L]),ke=b.useCallback((Kt,pt)=>(xr,Ur)=>{const Wr=xr.nativeEvent,vr=L.get(Ur);if(z.current!==null||!vr||Wr.dndKit||Wr.defaultPrevented)return;const In={active:vr};Kt(xr,pt.options,In)===!0&&(Wr.dndKit={capturedBy:pt.sensor},z.current=Ur,Rt(xr,pt))},[L,Rt]),Pe=U1e(h,ke);eve(h),Bo(()=>{oe&&T===Dc.Initializing&&E(Dc.Initialized)},[oe,T]),b.useEffect(()=>{const{onDragMove:Kt}=X.current,{active:pt,activatorEvent:xr,collisions:Ur,over:Wr}=We.current;if(!pt||!xr)return;const vr={active:pt,activatorEvent:xr,collisions:Ur,delta:{x:Ie.x,y:Ie.y},over:Wr};pa.unstable_batchedUpdates(()=>{Kt?.(vr),j({type:"onDragMove",event:vr})})},[Ie.x,Ie.y]),b.useEffect(()=>{const{active:Kt,activatorEvent:pt,collisions:xr,droppableContainers:Ur,scrollAdjustedTranslate:Wr}=We.current;if(!Kt||z.current==null||!pt||!Wr)return;const{onDragOver:vr}=X.current,In=Ur.get(Pt),cr=In&&In.rect.current?{id:In.id,rect:In.rect.current,data:In.data,disabled:In.disabled}:null,nr={active:Kt,activatorEvent:pt,collisions:xr,delta:{x:Wr.x,y:Wr.y},over:cr};pa.unstable_batchedUpdates(()=>{zn(cr),vr?.(nr),j({type:"onDragOver",event:nr})})},[Pt]),Bo(()=>{We.current={activatorEvent:Y,active:te,activeNode:ne,collisionRect:st,collisions:yt,droppableRects:I,draggableNodes:L,draggingNode:Oe,draggingNodeRect:Ve,droppableContainers:B,over:Mt,scrollableAncestors:xt,scrollAdjustedTranslate:Ie},U.current={initial:Ve,translated:st}},[te,ne,yt,st,L,Oe,Ve,I,B,Mt,xt,Ie]),$1e({...se,delta:P,draggingRect:st,pointerCoordinates:Yt,scrollableAncestors:xt,scrollableAncestorRects:kn});const it=b.useMemo(()=>({active:te,activeNode:ne,activeNodeRect:oe,activatorEvent:Y,collisions:yt,containerNodeRect:Te,dragOverlay:Je,draggableNodes:L,droppableContainers:B,droppableRects:I,over:Mt,measureDroppableContainers:V,scrollableAncestors:xt,scrollableAncestorRects:kn,measuringConfiguration:G,measuringScheduled:ee,windowRect:Ot}),[te,ne,oe,Y,yt,Te,Je,L,B,I,Mt,V,xt,kn,G,ee,Ot]),ot=b.useMemo(()=>({activatorEvent:Y,activators:Pe,active:te,activeNodeRect:oe,ariaDescribedById:{draggable:R},dispatch:k,draggableNodes:L,over:Mt,measureDroppableContainers:V}),[Y,Pe,te,oe,k,R,L,Mt,V]);return ae.createElement(bQ.Provider,{value:N},ae.createElement(Db.Provider,{value:ot},ae.createElement(DQ.Provider,{value:it},ae.createElement(PQ.Provider,{value:rt},d)),ae.createElement(dve,{disabled:l?.restoreFocus===!1})),ae.createElement(h1e,{...l,hiddenTextDescribedById:R}));function nn(){const Kt=Q?.autoScrollEnabled===!1,pt=typeof c=="object"?c.enabled===!1:c===!1,xr=_&&!Kt&&!pt;return typeof c=="object"?{...c,enabled:xr}:{enabled:xr}}}),gve=b.createContext(null),fM="button",xve="Draggable";function vve(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const i=cg(xve),{activators:a,activatorEvent:l,active:c,activeNodeRect:d,ariaDescribedById:h,draggableNodes:m,over:g}=b.useContext(Db),{role:x=fM,roleDescription:y="draggable",tabIndex:w=0}=s??{},S=c?.id===e,k=b.useContext(S?PQ:gve),[j,N]=my(),[T,E]=my(),_=tve(a,e),A=up(n);Bo(()=>(m.set(e,{id:e,key:i,node:j,activatorNode:T,data:A}),()=>{const P=m.get(e);P&&P.key===i&&m.delete(e)}),[m,e]);const L=b.useMemo(()=>({role:x,tabIndex:w,"aria-disabled":r,"aria-pressed":S&&x===fM?!0:void 0,"aria-roledescription":y,"aria-describedby":h.draggable}),[r,x,w,S,y,h.draggable]);return{active:c,activatorEvent:l,activeNodeRect:d,attributes:L,isDragging:S,listeners:r?void 0:_,node:j,over:g,setNodeRef:N,setActivatorNodeRef:E,transform:k}}function yve(){return b.useContext(DQ)}const bve="Droppable",wve={timeout:25};function Sve(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const i=cg(bve),{active:a,dispatch:l,over:c,measureDroppableContainers:d}=b.useContext(Db),h=b.useRef({disabled:n}),m=b.useRef(!1),g=b.useRef(null),x=b.useRef(null),{disabled:y,updateMeasurementsFor:w,timeout:S}={...wve,...s},k=up(w??r),j=b.useCallback(()=>{if(!m.current){m.current=!0;return}x.current!=null&&clearTimeout(x.current),x.current=setTimeout(()=>{d(Array.isArray(k.current)?k.current:[k.current]),x.current=null},S)},[S]),N=Rb({callback:j,disabled:y||!a}),T=b.useCallback((L,P)=>{N&&(P&&(N.unobserve(P),m.current=!1),L&&N.observe(L))},[N]),[E,_]=my(T),A=up(e);return b.useEffect(()=>{!N||!E.current||(N.disconnect(),m.current=!1,N.observe(E.current))},[E,N]),b.useEffect(()=>(l({type:ds.RegisterDroppable,element:{id:r,key:i,disabled:n,node:E,rect:g,data:A}}),()=>l({type:ds.UnregisterDroppable,key:i,id:r})),[r]),b.useEffect(()=>{n!==h.current.disabled&&(l({type:ds.SetDroppableDisabled,id:r,key:i,disabled:n}),h.current.disabled=n)},[r,i,n,l]),{active:a,rect:g,isOver:c?.id===r,node:E,over:c,setNodeRef:_}}function iN(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function kve(t,e){return t.reduce((n,r,s)=>{const i=e.get(r);return i&&(n[s]=i),n},Array(t.length))}function j1(t){return t!==null&&t>=0}function Ove(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n{var e;let{rects:n,activeNodeRect:r,activeIndex:s,overIndex:i,index:a}=t;const l=(e=n[s])!=null?e:r;if(!l)return null;const c=Cve(n,a,s);if(a===s){const d=n[i];return d?{x:ss&&a<=i?{x:-l.width-c,y:0,...N1}:a=i?{x:l.width+c,y:0,...N1}:{x:0,y:0,...N1}};function Cve(t,e,n){const r=t[e],s=t[e-1],i=t[e+1];return!r||!s&&!i?0:n{let{rects:e,activeIndex:n,overIndex:r,index:s}=t;const i=iN(e,r,n),a=e[s],l=i[s];return!l||!a?null:{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}},IQ="Sortable",LQ=ae.createContext({activeIndex:-1,containerId:IQ,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:zQ,disabled:{draggable:!1,droppable:!1}});function Tve(t){let{children:e,id:n,items:r,strategy:s=zQ,disabled:i=!1}=t;const{active:a,dragOverlay:l,droppableRects:c,over:d,measureDroppableContainers:h}=yve(),m=cg(IQ,n),g=l.rect!==null,x=b.useMemo(()=>r.map(_=>typeof _=="object"&&"id"in _?_.id:_),[r]),y=a!=null,w=a?x.indexOf(a.id):-1,S=d?x.indexOf(d.id):-1,k=b.useRef(x),j=!Ove(x,k.current),N=S!==-1&&w===-1||j,T=jve(i);Bo(()=>{j&&y&&h(x)},[j,x,y,h]),b.useEffect(()=>{k.current=x},[x]);const E=b.useMemo(()=>({activeIndex:w,containerId:m,disabled:T,disableTransforms:N,items:x,overIndex:S,useDragOverlay:g,sortedRects:kve(x,c),strategy:s}),[w,m,T.draggable,T.droppable,N,x,S,c,g,s]);return ae.createElement(LQ.Provider,{value:E},e)}const Eve=t=>{let{id:e,items:n,activeIndex:r,overIndex:s}=t;return iN(n,r,s).indexOf(e)},_ve=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:s,items:i,newIndex:a,previousItems:l,previousContainerId:c,transition:d}=t;return!d||!r||l!==i&&s===a?!1:n?!0:a!==s&&e===c},Ave={duration:200,easing:"ease"},BQ="transform",Mve=hp.Transition.toString({property:BQ,duration:0,easing:"linear"}),Rve={roleDescription:"sortable"};function Dve(t){let{disabled:e,index:n,node:r,rect:s}=t;const[i,a]=b.useState(null),l=b.useRef(n);return Bo(()=>{if(!e&&n!==l.current&&r.current){const c=s.current;if(c){const d=Lf(r.current,{ignoreTransform:!0}),h={x:c.left-d.left,y:c.top-d.top,scaleX:c.width/d.width,scaleY:c.height/d.height};(h.x||h.y)&&a(h)}}n!==l.current&&(l.current=n)},[e,n,r,s]),b.useEffect(()=>{i&&a(null)},[i]),i}function Pve(t){let{animateLayoutChanges:e=_ve,attributes:n,disabled:r,data:s,getNewIndex:i=Eve,id:a,strategy:l,resizeObserverConfig:c,transition:d=Ave}=t;const{items:h,containerId:m,activeIndex:g,disabled:x,disableTransforms:y,sortedRects:w,overIndex:S,useDragOverlay:k,strategy:j}=b.useContext(LQ),N=zve(r,x),T=h.indexOf(a),E=b.useMemo(()=>({sortable:{containerId:m,index:T,items:h},...s}),[m,s,T,h]),_=b.useMemo(()=>h.slice(h.indexOf(a)),[h,a]),{rect:A,node:L,isOver:P,setNodeRef:B}=Sve({id:a,data:E,disabled:N.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...c}}),{active:$,activatorEvent:U,activeNodeRect:te,attributes:z,setNodeRef:Q,listeners:F,isDragging:Y,over:J,setActivatorNodeRef:X,transform:R}=vve({id:a,data:E,attributes:{...Rve,...n},disabled:N.draggable}),ie=Jxe(B,Q),G=!!$,I=G&&!y&&j1(g)&&j1(S),V=!k&&Y,ee=V&&I?R:null,W=I?ee??(l??j)({rects:w,activeNodeRect:te,activeIndex:g,overIndex:S,index:T}):null,se=j1(g)&&j1(S)?i({id:a,items:h,activeIndex:g,overIndex:S}):T,re=$?.id,oe=b.useRef({activeId:re,items:h,newIndex:se,containerId:m}),Te=h!==oe.current.items,We=e({active:$,containerId:m,isDragging:Y,isSorting:G,id:a,index:T,items:h,newIndex:oe.current.newIndex,previousItems:oe.current.items,previousContainerId:oe.current.containerId,transition:d,wasDragging:oe.current.activeId!=null}),Ye=Dve({disabled:!We,index:T,node:L,rect:A});return b.useEffect(()=>{G&&oe.current.newIndex!==se&&(oe.current.newIndex=se),m!==oe.current.containerId&&(oe.current.containerId=m),h!==oe.current.items&&(oe.current.items=h)},[G,se,m,h]),b.useEffect(()=>{if(re===oe.current.activeId)return;if(re!=null&&oe.current.activeId==null){oe.current.activeId=re;return}const Oe=setTimeout(()=>{oe.current.activeId=re},50);return()=>clearTimeout(Oe)},[re]),{active:$,activeIndex:g,attributes:z,data:E,rect:A,index:T,newIndex:se,items:h,isOver:P,isSorting:G,isDragging:Y,listeners:F,node:L,overIndex:S,over:J,setNodeRef:ie,setActivatorNodeRef:X,setDroppableNodeRef:B,setDraggableNodeRef:Q,transform:Ye??W,transition:Je()};function Je(){if(Ye||Te&&oe.current.newIndex===T)return Mve;if(!(V&&!eN(U)||!d)&&(G||We))return hp.Transition.toString({...d,property:BQ})}}function zve(t,e){var n,r;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t?.draggable)!=null?n:e.draggable,droppable:(r=t?.droppable)!=null?r:e.droppable}}function xy(t){if(!t)return!1;const e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const Ive=[bn.Down,bn.Right,bn.Up,bn.Left],Lve=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:i,over:a,scrollableAncestors:l}}=e;if(Ive.includes(t.code)){if(t.preventDefault(),!n||!r)return;const c=[];i.getEnabled().forEach(m=>{if(!m||m!=null&&m.disabled)return;const g=s.get(m.id);if(g)switch(t.code){case bn.Down:r.topg.top&&c.push(m);break;case bn.Left:r.left>g.left&&c.push(m);break;case bn.Right:r.left1&&(h=d[1].id),h!=null){const m=i.get(n.id),g=i.get(h),x=g?s.get(g.id):null,y=g?.node.current;if(y&&x&&m&&g){const S=Mb(y).some((_,A)=>l[A]!==_),k=FQ(m,g),j=Bve(m,g),N=S||!k?{x:0,y:0}:{x:j?r.width-x.width:0,y:j?r.height-x.height:0},T={x:x.left,y:x.top};return N.x&&N.y?T:dp(T,N)}}}};function FQ(t,e){return!xy(t)||!xy(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function Bve(t,e){return!xy(t)||!xy(e)||!FQ(t,e)?!1:t.data.current.sortable.index{h.stopPropagation(),n(t)}})]})})}function qve({options:t,selected:e,onChange:n,placeholder:r="选择选项...",emptyText:s="未找到选项",className:i}){const[a,l]=b.useState(!1),c=f1e(tM(sN,{activationConstraint:{distance:8}}),tM(nN,{coordinateGetter:Lve})),d=g=>{e.includes(g)?n(e.filter(x=>x!==g)):n([...e,g])},h=g=>{n(e.filter(x=>x!==g))},m=g=>{const{active:x,over:y}=g;if(y&&x.id!==y.id){const w=e.indexOf(x.id),S=e.indexOf(y.id);n(iN(e,w,S))}};return o.jsxs(zo,{open:a,onOpenChange:l,children:[o.jsx(Io,{asChild:!0,children:o.jsxs(de,{variant:"outline",role:"combobox","aria-expanded":a,className:xe("w-full justify-between min-h-10 h-auto",i),children:[o.jsx(pve,{sensors:c,collisionDetection:p1e,onDragEnd:m,children:o.jsx(Tve,{items:e,strategy:Nve,children:o.jsx("div",{className:"flex gap-1 flex-wrap flex-1",children:e.length===0?o.jsx("span",{className:"text-muted-foreground",children:r}):e.map(g=>{const x=t.find(y=>y.value===g);return o.jsx(Fve,{value:g,label:x?.label||g,onRemove:h},g)})})})}),o.jsx(Mj,{className:"ml-2 h-4 w-4 shrink-0 opacity-50",strokeWidth:2,fill:"none"})]})}),o.jsx(Xa,{className:"w-full p-0",align:"start",children:o.jsxs(Ob,{children:[o.jsx(jb,{placeholder:"搜索...",className:"h-9"}),o.jsxs(Nb,{children:[o.jsx(Cb,{children:s}),o.jsx(ap,{children:t.map(g=>{const x=e.includes(g.value);return o.jsxs(op,{value:g.value,onSelect:()=>d(g.value),children:[o.jsx("div",{className:xe("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",x?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:o.jsx(Ro,{className:"h-3 w-3",strokeWidth:2,fill:"none"})}),o.jsx("span",{children:g.label})]},g.value)})})]})]})})]})}const mM=new Map,$ve=300*1e3;function Hve(){const[t,e]=b.useState([]),[n,r]=b.useState([]),[s,i]=b.useState([]),[a,l]=b.useState([]),[c,d]=b.useState(null),[h,m]=b.useState(!0),[g,x]=b.useState(!1),[y,w]=b.useState(!1),[S,k]=b.useState(!1),[j,N]=b.useState(!1),[T,E]=b.useState(!1),[_,A]=b.useState(!1),[L,P]=b.useState(null),[B,$]=b.useState(null),[U,te]=b.useState(!1),[z,Q]=b.useState(null),[F,Y]=b.useState(""),[J,X]=b.useState(new Set),[R,ie]=b.useState(!1),[G,I]=b.useState(1),[V,ee]=b.useState(20),[ne,W]=b.useState(""),[se,re]=b.useState([]),[oe,Te]=b.useState(!1),[We,Ye]=b.useState(null),[Je,Oe]=b.useState(!1),[Ve,Ue]=b.useState(null),{toast:He}=as(),Ot=Zi(),{registerTour:xt,startTour:kn,state:It,goToStep:Yt}=Y6(),_t=b.useRef(null),mt=b.useRef(null),Ne=b.useRef(!0);b.useEffect(()=>{xt(_l,gQ)},[xt]),b.useEffect(()=>{if(It.activeTourId===_l&&It.isRunning){const ge=xQ[It.stepIndex];ge&&!window.location.pathname.endsWith(ge.replace("/config/",""))&&Ot({to:ge})}},[It.stepIndex,It.activeTourId,It.isRunning,Ot]);const Ie=b.useRef(It.stepIndex);b.useEffect(()=>{if(It.activeTourId===_l&&It.isRunning){const ge=Ie.current,Le=It.stepIndex;ge>=12&&ge<=17&&Le<12&&A(!1),Ie.current=Le}},[It.stepIndex,It.activeTourId,It.isRunning]),b.useEffect(()=>{if(It.activeTourId!==_l||!It.isRunning)return;const ge=Le=>{const Ct=Le.target,vn=It.stepIndex;vn===2&&Ct.closest('[data-tour="add-provider-button"]')?setTimeout(()=>Yt(3),300):vn===9&&Ct.closest('[data-tour="provider-cancel-button"]')?setTimeout(()=>Yt(10),300):vn===11&&Ct.closest('[data-tour="add-model-button"]')?setTimeout(()=>Yt(12),300):vn===17&&Ct.closest('[data-tour="model-cancel-button"]')?setTimeout(()=>Yt(18),300):vn===18&&Ct.closest('[data-tour="tasks-tab-trigger"]')&&setTimeout(()=>Yt(19),300)};return document.addEventListener("click",ge,!0),()=>document.removeEventListener("click",ge,!0)},[It,Yt]);const st=()=>{kn(_l)};b.useEffect(()=>{yt()},[]);const yt=async()=>{try{m(!0);const ge=await Rh(),Le=ge.models||[];e(Le),l(Le.map(vn=>vn.name));const Ct=ge.api_providers||[];r(Ct.map(vn=>vn.name)),i(Ct),d(ge.model_task_config||null),k(!1),Ne.current=!1}catch(ge){console.error("加载配置失败:",ge)}finally{m(!1)}},Pt=b.useCallback(ge=>s.find(Le=>Le.name===ge),[s]),Mt=b.useCallback(async(ge,Le=!1)=>{const Ct=Pt(ge);if(!Ct?.base_url){re([]),Ue(null),Ye('提供商配置不完整,请先在"模型提供商配置"中配置');return}if(!Ct.api_key){re([]),Ue(null),Ye('该提供商未配置 API Key,请先在"模型提供商配置"中填写');return}const vn=Kxe(Ct.base_url);if(Ue(vn),!vn?.modelFetcher){re([]),Ye(null);return}const Fr=`${ge}:${Ct.base_url}`,Cr=mM.get(Fr);if(!Le&&Cr&&Date.now()-Cr.timestamp<$ve){re(Cr.models),Ye(null);return}Te(!0),Ye(null);try{const Tr=await kae(ge,vn.modelFetcher.parser,vn.modelFetcher.endpoint);re(Tr),mM.set(Fr,{models:Tr,timestamp:Date.now()})}catch(Tr){console.error("获取模型列表失败:",Tr);const Ns=Tr.message||"获取模型列表失败";Ns.includes("无效")||Ns.includes("过期")||Ns.includes("API Key")?Ye('API Key 无效或已过期,请检查"模型提供商配置"中的密钥'):Ns.includes("权限")?Ye("没有权限获取模型列表,请检查 API Key 权限"):Ns.includes("timeout")||Ns.includes("超时")?Ye("请求超时,请检查网络连接后重试"):Ns.includes("不支持")?Ye("该提供商不支持自动获取模型列表,请手动输入"):Ye(Ns),re([])}finally{Te(!1)}},[Pt]);b.useEffect(()=>{_&&L?.api_provider&&Mt(L.api_provider)},[_,L?.api_provider,Mt]);const zn=async()=>{try{N(!0),ib().catch(()=>{}),E(!0)}catch(ge){console.error("重启失败:",ge),E(!1),He({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),N(!1)}},Fe=async()=>{try{x(!0),_t.current&&clearTimeout(_t.current),mt.current&&clearTimeout(mt.current);const ge=await Rh();ge.models=t,ge.model_task_config=c,await qv(ge),k(!1),He({title:"保存成功",description:"正在重启麦麦..."}),await zn()}catch(ge){console.error("保存配置失败:",ge),He({title:"保存失败",description:ge.message,variant:"destructive"}),x(!1)}},rt=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},tn=()=>{E(!1),N(!1),He({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},Rt=b.useCallback(async ge=>{if(!Ne.current)try{w(!0),await xk("models",ge),k(!1)}catch(Le){console.error("自动保存模型列表失败:",Le),k(!0)}finally{w(!1)}},[]),ke=b.useCallback(async ge=>{if(!Ne.current)try{w(!0),await xk("model_task_config",ge),k(!1)}catch(Le){console.error("自动保存任务配置失败:",Le),k(!0)}finally{w(!1)}},[]);b.useEffect(()=>{if(!Ne.current)return k(!0),_t.current&&clearTimeout(_t.current),_t.current=setTimeout(()=>{Rt(t)},2e3),()=>{_t.current&&clearTimeout(_t.current)}},[t,Rt]),b.useEffect(()=>{if(!(Ne.current||!c))return k(!0),mt.current&&clearTimeout(mt.current),mt.current=setTimeout(()=>{ke(c)},2e3),()=>{mt.current&&clearTimeout(mt.current)}},[c,ke]);const Pe=async()=>{try{x(!0),_t.current&&clearTimeout(_t.current),mt.current&&clearTimeout(mt.current);const ge=await Rh();ge.models=t,ge.model_task_config=c,await qv(ge),k(!1),He({title:"保存成功",description:"模型配置已保存"}),await yt()}catch(ge){console.error("保存配置失败:",ge),He({title:"保存失败",description:ge.message,variant:"destructive"})}finally{x(!1)}},it=(ge,Le)=>{P(ge||{model_identifier:"",name:"",api_provider:n[0]||"",price_in:0,price_out:0,force_stream_mode:!1,extra_params:{}}),$(Le),A(!0)},ot=()=>{if(!L)return;const ge={...L,price_in:L.price_in??0,price_out:L.price_out??0};let Le;B!==null?(Le=[...t],Le[B]=ge):Le=[...t,ge],e(Le),l(Le.map(Ct=>Ct.name)),A(!1),P(null),$(null)},nn=ge=>{if(!ge&&L){const Le={...L,price_in:L.price_in??0,price_out:L.price_out??0};P(Le)}A(ge)},Kt=ge=>{Q(ge),te(!0)},pt=()=>{if(z!==null){const ge=t.filter((Le,Ct)=>Ct!==z);e(ge),l(ge.map(Le=>Le.name)),He({title:"删除成功",description:"模型已从列表中移除"})}te(!1),Q(null)},xr=ge=>{const Le=new Set(J);Le.has(ge)?Le.delete(ge):Le.add(ge),X(Le)},Ur=()=>{if(J.size===cr.length)X(new Set);else{const ge=cr.map((Le,Ct)=>t.findIndex(vn=>vn===cr[Ct]));X(new Set(ge))}},Wr=()=>{if(J.size===0){He({title:"提示",description:"请先选择要删除的模型",variant:"default"});return}ie(!0)},vr=()=>{const ge=t.filter((Le,Ct)=>!J.has(Ct));e(ge),l(ge.map(Le=>Le.name)),X(new Set),ie(!1),He({title:"批量删除成功",description:`已删除 ${J.size} 个模型`})},In=(ge,Le,Ct)=>{c&&d({...c,[ge]:{...c[ge],[Le]:Ct}})},cr=t.filter(ge=>{if(!F)return!0;const Le=F.toLowerCase();return ge.name.toLowerCase().includes(Le)||ge.model_identifier.toLowerCase().includes(Le)||ge.api_provider.toLowerCase().includes(Le)}),nr=Math.ceil(cr.length/V),gs=cr.slice((G-1)*V,G*V),xs=()=>{const ge=parseInt(ne);ge>=1&&ge<=nr&&(I(ge),W(""))},js=ge=>c?[c.utils?.model_list||[],c.utils_small?.model_list||[],c.tool_use?.model_list||[],c.replyer?.model_list||[],c.planner?.model_list||[],c.vlm?.model_list||[],c.voice?.model_list||[],c.embedding?.model_list||[],c.lpmm_entity_extract?.model_list||[],c.lpmm_rdf_build?.model_list||[],c.lpmm_qa?.model_list||[]].some(Ct=>Ct.includes(ge)):!1;return h?o.jsx(gn,{className:"h-full",children:o.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):o.jsx(gn,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型管理与分配"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"添加模型并为模型分配功能"})]}),o.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[o.jsxs(de,{onClick:Pe,disabled:g||y||!S||j,size:"sm",variant:"outline",className:"flex-1 sm:flex-none sm:min-w-[120px]",children:[o.jsx(Gy,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),g?"保存中...":y?"自动保存中...":S?"保存配置":"已保存"]}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsxs(de,{disabled:g||y||j,size:"sm",className:"flex-1 sm:flex-none sm:min-w-[120px]",children:[o.jsx(Aj,{className:"mr-2 h-4 w-4"}),j?"重启中...":S?"保存并重启":"重启麦麦"]})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认重启麦麦?"}),o.jsx(_n,{className:"space-y-3",asChild:!0,children:o.jsxs("div",{children:[o.jsx("p",{children:S?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"}),o.jsxs(ga,{className:"border-yellow-500/50 bg-yellow-500/10",children:[o.jsx(Oa,{className:"h-4 w-4 text-yellow-600"}),o.jsxs(xa,{className:"text-yellow-900 dark:text-yellow-100",children:[o.jsx("strong",{children:"重要提示:"}),"由于技术原因,使用重启功能后,将无法再使用 ",o.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。",o.jsxs(Dr,{children:[o.jsx(Of,{asChild:!0,children:o.jsxs("button",{className:"ml-1 text-yellow-700 dark:text-yellow-300 underline hover:text-yellow-800 dark:hover:text-yellow-200 inline-flex items-center gap-1",children:[o.jsx(Wy,{className:"h-3 w-3"}),"如何结束程序?"]})}),o.jsxs(Sr,{className:"max-w-2xl",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"如何结束使用重启功能后的麦麦程序"}),o.jsx(ss,{children:"由于重启功能会使程序脱离终端控制,需要通过系统命令来结束进程"})]}),o.jsxs(ja,{defaultValue:"windows",className:"w-full",children:[o.jsxs(Wi,{className:"grid w-full grid-cols-3",children:[o.jsx(Lt,{value:"windows",children:"Windows"}),o.jsx(Lt,{value:"macos",children:"macOS"}),o.jsx(Lt,{value:"linux",children:"Linux"})]}),o.jsxs(un,{value:"windows",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用任务管理器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Ctrl + Shift + Esc"})," 打开任务管理器"]}),o.jsxs("li",{children:['在"进程"或"详细信息"标签页中找到 ',o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"python.exe"})]}),o.jsx("li",{children:'右键点击并选择"结束任务"'})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用命令行"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开 PowerShell 或命令提示符,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:'Get-Process python | Where-Object {$_.MainWindowTitle -eq ""}'}),o.jsx("p",{className:"mt-2",children:"# 结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"Stop-Process -Name python -Force"})]})]})]}),o.jsxs(un,{value:"macos",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法一:使用活动监视器"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Cmd + Space"}),' 打开 Spotlight,搜索"活动监视器"']}),o.jsxs("li",{children:["在进程列表中找到 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Python"})]}),o.jsx("li",{children:"选中后点击左上角的 X 按钮结束进程"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"方法二:使用终端"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 "}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]})]}),o.jsxs(un,{value:"linux",className:"space-y-4 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用终端命令"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),o.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[o.jsx("p",{children:"# 查找麦麦进程"}),o.jsx("p",{children:"ps aux | grep python | grep -v grep"}),o.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),o.jsx("p",{children:"kill -9 "}),o.jsx("p",{className:"mt-2",children:"# 或使用 pkill 按名称结束"}),o.jsx("p",{children:'pkill -9 -f "bot.py"'}),o.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),o.jsx("p",{children:"pkill -9 python"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-semibold",children:"使用 htop(如已安装)"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["在终端输入 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"htop"})]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F3"})," 搜索 python"]}),o.jsxs("li",{children:["按 ",o.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F9"})," 发送信号,选择 SIGKILL"]})]})]})]})]}),o.jsx(ws,{children:o.jsx(Gj,{asChild:!0,children:o.jsx(de,{variant:"outline",children:"关闭"})})})]})]})]})]})]})})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:S?Fe:zn,children:S?"保存并重启":"确认重启"})]})]})]})]})]}),o.jsxs(ga,{children:[o.jsx(Oa,{className:"h-4 w-4"}),o.jsxs(xa,{children:["配置更新后需要",o.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),o.jsxs(ga,{className:"hidden lg:flex border-primary/30 bg-primary/5 cursor-pointer hover:bg-primary/10 transition-colors",onClick:st,children:[o.jsx(Yee,{className:"h-4 w-4 text-primary"}),o.jsxs(xa,{className:"flex items-center justify-between",children:[o.jsxs("span",{children:[o.jsx("strong",{className:"text-primary",children:"新手引导:"}),"不知道如何配置模型?点击这里开始学习如何为麦麦的组件分配模型。"]}),o.jsx(de,{variant:"outline",size:"sm",className:"ml-4 shrink-0",children:"开始引导"})]})]}),o.jsxs(ja,{defaultValue:"models",className:"w-full",children:[o.jsxs(Wi,{className:"grid w-full max-w-full sm:max-w-md grid-cols-2",children:[o.jsx(Lt,{value:"models",children:"添加模型"}),o.jsx(Lt,{value:"tasks","data-tour":"tasks-tab-trigger",children:"为模型分配功能"})]}),o.jsxs(un,{value:"models",className:"space-y-4 mt-0",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:"配置可用的模型列表"}),o.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[J.size>0&&o.jsxs(de,{onClick:Wr,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[o.jsx(Sn,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",J.size,")"]}),o.jsxs(de,{onClick:()=>it(null,null),size:"sm",variant:"outline",className:"w-full sm:w-auto","data-tour":"add-model-button",children:[o.jsx(Ls,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加模型"]})]})]}),o.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2",children:[o.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[o.jsx(Ni,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(ze,{placeholder:"搜索模型名称、标识符或提供商...",value:F,onChange:ge=>Y(ge.target.value),className:"pl-9"})]}),F&&o.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",cr.length," 个结果"]})]}),o.jsx("div",{className:"md:hidden space-y-3",children:gs.length===0?o.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:F?"未找到匹配的模型":"暂无模型配置"}):gs.map((ge,Le)=>{const Ct=t.findIndex(Fr=>Fr===ge),vn=js(ge.name);return o.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx("h3",{className:"font-semibold text-base",children:ge.name}),o.jsx(Xn,{variant:vn?"default":"secondary",className:vn?"bg-green-600 hover:bg-green-700":"",children:vn?"已使用":"未使用"})]}),o.jsx("p",{className:"text-xs text-muted-foreground break-all",title:ge.model_identifier,children:ge.model_identifier})]}),o.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[o.jsxs(de,{variant:"default",size:"sm",onClick:()=>it(ge,Ct),children:[o.jsx(Yu,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),o.jsxs(de,{size:"sm",onClick:()=>Kt(Ct),className:"bg-red-600 hover:bg-red-700 text-white",children:[o.jsx(Sn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"提供商"}),o.jsx("p",{className:"font-medium",children:ge.api_provider})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"强制流式"}),o.jsx("p",{className:"font-medium",children:ge.force_stream_mode?"是":"否"})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"输入价格"}),o.jsxs("p",{className:"font-medium",children:["¥",ge.price_in,"/M"]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"输出价格"}),o.jsxs("p",{className:"font-medium",children:["¥",ge.price_out,"/M"]})]})]})]},Le)})}),o.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs(_f,{children:[o.jsx(Af,{children:o.jsxs(Is,{children:[o.jsx(pn,{className:"w-12",children:o.jsx(Oi,{checked:J.size===cr.length&&cr.length>0,onCheckedChange:Ur})}),o.jsx(pn,{className:"w-24",children:"使用状态"}),o.jsx(pn,{children:"模型名称"}),o.jsx(pn,{children:"模型标识符"}),o.jsx(pn,{children:"提供商"}),o.jsx(pn,{className:"text-right",children:"输入价格"}),o.jsx(pn,{className:"text-right",children:"输出价格"}),o.jsx(pn,{className:"text-center",children:"强制流式"}),o.jsx(pn,{className:"text-right",children:"操作"})]})}),o.jsx(Mf,{children:gs.length===0?o.jsx(Is,{children:o.jsx(Gt,{colSpan:9,className:"text-center text-muted-foreground py-8",children:F?"未找到匹配的模型":"暂无模型配置"})}):gs.map((ge,Le)=>{const Ct=t.findIndex(Fr=>Fr===ge),vn=js(ge.name);return o.jsxs(Is,{children:[o.jsx(Gt,{children:o.jsx(Oi,{checked:J.has(Ct),onCheckedChange:()=>xr(Ct)})}),o.jsx(Gt,{children:o.jsx(Xn,{variant:vn?"default":"secondary",className:vn?"bg-green-600 hover:bg-green-700":"",children:vn?"已使用":"未使用"})}),o.jsx(Gt,{className:"font-medium",children:ge.name}),o.jsx(Gt,{className:"max-w-xs truncate",title:ge.model_identifier,children:ge.model_identifier}),o.jsx(Gt,{children:ge.api_provider}),o.jsxs(Gt,{className:"text-right",children:["¥",ge.price_in,"/M"]}),o.jsxs(Gt,{className:"text-right",children:["¥",ge.price_out,"/M"]}),o.jsx(Gt,{className:"text-center",children:ge.force_stream_mode?"是":"否"}),o.jsx(Gt,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsxs(de,{variant:"default",size:"sm",onClick:()=>it(ge,Ct),children:[o.jsx(Yu,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),o.jsxs(de,{size:"sm",onClick:()=>Kt(Ct),className:"bg-red-600 hover:bg-red-700 text-white",children:[o.jsx(Sn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},Le)})})]})})}),cr.length>0&&o.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{htmlFor:"page-size-model",className:"text-sm whitespace-nowrap",children:"每页显示"}),o.jsxs(Vt,{value:V.toString(),onValueChange:ge=>{ee(parseInt(ge)),I(1),X(new Set)},children:[o.jsx($t,{id:"page-size-model",className:"w-20",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"10",children:"10"}),o.jsx(De,{value:"20",children:"20"}),o.jsx(De,{value:"50",children:"50"}),o.jsx(De,{value:"100",children:"100"})]})]}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(G-1)*V+1," 到"," ",Math.min(G*V,cr.length)," 条,共 ",cr.length," 条"]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(de,{variant:"outline",size:"sm",onClick:()=>I(1),disabled:G===1,className:"hidden sm:flex",children:o.jsx(Ap,{className:"h-4 w-4"})}),o.jsxs(de,{variant:"outline",size:"sm",onClick:()=>I(ge=>Math.max(1,ge-1)),disabled:G===1,children:[o.jsx(vd,{className:"h-4 w-4 sm:mr-1"}),o.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ze,{type:"number",value:ne,onChange:ge=>W(ge.target.value),onKeyDown:ge=>ge.key==="Enter"&&xs(),placeholder:G.toString(),className:"w-16 h-8 text-center",min:1,max:nr}),o.jsx(de,{variant:"outline",size:"sm",onClick:xs,disabled:!ne,className:"h-8",children:"跳转"})]}),o.jsxs(de,{variant:"outline",size:"sm",onClick:()=>I(ge=>ge+1),disabled:G>=nr,children:[o.jsx("span",{className:"hidden sm:inline",children:"下一页"}),o.jsx(yd,{className:"h-4 w-4 sm:ml-1"})]}),o.jsx(de,{variant:"outline",size:"sm",onClick:()=>I(nr),disabled:G>=nr,className:"hidden sm:flex",children:o.jsx(Mp,{className:"h-4 w-4"})})]})]})]}),o.jsxs(un,{value:"tasks",className:"space-y-6 mt-0",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:"为不同的任务配置使用的模型和参数"}),c&&o.jsxs("div",{className:"grid gap-4 sm:gap-6",children:[o.jsx(Fa,{title:"组件模型 (utils)",description:"用于表情包、取名、关系、情绪变化等组件",taskConfig:c.utils,modelNames:a,onChange:(ge,Le)=>In("utils",ge,Le),dataTour:"task-model-select"}),o.jsx(Fa,{title:"组件小模型 (utils_small)",description:"消耗量较大的组件,建议使用速度较快的小模型",taskConfig:c.utils_small,modelNames:a,onChange:(ge,Le)=>In("utils_small",ge,Le)}),o.jsx(Fa,{title:"工具调用模型 (tool_use)",description:"需要使用支持工具调用的模型",taskConfig:c.tool_use,modelNames:a,onChange:(ge,Le)=>In("tool_use",ge,Le)}),o.jsx(Fa,{title:"首要回复模型 (replyer)",description:"用于表达器和表达方式学习",taskConfig:c.replyer,modelNames:a,onChange:(ge,Le)=>In("replyer",ge,Le)}),o.jsx(Fa,{title:"决策模型 (planner)",description:"负责决定麦麦该什么时候回复",taskConfig:c.planner,modelNames:a,onChange:(ge,Le)=>In("planner",ge,Le)}),o.jsx(Fa,{title:"图像识别模型 (vlm)",description:"视觉语言模型",taskConfig:c.vlm,modelNames:a,onChange:(ge,Le)=>In("vlm",ge,Le),hideTemperature:!0}),o.jsx(Fa,{title:"语音识别模型 (voice)",description:"语音转文字",taskConfig:c.voice,modelNames:a,onChange:(ge,Le)=>In("voice",ge,Le),hideTemperature:!0,hideMaxTokens:!0}),o.jsx(Fa,{title:"嵌入模型 (embedding)",description:"用于向量化",taskConfig:c.embedding,modelNames:a,onChange:(ge,Le)=>In("embedding",ge,Le),hideTemperature:!0,hideMaxTokens:!0}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库模型"}),o.jsx(Fa,{title:"实体提取模型 (lpmm_entity_extract)",description:"从文本中提取实体",taskConfig:c.lpmm_entity_extract,modelNames:a,onChange:(ge,Le)=>In("lpmm_entity_extract",ge,Le)}),o.jsx(Fa,{title:"RDF 构建模型 (lpmm_rdf_build)",description:"构建知识图谱",taskConfig:c.lpmm_rdf_build,modelNames:a,onChange:(ge,Le)=>In("lpmm_rdf_build",ge,Le)}),o.jsx(Fa,{title:"问答模型 (lpmm_qa)",description:"知识库问答",taskConfig:c.lpmm_qa,modelNames:a,onChange:(ge,Le)=>In("lpmm_qa",ge,Le)})]})]})]})]}),o.jsx(Dr,{open:_,onOpenChange:nn,children:o.jsxs(Sr,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto","data-tour":"model-dialog",preventOutsideClose:It.isRunning,children:[o.jsxs(kr,{children:[o.jsx(Or,{children:B!==null?"编辑模型":"添加模型"}),o.jsx(ss,{children:"配置模型的基本信息和参数"})]}),o.jsxs("div",{className:"grid gap-4 py-4",children:[o.jsxs("div",{className:"grid gap-2","data-tour":"model-name-input",children:[o.jsx(he,{htmlFor:"model_name",children:"模型名称 *"}),o.jsx(ze,{id:"model_name",value:L?.name||"",onChange:ge=>P(Le=>Le?{...Le,name:ge.target.value}:null),placeholder:"例如: qwen3-30b"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"用于在任务配置中引用此模型"})]}),o.jsxs("div",{className:"grid gap-2","data-tour":"model-provider-select",children:[o.jsx(he,{htmlFor:"api_provider",children:"API 提供商 *"}),o.jsxs(Vt,{value:L?.api_provider||"",onValueChange:ge=>{P(Le=>Le?{...Le,api_provider:ge}:null),re([]),Ye(null)},children:[o.jsx($t,{id:"api_provider",children:o.jsx(Ut,{placeholder:"选择提供商"})}),o.jsx(Ht,{children:n.map(ge=>o.jsx(De,{value:ge,children:ge},ge))})]})]}),o.jsxs("div",{className:"grid gap-2","data-tour":"model-identifier-input",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{htmlFor:"model_identifier",children:"模型标识符 *"}),Ve?.modelFetcher&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Xn,{variant:"secondary",className:"text-xs",children:Ve.display_name}),o.jsx(de,{variant:"ghost",size:"sm",className:"h-6 px-2",onClick:()=>L?.api_provider&&Mt(L.api_provider,!0),disabled:oe,children:oe?o.jsx(Po,{className:"h-3 w-3 animate-spin"}):o.jsx(Ps,{className:"h-3 w-3"})})]})]}),Ve?.modelFetcher?o.jsxs(zo,{open:Je,onOpenChange:Oe,children:[o.jsx(Io,{asChild:!0,children:o.jsxs(de,{variant:"outline",role:"combobox","aria-expanded":Je,className:"w-full justify-between font-normal",disabled:oe||!!We,children:[oe?o.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx(Po,{className:"h-4 w-4 animate-spin"}),"正在获取模型列表..."]}):We?o.jsx("span",{className:"text-muted-foreground text-sm",children:"点击下方输入框手动填写"}):L?.model_identifier?o.jsx("span",{className:"truncate",children:L.model_identifier}):o.jsx("span",{className:"text-muted-foreground",children:"搜索或选择模型..."}),o.jsx(Mj,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o.jsx(Xa,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:o.jsxs(Ob,{children:[o.jsx(jb,{placeholder:"搜索模型..."}),o.jsx(gn,{className:"h-[300px]",children:o.jsxs(Nb,{className:"max-h-none overflow-visible",children:[o.jsx(Cb,{children:We?o.jsxs("div",{className:"py-4 px-2 text-center space-y-2",children:[o.jsx("p",{className:"text-sm text-destructive",children:We}),!We.includes("API Key")&&o.jsx(de,{variant:"link",size:"sm",onClick:()=>L?.api_provider&&Mt(L.api_provider,!0),children:"重试"})]}):"未找到匹配的模型"}),o.jsx(ap,{heading:"可用模型",children:se.map(ge=>o.jsxs(op,{value:ge.id,onSelect:()=>{P(Le=>Le?{...Le,model_identifier:ge.id}:null),Oe(!1)},children:[o.jsx(Ro,{className:`mr-2 h-4 w-4 ${L?.model_identifier===ge.id?"opacity-100":"opacity-0"}`}),o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{children:ge.id}),ge.name!==ge.id&&o.jsx("span",{className:"text-xs text-muted-foreground",children:ge.name})]})]},ge.id))}),o.jsx(ap,{heading:"手动输入",children:o.jsxs(op,{value:"__manual_input__",onSelect:()=>{Oe(!1)},children:[o.jsx(Yu,{className:"mr-2 h-4 w-4"}),"手动输入模型标识符..."]})})]})})]})})]}):o.jsx(ze,{id:"model_identifier",value:L?.model_identifier||"",onChange:ge=>P(Le=>Le?{...Le,model_identifier:ge.target.value}:null),placeholder:"Qwen/Qwen3-30B-A3B-Instruct-2507"}),We&&Ve?.modelFetcher&&o.jsxs(ga,{variant:"destructive",className:"mt-2 py-2",children:[o.jsx(Oa,{className:"h-4 w-4"}),o.jsx(xa,{className:"text-xs",children:We})]}),Ve?.modelFetcher&&o.jsx(ze,{value:L?.model_identifier||"",onChange:ge=>P(Le=>Le?{...Le,model_identifier:ge.target.value}:null),placeholder:"或手动输入模型标识符",className:"mt-2"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:We?'请手动输入模型标识符,或前往"模型提供商配置"检查 API Key':Ve?.modelFetcher?`已识别为 ${Ve.display_name},支持自动获取模型列表`:"API 提供商提供的模型 ID"})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"price_in",children:"输入价格 (¥/M token)"}),o.jsx(ze,{id:"price_in",type:"number",step:"0.1",min:"0",value:L?.price_in??"",onChange:ge=>{const Le=ge.target.value===""?null:parseFloat(ge.target.value);P(Ct=>Ct?{...Ct,price_in:Le}:null)},placeholder:"默认: 0"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"price_out",children:"输出价格 (¥/M token)"}),o.jsx(ze,{id:"price_out",type:"number",step:"0.1",min:"0",value:L?.price_out??"",onChange:ge=>{const Le=ge.target.value===""?null:parseFloat(ge.target.value);P(Ct=>Ct?{...Ct,price_out:Le}:null)},placeholder:"默认: 0"})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"force_stream_mode",checked:L?.force_stream_mode||!1,onCheckedChange:ge=>P(Le=>Le?{...Le,force_stream_mode:ge}:null)}),o.jsx(he,{htmlFor:"force_stream_mode",className:"cursor-pointer",children:"强制流式输出模式"})]})]}),o.jsxs(ws,{children:[o.jsx(de,{variant:"outline",onClick:()=>A(!1),"data-tour":"model-cancel-button",children:"取消"}),o.jsx(de,{onClick:ot,"data-tour":"model-save-button",children:"保存"})]})]})}),o.jsx(Dn,{open:U,onOpenChange:te,children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:['确定要删除模型 "',z!==null?t[z]?.name:"",'" 吗? 此操作无法撤销。']})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:pt,children:"删除"})]})]})}),o.jsx(Dn,{open:R,onOpenChange:ie,children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认批量删除"}),o.jsxs(_n,{children:["确定要删除选中的 ",J.size," 个模型吗? 此操作无法撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:vr,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),T&&o.jsx(Kj,{onRestartComplete:rt,onRestartFailed:tn})]})})}function Fa({title:t,description:e,taskConfig:n,modelNames:r,onChange:s,hideTemperature:i=!1,hideMaxTokens:a=!1,dataTour:l}){const c=d=>{s("model_list",d)};return o.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"font-semibold text-base sm:text-lg",children:t}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:e})]}),o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"grid gap-2","data-tour":l,children:[o.jsx(he,{children:"模型列表"}),o.jsx(qve,{options:r.map(d=>({label:d,value:d})),selected:n.model_list||[],onChange:c,placeholder:"选择模型...",emptyText:"暂无可用模型"})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[!i&&o.jsxs("div",{className:"grid gap-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(he,{children:"温度"}),o.jsx(ze,{type:"number",step:"0.1",min:"0",max:"1",value:n.temperature??.3,onChange:d=>{const h=parseFloat(d.target.value);!isNaN(h)&&h>=0&&h<=1&&s("temperature",h)},className:"w-20 h-8 text-sm"})]}),o.jsx(Bp,{value:[n.temperature??.3],onValueChange:d=>s("temperature",d[0]),min:0,max:1,step:.1,className:"w-full"})]}),!a&&o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{children:"最大 Token"}),o.jsx(ze,{type:"number",step:"1",min:"1",value:n.max_tokens??1024,onChange:d=>s("max_tokens",parseInt(d.target.value))})]})]})]})]})}const Pb="/api/webui/config";async function Qve(){const e=await(await St(`${Pb}/adapter-config/path`)).json();return!e.success||!e.path?null:{path:e.path,lastModified:e.lastModified}}async function pM(t){const n=await(await St(`${Pb}/adapter-config/path`,{method:"POST",headers:Dt(),body:JSON.stringify({path:t})})).json();if(!n.success)throw new Error(n.message||"保存路径失败")}async function gM(t){const n=await(await St(`${Pb}/adapter-config?path=${encodeURIComponent(t)}`)).json();if(!n.success)throw new Error("读取配置文件失败");return n.content}async function xM(t,e){const r=await(await St(`${Pb}/adapter-config`,{method:"POST",headers:Dt(),body:JSON.stringify({path:t,content:e})})).json();if(!r.success)throw new Error(r.message||"保存配置失败")}const Fi={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"}},CS={oneclick:{name:"一键包",description:"使用一键包部署的适配器配置",path:"../MaiBot-Napcat-Adapter/config.toml",icon:Gh},docker:{name:"Docker",description:"Docker Compose 部署的适配器配置",path:"/MaiMBot/adapters-config/config.toml",icon:Kee}};function Vve(){const[t,e]=b.useState("upload"),[n,r]=b.useState(null),[s,i]=b.useState(""),[a,l]=b.useState(""),[c,d]=b.useState("oneclick"),[h,m]=b.useState(""),[g,x]=b.useState(!1),[y,w]=b.useState(!1),[S,k]=b.useState(!1),[j,N]=b.useState(!1),[T,E]=b.useState(null),_=b.useRef(null),{toast:A}=as(),L=b.useRef(null),P=W=>{if(!W.trim())return{valid:!1,error:"路径不能为空"};if(!W.toLowerCase().endsWith(".toml"))return{valid:!1,error:"文件必须是 .toml 格式"};const se=/^([a-zA-Z]:\\|\\\\[^\\]+\\[^\\]+\\).+\.toml$/i,re=/^(\/|~\/).+\.toml$/i,oe=/^(\.{1,2}[\\/]|[^:\\/]).+\.toml$/i,Te=se.test(W),We=re.test(W),Ye=oe.test(W);return!Te&&!We&&!Ye?{valid:!1,error:"路径格式错误"}:/[<>"|?*\x00-\x1F]/.test(W)?{valid:!1,error:"路径包含非法字符"}:{valid:!0,error:""}},B=W=>{if(l(W),W.trim()){const se=P(W);m(se.error)}else m("")},$=b.useCallback(async W=>{const se=CS[W];w(!0);try{const re=await gM(se.path),oe=G(re);r(oe),d(W),l(se.path),await pM(se.path),A({title:"加载成功",description:`已从${se.name}预设加载配置`})}catch(re){console.error("加载预设配置失败:",re),A({title:"加载失败",description:re instanceof Error?re.message:"无法读取预设配置文件",variant:"destructive"})}finally{w(!1)}},[A]),U=b.useCallback(async W=>{const se=P(W);if(!se.valid){m(se.error),A({title:"路径无效",description:se.error,variant:"destructive"});return}m(""),w(!0);try{const re=await gM(W),oe=G(re);r(oe),l(W),await pM(W),A({title:"加载成功",description:"已从配置文件加载"})}catch(re){console.error("加载配置失败:",re),A({title:"加载失败",description:re instanceof Error?re.message:"无法读取配置文件",variant:"destructive"})}finally{w(!1)}},[A]);b.useEffect(()=>{(async()=>{try{const se=await Qve();if(se&&se.path){l(se.path);const re=Object.entries(CS).find(([,oe])=>oe.path===se.path);re?(e("preset"),d(re[0]),await $(re[0])):(e("path"),await U(se.path))}}catch(se){console.error("加载保存的路径失败:",se)}})()},[U,$]);const te=b.useCallback(W=>{t!=="path"&&t!=="preset"||!a||(L.current&&clearTimeout(L.current),L.current=setTimeout(async()=>{x(!0);try{const se=I(W);await xM(a,se),A({title:"自动保存成功",description:"配置已保存到文件"})}catch(se){console.error("自动保存失败:",se),A({title:"自动保存失败",description:se instanceof Error?se.message:"保存配置失败",variant:"destructive"})}finally{x(!1)}},1e3))},[t,a,A]),z=async()=>{if(!n||!a)return;const W=P(a);if(!W.valid){A({title:"保存失败",description:W.error,variant:"destructive"});return}x(!0);try{const se=I(n);await xM(a,se),A({title:"保存成功",description:"配置已保存到文件"})}catch(se){console.error("保存失败:",se),A({title:"保存失败",description:se instanceof Error?se.message:"保存配置失败",variant:"destructive"})}finally{x(!1)}},Q=async()=>{a&&await U(a)},F=W=>{if(W!==t){if(n){E(W),k(!0);return}Y(W)}},Y=W=>{r(null),i(""),m(""),e(W),W==="preset"&&$("oneclick"),A({title:"已切换模式",description:{upload:"现在可以上传配置文件",path:"现在可以指定配置文件路径",preset:"现在可以使用预设配置"}[W]})},J=()=>{T&&(Y(T),E(null)),k(!1)},X=()=>{if(n){N(!0);return}R()},R=()=>{l(""),r(null),m(""),A({title:"已清空",description:"路径和配置已清空"})},ie=()=>{R(),N(!1)},G=W=>{const se=JSON.parse(JSON.stringify(Fi)),re=W.split(` +`);let oe="";for(const Te of re){const We=Te.trim();if(!We||We.startsWith("#"))continue;const Ye=We.match(/^\[(\w+)\]/);if(Ye){oe=Ye[1];continue}const Je=We.match(/^(\w+)\s*=\s*(.+)$/);if(Je&&oe){const[,Oe,Ve]=Je;let Ue=Ve.trim();const He=Ue.match(/^("[^"]*")/);if(He)Ue=He[1];else{const xt=Ue.indexOf("#");xt!==-1&&(Ue=Ue.substring(0,xt).trim())}let Ot;if(Ue==="true")Ot=!0;else if(Ue==="false")Ot=!1;else if(Ue.startsWith("[")&&Ue.endsWith("]")){const xt=Ue.slice(1,-1).trim();if(xt){const kn=xt.split(",").map(Yt=>{const _t=Yt.trim();return isNaN(Number(_t))?_t.replace(/"/g,""):Number(_t)}),It=typeof kn[0];Ot=kn.every(Yt=>typeof Yt===It)?kn:kn.filter(Yt=>typeof Yt=="number")}else Ot=[]}else Ue.startsWith('"')&&Ue.endsWith('"')?Ot=Ue.slice(1,-1):isNaN(Number(Ue))?Ot=Ue.replace(/"/g,""):Ot=Number(Ue);if(oe in se){const xt=se[oe];xt[Oe]=Ot}}}return se},I=W=>{const se=[],re=(oe,Te)=>oe===""||oe===null||oe===void 0?Te:oe;return se.push("[inner]"),se.push(`version = "${re(W.inner.version,Fi.inner.version)}" # 版本号`),se.push("# 请勿修改版本号,除非你知道自己在做什么"),se.push(""),se.push("[nickname] # 现在没用"),se.push(`nickname = "${re(W.nickname.nickname,Fi.nickname.nickname)}"`),se.push(""),se.push("[napcat_server] # Napcat连接的ws服务设置"),se.push(`host = "${re(W.napcat_server.host,Fi.napcat_server.host)}" # Napcat设定的主机地址`),se.push(`port = ${re(W.napcat_server.port||0,Fi.napcat_server.port)} # Napcat设定的端口`),se.push(`token = "${re(W.napcat_server.token,Fi.napcat_server.token)}" # Napcat设定的访问令牌,若无则留空`),se.push(`heartbeat_interval = ${re(W.napcat_server.heartbeat_interval||0,Fi.napcat_server.heartbeat_interval)} # 与Napcat设置的心跳相同(按秒计)`),se.push(""),se.push("[maibot_server] # 连接麦麦的ws服务设置"),se.push(`host = "${re(W.maibot_server.host,Fi.maibot_server.host)}" # 麦麦在.env文件中设置的主机地址,即HOST字段`),se.push(`port = ${re(W.maibot_server.port||0,Fi.maibot_server.port)} # 麦麦在.env文件中设置的端口,即PORT字段`),se.push(""),se.push("[chat] # 黑白名单功能"),se.push(`group_list_type = "${re(W.chat.group_list_type,Fi.chat.group_list_type)}" # 群组名单类型,可选为:whitelist, blacklist`),se.push(`group_list = [${W.chat.group_list.join(", ")}] # 群组名单`),se.push("# 当group_list_type为whitelist时,只有群组名单中的群组可以聊天"),se.push("# 当group_list_type为blacklist时,群组名单中的任何群组无法聊天"),se.push(`private_list_type = "${re(W.chat.private_list_type,Fi.chat.private_list_type)}" # 私聊名单类型,可选为:whitelist, blacklist`),se.push(`private_list = [${W.chat.private_list.join(", ")}] # 私聊名单`),se.push("# 当private_list_type为whitelist时,只有私聊名单中的用户可以聊天"),se.push("# 当private_list_type为blacklist时,私聊名单中的任何用户无法聊天"),se.push(`ban_user_id = [${W.chat.ban_user_id.join(", ")}] # 全局禁止名单(全局禁止名单中的用户无法进行任何聊天)`),se.push(`ban_qq_bot = ${W.chat.ban_qq_bot} # 是否屏蔽QQ官方机器人`),se.push(`enable_poke = ${W.chat.enable_poke} # 是否启用戳一戳功能`),se.push(""),se.push("[voice] # 发送语音设置"),se.push(`use_tts = ${W.voice.use_tts} # 是否使用tts语音(请确保你配置了tts并有对应的adapter)`),se.push(""),se.push("[debug]"),se.push(`level = "${re(W.debug.level,Fi.debug.level)}" # 日志等级(DEBUG, INFO, WARNING, ERROR, CRITICAL)`),se.join(` +`)},V=W=>{const se=W.target.files?.[0];if(!se)return;const re=new FileReader;re.onload=oe=>{try{const Te=oe.target?.result,We=G(Te);r(We),i(se.name),A({title:"上传成功",description:`已加载配置文件:${se.name}`})}catch(Te){console.error("解析配置文件失败:",Te),A({title:"解析失败",description:"配置文件格式错误,请检查文件内容",variant:"destructive"})}},re.readAsText(se)},ee=()=>{if(!n)return;const W=I(n),se=new Blob([W],{type:"text/plain;charset=utf-8"}),re=URL.createObjectURL(se),oe=document.createElement("a");oe.href=re,oe.download=s||"config.toml",document.body.appendChild(oe),oe.click(),document.body.removeChild(oe),URL.revokeObjectURL(re),A({title:"下载成功",description:"配置文件已下载,请手动覆盖并重启适配器"})},ne=()=>{r(JSON.parse(JSON.stringify(Fi))),i("config.toml"),A({title:"已加载默认配置",description:"可以开始编辑配置"})};return o.jsx(gn,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦适配器配置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的 QQ 适配器的配置文件"})]})}),o.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg border border-amber-500/50 bg-amber-500/10 text-amber-700 dark:text-amber-400",children:[o.jsx(Uc,{className:"h-4 w-4 mt-0.5 flex-shrink-0"}),o.jsx("p",{className:"text-sm",children:"适配器配置保存之后使用 WebUI 的重启功能适配器并不会重启,需要手动重启适配器。"})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{children:[o.jsx(qn,{children:"工作模式"}),o.jsx(ts,{children:"选择配置文件的管理方式"})]}),o.jsxs(Gn,{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 md:gap-4",children:[o.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${t==="preset"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>F("preset"),children:o.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[o.jsx(Gh,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"预设模式"}),o.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"使用预设的部署配置"})]})]})}),o.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${t==="upload"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>F("upload"),children:o.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[o.jsx(b9,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"上传文件模式"}),o.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"上传配置文件,编辑后下载并手动覆盖"})]})]})}),o.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${t==="path"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>F("path"),children:o.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[o.jsx(Zee,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"指定路径模式"}),o.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"指定配置文件路径,自动加载和保存"})]})]})})]}),t==="preset"&&o.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[o.jsx(he,{className:"text-sm md:text-base",children:"选择部署方式"}),o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:Object.entries(CS).map(([W,se])=>{const re=se.icon,oe=c===W;return o.jsx("div",{className:`border-2 rounded-lg p-3 cursor-pointer transition-all ${oe?"border-primary bg-primary/5":"border-muted hover:border-primary/50"}`,onClick:()=>{d(W),$(W)},children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(re,{className:"h-5 w-5 mt-0.5 flex-shrink-0"}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("h4",{className:"font-semibold text-sm",children:se.name}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:se.description}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1 font-mono break-all",children:se.path})]})]})},W)})})]}),t==="path"&&o.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"config-path",className:"text-sm md:text-base",children:"配置文件路径"}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[o.jsxs("div",{className:"flex-1 space-y-1",children:[o.jsx(ze,{id:"config-path",value:a,onChange:W=>B(W.target.value),placeholder:"例: C:\\Adapter\\config.toml",className:`text-sm ${h?"border-destructive":""}`}),h&&o.jsx("p",{className:"text-xs text-destructive",children:h})]}),o.jsx(de,{onClick:()=>U(a),disabled:y||!a||!!h,className:"w-full sm:w-auto",children:y?o.jsxs(o.Fragment,{children:[o.jsx(Ps,{className:"h-4 w-4 animate-spin mr-2"}),o.jsx("span",{className:"sm:hidden",children:"加载中..."})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"sm:hidden",children:"加载配置"}),o.jsx("span",{className:"hidden sm:inline",children:"加载"})]})})]})]}),o.jsxs("details",{className:"rounded-lg bg-muted/50 p-3 group",children:[o.jsxs("summary",{className:"text-xs font-medium cursor-pointer select-none list-none flex items-center justify-between",children:[o.jsx("span",{children:"路径格式说明"}),o.jsx("svg",{className:"h-4 w-4 transition-transform group-open:rotate-180",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),o.jsxs("div",{className:"mt-2 space-y-2 text-xs text-muted-foreground",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("div",{className:"flex items-center gap-2",children:o.jsx("span",{className:"font-mono bg-background px-1.5 py-0.5 rounded text-[10px] md:text-xs whitespace-nowrap",children:"Windows"})}),o.jsxs("div",{className:"pl-2 space-y-0.5 text-[10px] md:text-xs break-all",children:[o.jsx("div",{children:"C:\\Adapter\\config.toml"}),o.jsx("div",{className:"hidden sm:block",children:"D:\\MaiBot\\adapter\\config.toml"}),o.jsx("div",{className:"hidden sm:block",children:"\\\\server\\share\\config.toml"})]})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("div",{className:"flex items-center gap-2",children:o.jsx("span",{className:"font-mono bg-background px-1.5 py-0.5 rounded text-[10px] md:text-xs whitespace-nowrap",children:"Linux"})}),o.jsxs("div",{className:"pl-2 space-y-0.5 text-[10px] md:text-xs break-all",children:[o.jsx("div",{children:"/opt/adapter/config.toml"}),o.jsx("div",{className:"hidden sm:block",children:"/home/user/adapter/config.toml"}),o.jsx("div",{className:"hidden sm:block",children:"~/adapter/config.toml"})]})]}),o.jsx("p",{className:"pt-1 border-t text-[10px] md:text-xs",children:"💡 配置会自动保存到指定文件,修改后 1 秒自动保存"})]})]})]})]})]}),o.jsxs(ga,{children:[o.jsx(Oa,{className:"h-4 w-4"}),o.jsx(xa,{children:t==="preset"?o.jsxs(o.Fragment,{children:[o.jsx("strong",{children:"预设模式:"}),"选择预设的部署方式,配置会自动加载,修改后 1 秒自动保存",g&&" (正在保存...)"]}):t==="upload"?o.jsxs(o.Fragment,{children:[o.jsx("strong",{children:"上传文件模式:"}),"上传配置文件 → 在线编辑 → 下载文件 → 手动覆盖并重启适配器"]}):o.jsxs(o.Fragment,{children:[o.jsx("strong",{children:"指定路径模式:"}),"指定配置文件路径后,配置会自动加载,修改后 1 秒自动保存",g&&" (正在保存...)"]})})]}),t==="upload"&&!n&&o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[o.jsx("input",{ref:_,type:"file",accept:".toml",className:"hidden",onChange:V}),o.jsxs(de,{onClick:()=>_.current?.click(),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[o.jsx(b9,{className:"mr-2 h-4 w-4"}),"上传配置"]}),o.jsxs(de,{onClick:ne,size:"sm",className:"w-full sm:w-auto",children:[o.jsx(zl,{className:"mr-2 h-4 w-4"}),"使用默认配置"]})]}),t==="upload"&&n&&o.jsx("div",{className:"flex gap-2",children:o.jsxs(de,{onClick:ee,size:"sm",className:"w-full sm:w-auto",children:[o.jsx(Ku,{className:"mr-2 h-4 w-4"}),"下载配置"]})}),(t==="preset"||t==="path")&&n&&o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[o.jsxs(de,{onClick:z,size:"sm",disabled:g||!!h,className:"w-full sm:w-auto",children:[o.jsx(Gy,{className:"mr-2 h-4 w-4"}),g?"保存中...":"立即保存"]}),o.jsxs(de,{onClick:Q,size:"sm",variant:"outline",disabled:y,className:"w-full sm:w-auto",children:[o.jsx(Ps,{className:`mr-2 h-4 w-4 ${y?"animate-spin":""}`}),"刷新"]}),t==="path"&&o.jsxs(de,{onClick:X,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[o.jsx(Sn,{className:"mr-2 h-4 w-4"}),"清空路径"]})]}),n?o.jsxs(ja,{defaultValue:"napcat",className:"w-full",children:[o.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:o.jsxs(Wi,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5",children:[o.jsxs(Lt,{value:"napcat",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[o.jsx("span",{className:"hidden sm:inline",children:"Napcat 连接"}),o.jsx("span",{className:"sm:hidden",children:"Napcat"})]}),o.jsxs(Lt,{value:"maibot",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[o.jsx("span",{className:"hidden sm:inline",children:"麦麦连接"}),o.jsx("span",{className:"sm:hidden",children:"麦麦"})]}),o.jsxs(Lt,{value:"chat",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[o.jsx("span",{className:"hidden sm:inline",children:"聊天控制"}),o.jsx("span",{className:"sm:hidden",children:"聊天"})]}),o.jsxs(Lt,{value:"voice",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[o.jsx("span",{className:"hidden sm:inline",children:"语音设置"}),o.jsx("span",{className:"sm:hidden",children:"语音"})]}),o.jsx(Lt,{value:"debug",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:"调试"})]})}),o.jsx(un,{value:"napcat",className:"space-y-4",children:o.jsx(Uve,{config:n,onChange:W=>{r(W),te(W)}})}),o.jsx(un,{value:"maibot",className:"space-y-4",children:o.jsx(Wve,{config:n,onChange:W=>{r(W),te(W)}})}),o.jsx(un,{value:"chat",className:"space-y-4",children:o.jsx(Gve,{config:n,onChange:W=>{r(W),te(W)}})}),o.jsx(un,{value:"voice",className:"space-y-4",children:o.jsx(Xve,{config:n,onChange:W=>{r(W),te(W)}})}),o.jsx(un,{value:"debug",className:"space-y-4",children:o.jsx(Yve,{config:n,onChange:W=>{r(W),te(W)}})})]}):o.jsx("div",{className:"rounded-lg border bg-card p-6 md:p-12",children:o.jsxs("div",{className:"text-center space-y-3 md:space-y-4",children:[o.jsx(zl,{className:"h-12 w-12 md:h-16 md:w-16 mx-auto text-muted-foreground"}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold",children:"尚未加载配置"}),o.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-2 px-4",children:t==="preset"?"请选择预设的部署方式":t==="upload"?"请上传现有配置文件,或使用默认配置开始编辑":"请指定配置文件路径并点击加载按钮"})]})]})}),o.jsx(Dn,{open:S,onOpenChange:k,children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认切换模式"}),o.jsxs(_n,{children:["切换模式将清空当前配置,确定要继续吗?",o.jsx("br",{}),o.jsx("span",{className:"text-destructive font-medium",children:"请确保已保存重要配置"})]})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{onClick:()=>{k(!1),E(null)},children:"取消"}),o.jsx(An,{onClick:J,children:"确认切换"})]})]})}),o.jsx(Dn,{open:j,onOpenChange:N,children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认清空路径"}),o.jsxs(_n,{children:["清空路径将清除当前配置,确定要继续吗?",o.jsx("br",{}),o.jsx("span",{className:"text-muted-foreground text-sm",children:"此操作不会删除配置文件,只是清除界面中的配置"})]})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{onClick:()=>N(!1),children:"取消"}),o.jsx(An,{onClick:ie,className:"bg-destructive hover:bg-destructive/90",children:"确认清空"})]})]})})]})})}function Uve({config:t,onChange:e}){return o.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"Napcat WebSocket 服务设置"}),o.jsxs("div",{className:"grid gap-3 md:gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"napcat-host",className:"text-sm md:text-base",children:"主机地址"}),o.jsx(ze,{id:"napcat-host",value:t.napcat_server.host,onChange:n=>e({...t,napcat_server:{...t.napcat_server,host:n.target.value}}),placeholder:"localhost",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的主机地址"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"napcat-port",className:"text-sm md:text-base",children:"端口"}),o.jsx(ze,{id:"napcat-port",type:"number",value:t.napcat_server.port||"",onChange:n=>e({...t,napcat_server:{...t.napcat_server,port:n.target.value?parseInt(n.target.value):0}}),placeholder:"8095",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的端口(留空使用默认值 8095)"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"napcat-token",className:"text-sm md:text-base",children:"访问令牌(Token)"}),o.jsx(ze,{id:"napcat-token",type:"password",value:t.napcat_server.token,onChange:n=>e({...t,napcat_server:{...t.napcat_server,token:n.target.value}}),placeholder:"留空表示无需令牌",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的访问令牌,若无则留空"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"napcat-heartbeat",className:"text-sm md:text-base",children:"心跳间隔(秒)"}),o.jsx(ze,{id:"napcat-heartbeat",type:"number",value:t.napcat_server.heartbeat_interval||"",onChange:n=>e({...t,napcat_server:{...t.napcat_server,heartbeat_interval:n.target.value?parseInt(n.target.value):0}}),placeholder:"30",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"与 Napcat 设置的心跳间隔保持一致(留空使用默认值 30)"})]})]})]})})}function Wve({config:t,onChange:e}){return o.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"麦麦 WebSocket 服务设置"}),o.jsxs("div",{className:"grid gap-3 md:gap-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"maibot-host",className:"text-sm md:text-base",children:"主机地址"}),o.jsx(ze,{id:"maibot-host",value:t.maibot_server.host,onChange:n=>e({...t,maibot_server:{...t.maibot_server,host:n.target.value}}),placeholder:"localhost",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 HOST 字段"})]}),o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{htmlFor:"maibot-port",className:"text-sm md:text-base",children:"端口"}),o.jsx(ze,{id:"maibot-port",type:"number",value:t.maibot_server.port||"",onChange:n=>e({...t,maibot_server:{...t.maibot_server,port:n.target.value?parseInt(n.target.value):0}}),placeholder:"8000",className:"text-sm md:text-base"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 PORT 字段(留空使用默认值 8000)"})]})]})]})})}function Gve({config:t,onChange:e}){const n=i=>{const a={...t};i==="group"?a.chat.group_list=[...a.chat.group_list,0]:i==="private"?a.chat.private_list=[...a.chat.private_list,0]:a.chat.ban_user_id=[...a.chat.ban_user_id,0],e(a)},r=(i,a)=>{const l={...t};i==="group"?l.chat.group_list=l.chat.group_list.filter((c,d)=>d!==a):i==="private"?l.chat.private_list=l.chat.private_list.filter((c,d)=>d!==a):l.chat.ban_user_id=l.chat.ban_user_id.filter((c,d)=>d!==a),e(l)},s=(i,a,l)=>{const c={...t};i==="group"?c.chat.group_list[a]=l:i==="private"?c.chat.private_list[a]=l:c.chat.ban_user_id[a]=l,e(c)};return o.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"聊天黑白名单功能"}),o.jsxs("div",{className:"grid gap-4 md:gap-6",children:[o.jsxs("div",{className:"space-y-3 md:space-y-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-sm md:text-base",children:"群组名单类型"}),o.jsxs(Vt,{value:t.chat.group_list_type,onValueChange:i=>e({...t,chat:{...t.chat,group_list_type:i}}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),o.jsx(De,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[o.jsx(he,{className:"text-sm md:text-base",children:"群组列表"}),o.jsxs(de,{onClick:()=>n("group"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[o.jsx(zl,{className:"mr-1 h-4 w-4"}),"添加群号"]})]}),t.chat.group_list.map((i,a)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ze,{type:"number",value:i,onChange:l=>s("group",a,parseInt(l.target.value)||0),placeholder:"输入群号",className:"text-sm md:text-base"}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(de,{size:"icon",variant:"outline",children:o.jsx(Sn,{className:"h-4 w-4"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:["确定要删除群号 ",i," 吗?此操作无法撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:()=>r("group",a),children:"删除"})]})]})]})]},a)),t.chat.group_list.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无群组"})]})]}),o.jsxs("div",{className:"space-y-3 md:space-y-4",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-sm md:text-base",children:"私聊名单类型"}),o.jsxs(Vt,{value:t.chat.private_list_type,onValueChange:i=>e({...t,chat:{...t.chat,private_list_type:i}}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),o.jsx(De,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[o.jsx(he,{className:"text-sm md:text-base",children:"私聊列表"}),o.jsxs(de,{onClick:()=>n("private"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[o.jsx(zl,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),t.chat.private_list.map((i,a)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ze,{type:"number",value:i,onChange:l=>s("private",a,parseInt(l.target.value)||0),placeholder:"输入QQ号",className:"text-sm md:text-base"}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(de,{size:"icon",variant:"outline",children:o.jsx(Sn,{className:"h-4 w-4"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:["确定要删除用户 ",i," 吗?此操作无法撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:()=>r("private",a),children:"删除"})]})]})]})]},a)),t.chat.private_list.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无用户"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-sm md:text-base",children:"全局禁止名单"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"名单中的用户无法进行任何聊天"})]}),o.jsxs(de,{onClick:()=>n("ban"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[o.jsx(zl,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),t.chat.ban_user_id.map((i,a)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ze,{type:"number",value:i,onChange:l=>s("ban",a,parseInt(l.target.value)||0),placeholder:"输入QQ号",className:"text-sm md:text-base"}),o.jsxs(Dn,{children:[o.jsx(rs,{asChild:!0,children:o.jsx(de,{size:"icon",variant:"outline",children:o.jsx(Sn,{className:"h-4 w-4"})})}),o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:["确定要从全局禁止名单中删除用户 ",i," 吗?此操作无法撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:()=>r("ban",a),children:"删除"})]})]})]})]},a)),t.chat.ban_user_id.length===0&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无禁止用户"})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-sm md:text-base",children:"屏蔽QQ官方机器人"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否屏蔽来自QQ官方机器人的消息"})]}),o.jsx(Bt,{checked:t.chat.ban_qq_bot,onCheckedChange:i=>e({...t,chat:{...t.chat,ban_qq_bot:i}})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-sm md:text-base",children:"启用戳一戳功能"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否响应戳一戳消息"})]}),o.jsx(Bt,{checked:t.chat.enable_poke,onCheckedChange:i=>e({...t,chat:{...t.chat,enable_poke:i}})})]})]})]})})}function Xve({config:t,onChange:e}){return o.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"发送语音设置"}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-sm md:text-base",children:"使用 TTS 语音"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"请确保已配置 TTS 并有对应的适配器"})]}),o.jsx(Bt,{checked:t.voice.use_tts,onCheckedChange:n=>e({...t,voice:{use_tts:n}})})]})]})})}function Yve({config:t,onChange:e}){return o.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:o.jsxs("div",{children:[o.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"调试设置"}),o.jsx("div",{className:"grid gap-3 md:gap-4",children:o.jsxs("div",{className:"grid gap-2",children:[o.jsx(he,{className:"text-sm md:text-base",children:"日志等级"}),o.jsxs(Vt,{value:t.debug.level,onValueChange:n=>e({...t,debug:{level:n}}),children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"DEBUG",children:"DEBUG(调试)"}),o.jsx(De,{value:"INFO",children:"INFO(信息)"}),o.jsx(De,{value:"WARNING",children:"WARNING(警告)"}),o.jsx(De,{value:"ERROR",children:"ERROR(错误)"}),o.jsx(De,{value:"CRITICAL",children:"CRITICAL(严重)"})]})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"设置适配器的日志输出等级"})]})})]})})}function vM(t){const e=[],n=String(t||"");let r=n.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const a=n.slice(s,r).trim();(a||!i)&&e.push(a),s=r+1,r=n.indexOf(",",s)}return e}function Kve(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Zve=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Jve=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,eye={};function yM(t,e){return(eye.jsx?Jve:Zve).test(t)}const tye=/[ \t\n\f\r]/g;function nye(t){return typeof t=="object"?t.type==="text"?bM(t.value):!1:bM(t)}function bM(t){return t.replace(tye,"")===""}class ug{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}ug.prototype.normal={};ug.prototype.property={};ug.prototype.space=void 0;function qQ(t,e){const n={},r={};for(const s of t)Object.assign(n,s.property),Object.assign(r,s.normal);return new ug(n,r,e)}function mp(t){return t.toLowerCase()}class Ei{constructor(e,n){this.attribute=n,this.property=e}}Ei.prototype.attribute="";Ei.prototype.booleanish=!1;Ei.prototype.boolean=!1;Ei.prototype.commaOrSpaceSeparated=!1;Ei.prototype.commaSeparated=!1;Ei.prototype.defined=!1;Ei.prototype.mustUseProperty=!1;Ei.prototype.number=!1;Ei.prototype.overloadedBoolean=!1;Ei.prototype.property="";Ei.prototype.spaceSeparated=!1;Ei.prototype.space=void 0;let rye=0;const Jt=wd(),Jr=wd(),TO=wd(),Qe=wd(),ur=wd(),qh=wd(),qi=wd();function wd(){return 2**++rye}const EO=Object.freeze(Object.defineProperty({__proto__:null,boolean:Jt,booleanish:Jr,commaOrSpaceSeparated:qi,commaSeparated:qh,number:Qe,overloadedBoolean:TO,spaceSeparated:ur},Symbol.toStringTag,{value:"Module"})),TS=Object.keys(EO);class aN extends Ei{constructor(e,n,r,s){let i=-1;if(super(e,n),wM(this,"space",s),typeof r=="number")for(;++i4&&n.slice(0,4)==="data"&&lye.test(e)){if(e.charAt(4)==="-"){const i=e.slice(5).replace(SM,uye);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=e.slice(4);if(!SM.test(i)){let a=i.replace(oye,cye);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}s=aN}return new s(r,e)}function cye(t){return"-"+t.toLowerCase()}function uye(t){return t.charAt(1).toUpperCase()}const XQ=qQ([$Q,sye,VQ,UQ,WQ],"html"),zb=qQ([$Q,iye,VQ,UQ,WQ],"svg");function kM(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function dye(t){return t.join(" ").trim()}var oh={},ES,OM;function hye(){if(OM)return ES;OM=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,l=/^\s+|\s+$/g,c=` +`,d="/",h="*",m="",g="comment",x="declaration";function y(S,k){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];k=k||{};var j=1,N=1;function T(z){var Q=z.match(e);Q&&(j+=Q.length);var F=z.lastIndexOf(c);N=~F?z.length-F:N+z.length}function E(){var z={line:j,column:N};return function(Q){return Q.position=new _(z),P(),Q}}function _(z){this.start=z,this.end={line:j,column:N},this.source=k.source}_.prototype.content=S;function A(z){var Q=new Error(k.source+":"+j+":"+N+": "+z);if(Q.reason=z,Q.filename=k.source,Q.line=j,Q.column=N,Q.source=S,!k.silent)throw Q}function L(z){var Q=z.exec(S);if(Q){var F=Q[0];return T(F),S=S.slice(F.length),Q}}function P(){L(n)}function B(z){var Q;for(z=z||[];Q=$();)Q!==!1&&z.push(Q);return z}function $(){var z=E();if(!(d!=S.charAt(0)||h!=S.charAt(1))){for(var Q=2;m!=S.charAt(Q)&&(h!=S.charAt(Q)||d!=S.charAt(Q+1));)++Q;if(Q+=2,m===S.charAt(Q-1))return A("End of comment missing");var F=S.slice(2,Q-2);return N+=2,T(F),S=S.slice(Q),N+=2,z({type:g,comment:F})}}function U(){var z=E(),Q=L(r);if(Q){if($(),!L(s))return A("property missing ':'");var F=L(i),Y=z({type:x,property:w(Q[0].replace(t,m)),value:F?w(F[0].replace(t,m)):m});return L(a),Y}}function te(){var z=[];B(z);for(var Q;Q=U();)Q!==!1&&(z.push(Q),B(z));return z}return P(),te()}function w(S){return S?S.replace(l,m):m}return ES=y,ES}var jM;function fye(){if(jM)return oh;jM=1;var t=oh&&oh.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(oh,"__esModule",{value:!0}),oh.default=n;const e=t(hye());function n(r,s){let i=null;if(!r||typeof r!="string")return i;const a=(0,e.default)(r),l=typeof s=="function";return a.forEach(c=>{if(c.type!=="declaration")return;const{property:d,value:h}=c;l?s(d,h,c):h&&(i=i||{},i[d]=h)}),i}return oh}var Ym={},NM;function mye(){if(NM)return Ym;NM=1,Object.defineProperty(Ym,"__esModule",{value:!0}),Ym.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(d){return!d||n.test(d)||t.test(d)},a=function(d,h){return h.toUpperCase()},l=function(d,h){return"".concat(h,"-")},c=function(d,h){return h===void 0&&(h={}),i(d)?d:(d=d.toLowerCase(),h.reactCompat?d=d.replace(s,l):d=d.replace(r,l),d.replace(e,a))};return Ym.camelCase=c,Ym}var Km,CM;function pye(){if(CM)return Km;CM=1;var t=Km&&Km.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},e=t(fye()),n=mye();function r(s,i){var a={};return!s||typeof s!="string"||(0,e.default)(s,function(l,c){l&&c&&(a[(0,n.camelCase)(l,i)]=c)}),a}return r.default=r,Km=r,Km}var gye=pye();const xye=gd(gye),YQ=KQ("end"),oN=KQ("start");function KQ(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};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 vye(t){const e=oN(t),n=YQ(t);if(e&&n)return{start:e,end:n}}function _0(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?TM(t.position):"start"in t||"end"in t?TM(t):"line"in t||"column"in t?_O(t):""}function _O(t){return EM(t&&t.line)+":"+EM(t&&t.column)}function TM(t){return _O(t&&t.start)+"-"+_O(t&&t.end)}function EM(t){return t&&typeof t=="number"?t:1}class Ws extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},a=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof e=="string"?s=e:!i.cause&&e&&(a=!0,s=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?i.ruleId=r:(i.source=r.slice(0,c),i.ruleId=r.slice(c+1))}if(!i.place&&i.ancestors&&i.ancestors){const c=i.ancestors[i.ancestors.length-1];c&&(i.place=c.position)}const l=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=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=_0(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=a&&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}}Ws.prototype.file="";Ws.prototype.name="";Ws.prototype.reason="";Ws.prototype.message="";Ws.prototype.stack="";Ws.prototype.column=void 0;Ws.prototype.line=void 0;Ws.prototype.ancestors=void 0;Ws.prototype.cause=void 0;Ws.prototype.fatal=void 0;Ws.prototype.place=void 0;Ws.prototype.ruleId=void 0;Ws.prototype.source=void 0;const lN={}.hasOwnProperty,yye=new Map,bye=/[A-Z]/g,wye=new Set(["table","tbody","thead","tfoot","tr"]),Sye=new Set(["td","th"]),ZQ="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function kye(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=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=Aye(n,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=_ye(n,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:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?zb:XQ,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},i=JQ(s,t,void 0);return i&&typeof i!="string"?i:s.create(t,s.Fragment,{children:i||void 0},void 0)}function JQ(t,e,n){if(e.type==="element")return Oye(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return jye(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Cye(t,e,n);if(e.type==="mdxjsEsm")return Nye(t,e);if(e.type==="root")return Tye(t,e,n);if(e.type==="text")return Eye(t,e)}function Oye(t,e,n){const r=t.schema;let s=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=zb,t.schema=s),t.ancestors.push(e);const i=tV(t,e.tagName,!1),a=Mye(t,e);let l=uN(t,e);return wye.has(e.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!nye(c):!0})),eV(t,a,i,e),cN(a,l),t.ancestors.pop(),t.schema=r,t.create(e,i,a,n)}function jye(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}pp(t,e.position)}function Nye(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);pp(t,e.position)}function Cye(t,e,n){const r=t.schema;let s=r;e.name==="svg"&&r.space==="html"&&(s=zb,t.schema=s),t.ancestors.push(e);const i=e.name===null?t.Fragment:tV(t,e.name,!0),a=Rye(t,e),l=uN(t,e);return eV(t,a,i,e),cN(a,l),t.ancestors.pop(),t.schema=r,t.create(e,i,a,n)}function Tye(t,e,n){const r={};return cN(r,uN(t,e)),t.create(e,t.Fragment,r,n)}function Eye(t,e){return e.value}function eV(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function cN(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function _ye(t,e,n){return r;function r(s,i,a,l){const d=Array.isArray(a.children)?n:e;return l?d(i,a,l):d(i,a)}}function Aye(t,e){return n;function n(r,s,i,a){const l=Array.isArray(i.children),c=oN(r);return e(s,i,a,l,{columnNumber:c?c.column-1:void 0,fileName:t,lineNumber:c?c.line:void 0},void 0)}}function Mye(t,e){const n={};let r,s;for(s in e.properties)if(s!=="children"&&lN.call(e.properties,s)){const i=Dye(t,s,e.properties[s]);if(i){const[a,l]=i;t.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&Sye.has(e.tagName)?r=l:n[a]=l}}if(r){const i=n.style||(n.style={});i[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Rye(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const l=a.properties[0];l.type,Object.assign(n,t.evaluater.evaluateExpression(l.argument))}else pp(t,e.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const l=r.value.data.estree.body[0];l.type,i=t.evaluater.evaluateExpression(l.expression)}else pp(t,e.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function uN(t,e){const n=[];let r=-1;const s=t.passKeys?new Map:yye;for(;++rs?0:s+e:e=e>s?s:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);i0?(Gi(t,t.length,0,e),t):e}const MM={}.hasOwnProperty;function rV(t){const e={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Ga(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Js=uu(/[A-Za-z]/),Vs=uu(/[\dA-Za-z]/),Hye=uu(/[#-'*+\--9=?A-Z^-~]/);function vy(t){return t!==null&&(t<32||t===127)}const AO=uu(/\d/),Qye=uu(/[\dA-Fa-f]/),Vye=uu(/[!-/:-@[-`{-~]/);function bt(t){return t!==null&&t<-2}function or(t){return t!==null&&(t<0||t===32)}function dn(t){return t===-2||t===-1||t===32}const Ib=uu(new RegExp("\\p{P}|\\p{S}","u")),fd=uu(/\s/);function uu(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Ff(t){const e=[];let n=-1,r=0,s=0;for(;++n55295&&i<57344){const l=t.charCodeAt(n+1);i<56320&&l>56319&&l<57344?(a=String.fromCharCode(i,l),s=1):a="�"}else a=String.fromCharCode(i);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return e.join("")+t.slice(r)}function on(t,e,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(c){return dn(c)?(t.enter(n),l(c)):e(c)}function l(c){return dn(c)&&i++a))return;const A=e.events.length;let L=A,P,B;for(;L--;)if(e.events[L][0]==="exit"&&e.events[L][1].type==="chunkFlow"){if(P){B=e.events[L][1].end;break}P=!0}for(k(r),_=A;_N;){const E=n[T];e.containerState=E[1],E[0].exit.call(e,t)}n.length=N}function j(){s.write([null]),i=void 0,s=void 0,e.containerState._closeFlow=void 0}}function Yye(t,e,n){return on(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function hf(t){if(t===null||or(t)||fd(t))return 1;if(Ib(t))return 2}function Lb(t,e,n){const r=[];let s=-1;for(;++s1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const m={...t[r][1].end},g={...t[n][1].start};DM(m,-c),DM(g,c),a={type:c>1?"strongSequence":"emphasisSequence",start:m,end:{...t[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:g},i={type:c>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},s={type:c>1?"strong":"emphasis",start:{...a.start},end:{...l.end}},t[r][1].end={...a.start},t[n][1].start={...l.end},d=[],t[r][1].end.offset-t[r][1].start.offset&&(d=fa(d,[["enter",t[r][1],e],["exit",t[r][1],e]])),d=fa(d,[["enter",s,e],["enter",a,e],["exit",a,e],["enter",i,e]]),d=fa(d,Lb(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),d=fa(d,[["exit",i,e],["enter",l,e],["exit",l,e],["exit",s,e]]),t[n][1].end.offset-t[n][1].start.offset?(h=2,d=fa(d,[["enter",t[n][1],e],["exit",t[n][1],e]])):h=0,Gi(t,r-1,n-r+3,d),n=r+d.length-h-2;break}}for(n=-1;++n0&&dn(_)?on(t,j,"linePrefix",i+1)(_):j(_)}function j(_){return _===null||bt(_)?t.check(PM,w,T)(_):(t.enter("codeFlowValue"),N(_))}function N(_){return _===null||bt(_)?(t.exit("codeFlowValue"),j(_)):(t.consume(_),N)}function T(_){return t.exit("codeFenced"),e(_)}function E(_,A,L){let P=0;return B;function B(Q){return _.enter("lineEnding"),_.consume(Q),_.exit("lineEnding"),$}function $(Q){return _.enter("codeFencedFence"),dn(Q)?on(_,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q):U(Q)}function U(Q){return Q===l?(_.enter("codeFencedFenceSequence"),te(Q)):L(Q)}function te(Q){return Q===l?(P++,_.consume(Q),te):P>=a?(_.exit("codeFencedFenceSequence"),dn(Q)?on(_,z,"whitespace")(Q):z(Q)):L(Q)}function z(Q){return Q===null||bt(Q)?(_.exit("codeFencedFence"),A(Q)):L(Q)}}}function lbe(t,e,n){const r=this;return s;function s(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const AS={name:"codeIndented",tokenize:ube},cbe={partial:!0,tokenize:dbe};function ube(t,e,n){const r=this;return s;function s(d){return t.enter("codeIndented"),on(t,i,"linePrefix",5)(d)}function i(d){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?a(d):n(d)}function a(d){return d===null?c(d):bt(d)?t.attempt(cbe,a,c)(d):(t.enter("codeFlowValue"),l(d))}function l(d){return d===null||bt(d)?(t.exit("codeFlowValue"),a(d)):(t.consume(d),l)}function c(d){return t.exit("codeIndented"),e(d)}}function dbe(t,e,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):bt(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s):on(t,i,"linePrefix",5)(a)}function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(a):bt(a)?s(a):n(a)}}const hbe={name:"codeText",previous:mbe,resolve:fbe,tokenize:pbe};function fbe(t){let e=t.length-4,n=3,r,s;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r=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 ethis.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,n,r){const s=n||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Zm(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),Zm(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Zm(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=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function cV(t,e,n,r,s,i,a,l,c){const d=c||Number.POSITIVE_INFINITY;let h=0;return m;function m(k){return k===60?(t.enter(r),t.enter(s),t.enter(i),t.consume(k),t.exit(i),g):k===null||k===32||k===41||vy(k)?n(k):(t.enter(r),t.enter(a),t.enter(l),t.enter("chunkString",{contentType:"string"}),w(k))}function g(k){return k===62?(t.enter(i),t.consume(k),t.exit(i),t.exit(s),t.exit(r),e):(t.enter(l),t.enter("chunkString",{contentType:"string"}),x(k))}function x(k){return k===62?(t.exit("chunkString"),t.exit(l),g(k)):k===null||k===60||bt(k)?n(k):(t.consume(k),k===92?y:x)}function y(k){return k===60||k===62||k===92?(t.consume(k),x):x(k)}function w(k){return!h&&(k===null||k===41||or(k))?(t.exit("chunkString"),t.exit(l),t.exit(a),t.exit(r),e(k)):h999||x===null||x===91||x===93&&!c||x===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(x):x===93?(t.exit(i),t.enter(s),t.consume(x),t.exit(s),t.exit(r),e):bt(x)?(t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),h):(t.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===null||x===91||x===93||bt(x)||l++>999?(t.exit("chunkString"),h(x)):(t.consume(x),c||(c=!dn(x)),x===92?g:m)}function g(x){return x===91||x===92||x===93?(t.consume(x),l++,m):m(x)}}function dV(t,e,n,r,s,i){let a;return l;function l(g){return g===34||g===39||g===40?(t.enter(r),t.enter(s),t.consume(g),t.exit(s),a=g===40?41:g,c):n(g)}function c(g){return g===a?(t.enter(s),t.consume(g),t.exit(s),t.exit(r),e):(t.enter(i),d(g))}function d(g){return g===a?(t.exit(i),c(a)):g===null?n(g):bt(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),on(t,d,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===a||g===null||bt(g)?(t.exit("chunkString"),d(g)):(t.consume(g),g===92?m:h)}function m(g){return g===a||g===92?(t.consume(g),h):h(g)}}function A0(t,e){let n;return r;function r(s){return bt(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),n=!0,r):dn(s)?on(t,r,n?"linePrefix":"lineSuffix")(s):e(s)}}const kbe={name:"definition",tokenize:jbe},Obe={partial:!0,tokenize:Nbe};function jbe(t,e,n){const r=this;let s;return i;function i(x){return t.enter("definition"),a(x)}function a(x){return uV.call(r,t,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function l(x){return s=Ga(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(t.enter("definitionMarker"),t.consume(x),t.exit("definitionMarker"),c):n(x)}function c(x){return or(x)?A0(t,d)(x):d(x)}function d(x){return cV(t,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function h(x){return t.attempt(Obe,m,m)(x)}function m(x){return dn(x)?on(t,g,"whitespace")(x):g(x)}function g(x){return x===null||bt(x)?(t.exit("definition"),r.parser.defined.push(s),e(x)):n(x)}}function Nbe(t,e,n){return r;function r(l){return or(l)?A0(t,s)(l):n(l)}function s(l){return dV(t,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function i(l){return dn(l)?on(t,a,"whitespace")(l):a(l)}function a(l){return l===null||bt(l)?e(l):n(l)}}const Cbe={name:"hardBreakEscape",tokenize:Tbe};function Tbe(t,e,n){return r;function r(i){return t.enter("hardBreakEscape"),t.consume(i),s}function s(i){return bt(i)?(t.exit("hardBreakEscape"),e(i)):n(i)}}const Ebe={name:"headingAtx",resolve:_be,tokenize:Abe};function _be(t,e){let n=t.length-2,r=3,s,i;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},i={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},Gi(t,r,n-r+1,[["enter",s,e],["enter",i,e],["exit",i,e],["exit",s,e]])),t}function Abe(t,e,n){let r=0;return s;function s(h){return t.enter("atxHeading"),i(h)}function i(h){return t.enter("atxHeadingSequence"),a(h)}function a(h){return h===35&&r++<6?(t.consume(h),a):h===null||or(h)?(t.exit("atxHeadingSequence"),l(h)):n(h)}function l(h){return h===35?(t.enter("atxHeadingSequence"),c(h)):h===null||bt(h)?(t.exit("atxHeading"),e(h)):dn(h)?on(t,l,"whitespace")(h):(t.enter("atxHeadingText"),d(h))}function c(h){return h===35?(t.consume(h),c):(t.exit("atxHeadingSequence"),l(h))}function d(h){return h===null||h===35||or(h)?(t.exit("atxHeadingText"),l(h)):(t.consume(h),d)}}const Mbe=["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"],IM=["pre","script","style","textarea"],Rbe={concrete:!0,name:"htmlFlow",resolveTo:zbe,tokenize:Ibe},Dbe={partial:!0,tokenize:Bbe},Pbe={partial:!0,tokenize:Lbe};function zbe(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function Ibe(t,e,n){const r=this;let s,i,a,l,c;return d;function d(I){return h(I)}function h(I){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(I),m}function m(I){return I===33?(t.consume(I),g):I===47?(t.consume(I),i=!0,w):I===63?(t.consume(I),s=3,r.interrupt?e:R):Js(I)?(t.consume(I),a=String.fromCharCode(I),S):n(I)}function g(I){return I===45?(t.consume(I),s=2,x):I===91?(t.consume(I),s=5,l=0,y):Js(I)?(t.consume(I),s=4,r.interrupt?e:R):n(I)}function x(I){return I===45?(t.consume(I),r.interrupt?e:R):n(I)}function y(I){const V="CDATA[";return I===V.charCodeAt(l++)?(t.consume(I),l===V.length?r.interrupt?e:U:y):n(I)}function w(I){return Js(I)?(t.consume(I),a=String.fromCharCode(I),S):n(I)}function S(I){if(I===null||I===47||I===62||or(I)){const V=I===47,ee=a.toLowerCase();return!V&&!i&&IM.includes(ee)?(s=1,r.interrupt?e(I):U(I)):Mbe.includes(a.toLowerCase())?(s=6,V?(t.consume(I),k):r.interrupt?e(I):U(I)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):i?j(I):N(I))}return I===45||Vs(I)?(t.consume(I),a+=String.fromCharCode(I),S):n(I)}function k(I){return I===62?(t.consume(I),r.interrupt?e:U):n(I)}function j(I){return dn(I)?(t.consume(I),j):B(I)}function N(I){return I===47?(t.consume(I),B):I===58||I===95||Js(I)?(t.consume(I),T):dn(I)?(t.consume(I),N):B(I)}function T(I){return I===45||I===46||I===58||I===95||Vs(I)?(t.consume(I),T):E(I)}function E(I){return I===61?(t.consume(I),_):dn(I)?(t.consume(I),E):N(I)}function _(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(t.consume(I),c=I,A):dn(I)?(t.consume(I),_):L(I)}function A(I){return I===c?(t.consume(I),c=null,P):I===null||bt(I)?n(I):(t.consume(I),A)}function L(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||or(I)?E(I):(t.consume(I),L)}function P(I){return I===47||I===62||dn(I)?N(I):n(I)}function B(I){return I===62?(t.consume(I),$):n(I)}function $(I){return I===null||bt(I)?U(I):dn(I)?(t.consume(I),$):n(I)}function U(I){return I===45&&s===2?(t.consume(I),F):I===60&&s===1?(t.consume(I),Y):I===62&&s===4?(t.consume(I),ie):I===63&&s===3?(t.consume(I),R):I===93&&s===5?(t.consume(I),X):bt(I)&&(s===6||s===7)?(t.exit("htmlFlowData"),t.check(Dbe,G,te)(I)):I===null||bt(I)?(t.exit("htmlFlowData"),te(I)):(t.consume(I),U)}function te(I){return t.check(Pbe,z,G)(I)}function z(I){return t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),Q}function Q(I){return I===null||bt(I)?te(I):(t.enter("htmlFlowData"),U(I))}function F(I){return I===45?(t.consume(I),R):U(I)}function Y(I){return I===47?(t.consume(I),a="",J):U(I)}function J(I){if(I===62){const V=a.toLowerCase();return IM.includes(V)?(t.consume(I),ie):U(I)}return Js(I)&&a.length<8?(t.consume(I),a+=String.fromCharCode(I),J):U(I)}function X(I){return I===93?(t.consume(I),R):U(I)}function R(I){return I===62?(t.consume(I),ie):I===45&&s===2?(t.consume(I),R):U(I)}function ie(I){return I===null||bt(I)?(t.exit("htmlFlowData"),G(I)):(t.consume(I),ie)}function G(I){return t.exit("htmlFlow"),e(I)}}function Lbe(t,e,n){const r=this;return s;function s(a){return bt(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):n(a)}function i(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function Bbe(t,e,n){return r;function r(s){return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),t.attempt(dg,e,n)}}const Fbe={name:"htmlText",tokenize:qbe};function qbe(t,e,n){const r=this;let s,i,a;return l;function l(R){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(R),c}function c(R){return R===33?(t.consume(R),d):R===47?(t.consume(R),E):R===63?(t.consume(R),N):Js(R)?(t.consume(R),L):n(R)}function d(R){return R===45?(t.consume(R),h):R===91?(t.consume(R),i=0,y):Js(R)?(t.consume(R),j):n(R)}function h(R){return R===45?(t.consume(R),x):n(R)}function m(R){return R===null?n(R):R===45?(t.consume(R),g):bt(R)?(a=m,Y(R)):(t.consume(R),m)}function g(R){return R===45?(t.consume(R),x):m(R)}function x(R){return R===62?F(R):R===45?g(R):m(R)}function y(R){const ie="CDATA[";return R===ie.charCodeAt(i++)?(t.consume(R),i===ie.length?w:y):n(R)}function w(R){return R===null?n(R):R===93?(t.consume(R),S):bt(R)?(a=w,Y(R)):(t.consume(R),w)}function S(R){return R===93?(t.consume(R),k):w(R)}function k(R){return R===62?F(R):R===93?(t.consume(R),k):w(R)}function j(R){return R===null||R===62?F(R):bt(R)?(a=j,Y(R)):(t.consume(R),j)}function N(R){return R===null?n(R):R===63?(t.consume(R),T):bt(R)?(a=N,Y(R)):(t.consume(R),N)}function T(R){return R===62?F(R):N(R)}function E(R){return Js(R)?(t.consume(R),_):n(R)}function _(R){return R===45||Vs(R)?(t.consume(R),_):A(R)}function A(R){return bt(R)?(a=A,Y(R)):dn(R)?(t.consume(R),A):F(R)}function L(R){return R===45||Vs(R)?(t.consume(R),L):R===47||R===62||or(R)?P(R):n(R)}function P(R){return R===47?(t.consume(R),F):R===58||R===95||Js(R)?(t.consume(R),B):bt(R)?(a=P,Y(R)):dn(R)?(t.consume(R),P):F(R)}function B(R){return R===45||R===46||R===58||R===95||Vs(R)?(t.consume(R),B):$(R)}function $(R){return R===61?(t.consume(R),U):bt(R)?(a=$,Y(R)):dn(R)?(t.consume(R),$):P(R)}function U(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(t.consume(R),s=R,te):bt(R)?(a=U,Y(R)):dn(R)?(t.consume(R),U):(t.consume(R),z)}function te(R){return R===s?(t.consume(R),s=void 0,Q):R===null?n(R):bt(R)?(a=te,Y(R)):(t.consume(R),te)}function z(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||or(R)?P(R):(t.consume(R),z)}function Q(R){return R===47||R===62||or(R)?P(R):n(R)}function F(R){return R===62?(t.consume(R),t.exit("htmlTextData"),t.exit("htmlText"),e):n(R)}function Y(R){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),J}function J(R){return dn(R)?on(t,X,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):X(R)}function X(R){return t.enter("htmlTextData"),a(R)}}const fN={name:"labelEnd",resolveAll:Vbe,resolveTo:Ube,tokenize:Wbe},$be={tokenize:Gbe},Hbe={tokenize:Xbe},Qbe={tokenize:Ybe};function Vbe(t){let e=-1;const n=[];for(;++e=3&&(d===null||bt(d))?(t.exit("thematicBreak"),e(d)):n(d)}function c(d){return d===s?(t.consume(d),r++,c):(t.exit("thematicBreakSequence"),dn(d)?on(t,l,"whitespace")(d):l(d))}}const fi={continuation:{tokenize:awe},exit:lwe,name:"list",tokenize:iwe},rwe={partial:!0,tokenize:cwe},swe={partial:!0,tokenize:owe};function iwe(t,e,n){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,a=0;return l;function l(x){const y=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:AO(x)){if(r.containerState.type||(r.containerState.type=y,t.enter(y,{_container:!0})),y==="listUnordered")return t.enter("listItemPrefix"),x===42||x===45?t.check(Sv,n,d)(x):d(x);if(!r.interrupt||x===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),c(x)}return n(x)}function c(x){return AO(x)&&++a<10?(t.consume(x),c):(!r.interrupt||a<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(t.exit("listItemValue"),d(x)):n(x)}function d(x){return t.enter("listItemMarker"),t.consume(x),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,t.check(dg,r.interrupt?n:h,t.attempt(rwe,g,m))}function h(x){return r.containerState.initialBlankLine=!0,i++,g(x)}function m(x){return dn(x)?(t.enter("listItemPrefixWhitespace"),t.consume(x),t.exit("listItemPrefixWhitespace"),g):n(x)}function g(x){return r.containerState.size=i+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(x)}}function awe(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(dg,s,i);function s(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,on(t,e,"listItemIndent",r.containerState.size+1)(l)}function i(l){return r.containerState.furtherBlankLines||!dn(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(swe,e,a)(l))}function a(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,on(t,t.attempt(fi,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function owe(t,e,n){const r=this;return on(t,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(i):n(i)}}function lwe(t){t.exit(this.containerState.type)}function cwe(t,e,n){const r=this;return on(t,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!dn(i)&&a&&a[1].type==="listItemPrefixWhitespace"?e(i):n(i)}}const LM={name:"setextUnderline",resolveTo:uwe,tokenize:dwe};function uwe(t,e){let n=t.length,r,s,i;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(s=n)}else t[n][1].type==="content"&&t.splice(n,1),!i&&t[n][1].type==="definition"&&(i=n);const a={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[s][1].type="setextHeadingText",i?(t.splice(s,0,["enter",a,e]),t.splice(i+1,0,["exit",t[r][1],e]),t[r][1].end={...t[i][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function dwe(t,e,n){const r=this;let s;return i;function i(d){let h=r.events.length,m;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){m=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(t.enter("setextHeadingLine"),s=d,a(d)):n(d)}function a(d){return t.enter("setextHeadingLineSequence"),l(d)}function l(d){return d===s?(t.consume(d),l):(t.exit("setextHeadingLineSequence"),dn(d)?on(t,c,"lineSuffix")(d):c(d))}function c(d){return d===null||bt(d)?(t.exit("setextHeadingLine"),e(d)):n(d)}}const hwe={tokenize:fwe};function fwe(t){const e=this,n=t.attempt(dg,r,t.attempt(this.parser.constructs.flowInitial,s,on(t,t.attempt(this.parser.constructs.flow,s,t.attempt(vbe,s)),"linePrefix")));return n;function r(i){if(i===null){t.consume(i);return}return t.enter("lineEndingBlank"),t.consume(i),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function s(i){if(i===null){t.consume(i);return}return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const mwe={resolveAll:fV()},pwe=hV("string"),gwe=hV("text");function hV(t){return{resolveAll:fV(t==="text"?xwe:void 0),tokenize:e};function e(n){const r=this,s=this.parser.constructs[t],i=n.attempt(s,a,l);return a;function a(h){return d(h)?i(h):l(h)}function l(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),c}function c(h){return d(h)?(n.exit("data"),i(h)):(n.consume(h),c)}function d(h){if(h===null)return!0;const m=s[h];let g=-1;if(m)for(;++g-1){const l=a[0];typeof l=="string"?a[0]=l.slice(r):a.shift()}i>0&&a.push(t[s].slice(0,i))}return a}function _we(t,e){let n=-1;const r=[];let s;for(;++n0){const At=st.tokenStack[st.tokenStack.length-1];(At[1]||DA).call(st,void 0,At[0])}for(Ie.position={start:jc(Ne.length>0?Ne[0][1].start:{line:1,column:1,offset:0}),end:jc(Ne.length>0?Ne[Ne.length-2][1].end:{line:1,column:1,offset:0})},Pt=-1;++Pt1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};t.patch(e,c);const d={type:"element",tagName:"sup",properties:{},children:[c]};return t.patch(e,d),t.applyData(e,d)}function Twe(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Ewe(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function uV(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const s=t.all(e),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function _we(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return uV(t,e);const s={src:Lf(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 t.patch(e,i),t.applyData(e,i)}function Mwe(t,e){const n={src:Lf(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function Awe(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function Rwe(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return uV(t,e);const s={href:Lf(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function Dwe(t,e){const n={href:Lf(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function Pwe(t,e,n){const r=t.all(e),s=n?zwe(n):dV(e),i={},a=[];if(typeof e.checked=="boolean"){const h=r[0];let m;h&&h.type==="element"&&h.tagName==="p"?m=h:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let l=-1;for(;++l0){const Mt=st.tokenStack[st.tokenStack.length-1];(Mt[1]||FM).call(st,void 0,Mt[0])}for(Ie.position={start:Nc(Ne.length>0?Ne[0][1].start:{line:1,column:1,offset:0}),end:Nc(Ne.length>0?Ne[Ne.length-2][1].end:{line:1,column:1,offset:0})},Pt=-1;++Pt1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};t.patch(e,c);const d={type:"element",tagName:"sup",properties:{},children:[c]};return t.patch(e,d),t.applyData(e,d)}function Wwe(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Gwe(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function gV(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const s=t.all(e),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function Xwe(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return gV(t,e);const s={src:Ff(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 t.patch(e,i),t.applyData(e,i)}function Ywe(t,e){const n={src:Ff(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function Kwe(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function Zwe(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return gV(t,e);const s={href:Ff(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function Jwe(t,e){const n={href:Ff(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function e2e(t,e,n){const r=t.all(e),s=n?t2e(n):xV(e),i={},a=[];if(typeof e.checked=="boolean"){const h=r[0];let m;h&&h.type==="element"&&h.tagName==="p"?m=h:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let l=-1;for(;++l1}function Iwe(t,e){const n={},r=t.all(e);let s=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++s0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},l=rN(e.children[1]),c=QQ(e.children[e.children.length-1]);l&&c&&(a.position={start:l,end:c}),s.push(a)}const i={type:"element",tagName:"table",properties:{},children:t.wrap(s,!0)};return t.patch(e,i),t.applyData(e,i)}function $we(t,e,n){const r=n?n.children:void 0,i=(r?r.indexOf(e):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,l=a?a.length:e.children.length;let c=-1;const d=[];for(;++c0,!0),r[0]),s=r.index+r[0].length,r=n.exec(e);return i.push(IA(e.slice(s),s>0,!1)),i.join("")}function IA(t,e,n){let r=0,s=t.length;if(e){let i=t.codePointAt(r);for(;i===PA||i===zA;)r++,i=t.codePointAt(r)}if(n){let i=t.codePointAt(s-1);for(;i===PA||i===zA;)s--,i=t.codePointAt(s-1)}return s>r?t.slice(r,s):""}function Vwe(t,e){const n={type:"text",value:Qwe(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function Uwe(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const Wwe={blockquote:Swe,break:kwe,code:Owe,delete:jwe,emphasis:Nwe,footnoteReference:Cwe,heading:Twe,html:Ewe,imageReference:_we,image:Mwe,inlineCode:Awe,linkReference:Rwe,link:Dwe,listItem:Pwe,list:Iwe,paragraph:Lwe,root:Bwe,strong:Fwe,table:qwe,tableCell:Hwe,tableRow:$we,text:Vwe,thematicBreak:Uwe,toml:j1,yaml:j1,definition:j1,footnoteDefinition:j1};function j1(){}const hV=-1,Rb=0,E0=1,my=2,uN=3,dN=4,hN=5,fN=6,fV=7,mV=8,LA=typeof self=="object"?self:globalThis,Gwe=(t,e)=>{const n=(s,i)=>(t.set(i,s),s),r=s=>{if(t.has(s))return t.get(s);const[i,a]=e[s];switch(i){case Rb:case hV:return n(a,s);case E0:{const l=n([],s);for(const c of a)l.push(r(c));return l}case my:{const l=n({},s);for(const[c,d]of a)l[r(c)]=r(d);return l}case uN:return n(new Date(a),s);case dN:{const{source:l,flags:c}=a;return n(new RegExp(l,c),s)}case hN:{const l=n(new Map,s);for(const[c,d]of a)l.set(r(c),r(d));return l}case fN:{const l=n(new Set,s);for(const c of a)l.add(r(c));return l}case fV:{const{name:l,message:c}=a;return n(new LA[l](c),s)}case mV:return n(BigInt(a),s);case"BigInt":return n(Object(BigInt(a)),s);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(new LA[i](a),s)};return r},BA=t=>Gwe(new Map,t)(0),lh="",{toString:Xwe}={},{keys:Ywe}=Object,Km=t=>{const e=typeof t;if(e!=="object"||!t)return[Rb,e];const n=Xwe.call(t).slice(8,-1);switch(n){case"Array":return[E0,lh];case"Object":return[my,lh];case"Date":return[uN,lh];case"RegExp":return[dN,lh];case"Map":return[hN,lh];case"Set":return[fN,lh];case"DataView":return[E0,n]}return n.includes("Array")?[E0,n]:n.includes("Error")?[fV,n]:[my,n]},N1=([t,e])=>t===Rb&&(e==="function"||e==="symbol"),Kwe=(t,e,n,r)=>{const s=(a,l)=>{const c=r.push(a)-1;return n.set(l,c),c},i=a=>{if(n.has(a))return n.get(a);let[l,c]=Km(a);switch(l){case Rb:{let h=a;switch(c){case"bigint":l=mV,h=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+c);h=null;break;case"undefined":return s([hV],a)}return s([l,h],a)}case E0:{if(c){let g=a;return c==="DataView"?g=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(g=new Uint8Array(a)),s([c,[...g]],a)}const h=[],m=s([l,h],a);for(const g of a)h.push(i(g));return m}case my:{if(c)switch(c){case"BigInt":return s([c,a.toString()],a);case"Boolean":case"Number":case"String":return s([c,a.valueOf()],a)}if(e&&"toJSON"in a)return i(a.toJSON());const h=[],m=s([l,h],a);for(const g of Ywe(a))(t||!N1(Km(a[g])))&&h.push([i(g),i(a[g])]);return m}case uN:return s([l,a.toISOString()],a);case dN:{const{source:h,flags:m}=a;return s([l,{source:h,flags:m}],a)}case hN:{const h=[],m=s([l,h],a);for(const[g,x]of a)(t||!(N1(Km(g))||N1(Km(x))))&&h.push([i(g),i(x)]);return m}case fN:{const h=[],m=s([l,h],a);for(const g of a)(t||!N1(Km(g)))&&h.push(i(g));return m}}const{message:d}=a;return s([l,{name:c,message:d}],a)};return i},FA=(t,{json:e,lossy:n}={})=>{const r=[];return Kwe(!(e||n),!!e,new Map,r)(t),r},py=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?BA(FA(t,e)):structuredClone(t):(t,e)=>BA(FA(t,e));function Zwe(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function Jwe(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function e2e(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||Zwe,r=t.options.footnoteBackLabel||Jwe,s=t.options.footnoteLabel||"Footnotes",i=t.options.footnoteLabelTagName||"h2",a=t.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&y.push({type:"text",value:" "});let j=typeof n=="string"?n:n(c,x);typeof j=="string"&&(j={type:"text",value:j}),y.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+g+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,x),className:["data-footnote-backref"]},children:Array.isArray(j)?j:[j]})}const S=h[h.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const j=S.children[S.children.length-1];j&&j.type==="text"?j.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...y)}else h.push(...y);const k={type:"element",tagName:"li",properties:{id:e+"fn-"+g},children:t.wrap(h,!0)};t.patch(d,k),l.push(k)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...py(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` +`});const d={type:"element",tagName:"li",properties:i,children:a};return t.patch(e,d),t.applyData(e,d)}function t2e(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r1}function n2e(t,e){const n={},r=t.all(e);let s=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++s0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},l=oN(e.children[1]),c=YQ(e.children[e.children.length-1]);l&&c&&(a.position={start:l,end:c}),s.push(a)}const i={type:"element",tagName:"table",properties:{},children:t.wrap(s,!0)};return t.patch(e,i),t.applyData(e,i)}function o2e(t,e,n){const r=n?n.children:void 0,i=(r?r.indexOf(e):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,l=a?a.length:e.children.length;let c=-1;const d=[];for(;++c0,!0),r[0]),s=r.index+r[0].length,r=n.exec(e);return i.push(HM(e.slice(s),s>0,!1)),i.join("")}function HM(t,e,n){let r=0,s=t.length;if(e){let i=t.codePointAt(r);for(;i===qM||i===$M;)r++,i=t.codePointAt(r)}if(n){let i=t.codePointAt(s-1);for(;i===qM||i===$M;)s--,i=t.codePointAt(s-1)}return s>r?t.slice(r,s):""}function u2e(t,e){const n={type:"text",value:c2e(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function d2e(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const h2e={blockquote:qwe,break:$we,code:Hwe,delete:Qwe,emphasis:Vwe,footnoteReference:Uwe,heading:Wwe,html:Gwe,imageReference:Xwe,image:Ywe,inlineCode:Kwe,linkReference:Zwe,link:Jwe,listItem:e2e,list:n2e,paragraph:r2e,root:s2e,strong:i2e,table:a2e,tableCell:l2e,tableRow:o2e,text:u2e,thematicBreak:d2e,toml:C1,yaml:C1,definition:C1,footnoteDefinition:C1};function C1(){}const vV=-1,Bb=0,M0=1,yy=2,mN=3,pN=4,gN=5,xN=6,yV=7,bV=8,QM=typeof self=="object"?self:globalThis,f2e=(t,e)=>{const n=(s,i)=>(t.set(i,s),s),r=s=>{if(t.has(s))return t.get(s);const[i,a]=e[s];switch(i){case Bb:case vV:return n(a,s);case M0:{const l=n([],s);for(const c of a)l.push(r(c));return l}case yy:{const l=n({},s);for(const[c,d]of a)l[r(c)]=r(d);return l}case mN:return n(new Date(a),s);case pN:{const{source:l,flags:c}=a;return n(new RegExp(l,c),s)}case gN:{const l=n(new Map,s);for(const[c,d]of a)l.set(r(c),r(d));return l}case xN:{const l=n(new Set,s);for(const c of a)l.add(r(c));return l}case yV:{const{name:l,message:c}=a;return n(new QM[l](c),s)}case bV:return n(BigInt(a),s);case"BigInt":return n(Object(BigInt(a)),s);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(new QM[i](a),s)};return r},VM=t=>f2e(new Map,t)(0),lh="",{toString:m2e}={},{keys:p2e}=Object,Jm=t=>{const e=typeof t;if(e!=="object"||!t)return[Bb,e];const n=m2e.call(t).slice(8,-1);switch(n){case"Array":return[M0,lh];case"Object":return[yy,lh];case"Date":return[mN,lh];case"RegExp":return[pN,lh];case"Map":return[gN,lh];case"Set":return[xN,lh];case"DataView":return[M0,n]}return n.includes("Array")?[M0,n]:n.includes("Error")?[yV,n]:[yy,n]},T1=([t,e])=>t===Bb&&(e==="function"||e==="symbol"),g2e=(t,e,n,r)=>{const s=(a,l)=>{const c=r.push(a)-1;return n.set(l,c),c},i=a=>{if(n.has(a))return n.get(a);let[l,c]=Jm(a);switch(l){case Bb:{let h=a;switch(c){case"bigint":l=bV,h=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+c);h=null;break;case"undefined":return s([vV],a)}return s([l,h],a)}case M0:{if(c){let g=a;return c==="DataView"?g=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(g=new Uint8Array(a)),s([c,[...g]],a)}const h=[],m=s([l,h],a);for(const g of a)h.push(i(g));return m}case yy:{if(c)switch(c){case"BigInt":return s([c,a.toString()],a);case"Boolean":case"Number":case"String":return s([c,a.valueOf()],a)}if(e&&"toJSON"in a)return i(a.toJSON());const h=[],m=s([l,h],a);for(const g of p2e(a))(t||!T1(Jm(a[g])))&&h.push([i(g),i(a[g])]);return m}case mN:return s([l,a.toISOString()],a);case pN:{const{source:h,flags:m}=a;return s([l,{source:h,flags:m}],a)}case gN:{const h=[],m=s([l,h],a);for(const[g,x]of a)(t||!(T1(Jm(g))||T1(Jm(x))))&&h.push([i(g),i(x)]);return m}case xN:{const h=[],m=s([l,h],a);for(const g of a)(t||!T1(Jm(g)))&&h.push(i(g));return m}}const{message:d}=a;return s([l,{name:c,message:d}],a)};return i},UM=(t,{json:e,lossy:n}={})=>{const r=[];return g2e(!(e||n),!!e,new Map,r)(t),r},by=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?VM(UM(t,e)):structuredClone(t):(t,e)=>VM(UM(t,e));function x2e(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function v2e(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function y2e(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||x2e,r=t.options.footnoteBackLabel||v2e,s=t.options.footnoteLabel||"Footnotes",i=t.options.footnoteLabelTagName||"h2",a=t.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&y.push({type:"text",value:" "});let j=typeof n=="string"?n:n(c,x);typeof j=="string"&&(j={type:"text",value:j}),y.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+g+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,x),className:["data-footnote-backref"]},children:Array.isArray(j)?j:[j]})}const S=h[h.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const j=S.children[S.children.length-1];j&&j.type==="text"?j.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...y)}else h.push(...y);const k={type:"element",tagName:"li",properties:{id:e+"fn-"+g},children:t.wrap(h,!0)};t.patch(d,k),l.push(k)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...by(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:t.wrap(l,!0)},{type:"text",value:` -`}]}}const ug=(function(t){if(t==null)return s2e;if(typeof t=="function")return Db(t);if(typeof t=="object")return Array.isArray(t)?t2e(t):n2e(t);if(typeof t=="string")return r2e(t);throw new Error("Expected function, string, or object as test")});function t2e(t){const e=[];let n=-1;for(;++n":""))+")"})}return g;function g(){let x=pV,y,w,S;if((!e||i(c,d,h[h.length-1]||void 0))&&(x=o2e(n(c,h)),x[0]===CO))return x;if("children"in c&&c.children){const k=c;if(k.children&&x[0]!==gV)for(w=(r?k.children.length:-1)+a,S=h.concat(k);w>-1&&w":""))+")"})}return g;function g(){let x=wV,y,w,S;if((!e||i(c,d,h[h.length-1]||void 0))&&(x=N2e(n(c,h)),x[0]===RO))return x;if("children"in c&&c.children){const k=c;if(k.children&&x[0]!==SV)for(w=(r?k.children.length:-1)+a,S=h.concat(k);w>-1&&w0&&n.push({type:"text",value:` -`}),n}function qA(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function $A(t,e){const n=c2e(t,e),r=n.one(t,void 0),s=e2e(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:` -`},s),i}function m2e(t,e){return t&&"run"in t?async function(n,r){const s=$A(n,{file:r,...e});await t.run(s,r)}:function(n,r){return $A(n,{file:r,...t||e})}}function HA(t){if(t)throw t}var CS,QA;function p2e(){if(QA)return CS;QA=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(d){return typeof Array.isArray=="function"?Array.isArray(d):e.call(d)==="[object Array]"},i=function(d){if(!d||e.call(d)!=="[object Object]")return!1;var h=t.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&t.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!h&&!m)return!1;var g;for(g in d);return typeof g>"u"||t.call(d,g)},a=function(d,h){n&&h.name==="__proto__"?n(d,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):d[h.name]=h.newValue},l=function(d,h){if(h==="__proto__")if(t.call(d,h)){if(r)return r(d,h).value}else return;return d[h]};return CS=function c(){var d,h,m,g,x,y,w=arguments[0],S=1,k=arguments.length,j=!1;for(typeof w=="boolean"&&(j=w,w=arguments[1]||{},S=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});Sa.length;let c;l&&a.push(s);try{c=t.apply(this,a)}catch(d){const h=d;if(l&&n)throw h;return s(h)}l||(c&&c.then&&typeof c.then=="function"?c.then(i,s):c instanceof Error?s(c):i(c))}function s(a,...l){n||(n=!0,e(a,...l))}function i(a){s(null,a)}}const go={basename:y2e,dirname:b2e,extname:w2e,join:S2e,sep:"/"};function y2e(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');dg(t);let n=0,r=-1,s=t.length,i;if(e===void 0||e.length===0||e.length>t.length){for(;s--;)if(t.codePointAt(s)===47){if(i){n=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,l=e.length-1;for(;s--;)if(t.codePointAt(s)===47){if(i){n=s+1;break}}else a<0&&(i=!0,a=s+1),l>-1&&(t.codePointAt(s)===e.codePointAt(l--)?l<0&&(r=s):(l=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function b2e(t){if(dg(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function w2e(t){dg(t);let e=t.length,n=-1,r=0,s=-1,i=0,a;for(;e--;){const l=t.codePointAt(e);if(l===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),l===46?s<0?s=e:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||n<0||i===0||i===1&&s===n-1&&s===r+1?"":t.slice(s,n)}function S2e(...t){let e=-1,n;for(;++e0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function O2e(t,e){let n="",r=0,s=-1,i=0,a=-1,l,c;for(;++a<=t.length;){if(a2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),s=a,i=0;continue}}else if(n.length>0){n="",r=0,s=a,i=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(s+1,a):n=t.slice(s+1,a),r=a-s-1;s=a,i=0}else l===46&&i>-1?i++:i=-1}return n}function dg(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const j2e={cwd:N2e};function N2e(){return"/"}function _O(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function C2e(t){if(typeof t=="string")t=new URL(t);else if(!_O(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return T2e(t)}function T2e(t){if(t.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=t.pathname;let n=-1;for(;++n0){let[x,...y]=h;const w=r[g][1];EO(w)&&EO(x)&&(x=TS(!0,w,x)),r[g]=[d,x,...y]}}}}const A2e=new gN().freeze();function AS(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function RS(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function DS(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function UA(t){if(!EO(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function WA(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function C1(t){return R2e(t)?t:new xV(t)}function R2e(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function D2e(t){return typeof t=="string"||P2e(t)}function P2e(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const z2e="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",GA=[],XA={allowDangerousHtml:!0},I2e=/^(https?|ircs?|mailto|xmpp)$/i,L2e=[{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 B2e(t){const e=F2e(t),n=q2e(t);return $2e(e.runSync(e.parse(n),n),t)}function F2e(t){const e=t.rehypePlugins||GA,n=t.remarkPlugins||GA,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...XA}:XA;return A2e().use(wwe).use(n).use(m2e,r).use(e)}function q2e(t){const e=t.children||"",n=new xV;return typeof e=="string"&&(n.value=e),n}function $2e(t,e){const n=e.allowedElements,r=e.allowElement,s=e.components,i=e.disallowedElements,a=e.skipHtml,l=e.unwrapDisallowed,c=e.urlTransform||H2e;for(const h of L2e)Object.hasOwn(e,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+z2e+h.id,void 0);return pN(t,d),sye(t,{Fragment:o.Fragment,components:s,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function d(h,m,g){if(h.type==="raw"&&g&&typeof m=="number")return a?g.children.splice(m,1):g.children[m]={type:"text",value:h.value},m;if(h.type==="element"){let x;for(x in OS)if(Object.hasOwn(OS,x)&&Object.hasOwn(h.properties,x)){const y=h.properties[x],w=OS[x];(w===null||w.includes(h.tagName))&&(h.properties[x]=c(String(y||""),x,h))}}if(h.type==="element"){let x=n?!n.includes(h.tagName):i?i.includes(h.tagName):!1;if(!x&&r&&typeof m=="number"&&(x=!r(h,m,g)),x&&g&&typeof m=="number")return l&&h.children?g.children.splice(m,1,...h.children):g.children.splice(m,1),m}}}function H2e(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),s=t.indexOf("/");return e===-1||s!==-1&&e>s||n!==-1&&e>n||r!==-1&&e>r||I2e.test(t.slice(0,e))?t:""}function YA(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(e);for(;s!==-1;)r++,s=n.indexOf(e,s+e.length);return r}function Q2e(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function V2e(t,e,n){const s=ug((n||{}).ignore||[]),i=U2e(e);let a=-1;for(;++a0?{type:"text",value:_}:void 0),_===!1?g.lastIndex=T+1:(y!==T&&j.push({type:"text",value:d.value.slice(y,T)}),Array.isArray(_)?j.push(..._):_&&j.push(_),y=T+N[0].length,k=!0),!g.global)break;N=g.exec(d.value)}return k?(y?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const s=YA(t,"(");let i=YA(t,")");for(;r!==-1&&s>i;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[t,n]}function vV(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||fd(n)||Mb(n))&&(!e||n!==47)}yV.peek=p4e;function o4e(){this.buffer()}function l4e(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function c4e(){this.buffer()}function u4e(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function d4e(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ga(this.sliceSerialize(t)).toLowerCase(),n.label=e}function h4e(t){this.exit(t)}function f4e(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ga(this.sliceSerialize(t)).toLowerCase(),n.label=e}function m4e(t){this.exit(t)}function p4e(){return"["}function yV(t,e,n,r){const s=n.createTracker(r);let i=s.move("[^");const a=n.enter("footnoteReference"),l=n.enter("reference");return i+=s.move(n.safe(n.associationId(t),{after:"]",before:i})),l(),a(),i+=s.move("]"),i}function g4e(){return{enter:{gfmFootnoteCallString:o4e,gfmFootnoteCall:l4e,gfmFootnoteDefinitionLabelString:c4e,gfmFootnoteDefinition:u4e},exit:{gfmFootnoteCallString:d4e,gfmFootnoteCall:h4e,gfmFootnoteDefinitionLabelString:f4e,gfmFootnoteDefinition:m4e}}}function x4e(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:yV},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,i,a){const l=i.createTracker(a);let c=l.move("[^");const d=i.enter("footnoteDefinition"),h=i.enter("label");return c+=l.move(i.safe(i.associationId(r),{before:c,after:"]"})),h(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((e?` -`:" ")+i.indentLines(i.containerFlow(r,l.current()),e?bV:v4e))),d(),c}}function v4e(t,e,n){return e===0?t:bV(t,e,n)}function bV(t,e,n){return(n?"":" ")+t}const y4e=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];wV.peek=O4e;function b4e(){return{canContainEols:["delete"],enter:{strikethrough:S4e},exit:{strikethrough:k4e}}}function w4e(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:y4e}],handlers:{delete:wV}}}function S4e(t){this.enter({type:"delete",children:[]},t)}function k4e(t){this.exit(t)}function wV(t,e,n,r){const s=n.createTracker(r),i=n.enter("strikethrough");let a=s.move("~~");return a+=n.containerPhrasing(t,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function O4e(){return"~"}function j4e(t){return t.length}function N4e(t,e){const n=e||{},r=(n.align||[]).concat(),s=n.stringLength||j4e,i=[],a=[],l=[],c=[];let d=0,h=-1;for(;++hd&&(d=t[h].length);++kc[k])&&(c[k]=N)}w.push(j)}a[h]=w,l[h]=S}let m=-1;if(typeof r=="object"&&"length"in r)for(;++mc[m]&&(c[m]=j),x[m]=j),g[m]=N}a.splice(1,0,g),l.splice(1,0,x),h=-1;const y=[];for(;++h "),i.shift(2);const a=n.indentLines(n.containerFlow(t,i.current()),E4e);return s(),a}function E4e(t,e,n){return">"+(n?"":" ")+t}function _4e(t,e){return ZA(t,e.inConstruct,!0)&&!ZA(t,e.notInConstruct,!1)}function ZA(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++ra&&(a=i):i=1,s=r+e.length,r=n.indexOf(e,s);return a}function M4e(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function A4e(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function R4e(t,e,n,r){const s=A4e(n),i=t.value||"",a=s==="`"?"GraveAccent":"Tilde";if(M4e(t,n)){const m=n.enter("codeIndented"),g=n.indentLines(i,D4e);return m(),g}const l=n.createTracker(r),c=s.repeat(Math.max(SV(i,s)+1,3)),d=n.enter("codeFenced");let h=l.move(c);if(t.lang){const m=n.enter(`codeFencedLang${a}`);h+=l.move(n.safe(t.lang,{before:h,after:" ",encode:["`"],...l.current()})),m()}if(t.lang&&t.meta){const m=n.enter(`codeFencedMeta${a}`);h+=l.move(" "),h+=l.move(n.safe(t.meta,{before:h,after:` +`}),n}function WM(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function GM(t,e){const n=T2e(t,e),r=n.one(t,void 0),s=y2e(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:` +`},s),i}function R2e(t,e){return t&&"run"in t?async function(n,r){const s=GM(n,{file:r,...e});await t.run(s,r)}:function(n,r){return GM(n,{file:r,...t||e})}}function XM(t){if(t)throw t}var RS,YM;function D2e(){if(YM)return RS;YM=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(d){return typeof Array.isArray=="function"?Array.isArray(d):e.call(d)==="[object Array]"},i=function(d){if(!d||e.call(d)!=="[object Object]")return!1;var h=t.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&t.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!h&&!m)return!1;var g;for(g in d);return typeof g>"u"||t.call(d,g)},a=function(d,h){n&&h.name==="__proto__"?n(d,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):d[h.name]=h.newValue},l=function(d,h){if(h==="__proto__")if(t.call(d,h)){if(r)return r(d,h).value}else return;return d[h]};return RS=function c(){var d,h,m,g,x,y,w=arguments[0],S=1,k=arguments.length,j=!1;for(typeof w=="boolean"&&(j=w,w=arguments[1]||{},S=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});Sa.length;let c;l&&a.push(s);try{c=t.apply(this,a)}catch(d){const h=d;if(l&&n)throw h;return s(h)}l||(c&&c.then&&typeof c.then=="function"?c.then(i,s):c instanceof Error?s(c):i(c))}function s(a,...l){n||(n=!0,e(a,...l))}function i(a){s(null,a)}}const go={basename:L2e,dirname:B2e,extname:F2e,join:q2e,sep:"/"};function L2e(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');fg(t);let n=0,r=-1,s=t.length,i;if(e===void 0||e.length===0||e.length>t.length){for(;s--;)if(t.codePointAt(s)===47){if(i){n=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,l=e.length-1;for(;s--;)if(t.codePointAt(s)===47){if(i){n=s+1;break}}else a<0&&(i=!0,a=s+1),l>-1&&(t.codePointAt(s)===e.codePointAt(l--)?l<0&&(r=s):(l=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function B2e(t){if(fg(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function F2e(t){fg(t);let e=t.length,n=-1,r=0,s=-1,i=0,a;for(;e--;){const l=t.codePointAt(e);if(l===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),l===46?s<0?s=e:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||n<0||i===0||i===1&&s===n-1&&s===r+1?"":t.slice(s,n)}function q2e(...t){let e=-1,n;for(;++e0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function H2e(t,e){let n="",r=0,s=-1,i=0,a=-1,l,c;for(;++a<=t.length;){if(a2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),s=a,i=0;continue}}else if(n.length>0){n="",r=0,s=a,i=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(s+1,a):n=t.slice(s+1,a),r=a-s-1;s=a,i=0}else l===46&&i>-1?i++:i=-1}return n}function fg(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Q2e={cwd:V2e};function V2e(){return"/"}function zO(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function U2e(t){if(typeof t=="string")t=new URL(t);else if(!zO(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return W2e(t)}function W2e(t){if(t.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=t.pathname;let n=-1;for(;++n0){let[x,...y]=h;const w=r[g][1];PO(w)&&PO(x)&&(x=DS(!0,w,x)),r[g]=[d,x,...y]}}}}const K2e=new bN().freeze();function LS(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function BS(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function FS(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ZM(t){if(!PO(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function JM(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function E1(t){return Z2e(t)?t:new kV(t)}function Z2e(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function J2e(t){return typeof t=="string"||e4e(t)}function e4e(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const t4e="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",eR=[],tR={allowDangerousHtml:!0},n4e=/^(https?|ircs?|mailto|xmpp)$/i,r4e=[{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 s4e(t){const e=i4e(t),n=a4e(t);return o4e(e.runSync(e.parse(n),n),t)}function i4e(t){const e=t.rehypePlugins||eR,n=t.remarkPlugins||eR,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...tR}:tR;return K2e().use(Fwe).use(n).use(R2e,r).use(e)}function a4e(t){const e=t.children||"",n=new kV;return typeof e=="string"&&(n.value=e),n}function o4e(t,e){const n=e.allowedElements,r=e.allowElement,s=e.components,i=e.disallowedElements,a=e.skipHtml,l=e.unwrapDisallowed,c=e.urlTransform||l4e;for(const h of r4e)Object.hasOwn(e,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+t4e+h.id,void 0);return yN(t,d),kye(t,{Fragment:o.Fragment,components:s,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function d(h,m,g){if(h.type==="raw"&&g&&typeof m=="number")return a?g.children.splice(m,1):g.children[m]={type:"text",value:h.value},m;if(h.type==="element"){let x;for(x in _S)if(Object.hasOwn(_S,x)&&Object.hasOwn(h.properties,x)){const y=h.properties[x],w=_S[x];(w===null||w.includes(h.tagName))&&(h.properties[x]=c(String(y||""),x,h))}}if(h.type==="element"){let x=n?!n.includes(h.tagName):i?i.includes(h.tagName):!1;if(!x&&r&&typeof m=="number"&&(x=!r(h,m,g)),x&&g&&typeof m=="number")return l&&h.children?g.children.splice(m,1,...h.children):g.children.splice(m,1),m}}}function l4e(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),s=t.indexOf("/");return e===-1||s!==-1&&e>s||n!==-1&&e>n||r!==-1&&e>r||n4e.test(t.slice(0,e))?t:""}function nR(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(e);for(;s!==-1;)r++,s=n.indexOf(e,s+e.length);return r}function c4e(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function u4e(t,e,n){const s=hg((n||{}).ignore||[]),i=d4e(e);let a=-1;for(;++a0?{type:"text",value:_}:void 0),_===!1?g.lastIndex=T+1:(y!==T&&j.push({type:"text",value:d.value.slice(y,T)}),Array.isArray(_)?j.push(..._):_&&j.push(_),y=T+N[0].length,k=!0),!g.global)break;N=g.exec(d.value)}return k?(y?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const s=nR(t,"(");let i=nR(t,")");for(;r!==-1&&s>i;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[t,n]}function OV(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||fd(n)||Ib(n))&&(!e||n!==47)}jV.peek=D4e;function N4e(){this.buffer()}function C4e(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function T4e(){this.buffer()}function E4e(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function _4e(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ga(this.sliceSerialize(t)).toLowerCase(),n.label=e}function A4e(t){this.exit(t)}function M4e(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ga(this.sliceSerialize(t)).toLowerCase(),n.label=e}function R4e(t){this.exit(t)}function D4e(){return"["}function jV(t,e,n,r){const s=n.createTracker(r);let i=s.move("[^");const a=n.enter("footnoteReference"),l=n.enter("reference");return i+=s.move(n.safe(n.associationId(t),{after:"]",before:i})),l(),a(),i+=s.move("]"),i}function P4e(){return{enter:{gfmFootnoteCallString:N4e,gfmFootnoteCall:C4e,gfmFootnoteDefinitionLabelString:T4e,gfmFootnoteDefinition:E4e},exit:{gfmFootnoteCallString:_4e,gfmFootnoteCall:A4e,gfmFootnoteDefinitionLabelString:M4e,gfmFootnoteDefinition:R4e}}}function z4e(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:jV},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,i,a){const l=i.createTracker(a);let c=l.move("[^");const d=i.enter("footnoteDefinition"),h=i.enter("label");return c+=l.move(i.safe(i.associationId(r),{before:c,after:"]"})),h(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((e?` +`:" ")+i.indentLines(i.containerFlow(r,l.current()),e?NV:I4e))),d(),c}}function I4e(t,e,n){return e===0?t:NV(t,e,n)}function NV(t,e,n){return(n?"":" ")+t}const L4e=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];CV.peek=H4e;function B4e(){return{canContainEols:["delete"],enter:{strikethrough:q4e},exit:{strikethrough:$4e}}}function F4e(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:L4e}],handlers:{delete:CV}}}function q4e(t){this.enter({type:"delete",children:[]},t)}function $4e(t){this.exit(t)}function CV(t,e,n,r){const s=n.createTracker(r),i=n.enter("strikethrough");let a=s.move("~~");return a+=n.containerPhrasing(t,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function H4e(){return"~"}function Q4e(t){return t.length}function V4e(t,e){const n=e||{},r=(n.align||[]).concat(),s=n.stringLength||Q4e,i=[],a=[],l=[],c=[];let d=0,h=-1;for(;++hd&&(d=t[h].length);++kc[k])&&(c[k]=N)}w.push(j)}a[h]=w,l[h]=S}let m=-1;if(typeof r=="object"&&"length"in r)for(;++mc[m]&&(c[m]=j),x[m]=j),g[m]=N}a.splice(1,0,g),l.splice(1,0,x),h=-1;const y=[];for(;++h "),i.shift(2);const a=n.indentLines(n.containerFlow(t,i.current()),G4e);return s(),a}function G4e(t,e,n){return">"+(n?"":" ")+t}function X4e(t,e){return sR(t,e.inConstruct,!0)&&!sR(t,e.notInConstruct,!1)}function sR(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++ra&&(a=i):i=1,s=r+e.length,r=n.indexOf(e,s);return a}function Y4e(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function K4e(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function Z4e(t,e,n,r){const s=K4e(n),i=t.value||"",a=s==="`"?"GraveAccent":"Tilde";if(Y4e(t,n)){const m=n.enter("codeIndented"),g=n.indentLines(i,J4e);return m(),g}const l=n.createTracker(r),c=s.repeat(Math.max(TV(i,s)+1,3)),d=n.enter("codeFenced");let h=l.move(c);if(t.lang){const m=n.enter(`codeFencedLang${a}`);h+=l.move(n.safe(t.lang,{before:h,after:" ",encode:["`"],...l.current()})),m()}if(t.lang&&t.meta){const m=n.enter(`codeFencedMeta${a}`);h+=l.move(" "),h+=l.move(n.safe(t.meta,{before:h,after:` `,encode:["`"],...l.current()})),m()}return h+=l.move(` `),i&&(h+=l.move(i+` -`)),h+=l.move(c),d(),h}function D4e(t,e,n){return(n?"":" ")+t}function xN(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function P4e(t,e,n,r){const s=xN(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("[");return d+=c.move(n.safe(n.associationId(t),{before:d,after:"]",...c.current()})),d+=c.move("]: "),l(),!t.url||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(t.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(l=n.enter("destinationRaw"),d+=c.move(n.safe(t.url,{before:d,after:t.title?" ":` -`,...c.current()}))),l(),t.title&&(l=n.enter(`title${i}`),d+=c.move(" "+s),d+=c.move(n.safe(t.title,{before:d,after:s,...c.current()})),d+=c.move(s),l()),a(),d}function z4e(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function fp(t){return"&#x"+t.toString(16).toUpperCase()+";"}function gy(t,e,n){const r=uf(t),s=uf(e);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}kV.peek=I4e;function kV(t,e,n,r){const s=z4e(n),i=n.enter("emphasis"),a=n.createTracker(r),l=a.move(s);let c=a.move(n.containerPhrasing(t,{after:s,before:l,...a.current()}));const d=c.charCodeAt(0),h=gy(r.before.charCodeAt(r.before.length-1),d,s);h.inside&&(c=fp(d)+c.slice(1));const m=c.charCodeAt(c.length-1),g=gy(r.after.charCodeAt(0),m,s);g.inside&&(c=c.slice(0,-1)+fp(m));const x=a.move(s);return i(),n.attentionEncodeSurroundingInfo={after:g.outside,before:h.outside},l+c+x}function I4e(t,e,n){return n.options.emphasis||"*"}function L4e(t,e){let n=!1;return pN(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,CO}),!!((!t.depth||t.depth<3)&&oN(t)&&(e.options.setext||n))}function B4e(t,e,n,r){const s=Math.max(Math.min(6,t.depth||1),1),i=n.createTracker(r);if(L4e(t,n)){const h=n.enter("headingSetext"),m=n.enter("phrasing"),g=n.containerPhrasing(t,{...i.current(),before:` +`)),h+=l.move(c),d(),h}function J4e(t,e,n){return(n?"":" ")+t}function wN(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function eSe(t,e,n,r){const s=wN(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("[");return d+=c.move(n.safe(n.associationId(t),{before:d,after:"]",...c.current()})),d+=c.move("]: "),l(),!t.url||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(t.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(l=n.enter("destinationRaw"),d+=c.move(n.safe(t.url,{before:d,after:t.title?" ":` +`,...c.current()}))),l(),t.title&&(l=n.enter(`title${i}`),d+=c.move(" "+s),d+=c.move(n.safe(t.title,{before:d,after:s,...c.current()})),d+=c.move(s),l()),a(),d}function tSe(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function gp(t){return"&#x"+t.toString(16).toUpperCase()+";"}function wy(t,e,n){const r=hf(t),s=hf(e);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}EV.peek=nSe;function EV(t,e,n,r){const s=tSe(n),i=n.enter("emphasis"),a=n.createTracker(r),l=a.move(s);let c=a.move(n.containerPhrasing(t,{after:s,before:l,...a.current()}));const d=c.charCodeAt(0),h=wy(r.before.charCodeAt(r.before.length-1),d,s);h.inside&&(c=gp(d)+c.slice(1));const m=c.charCodeAt(c.length-1),g=wy(r.after.charCodeAt(0),m,s);g.inside&&(c=c.slice(0,-1)+gp(m));const x=a.move(s);return i(),n.attentionEncodeSurroundingInfo={after:g.outside,before:h.outside},l+c+x}function nSe(t,e,n){return n.options.emphasis||"*"}function rSe(t,e){let n=!1;return yN(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,RO}),!!((!t.depth||t.depth<3)&&dN(t)&&(e.options.setext||n))}function sSe(t,e,n,r){const s=Math.max(Math.min(6,t.depth||1),1),i=n.createTracker(r);if(rSe(t,n)){const h=n.enter("headingSetext"),m=n.enter("phrasing"),g=n.containerPhrasing(t,{...i.current(),before:` `,after:` `});return m(),h(),g+` `+(s===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(` `))+1))}const a="#".repeat(s),l=n.enter("headingAtx"),c=n.enter("phrasing");i.move(a+" ");let d=n.containerPhrasing(t,{before:"# ",after:` -`,...i.current()});return/^[\t ]/.test(d)&&(d=fp(d.charCodeAt(0))+d.slice(1)),d=d?a+" "+d:a,n.options.closeAtx&&(d+=" "+a),c(),l(),d}OV.peek=F4e;function OV(t){return t.value||""}function F4e(){return"<"}jV.peek=q4e;function jV(t,e,n,r){const s=xN(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("![");return d+=c.move(n.safe(t.alt,{before:d,after:"]",...c.current()})),d+=c.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(t.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(l=n.enter("destinationRaw"),d+=c.move(n.safe(t.url,{before:d,after:t.title?" ":")",...c.current()}))),l(),t.title&&(l=n.enter(`title${i}`),d+=c.move(" "+s),d+=c.move(n.safe(t.title,{before:d,after:s,...c.current()})),d+=c.move(s),l()),d+=c.move(")"),a(),d}function q4e(){return"!"}NV.peek=$4e;function NV(t,e,n,r){const s=t.referenceType,i=n.enter("imageReference");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");const d=n.safe(t.alt,{before:c,after:"]",...l.current()});c+=l.move(d+"]["),a();const h=n.stack;n.stack=[],a=n.enter("reference");const m=n.safe(n.associationId(t),{before:c,after:"]",...l.current()});return a(),n.stack=h,i(),s==="full"||!d||d!==m?c+=l.move(m+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function $4e(){return"!"}CV.peek=H4e;function CV(t,e,n){let r=t.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\u007F]/.test(t.url))}EV.peek=Q4e;function EV(t,e,n,r){const s=xN(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let l,c;if(TV(t,n)){const h=n.stack;n.stack=[],l=n.enter("autolink");let m=a.move("<");return m+=a.move(n.containerPhrasing(t,{before:m,after:">",...a.current()})),m+=a.move(">"),l(),n.stack=h,m}l=n.enter("link"),c=n.enter("label");let d=a.move("[");return d+=a.move(n.containerPhrasing(t,{before:d,after:"](",...a.current()})),d+=a.move("]("),c(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(c=n.enter("destinationLiteral"),d+=a.move("<"),d+=a.move(n.safe(t.url,{before:d,after:">",...a.current()})),d+=a.move(">")):(c=n.enter("destinationRaw"),d+=a.move(n.safe(t.url,{before:d,after:t.title?" ":")",...a.current()}))),c(),t.title&&(c=n.enter(`title${i}`),d+=a.move(" "+s),d+=a.move(n.safe(t.title,{before:d,after:s,...a.current()})),d+=a.move(s),c()),d+=a.move(")"),l(),d}function Q4e(t,e,n){return TV(t,n)?"<":"["}_V.peek=V4e;function _V(t,e,n,r){const s=t.referenceType,i=n.enter("linkReference");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");const d=n.containerPhrasing(t,{before:c,after:"]",...l.current()});c+=l.move(d+"]["),a();const h=n.stack;n.stack=[],a=n.enter("reference");const m=n.safe(n.associationId(t),{before:c,after:"]",...l.current()});return a(),n.stack=h,i(),s==="full"||!d||d!==m?c+=l.move(m+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function V4e(){return"["}function vN(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function U4e(t){const e=vN(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function W4e(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function MV(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function G4e(t,e,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=t.ordered?W4e(n):vN(n);const l=t.ordered?a==="."?")":".":U4e(n);let c=e&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!t.ordered){const h=t.children?t.children[0]:void 0;if((a==="*"||a==="-")&&h&&(!h.children||!h.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),MV(n)===a&&h){let m=-1;for(;++m-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(a=Math.ceil(a/4)*4);const l=n.createTracker(r);l.move(i+" ".repeat(a-i.length)),l.shift(a);const c=n.enter("listItem"),d=n.indentLines(n.containerFlow(t,l.current()),h);return c(),d;function h(m,g,x){return g?(x?"":" ".repeat(a))+m:(x?i:i+" ".repeat(a-i.length))+m}}function K4e(t,e,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(t,r);return i(),s(),a}const Z4e=ug(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function J4e(t,e,n,r){return(t.children.some(function(a){return Z4e(a)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function eSe(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}AV.peek=tSe;function AV(t,e,n,r){const s=eSe(n),i=n.enter("strong"),a=n.createTracker(r),l=a.move(s+s);let c=a.move(n.containerPhrasing(t,{after:s,before:l,...a.current()}));const d=c.charCodeAt(0),h=gy(r.before.charCodeAt(r.before.length-1),d,s);h.inside&&(c=fp(d)+c.slice(1));const m=c.charCodeAt(c.length-1),g=gy(r.after.charCodeAt(0),m,s);g.inside&&(c=c.slice(0,-1)+fp(m));const x=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:g.outside,before:h.outside},l+c+x}function tSe(t,e,n){return n.options.strong||"*"}function nSe(t,e,n,r){return n.safe(t.value,r)}function rSe(t){const e=t.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 sSe(t,e,n){const r=(MV(n)+(n.options.ruleSpaces?" ":"")).repeat(rSe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const RV={blockquote:T4e,break:JA,code:R4e,definition:P4e,emphasis:kV,hardBreak:JA,heading:B4e,html:OV,image:jV,imageReference:NV,inlineCode:CV,link:EV,linkReference:_V,list:G4e,listItem:Y4e,paragraph:K4e,root:J4e,strong:AV,text:nSe,thematicBreak:sSe};function iSe(){return{enter:{table:aSe,tableData:eR,tableHeader:eR,tableRow:lSe},exit:{codeText:cSe,table:oSe,tableData:LS,tableHeader:LS,tableRow:LS}}}function aSe(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function oSe(t){this.exit(t),this.data.inTable=void 0}function lSe(t){this.enter({type:"tableRow",children:[]},t)}function LS(t){this.exit(t)}function eR(t){this.enter({type:"tableCell",children:[]},t)}function cSe(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,uSe));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function uSe(t,e){return e==="|"?e:t}function dSe(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,s=e.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,...i.current()});return/^[\t ]/.test(d)&&(d=gp(d.charCodeAt(0))+d.slice(1)),d=d?a+" "+d:a,n.options.closeAtx&&(d+=" "+a),c(),l(),d}_V.peek=iSe;function _V(t){return t.value||""}function iSe(){return"<"}AV.peek=aSe;function AV(t,e,n,r){const s=wN(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("![");return d+=c.move(n.safe(t.alt,{before:d,after:"]",...c.current()})),d+=c.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(t.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(l=n.enter("destinationRaw"),d+=c.move(n.safe(t.url,{before:d,after:t.title?" ":")",...c.current()}))),l(),t.title&&(l=n.enter(`title${i}`),d+=c.move(" "+s),d+=c.move(n.safe(t.title,{before:d,after:s,...c.current()})),d+=c.move(s),l()),d+=c.move(")"),a(),d}function aSe(){return"!"}MV.peek=oSe;function MV(t,e,n,r){const s=t.referenceType,i=n.enter("imageReference");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");const d=n.safe(t.alt,{before:c,after:"]",...l.current()});c+=l.move(d+"]["),a();const h=n.stack;n.stack=[],a=n.enter("reference");const m=n.safe(n.associationId(t),{before:c,after:"]",...l.current()});return a(),n.stack=h,i(),s==="full"||!d||d!==m?c+=l.move(m+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function oSe(){return"!"}RV.peek=lSe;function RV(t,e,n){let r=t.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\u007F]/.test(t.url))}PV.peek=cSe;function PV(t,e,n,r){const s=wN(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let l,c;if(DV(t,n)){const h=n.stack;n.stack=[],l=n.enter("autolink");let m=a.move("<");return m+=a.move(n.containerPhrasing(t,{before:m,after:">",...a.current()})),m+=a.move(">"),l(),n.stack=h,m}l=n.enter("link"),c=n.enter("label");let d=a.move("[");return d+=a.move(n.containerPhrasing(t,{before:d,after:"](",...a.current()})),d+=a.move("]("),c(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(c=n.enter("destinationLiteral"),d+=a.move("<"),d+=a.move(n.safe(t.url,{before:d,after:">",...a.current()})),d+=a.move(">")):(c=n.enter("destinationRaw"),d+=a.move(n.safe(t.url,{before:d,after:t.title?" ":")",...a.current()}))),c(),t.title&&(c=n.enter(`title${i}`),d+=a.move(" "+s),d+=a.move(n.safe(t.title,{before:d,after:s,...a.current()})),d+=a.move(s),c()),d+=a.move(")"),l(),d}function cSe(t,e,n){return DV(t,n)?"<":"["}zV.peek=uSe;function zV(t,e,n,r){const s=t.referenceType,i=n.enter("linkReference");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");const d=n.containerPhrasing(t,{before:c,after:"]",...l.current()});c+=l.move(d+"]["),a();const h=n.stack;n.stack=[],a=n.enter("reference");const m=n.safe(n.associationId(t),{before:c,after:"]",...l.current()});return a(),n.stack=h,i(),s==="full"||!d||d!==m?c+=l.move(m+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function uSe(){return"["}function SN(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function dSe(t){const e=SN(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function hSe(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function IV(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function fSe(t,e,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=t.ordered?hSe(n):SN(n);const l=t.ordered?a==="."?")":".":dSe(n);let c=e&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!t.ordered){const h=t.children?t.children[0]:void 0;if((a==="*"||a==="-")&&h&&(!h.children||!h.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),IV(n)===a&&h){let m=-1;for(;++m-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(a=Math.ceil(a/4)*4);const l=n.createTracker(r);l.move(i+" ".repeat(a-i.length)),l.shift(a);const c=n.enter("listItem"),d=n.indentLines(n.containerFlow(t,l.current()),h);return c(),d;function h(m,g,x){return g?(x?"":" ".repeat(a))+m:(x?i:i+" ".repeat(a-i.length))+m}}function gSe(t,e,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(t,r);return i(),s(),a}const xSe=hg(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function vSe(t,e,n,r){return(t.children.some(function(a){return xSe(a)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function ySe(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}LV.peek=bSe;function LV(t,e,n,r){const s=ySe(n),i=n.enter("strong"),a=n.createTracker(r),l=a.move(s+s);let c=a.move(n.containerPhrasing(t,{after:s,before:l,...a.current()}));const d=c.charCodeAt(0),h=wy(r.before.charCodeAt(r.before.length-1),d,s);h.inside&&(c=gp(d)+c.slice(1));const m=c.charCodeAt(c.length-1),g=wy(r.after.charCodeAt(0),m,s);g.inside&&(c=c.slice(0,-1)+gp(m));const x=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:g.outside,before:h.outside},l+c+x}function bSe(t,e,n){return n.options.strong||"*"}function wSe(t,e,n,r){return n.safe(t.value,r)}function SSe(t){const e=t.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 kSe(t,e,n){const r=(IV(n)+(n.options.ruleSpaces?" ":"")).repeat(SSe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const BV={blockquote:W4e,break:iR,code:Z4e,definition:eSe,emphasis:EV,hardBreak:iR,heading:sSe,html:_V,image:AV,imageReference:MV,inlineCode:RV,link:PV,linkReference:zV,list:fSe,listItem:pSe,paragraph:gSe,root:vSe,strong:LV,text:wSe,thematicBreak:kSe};function OSe(){return{enter:{table:jSe,tableData:aR,tableHeader:aR,tableRow:CSe},exit:{codeText:TSe,table:NSe,tableData:QS,tableHeader:QS,tableRow:QS}}}function jSe(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function NSe(t){this.exit(t),this.data.inTable=void 0}function CSe(t){this.enter({type:"tableRow",children:[]},t)}function QS(t){this.exit(t)}function aR(t){this.enter({type:"tableCell",children:[]},t)}function TSe(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,ESe));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function ESe(t,e){return e==="|"?e:t}function _Se(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,s=e.stringLength,i=n?" ":"|";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:g,table:a,tableCell:c,tableRow:l}};function a(x,y,w,S){return d(h(x,w,S),x.align)}function l(x,y,w,S){const k=m(x,w,S),j=d([k]);return j.slice(0,j.indexOf(` -`))}function c(x,y,w,S){const k=w.enter("tableCell"),j=w.enter("phrasing"),N=w.containerPhrasing(x,{...S,before:i,after:i});return j(),k(),N}function d(x,y){return N4e(x,{align:y,alignDelimiters:r,padding:n,stringLength:s})}function h(x,y,w){const S=x.children;let k=-1;const j=[],N=y.enter("table");for(;++k0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const ESe={tokenize:ISe,partial:!0};function _Se(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:DSe,continuation:{tokenize:PSe},exit:zSe}},text:{91:{name:"gfmFootnoteCall",tokenize:RSe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:MSe,resolveTo:ASe}}}}function MSe(t,e,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const c=r.events[s][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!a||!a._balanced)return n(c);const d=Ga(r.sliceSerialize({start:a.end,end:r.now()}));return d.codePointAt(0)!==94||!i.includes(d.slice(1))?n(c):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(c),t.exit("gfmFootnoteCallLabelMarker"),e(c))}}function ASe(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},l=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",s,e],["exit",s,e],["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...l),t}function RSe(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return l;function l(m){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(m),t.exit("gfmFootnoteCallLabelMarker"),c}function c(m){return m!==94?n(m):(t.enter("gfmFootnoteCallMarker"),t.consume(m),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",d)}function d(m){if(i>999||m===93&&!a||m===null||m===91||or(m))return n(m);if(m===93){t.exit("chunkString");const g=t.exit("gfmFootnoteCallString");return s.includes(Ga(r.sliceSerialize(g)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(m),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(m)}return or(m)||(a=!0),i++,t.consume(m),m===92?h:d}function h(m){return m===91||m===92||m===93?(t.consume(m),i++,d):d(m)}}function DSe(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,l;return c;function c(y){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(y){return y===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",h):n(y)}function h(y){if(a>999||y===93&&!l||y===null||y===91||or(y))return n(y);if(y===93){t.exit("chunkString");const w=t.exit("gfmFootnoteDefinitionLabelString");return i=Ga(r.sliceSerialize(w)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),g}return or(y)||(l=!0),a++,t.consume(y),y===92?m:h}function m(y){return y===91||y===92||y===93?(t.consume(y),a++,h):h(y)}function g(y){return y===58?(t.enter("definitionMarker"),t.consume(y),t.exit("definitionMarker"),s.includes(i)||s.push(i),on(t,x,"gfmFootnoteDefinitionWhitespace")):n(y)}function x(y){return e(y)}}function PSe(t,e,n){return t.check(cg,e,t.attempt(ESe,e,n))}function zSe(t){t.exit("gfmFootnoteDefinition")}function ISe(t,e,n){const r=this;return on(t,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(i):n(i)}}function LSe(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,l){let c=-1;for(;++c1?c(y):(a.consume(y),m++,x);if(m<2&&!n)return c(y);const S=a.exit("strikethroughSequenceTemporary"),k=uf(y);return S._open=!k||k===2&&!!w,S._close=!w||w===2&&!!k,l(y)}}}class BSe{constructor(){this.map=[]}add(e,n,r){FSe(this,e,n,r)}consume(e){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][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 FSe(t,e,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s-1;){const z=r.events[H][1].type;if(z==="lineEnding"||z==="linePrefix")H--;else break}const U=H>-1?r.events[H][1].type:null,ee=U==="tableHead"||U==="tableRow"?_:c;return ee===_&&r.parser.lazy[r.now().line]?n(L):ee(L)}function c(L){return t.enter("tableHead"),t.enter("tableRow"),d(L)}function d(L){return L===124||(a=!0,i+=1),h(L)}function h(L){return L===null?n(L):bt(L)?i>1?(i=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(L),t.exit("lineEnding"),x):n(L):dn(L)?on(t,h,"whitespace")(L):(i+=1,a&&(a=!1,s+=1),L===124?(t.enter("tableCellDivider"),t.consume(L),t.exit("tableCellDivider"),a=!0,h):(t.enter("data"),m(L)))}function m(L){return L===null||L===124||or(L)?(t.exit("data"),h(L)):(t.consume(L),L===92?g:m)}function g(L){return L===92||L===124?(t.consume(L),m):m(L)}function x(L){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(L):(t.enter("tableDelimiterRow"),a=!1,dn(L)?on(t,y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):y(L))}function y(L){return L===45||L===58?S(L):L===124?(a=!0,t.enter("tableCellDivider"),t.consume(L),t.exit("tableCellDivider"),w):E(L)}function w(L){return dn(L)?on(t,S,"whitespace")(L):S(L)}function S(L){return L===58?(i+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(L),t.exit("tableDelimiterMarker"),k):L===45?(i+=1,k(L)):L===null||bt(L)?T(L):E(L)}function k(L){return L===45?(t.enter("tableDelimiterFiller"),j(L)):E(L)}function j(L){return L===45?(t.consume(L),j):L===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(L),t.exit("tableDelimiterMarker"),N):(t.exit("tableDelimiterFiller"),N(L))}function N(L){return dn(L)?on(t,T,"whitespace")(L):T(L)}function T(L){return L===124?y(L):L===null||bt(L)?!a||s!==i?E(L):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(L)):E(L)}function E(L){return n(L)}function _(L){return t.enter("tableRow"),M(L)}function M(L){return L===124?(t.enter("tableCellDivider"),t.consume(L),t.exit("tableCellDivider"),M):L===null||bt(L)?(t.exit("tableRow"),e(L)):dn(L)?on(t,M,"whitespace")(L):(t.enter("data"),I(L))}function I(L){return L===null||L===124||or(L)?(t.exit("data"),M(L)):(t.consume(L),L===92?P:I)}function P(L){return L===92||L===124?(t.consume(L),I):I(L)}}function QSe(t,e){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],l=!1,c=0,d,h,m;const g=new BSe;for(;++nn[2]+1){const y=n[2]+1,w=n[3]-n[2]-1;t.add(y,w,[])}}t.add(n[3]+1,0,[["exit",m,e]])}return s!==void 0&&(i.end=Object.assign({},kh(e.events,s)),t.add(s,0,[["exit",i,e]]),i=void 0),i}function nR(t,e,n,r,s){const i=[],a=kh(e.events,n);s&&(s.end=Object.assign({},a),i.push(["exit",s,e])),r.end=Object.assign({},a),i.push(["exit",r,e]),t.add(n+1,0,i)}function kh(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const VSe={name:"tasklistCheck",tokenize:WSe};function USe(){return{text:{91:VSe}}}function WSe(t,e,n){const r=this;return s;function s(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(c),t.exit("taskListCheckMarker"),i)}function i(c){return or(c)?(t.enter("taskListCheckValueUnchecked"),t.consume(c),t.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(t.enter("taskListCheckValueChecked"),t.consume(c),t.exit("taskListCheckValueChecked"),a):n(c)}function a(c){return c===93?(t.enter("taskListCheckMarker"),t.consume(c),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),l):n(c)}function l(c){return bt(c)?e(c):dn(c)?t.check({tokenize:GSe},e,n)(c):n(c)}}function GSe(t,e,n){return on(t,r,"whitespace");function r(s){return s===null?n(s):e(s)}}function XSe(t){return KQ([bSe(),_Se(),LSe(t),$Se(),USe()])}const YSe={};function KSe(t){const e=this,n=t||YSe,r=e.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(XSe(n)),i.push(gSe()),a.push(xSe(n))}function ZSe(){return{enter:{mathFlow:t,mathFlowFenceMeta:e,mathText:i},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:l,mathText:a,mathTextData:l}};function t(c){const d={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[d]}},c)}function e(){this.buffer()}function n(){const c=this.resume(),d=this.stack[this.stack.length-1];d.type,d.meta=c}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(c){const d=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),h=this.stack[this.stack.length-1];h.type,this.exit(c),h.value=d;const m=h.data.hChildren[0];m.type,m.tagName,m.children.push({type:"text",value:d}),this.data.mathFlowInside=void 0}function i(c){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},c),this.buffer()}function a(c){const d=this.resume(),h=this.stack[this.stack.length-1];h.type,this.exit(c),h.value=d,h.data.hChildren.push({type:"text",value:d})}function l(c){this.config.enter.data.call(this,c),this.config.exit.data.call(this,c)}}function JSe(t){let e=(t||{}).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:n,inlineMath:r}};function n(i,a,l,c){const d=i.value||"",h=l.createTracker(c),m="$".repeat(Math.max(SV(d,"$")+1,2)),g=l.enter("mathFlow");let x=h.move(m);if(i.meta){const y=l.enter("mathFlowMeta");x+=h.move(l.safe(i.meta,{after:` +`))}function c(x,y,w,S){const k=w.enter("tableCell"),j=w.enter("phrasing"),N=w.containerPhrasing(x,{...S,before:i,after:i});return j(),k(),N}function d(x,y){return V4e(x,{align:y,alignDelimiters:r,padding:n,stringLength:s})}function h(x,y,w){const S=x.children;let k=-1;const j=[],N=y.enter("table");for(;++k0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const GSe={tokenize:n5e,partial:!0};function XSe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:JSe,continuation:{tokenize:e5e},exit:t5e}},text:{91:{name:"gfmFootnoteCall",tokenize:ZSe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:YSe,resolveTo:KSe}}}}function YSe(t,e,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const c=r.events[s][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!a||!a._balanced)return n(c);const d=Ga(r.sliceSerialize({start:a.end,end:r.now()}));return d.codePointAt(0)!==94||!i.includes(d.slice(1))?n(c):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(c),t.exit("gfmFootnoteCallLabelMarker"),e(c))}}function KSe(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},l=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",s,e],["exit",s,e],["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...l),t}function ZSe(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return l;function l(m){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(m),t.exit("gfmFootnoteCallLabelMarker"),c}function c(m){return m!==94?n(m):(t.enter("gfmFootnoteCallMarker"),t.consume(m),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",d)}function d(m){if(i>999||m===93&&!a||m===null||m===91||or(m))return n(m);if(m===93){t.exit("chunkString");const g=t.exit("gfmFootnoteCallString");return s.includes(Ga(r.sliceSerialize(g)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(m),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(m)}return or(m)||(a=!0),i++,t.consume(m),m===92?h:d}function h(m){return m===91||m===92||m===93?(t.consume(m),i++,d):d(m)}}function JSe(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,l;return c;function c(y){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(y){return y===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",h):n(y)}function h(y){if(a>999||y===93&&!l||y===null||y===91||or(y))return n(y);if(y===93){t.exit("chunkString");const w=t.exit("gfmFootnoteDefinitionLabelString");return i=Ga(r.sliceSerialize(w)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),g}return or(y)||(l=!0),a++,t.consume(y),y===92?m:h}function m(y){return y===91||y===92||y===93?(t.consume(y),a++,h):h(y)}function g(y){return y===58?(t.enter("definitionMarker"),t.consume(y),t.exit("definitionMarker"),s.includes(i)||s.push(i),on(t,x,"gfmFootnoteDefinitionWhitespace")):n(y)}function x(y){return e(y)}}function e5e(t,e,n){return t.check(dg,e,t.attempt(GSe,e,n))}function t5e(t){t.exit("gfmFootnoteDefinition")}function n5e(t,e,n){const r=this;return on(t,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(i):n(i)}}function r5e(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,l){let c=-1;for(;++c1?c(y):(a.consume(y),m++,x);if(m<2&&!n)return c(y);const S=a.exit("strikethroughSequenceTemporary"),k=hf(y);return S._open=!k||k===2&&!!w,S._close=!w||w===2&&!!k,l(y)}}}class s5e{constructor(){this.map=[]}add(e,n,r){i5e(this,e,n,r)}consume(e){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][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 i5e(t,e,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s-1;){const z=r.events[$][1].type;if(z==="lineEnding"||z==="linePrefix")$--;else break}const U=$>-1?r.events[$][1].type:null,te=U==="tableHead"||U==="tableRow"?_:c;return te===_&&r.parser.lazy[r.now().line]?n(B):te(B)}function c(B){return t.enter("tableHead"),t.enter("tableRow"),d(B)}function d(B){return B===124||(a=!0,i+=1),h(B)}function h(B){return B===null?n(B):bt(B)?i>1?(i=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(B),t.exit("lineEnding"),x):n(B):dn(B)?on(t,h,"whitespace")(B):(i+=1,a&&(a=!1,s+=1),B===124?(t.enter("tableCellDivider"),t.consume(B),t.exit("tableCellDivider"),a=!0,h):(t.enter("data"),m(B)))}function m(B){return B===null||B===124||or(B)?(t.exit("data"),h(B)):(t.consume(B),B===92?g:m)}function g(B){return B===92||B===124?(t.consume(B),m):m(B)}function x(B){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(B):(t.enter("tableDelimiterRow"),a=!1,dn(B)?on(t,y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):y(B))}function y(B){return B===45||B===58?S(B):B===124?(a=!0,t.enter("tableCellDivider"),t.consume(B),t.exit("tableCellDivider"),w):E(B)}function w(B){return dn(B)?on(t,S,"whitespace")(B):S(B)}function S(B){return B===58?(i+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(B),t.exit("tableDelimiterMarker"),k):B===45?(i+=1,k(B)):B===null||bt(B)?T(B):E(B)}function k(B){return B===45?(t.enter("tableDelimiterFiller"),j(B)):E(B)}function j(B){return B===45?(t.consume(B),j):B===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(B),t.exit("tableDelimiterMarker"),N):(t.exit("tableDelimiterFiller"),N(B))}function N(B){return dn(B)?on(t,T,"whitespace")(B):T(B)}function T(B){return B===124?y(B):B===null||bt(B)?!a||s!==i?E(B):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(B)):E(B)}function E(B){return n(B)}function _(B){return t.enter("tableRow"),A(B)}function A(B){return B===124?(t.enter("tableCellDivider"),t.consume(B),t.exit("tableCellDivider"),A):B===null||bt(B)?(t.exit("tableRow"),e(B)):dn(B)?on(t,A,"whitespace")(B):(t.enter("data"),L(B))}function L(B){return B===null||B===124||or(B)?(t.exit("data"),A(B)):(t.consume(B),B===92?P:L)}function P(B){return B===92||B===124?(t.consume(B),L):L(B)}}function c5e(t,e){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],l=!1,c=0,d,h,m;const g=new s5e;for(;++nn[2]+1){const y=n[2]+1,w=n[3]-n[2]-1;t.add(y,w,[])}}t.add(n[3]+1,0,[["exit",m,e]])}return s!==void 0&&(i.end=Object.assign({},kh(e.events,s)),t.add(s,0,[["exit",i,e]]),i=void 0),i}function lR(t,e,n,r,s){const i=[],a=kh(e.events,n);s&&(s.end=Object.assign({},a),i.push(["exit",s,e])),r.end=Object.assign({},a),i.push(["exit",r,e]),t.add(n+1,0,i)}function kh(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const u5e={name:"tasklistCheck",tokenize:h5e};function d5e(){return{text:{91:u5e}}}function h5e(t,e,n){const r=this;return s;function s(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(c),t.exit("taskListCheckMarker"),i)}function i(c){return or(c)?(t.enter("taskListCheckValueUnchecked"),t.consume(c),t.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(t.enter("taskListCheckValueChecked"),t.consume(c),t.exit("taskListCheckValueChecked"),a):n(c)}function a(c){return c===93?(t.enter("taskListCheckMarker"),t.consume(c),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),l):n(c)}function l(c){return bt(c)?e(c):dn(c)?t.check({tokenize:f5e},e,n)(c):n(c)}}function f5e(t,e,n){return on(t,r,"whitespace");function r(s){return s===null?n(s):e(s)}}function m5e(t){return rV([BSe(),XSe(),r5e(t),o5e(),d5e()])}const p5e={};function g5e(t){const e=this,n=t||p5e,r=e.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(m5e(n)),i.push(PSe()),a.push(zSe(n))}function x5e(){return{enter:{mathFlow:t,mathFlowFenceMeta:e,mathText:i},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:l,mathText:a,mathTextData:l}};function t(c){const d={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[d]}},c)}function e(){this.buffer()}function n(){const c=this.resume(),d=this.stack[this.stack.length-1];d.type,d.meta=c}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(c){const d=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),h=this.stack[this.stack.length-1];h.type,this.exit(c),h.value=d;const m=h.data.hChildren[0];m.type,m.tagName,m.children.push({type:"text",value:d}),this.data.mathFlowInside=void 0}function i(c){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},c),this.buffer()}function a(c){const d=this.resume(),h=this.stack[this.stack.length-1];h.type,this.exit(c),h.value=d,h.data.hChildren.push({type:"text",value:d})}function l(c){this.config.enter.data.call(this,c),this.config.exit.data.call(this,c)}}function v5e(t){let e=(t||{}).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:n,inlineMath:r}};function n(i,a,l,c){const d=i.value||"",h=l.createTracker(c),m="$".repeat(Math.max(TV(d,"$")+1,2)),g=l.enter("mathFlow");let x=h.move(m);if(i.meta){const y=l.enter("mathFlowMeta");x+=h.move(l.safe(i.meta,{after:` `,before:x,encode:["$"],...h.current()})),y()}return x+=h.move(` `),d&&(x+=h.move(d+` -`)),x+=h.move(m),g(),x}function r(i,a,l){let c=i.value||"",d=1;for(e||d++;new RegExp("(^|[^$])"+"\\$".repeat(d)+"([^$]|$)").test(c);)d++;const h="$".repeat(d);/[^ \r\n]/.test(c)&&(/^[ \r\n]/.test(c)&&/[ \r\n]$/.test(c)||/^\$|\$$/.test(c))&&(c=" "+c+" ");let m=-1;for(;++m15?d="…"+l.slice(s-15,s):d=l.slice(0,s);var h;i+15":">","<":"<",'"':""","'":"'"},d5e=/[&><"']/g;function h5e(t){return String(t).replace(d5e,e=>u5e[e])}var $V=function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},f5e=function(e){var n=$V(e);return n.type==="mathord"||n.type==="textord"||n.type==="atom"},m5e=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},p5e=function(e){var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},$n={deflt:o5e,escape:h5e,hyphenate:c5e,getBaseElem:$V,isCharacterBox:f5e,protocolFromUrl:p5e},wv={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 "},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 ",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:t=>"#"+t},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),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:t=>Math.max(0,t),cli:"--min-rule-thickness ",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:t=>Math.max(0,t),cli:"-s, --max-size ",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:t=>Math.max(0,t),cli:"-e, --max-expand ",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function g5e(t){if(t.default)return t.default;var e=t.type,n=Array.isArray(e)?e[0]:e;if(typeof n!="string")return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class bN{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 n in wv)if(wv.hasOwnProperty(n)){var r=wv[n];this[n]=e[n]!==void 0?r.processor?r.processor(e[n]):e[n]:g5e(r)}}reportNonstrict(e,n,r){var s=this.strict;if(typeof s=="function"&&(s=s(e,n,r)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new $e("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+e+"]"),r);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+n+" ["+e+"]"))}}useStrictBehavior(e,n,r){var s=this.strict;if(typeof s=="function")try{s=s(e,n,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': "+(n+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+n+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var n=$n.protocolFromUrl(e.url);if(n==null)return!1;e.protocol=n}var r=typeof this.trust=="function"?this.trust(e):this.trust;return!!r}}class Nc{constructor(e,n,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=n,this.cramped=r}sup(){return bo[x5e[this.id]]}sub(){return bo[v5e[this.id]]}fracNum(){return bo[y5e[this.id]]}fracDen(){return bo[b5e[this.id]]}cramp(){return bo[w5e[this.id]]}text(){return bo[S5e[this.id]]}isTight(){return this.size>=2}}var wN=0,xy=1,$h=2,Il=3,mp=4,Sa=5,df=6,ei=7,bo=[new Nc(wN,0,!1),new Nc(xy,0,!0),new Nc($h,1,!1),new Nc(Il,1,!0),new Nc(mp,2,!1),new Nc(Sa,2,!0),new Nc(df,3,!1),new Nc(ei,3,!0)],x5e=[mp,Sa,mp,Sa,df,ei,df,ei],v5e=[Sa,Sa,Sa,Sa,ei,ei,ei,ei],y5e=[$h,Il,mp,Sa,df,ei,df,ei],b5e=[Il,Il,Sa,Sa,ei,ei,ei,ei],w5e=[xy,xy,Il,Il,Sa,Sa,ei,ei],S5e=[wN,xy,$h,Il,$h,Il,$h,Il],Et={DISPLAY:bo[wN],TEXT:bo[$h],SCRIPT:bo[mp],SCRIPTSCRIPT:bo[df]},AO=[{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 k5e(t){for(var e=0;e=s[0]&&t<=s[1])return n.name}return null}var Sv=[];AO.forEach(t=>t.blocks.forEach(e=>Sv.push(...e)));function HV(t){for(var e=0;e=Sv[e]&&t<=Sv[e+1])return!0;return!1}var ch=80,O5e=function(e,n){return"M95,"+(622+e+n)+` +`)),x+=h.move(m),g(),x}function r(i,a,l){let c=i.value||"",d=1;for(e||d++;new RegExp("(^|[^$])"+"\\$".repeat(d)+"([^$]|$)").test(c);)d++;const h="$".repeat(d);/[^ \r\n]/.test(c)&&(/^[ \r\n]/.test(c)&&/[ \r\n]$/.test(c)||/^\$|\$$/.test(c))&&(c=" "+c+" ");let m=-1;for(;++m15?d="…"+l.slice(s-15,s):d=l.slice(0,s);var h;i+15":">","<":"<",'"':""","'":"'"},_5e=/[&><"']/g;function A5e(t){return String(t).replace(_5e,e=>E5e[e])}var GV=function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},M5e=function(e){var n=GV(e);return n.type==="mathord"||n.type==="textord"||n.type==="atom"},R5e=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},D5e=function(e){var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},$n={deflt:N5e,escape:A5e,hyphenate:T5e,getBaseElem:GV,isCharacterBox:M5e,protocolFromUrl:D5e},kv={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 "},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 ",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:t=>"#"+t},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),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:t=>Math.max(0,t),cli:"--min-rule-thickness ",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:t=>Math.max(0,t),cli:"-s, --max-size ",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:t=>Math.max(0,t),cli:"-e, --max-expand ",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function P5e(t){if(t.default)return t.default;var e=t.type,n=Array.isArray(e)?e[0]:e;if(typeof n!="string")return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class ON{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 n in kv)if(kv.hasOwnProperty(n)){var r=kv[n];this[n]=e[n]!==void 0?r.processor?r.processor(e[n]):e[n]:P5e(r)}}reportNonstrict(e,n,r){var s=this.strict;if(typeof s=="function"&&(s=s(e,n,r)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new $e("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+e+"]"),r);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+n+" ["+e+"]"))}}useStrictBehavior(e,n,r){var s=this.strict;if(typeof s=="function")try{s=s(e,n,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': "+(n+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+n+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var n=$n.protocolFromUrl(e.url);if(n==null)return!1;e.protocol=n}var r=typeof this.trust=="function"?this.trust(e):this.trust;return!!r}}class Cc{constructor(e,n,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=n,this.cramped=r}sup(){return bo[z5e[this.id]]}sub(){return bo[I5e[this.id]]}fracNum(){return bo[L5e[this.id]]}fracDen(){return bo[B5e[this.id]]}cramp(){return bo[F5e[this.id]]}text(){return bo[q5e[this.id]]}isTight(){return this.size>=2}}var jN=0,Sy=1,$h=2,Ll=3,xp=4,Sa=5,ff=6,ti=7,bo=[new Cc(jN,0,!1),new Cc(Sy,0,!0),new Cc($h,1,!1),new Cc(Ll,1,!0),new Cc(xp,2,!1),new Cc(Sa,2,!0),new Cc(ff,3,!1),new Cc(ti,3,!0)],z5e=[xp,Sa,xp,Sa,ff,ti,ff,ti],I5e=[Sa,Sa,Sa,Sa,ti,ti,ti,ti],L5e=[$h,Ll,xp,Sa,ff,ti,ff,ti],B5e=[Ll,Ll,Sa,Sa,ti,ti,ti,ti],F5e=[Sy,Sy,Ll,Ll,Sa,Sa,ti,ti],q5e=[jN,Sy,$h,Ll,$h,Ll,$h,Ll],Et={DISPLAY:bo[jN],TEXT:bo[$h],SCRIPT:bo[xp],SCRIPTSCRIPT:bo[ff]},LO=[{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 $5e(t){for(var e=0;e=s[0]&&t<=s[1])return n.name}return null}var Ov=[];LO.forEach(t=>t.blocks.forEach(e=>Ov.push(...e)));function XV(t){for(var e=0;e=Ov[e]&&t<=Ov[e+1])return!0;return!1}var ch=80,H5e=function(e,n){return"M95,"+(622+e+n)+` 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 @@ -134,7 +134,7 @@ 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)+" "+n+"h400000v"+(40+e)+"h-400000z"},j5e=function(e,n){return"M263,"+(601+e+n)+`c0.7,0,18,39.7,52,119 +M`+(834+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},Q5e=function(e,n){return"M263,"+(601+e+n)+`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+` @@ -144,7 +144,7 @@ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5, 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)+" "+n+"h400000v"+(40+e)+"h-400000z"},N5e=function(e,n){return"M983 "+(10+e+n)+` +M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},V5e=function(e,n){return"M983 "+(10+e+n)+` 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 @@ -153,7 +153,7 @@ 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)+" "+n+"h400000v"+(40+e)+"h-400000z"},C5e=function(e,n){return"M424,"+(2398+e+n)+` +M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},U5e=function(e,n){return"M424,"+(2398+e+n)+` 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 @@ -163,18 +163,18 @@ 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)+" "+n+` -h400000v`+(40+e)+"h-400000z"},T5e=function(e,n){return"M473,"+(2713+e+n)+` +h400000v`+(40+e)+"h-400000z"},W5e=function(e,n){return"M473,"+(2713+e+n)+` 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)+" "+n+"h400000v"+(40+e)+"H1017.7z"},E5e=function(e){var n=e/2;return"M400000 "+e+" H0 L"+n+" 0 l65 45 L145 "+(e-80)+" H400000z"},_5e=function(e,n,r){var s=r-54-n-e;return"M702 "+(e+n)+"H400000"+(40+e)+` +606zM`+(1001+e)+" "+n+"h400000v"+(40+e)+"H1017.7z"},G5e=function(e){var n=e/2;return"M400000 "+e+" H0 L"+n+" 0 l65 45 L145 "+(e-80)+" H400000z"},X5e=function(e,n,r){var s=r-54-n-e;return"M702 "+(e+n)+"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 `+n+"H400000v"+(40+e)+"H742z"},M5e=function(e,n,r){n=1e3*n;var s="";switch(e){case"sqrtMain":s=O5e(n,ch);break;case"sqrtSize1":s=j5e(n,ch);break;case"sqrtSize2":s=N5e(n,ch);break;case"sqrtSize3":s=C5e(n,ch);break;case"sqrtSize4":s=T5e(n,ch);break;case"sqrtTall":s=_5e(n,ch,r)}return s},A5e=function(e,n){switch(e){case"⎜":return"M291 0 H417 V"+n+" H291z M291 0 H417 V"+n+" H291z";case"∣":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z";case"∥":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z"+("M367 0 H410 V"+n+" H367z M367 0 H410 V"+n+" H367z");case"⎟":return"M457 0 H583 V"+n+" H457z M457 0 H583 V"+n+" H457z";case"⎢":return"M319 0 H403 V"+n+" H319z M319 0 H403 V"+n+" H319z";case"⎥":return"M263 0 H347 V"+n+" H263z M263 0 H347 V"+n+" H263z";case"⎪":return"M384 0 H504 V"+n+" H384z M384 0 H504 V"+n+" H384z";case"⏐":return"M312 0 H355 V"+n+" H312z M312 0 H355 V"+n+" H312z";case"‖":return"M257 0 H300 V"+n+" H257z M257 0 H300 V"+n+" H257z"+("M478 0 H521 V"+n+" H478z M478 0 H521 V"+n+" H478z");default:return""}},sR={doubleleftarrow:`M262 157 +219 661 l218 661zM702 `+n+"H400000v"+(40+e)+"H742z"},Y5e=function(e,n,r){n=1e3*n;var s="";switch(e){case"sqrtMain":s=H5e(n,ch);break;case"sqrtSize1":s=Q5e(n,ch);break;case"sqrtSize2":s=V5e(n,ch);break;case"sqrtSize3":s=U5e(n,ch);break;case"sqrtSize4":s=W5e(n,ch);break;case"sqrtTall":s=X5e(n,ch,r)}return s},K5e=function(e,n){switch(e){case"⎜":return"M291 0 H417 V"+n+" H291z M291 0 H417 V"+n+" H291z";case"∣":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z";case"∥":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z"+("M367 0 H410 V"+n+" H367z M367 0 H410 V"+n+" H367z");case"⎟":return"M457 0 H583 V"+n+" H457z M457 0 H583 V"+n+" H457z";case"⎢":return"M319 0 H403 V"+n+" H319z M319 0 H403 V"+n+" H319z";case"⎥":return"M263 0 H347 V"+n+" H263z M263 0 H347 V"+n+" H263z";case"⎪":return"M384 0 H504 V"+n+" H384z M384 0 H504 V"+n+" H384z";case"⏐":return"M312 0 H355 V"+n+" H312z M312 0 H355 V"+n+" H312z";case"‖":return"M257 0 H300 V"+n+" H257z M257 0 H300 V"+n+" H257z"+("M478 0 H521 V"+n+" H478z M478 0 H521 V"+n+" H478z");default:return""}},uR={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 @@ -349,7 +349,7 @@ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z` 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`},R5e=function(e,n){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 h347 v-84 +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},Z5e=function(e,n){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 h347 v-84 H403z M403 1759 V0 H319 V1759 v`+n+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 @@ -377,21 +377,21 @@ 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 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,-`+(n+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 hg{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(),n=0;nn.toText();return this.children.map(e).join("")}}var _o={"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]}},E1={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]},iR={Å:"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 D5e(t,e){_o[t]=e}function SN(t,e,n){if(!_o[e])throw new Error("Font metrics not found for font: "+e+".");var r=t.charCodeAt(0),s=_o[e][r];if(!s&&t[0]in iR&&(r=iR[t[0]].charCodeAt(0),s=_o[e][r]),!s&&n==="text"&&HV(r)&&(s=_o[e][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var BS={};function P5e(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!BS[e]){var n=BS[e]={cssEmPerMu:E1.quad[e]/18};for(var r in E1)E1.hasOwnProperty(r)&&(n[r]=E1[r][e])}return BS[e]}var z5e=[[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]],aR=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],oR=function(e,n){return n.size<2?e:z5e[e-1][n.size-1]};class Cl{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||Cl.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=aR[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var n={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)&&(n[r]=e[r]);return new Cl(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:oR(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:aR[e-1]})}havingBaseStyle(e){e=e||this.style.text();var n=oR(Cl.BASESIZE,e);return this.size===n&&this.textSize===Cl.BASESIZE&&this.style===e?this:this.extend({style:e,size:n})}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!==Cl.BASESIZE?["sizing","reset-size"+this.size,"size"+Cl.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=P5e(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Cl.BASESIZE=6;var RO={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},I5e={ex:!0,em:!0,mu:!0},QV=function(e){return typeof e!="string"&&(e=e.unit),e in RO||e in I5e||e==="ex"},Rr=function(e,n){var r;if(e.unit in RO)r=RO[e.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(e.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var s;if(n.style.isTight()?s=n.havingStyle(n.style.text()):s=n,e.unit==="ex")r=s.fontMetrics().xHeight;else if(e.unit==="em")r=s.fontMetrics().quad;else throw new $e("Invalid unit: '"+e.unit+"'");s!==n&&(r*=s.sizeMultiplier/n.sizeMultiplier)}return Math.min(e.number*r,n.maxSize)},Xe=function(e){return+e.toFixed(4)+"em"},eu=function(e){return e.filter(n=>n).join(" ")},VV=function(e,n,r){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var s=n.getColor();s&&(this.style.color=s)}},UV=function(e){var n=document.createElement(e);n.className=eu(this.classes);for(var r in this.style)this.style.hasOwnProperty(r)&&(n.style[r]=this.style[r]);for(var s in this.attributes)this.attributes.hasOwnProperty(s)&&n.setAttribute(s,this.attributes[s]);for(var i=0;i/=\x00-\x1f]/,WV=function(e){var n="<"+e;this.classes.length&&(n+=' class="'+$n.escape(eu(this.classes))+'"');var r="";for(var s in this.style)this.style.hasOwnProperty(s)&&(r+=$n.hyphenate(s)+":"+this.style[s]+";");r&&(n+=' style="'+$n.escape(r)+'"');for(var i in this.attributes)if(this.attributes.hasOwnProperty(i)){if(L5e.test(i))throw new $e("Invalid attribute name '"+i+"'");n+=" "+i+'="'+$n.escape(this.attributes[i])+'"'}n+=">";for(var a=0;a",n};class fg{constructor(e,n,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,VV.call(this,e,r,s),this.children=n||[]}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return UV.call(this,"span")}toMarkup(){return WV.call(this,"span")}}class kN{constructor(e,n,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,VV.call(this,n,s),this.children=r||[],this.setAttribute("href",e)}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return UV.call(this,"a")}toMarkup(){return WV.call(this,"a")}}class B5e{constructor(e,n,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=n,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 n in this.style)this.style.hasOwnProperty(n)&&(e.style[n]=this.style[n]);return e}toMarkup(){var e=''+$n.escape(this.alt)+'0&&(n=document.createElement("span"),n.style.marginRight=Xe(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=eu(this.classes));for(var r in this.style)this.style.hasOwnProperty(r)&&(n=n||document.createElement("span"),n.style[r]=this.style[r]);return n?(n.appendChild(e),n):e}toMarkup(){var e=!1,n="0&&(r+="margin-right:"+this.italic+"em;");for(var s in this.style)this.style.hasOwnProperty(s)&&(r+=$n.hyphenate(s)+":"+this.style[s]+";");r&&(e=!0,n+=' style="'+$n.escape(r)+'"');var i=$n.escape(this.text);return e?(n+=">",n+=i,n+="",n):i}}class Hl{constructor(e,n){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=n||{}}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"svg");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);for(var s=0;s':''}}class DO{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"line");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var e=" but got "+String(t)+".")}var $5e={bin:1,close:1,inner:1,open:1,punct:1,rel:1},H5e={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},dr={math:{},text:{}};function A(t,e,n,r,s,i){dr[t][s]={font:e,group:n,replace:r},i&&r&&(dr[t][r]=dr[t][s])}var D="math",Be="text",$="main",le="ams",jr="accent-token",lt="bin",ii="close",Bf="inner",Tt="mathord",as="op-token",Ji="open",Pb="punct",ce="rel",Kl="spacing",me="textord";A(D,$,ce,"≡","\\equiv",!0);A(D,$,ce,"≺","\\prec",!0);A(D,$,ce,"≻","\\succ",!0);A(D,$,ce,"∼","\\sim",!0);A(D,$,ce,"⊥","\\perp");A(D,$,ce,"⪯","\\preceq",!0);A(D,$,ce,"⪰","\\succeq",!0);A(D,$,ce,"≃","\\simeq",!0);A(D,$,ce,"∣","\\mid",!0);A(D,$,ce,"≪","\\ll",!0);A(D,$,ce,"≫","\\gg",!0);A(D,$,ce,"≍","\\asymp",!0);A(D,$,ce,"∥","\\parallel");A(D,$,ce,"⋈","\\bowtie",!0);A(D,$,ce,"⌣","\\smile",!0);A(D,$,ce,"⊑","\\sqsubseteq",!0);A(D,$,ce,"⊒","\\sqsupseteq",!0);A(D,$,ce,"≐","\\doteq",!0);A(D,$,ce,"⌢","\\frown",!0);A(D,$,ce,"∋","\\ni",!0);A(D,$,ce,"∝","\\propto",!0);A(D,$,ce,"⊢","\\vdash",!0);A(D,$,ce,"⊣","\\dashv",!0);A(D,$,ce,"∋","\\owns");A(D,$,Pb,".","\\ldotp");A(D,$,Pb,"⋅","\\cdotp");A(D,$,me,"#","\\#");A(Be,$,me,"#","\\#");A(D,$,me,"&","\\&");A(Be,$,me,"&","\\&");A(D,$,me,"ℵ","\\aleph",!0);A(D,$,me,"∀","\\forall",!0);A(D,$,me,"ℏ","\\hbar",!0);A(D,$,me,"∃","\\exists",!0);A(D,$,me,"∇","\\nabla",!0);A(D,$,me,"♭","\\flat",!0);A(D,$,me,"ℓ","\\ell",!0);A(D,$,me,"♮","\\natural",!0);A(D,$,me,"♣","\\clubsuit",!0);A(D,$,me,"℘","\\wp",!0);A(D,$,me,"♯","\\sharp",!0);A(D,$,me,"♢","\\diamondsuit",!0);A(D,$,me,"ℜ","\\Re",!0);A(D,$,me,"♡","\\heartsuit",!0);A(D,$,me,"ℑ","\\Im",!0);A(D,$,me,"♠","\\spadesuit",!0);A(D,$,me,"§","\\S",!0);A(Be,$,me,"§","\\S");A(D,$,me,"¶","\\P",!0);A(Be,$,me,"¶","\\P");A(D,$,me,"†","\\dag");A(Be,$,me,"†","\\dag");A(Be,$,me,"†","\\textdagger");A(D,$,me,"‡","\\ddag");A(Be,$,me,"‡","\\ddag");A(Be,$,me,"‡","\\textdaggerdbl");A(D,$,ii,"⎱","\\rmoustache",!0);A(D,$,Ji,"⎰","\\lmoustache",!0);A(D,$,ii,"⟯","\\rgroup",!0);A(D,$,Ji,"⟮","\\lgroup",!0);A(D,$,lt,"∓","\\mp",!0);A(D,$,lt,"⊖","\\ominus",!0);A(D,$,lt,"⊎","\\uplus",!0);A(D,$,lt,"⊓","\\sqcap",!0);A(D,$,lt,"∗","\\ast");A(D,$,lt,"⊔","\\sqcup",!0);A(D,$,lt,"◯","\\bigcirc",!0);A(D,$,lt,"∙","\\bullet",!0);A(D,$,lt,"‡","\\ddagger");A(D,$,lt,"≀","\\wr",!0);A(D,$,lt,"⨿","\\amalg");A(D,$,lt,"&","\\And");A(D,$,ce,"⟵","\\longleftarrow",!0);A(D,$,ce,"⇐","\\Leftarrow",!0);A(D,$,ce,"⟸","\\Longleftarrow",!0);A(D,$,ce,"⟶","\\longrightarrow",!0);A(D,$,ce,"⇒","\\Rightarrow",!0);A(D,$,ce,"⟹","\\Longrightarrow",!0);A(D,$,ce,"↔","\\leftrightarrow",!0);A(D,$,ce,"⟷","\\longleftrightarrow",!0);A(D,$,ce,"⇔","\\Leftrightarrow",!0);A(D,$,ce,"⟺","\\Longleftrightarrow",!0);A(D,$,ce,"↦","\\mapsto",!0);A(D,$,ce,"⟼","\\longmapsto",!0);A(D,$,ce,"↗","\\nearrow",!0);A(D,$,ce,"↩","\\hookleftarrow",!0);A(D,$,ce,"↪","\\hookrightarrow",!0);A(D,$,ce,"↘","\\searrow",!0);A(D,$,ce,"↼","\\leftharpoonup",!0);A(D,$,ce,"⇀","\\rightharpoonup",!0);A(D,$,ce,"↙","\\swarrow",!0);A(D,$,ce,"↽","\\leftharpoondown",!0);A(D,$,ce,"⇁","\\rightharpoondown",!0);A(D,$,ce,"↖","\\nwarrow",!0);A(D,$,ce,"⇌","\\rightleftharpoons",!0);A(D,le,ce,"≮","\\nless",!0);A(D,le,ce,"","\\@nleqslant");A(D,le,ce,"","\\@nleqq");A(D,le,ce,"⪇","\\lneq",!0);A(D,le,ce,"≨","\\lneqq",!0);A(D,le,ce,"","\\@lvertneqq");A(D,le,ce,"⋦","\\lnsim",!0);A(D,le,ce,"⪉","\\lnapprox",!0);A(D,le,ce,"⊀","\\nprec",!0);A(D,le,ce,"⋠","\\npreceq",!0);A(D,le,ce,"⋨","\\precnsim",!0);A(D,le,ce,"⪹","\\precnapprox",!0);A(D,le,ce,"≁","\\nsim",!0);A(D,le,ce,"","\\@nshortmid");A(D,le,ce,"∤","\\nmid",!0);A(D,le,ce,"⊬","\\nvdash",!0);A(D,le,ce,"⊭","\\nvDash",!0);A(D,le,ce,"⋪","\\ntriangleleft");A(D,le,ce,"⋬","\\ntrianglelefteq",!0);A(D,le,ce,"⊊","\\subsetneq",!0);A(D,le,ce,"","\\@varsubsetneq");A(D,le,ce,"⫋","\\subsetneqq",!0);A(D,le,ce,"","\\@varsubsetneqq");A(D,le,ce,"≯","\\ngtr",!0);A(D,le,ce,"","\\@ngeqslant");A(D,le,ce,"","\\@ngeqq");A(D,le,ce,"⪈","\\gneq",!0);A(D,le,ce,"≩","\\gneqq",!0);A(D,le,ce,"","\\@gvertneqq");A(D,le,ce,"⋧","\\gnsim",!0);A(D,le,ce,"⪊","\\gnapprox",!0);A(D,le,ce,"⊁","\\nsucc",!0);A(D,le,ce,"⋡","\\nsucceq",!0);A(D,le,ce,"⋩","\\succnsim",!0);A(D,le,ce,"⪺","\\succnapprox",!0);A(D,le,ce,"≆","\\ncong",!0);A(D,le,ce,"","\\@nshortparallel");A(D,le,ce,"∦","\\nparallel",!0);A(D,le,ce,"⊯","\\nVDash",!0);A(D,le,ce,"⋫","\\ntriangleright");A(D,le,ce,"⋭","\\ntrianglerighteq",!0);A(D,le,ce,"","\\@nsupseteqq");A(D,le,ce,"⊋","\\supsetneq",!0);A(D,le,ce,"","\\@varsupsetneq");A(D,le,ce,"⫌","\\supsetneqq",!0);A(D,le,ce,"","\\@varsupsetneqq");A(D,le,ce,"⊮","\\nVdash",!0);A(D,le,ce,"⪵","\\precneqq",!0);A(D,le,ce,"⪶","\\succneqq",!0);A(D,le,ce,"","\\@nsubseteqq");A(D,le,lt,"⊴","\\unlhd");A(D,le,lt,"⊵","\\unrhd");A(D,le,ce,"↚","\\nleftarrow",!0);A(D,le,ce,"↛","\\nrightarrow",!0);A(D,le,ce,"⇍","\\nLeftarrow",!0);A(D,le,ce,"⇏","\\nRightarrow",!0);A(D,le,ce,"↮","\\nleftrightarrow",!0);A(D,le,ce,"⇎","\\nLeftrightarrow",!0);A(D,le,ce,"△","\\vartriangle");A(D,le,me,"ℏ","\\hslash");A(D,le,me,"▽","\\triangledown");A(D,le,me,"◊","\\lozenge");A(D,le,me,"Ⓢ","\\circledS");A(D,le,me,"®","\\circledR");A(Be,le,me,"®","\\circledR");A(D,le,me,"∡","\\measuredangle",!0);A(D,le,me,"∄","\\nexists");A(D,le,me,"℧","\\mho");A(D,le,me,"Ⅎ","\\Finv",!0);A(D,le,me,"⅁","\\Game",!0);A(D,le,me,"‵","\\backprime");A(D,le,me,"▲","\\blacktriangle");A(D,le,me,"▼","\\blacktriangledown");A(D,le,me,"■","\\blacksquare");A(D,le,me,"⧫","\\blacklozenge");A(D,le,me,"★","\\bigstar");A(D,le,me,"∢","\\sphericalangle",!0);A(D,le,me,"∁","\\complement",!0);A(D,le,me,"ð","\\eth",!0);A(Be,$,me,"ð","ð");A(D,le,me,"╱","\\diagup");A(D,le,me,"╲","\\diagdown");A(D,le,me,"□","\\square");A(D,le,me,"□","\\Box");A(D,le,me,"◊","\\Diamond");A(D,le,me,"¥","\\yen",!0);A(Be,le,me,"¥","\\yen",!0);A(D,le,me,"✓","\\checkmark",!0);A(Be,le,me,"✓","\\checkmark");A(D,le,me,"ℶ","\\beth",!0);A(D,le,me,"ℸ","\\daleth",!0);A(D,le,me,"ℷ","\\gimel",!0);A(D,le,me,"ϝ","\\digamma",!0);A(D,le,me,"ϰ","\\varkappa");A(D,le,Ji,"┌","\\@ulcorner",!0);A(D,le,ii,"┐","\\@urcorner",!0);A(D,le,Ji,"└","\\@llcorner",!0);A(D,le,ii,"┘","\\@lrcorner",!0);A(D,le,ce,"≦","\\leqq",!0);A(D,le,ce,"⩽","\\leqslant",!0);A(D,le,ce,"⪕","\\eqslantless",!0);A(D,le,ce,"≲","\\lesssim",!0);A(D,le,ce,"⪅","\\lessapprox",!0);A(D,le,ce,"≊","\\approxeq",!0);A(D,le,lt,"⋖","\\lessdot");A(D,le,ce,"⋘","\\lll",!0);A(D,le,ce,"≶","\\lessgtr",!0);A(D,le,ce,"⋚","\\lesseqgtr",!0);A(D,le,ce,"⪋","\\lesseqqgtr",!0);A(D,le,ce,"≑","\\doteqdot");A(D,le,ce,"≓","\\risingdotseq",!0);A(D,le,ce,"≒","\\fallingdotseq",!0);A(D,le,ce,"∽","\\backsim",!0);A(D,le,ce,"⋍","\\backsimeq",!0);A(D,le,ce,"⫅","\\subseteqq",!0);A(D,le,ce,"⋐","\\Subset",!0);A(D,le,ce,"⊏","\\sqsubset",!0);A(D,le,ce,"≼","\\preccurlyeq",!0);A(D,le,ce,"⋞","\\curlyeqprec",!0);A(D,le,ce,"≾","\\precsim",!0);A(D,le,ce,"⪷","\\precapprox",!0);A(D,le,ce,"⊲","\\vartriangleleft");A(D,le,ce,"⊴","\\trianglelefteq");A(D,le,ce,"⊨","\\vDash",!0);A(D,le,ce,"⊪","\\Vvdash",!0);A(D,le,ce,"⌣","\\smallsmile");A(D,le,ce,"⌢","\\smallfrown");A(D,le,ce,"≏","\\bumpeq",!0);A(D,le,ce,"≎","\\Bumpeq",!0);A(D,le,ce,"≧","\\geqq",!0);A(D,le,ce,"⩾","\\geqslant",!0);A(D,le,ce,"⪖","\\eqslantgtr",!0);A(D,le,ce,"≳","\\gtrsim",!0);A(D,le,ce,"⪆","\\gtrapprox",!0);A(D,le,lt,"⋗","\\gtrdot");A(D,le,ce,"⋙","\\ggg",!0);A(D,le,ce,"≷","\\gtrless",!0);A(D,le,ce,"⋛","\\gtreqless",!0);A(D,le,ce,"⪌","\\gtreqqless",!0);A(D,le,ce,"≖","\\eqcirc",!0);A(D,le,ce,"≗","\\circeq",!0);A(D,le,ce,"≜","\\triangleq",!0);A(D,le,ce,"∼","\\thicksim");A(D,le,ce,"≈","\\thickapprox");A(D,le,ce,"⫆","\\supseteqq",!0);A(D,le,ce,"⋑","\\Supset",!0);A(D,le,ce,"⊐","\\sqsupset",!0);A(D,le,ce,"≽","\\succcurlyeq",!0);A(D,le,ce,"⋟","\\curlyeqsucc",!0);A(D,le,ce,"≿","\\succsim",!0);A(D,le,ce,"⪸","\\succapprox",!0);A(D,le,ce,"⊳","\\vartriangleright");A(D,le,ce,"⊵","\\trianglerighteq");A(D,le,ce,"⊩","\\Vdash",!0);A(D,le,ce,"∣","\\shortmid");A(D,le,ce,"∥","\\shortparallel");A(D,le,ce,"≬","\\between",!0);A(D,le,ce,"⋔","\\pitchfork",!0);A(D,le,ce,"∝","\\varpropto");A(D,le,ce,"◀","\\blacktriangleleft");A(D,le,ce,"∴","\\therefore",!0);A(D,le,ce,"∍","\\backepsilon");A(D,le,ce,"▶","\\blacktriangleright");A(D,le,ce,"∵","\\because",!0);A(D,le,ce,"⋘","\\llless");A(D,le,ce,"⋙","\\gggtr");A(D,le,lt,"⊲","\\lhd");A(D,le,lt,"⊳","\\rhd");A(D,le,ce,"≂","\\eqsim",!0);A(D,$,ce,"⋈","\\Join");A(D,le,ce,"≑","\\Doteq",!0);A(D,le,lt,"∔","\\dotplus",!0);A(D,le,lt,"∖","\\smallsetminus");A(D,le,lt,"⋒","\\Cap",!0);A(D,le,lt,"⋓","\\Cup",!0);A(D,le,lt,"⩞","\\doublebarwedge",!0);A(D,le,lt,"⊟","\\boxminus",!0);A(D,le,lt,"⊞","\\boxplus",!0);A(D,le,lt,"⋇","\\divideontimes",!0);A(D,le,lt,"⋉","\\ltimes",!0);A(D,le,lt,"⋊","\\rtimes",!0);A(D,le,lt,"⋋","\\leftthreetimes",!0);A(D,le,lt,"⋌","\\rightthreetimes",!0);A(D,le,lt,"⋏","\\curlywedge",!0);A(D,le,lt,"⋎","\\curlyvee",!0);A(D,le,lt,"⊝","\\circleddash",!0);A(D,le,lt,"⊛","\\circledast",!0);A(D,le,lt,"⋅","\\centerdot");A(D,le,lt,"⊺","\\intercal",!0);A(D,le,lt,"⋒","\\doublecap");A(D,le,lt,"⋓","\\doublecup");A(D,le,lt,"⊠","\\boxtimes",!0);A(D,le,ce,"⇢","\\dashrightarrow",!0);A(D,le,ce,"⇠","\\dashleftarrow",!0);A(D,le,ce,"⇇","\\leftleftarrows",!0);A(D,le,ce,"⇆","\\leftrightarrows",!0);A(D,le,ce,"⇚","\\Lleftarrow",!0);A(D,le,ce,"↞","\\twoheadleftarrow",!0);A(D,le,ce,"↢","\\leftarrowtail",!0);A(D,le,ce,"↫","\\looparrowleft",!0);A(D,le,ce,"⇋","\\leftrightharpoons",!0);A(D,le,ce,"↶","\\curvearrowleft",!0);A(D,le,ce,"↺","\\circlearrowleft",!0);A(D,le,ce,"↰","\\Lsh",!0);A(D,le,ce,"⇈","\\upuparrows",!0);A(D,le,ce,"↿","\\upharpoonleft",!0);A(D,le,ce,"⇃","\\downharpoonleft",!0);A(D,$,ce,"⊶","\\origof",!0);A(D,$,ce,"⊷","\\imageof",!0);A(D,le,ce,"⊸","\\multimap",!0);A(D,le,ce,"↭","\\leftrightsquigarrow",!0);A(D,le,ce,"⇉","\\rightrightarrows",!0);A(D,le,ce,"⇄","\\rightleftarrows",!0);A(D,le,ce,"↠","\\twoheadrightarrow",!0);A(D,le,ce,"↣","\\rightarrowtail",!0);A(D,le,ce,"↬","\\looparrowright",!0);A(D,le,ce,"↷","\\curvearrowright",!0);A(D,le,ce,"↻","\\circlearrowright",!0);A(D,le,ce,"↱","\\Rsh",!0);A(D,le,ce,"⇊","\\downdownarrows",!0);A(D,le,ce,"↾","\\upharpoonright",!0);A(D,le,ce,"⇂","\\downharpoonright",!0);A(D,le,ce,"⇝","\\rightsquigarrow",!0);A(D,le,ce,"⇝","\\leadsto");A(D,le,ce,"⇛","\\Rrightarrow",!0);A(D,le,ce,"↾","\\restriction");A(D,$,me,"‘","`");A(D,$,me,"$","\\$");A(Be,$,me,"$","\\$");A(Be,$,me,"$","\\textdollar");A(D,$,me,"%","\\%");A(Be,$,me,"%","\\%");A(D,$,me,"_","\\_");A(Be,$,me,"_","\\_");A(Be,$,me,"_","\\textunderscore");A(D,$,me,"∠","\\angle",!0);A(D,$,me,"∞","\\infty",!0);A(D,$,me,"′","\\prime");A(D,$,me,"△","\\triangle");A(D,$,me,"Γ","\\Gamma",!0);A(D,$,me,"Δ","\\Delta",!0);A(D,$,me,"Θ","\\Theta",!0);A(D,$,me,"Λ","\\Lambda",!0);A(D,$,me,"Ξ","\\Xi",!0);A(D,$,me,"Π","\\Pi",!0);A(D,$,me,"Σ","\\Sigma",!0);A(D,$,me,"Υ","\\Upsilon",!0);A(D,$,me,"Φ","\\Phi",!0);A(D,$,me,"Ψ","\\Psi",!0);A(D,$,me,"Ω","\\Omega",!0);A(D,$,me,"A","Α");A(D,$,me,"B","Β");A(D,$,me,"E","Ε");A(D,$,me,"Z","Ζ");A(D,$,me,"H","Η");A(D,$,me,"I","Ι");A(D,$,me,"K","Κ");A(D,$,me,"M","Μ");A(D,$,me,"N","Ν");A(D,$,me,"O","Ο");A(D,$,me,"P","Ρ");A(D,$,me,"T","Τ");A(D,$,me,"X","Χ");A(D,$,me,"¬","\\neg",!0);A(D,$,me,"¬","\\lnot");A(D,$,me,"⊤","\\top");A(D,$,me,"⊥","\\bot");A(D,$,me,"∅","\\emptyset");A(D,le,me,"∅","\\varnothing");A(D,$,Tt,"α","\\alpha",!0);A(D,$,Tt,"β","\\beta",!0);A(D,$,Tt,"γ","\\gamma",!0);A(D,$,Tt,"δ","\\delta",!0);A(D,$,Tt,"ϵ","\\epsilon",!0);A(D,$,Tt,"ζ","\\zeta",!0);A(D,$,Tt,"η","\\eta",!0);A(D,$,Tt,"θ","\\theta",!0);A(D,$,Tt,"ι","\\iota",!0);A(D,$,Tt,"κ","\\kappa",!0);A(D,$,Tt,"λ","\\lambda",!0);A(D,$,Tt,"μ","\\mu",!0);A(D,$,Tt,"ν","\\nu",!0);A(D,$,Tt,"ξ","\\xi",!0);A(D,$,Tt,"ο","\\omicron",!0);A(D,$,Tt,"π","\\pi",!0);A(D,$,Tt,"ρ","\\rho",!0);A(D,$,Tt,"σ","\\sigma",!0);A(D,$,Tt,"τ","\\tau",!0);A(D,$,Tt,"υ","\\upsilon",!0);A(D,$,Tt,"ϕ","\\phi",!0);A(D,$,Tt,"χ","\\chi",!0);A(D,$,Tt,"ψ","\\psi",!0);A(D,$,Tt,"ω","\\omega",!0);A(D,$,Tt,"ε","\\varepsilon",!0);A(D,$,Tt,"ϑ","\\vartheta",!0);A(D,$,Tt,"ϖ","\\varpi",!0);A(D,$,Tt,"ϱ","\\varrho",!0);A(D,$,Tt,"ς","\\varsigma",!0);A(D,$,Tt,"φ","\\varphi",!0);A(D,$,lt,"∗","*",!0);A(D,$,lt,"+","+");A(D,$,lt,"−","-",!0);A(D,$,lt,"⋅","\\cdot",!0);A(D,$,lt,"∘","\\circ",!0);A(D,$,lt,"÷","\\div",!0);A(D,$,lt,"±","\\pm",!0);A(D,$,lt,"×","\\times",!0);A(D,$,lt,"∩","\\cap",!0);A(D,$,lt,"∪","\\cup",!0);A(D,$,lt,"∖","\\setminus",!0);A(D,$,lt,"∧","\\land");A(D,$,lt,"∨","\\lor");A(D,$,lt,"∧","\\wedge",!0);A(D,$,lt,"∨","\\vee",!0);A(D,$,me,"√","\\surd");A(D,$,Ji,"⟨","\\langle",!0);A(D,$,Ji,"∣","\\lvert");A(D,$,Ji,"∥","\\lVert");A(D,$,ii,"?","?");A(D,$,ii,"!","!");A(D,$,ii,"⟩","\\rangle",!0);A(D,$,ii,"∣","\\rvert");A(D,$,ii,"∥","\\rVert");A(D,$,ce,"=","=");A(D,$,ce,":",":");A(D,$,ce,"≈","\\approx",!0);A(D,$,ce,"≅","\\cong",!0);A(D,$,ce,"≥","\\ge");A(D,$,ce,"≥","\\geq",!0);A(D,$,ce,"←","\\gets");A(D,$,ce,">","\\gt",!0);A(D,$,ce,"∈","\\in",!0);A(D,$,ce,"","\\@not");A(D,$,ce,"⊂","\\subset",!0);A(D,$,ce,"⊃","\\supset",!0);A(D,$,ce,"⊆","\\subseteq",!0);A(D,$,ce,"⊇","\\supseteq",!0);A(D,le,ce,"⊈","\\nsubseteq",!0);A(D,le,ce,"⊉","\\nsupseteq",!0);A(D,$,ce,"⊨","\\models");A(D,$,ce,"←","\\leftarrow",!0);A(D,$,ce,"≤","\\le");A(D,$,ce,"≤","\\leq",!0);A(D,$,ce,"<","\\lt",!0);A(D,$,ce,"→","\\rightarrow",!0);A(D,$,ce,"→","\\to");A(D,le,ce,"≱","\\ngeq",!0);A(D,le,ce,"≰","\\nleq",!0);A(D,$,Kl," ","\\ ");A(D,$,Kl," ","\\space");A(D,$,Kl," ","\\nobreakspace");A(Be,$,Kl," ","\\ ");A(Be,$,Kl," "," ");A(Be,$,Kl," ","\\space");A(Be,$,Kl," ","\\nobreakspace");A(D,$,Kl,null,"\\nobreak");A(D,$,Kl,null,"\\allowbreak");A(D,$,Pb,",",",");A(D,$,Pb,";",";");A(D,le,lt,"⊼","\\barwedge",!0);A(D,le,lt,"⊻","\\veebar",!0);A(D,$,lt,"⊙","\\odot",!0);A(D,$,lt,"⊕","\\oplus",!0);A(D,$,lt,"⊗","\\otimes",!0);A(D,$,me,"∂","\\partial",!0);A(D,$,lt,"⊘","\\oslash",!0);A(D,le,lt,"⊚","\\circledcirc",!0);A(D,le,lt,"⊡","\\boxdot",!0);A(D,$,lt,"△","\\bigtriangleup");A(D,$,lt,"▽","\\bigtriangledown");A(D,$,lt,"†","\\dagger");A(D,$,lt,"⋄","\\diamond");A(D,$,lt,"⋆","\\star");A(D,$,lt,"◃","\\triangleleft");A(D,$,lt,"▹","\\triangleright");A(D,$,Ji,"{","\\{");A(Be,$,me,"{","\\{");A(Be,$,me,"{","\\textbraceleft");A(D,$,ii,"}","\\}");A(Be,$,me,"}","\\}");A(Be,$,me,"}","\\textbraceright");A(D,$,Ji,"{","\\lbrace");A(D,$,ii,"}","\\rbrace");A(D,$,Ji,"[","\\lbrack",!0);A(Be,$,me,"[","\\lbrack",!0);A(D,$,ii,"]","\\rbrack",!0);A(Be,$,me,"]","\\rbrack",!0);A(D,$,Ji,"(","\\lparen",!0);A(D,$,ii,")","\\rparen",!0);A(Be,$,me,"<","\\textless",!0);A(Be,$,me,">","\\textgreater",!0);A(D,$,Ji,"⌊","\\lfloor",!0);A(D,$,ii,"⌋","\\rfloor",!0);A(D,$,Ji,"⌈","\\lceil",!0);A(D,$,ii,"⌉","\\rceil",!0);A(D,$,me,"\\","\\backslash");A(D,$,me,"∣","|");A(D,$,me,"∣","\\vert");A(Be,$,me,"|","\\textbar",!0);A(D,$,me,"∥","\\|");A(D,$,me,"∥","\\Vert");A(Be,$,me,"∥","\\textbardbl");A(Be,$,me,"~","\\textasciitilde");A(Be,$,me,"\\","\\textbackslash");A(Be,$,me,"^","\\textasciicircum");A(D,$,ce,"↑","\\uparrow",!0);A(D,$,ce,"⇑","\\Uparrow",!0);A(D,$,ce,"↓","\\downarrow",!0);A(D,$,ce,"⇓","\\Downarrow",!0);A(D,$,ce,"↕","\\updownarrow",!0);A(D,$,ce,"⇕","\\Updownarrow",!0);A(D,$,as,"∐","\\coprod");A(D,$,as,"⋁","\\bigvee");A(D,$,as,"⋀","\\bigwedge");A(D,$,as,"⨄","\\biguplus");A(D,$,as,"⋂","\\bigcap");A(D,$,as,"⋃","\\bigcup");A(D,$,as,"∫","\\int");A(D,$,as,"∫","\\intop");A(D,$,as,"∬","\\iint");A(D,$,as,"∭","\\iiint");A(D,$,as,"∏","\\prod");A(D,$,as,"∑","\\sum");A(D,$,as,"⨂","\\bigotimes");A(D,$,as,"⨁","\\bigoplus");A(D,$,as,"⨀","\\bigodot");A(D,$,as,"∮","\\oint");A(D,$,as,"∯","\\oiint");A(D,$,as,"∰","\\oiiint");A(D,$,as,"⨆","\\bigsqcup");A(D,$,as,"∫","\\smallint");A(Be,$,Bf,"…","\\textellipsis");A(D,$,Bf,"…","\\mathellipsis");A(Be,$,Bf,"…","\\ldots",!0);A(D,$,Bf,"…","\\ldots",!0);A(D,$,Bf,"⋯","\\@cdots",!0);A(D,$,Bf,"⋱","\\ddots",!0);A(D,$,me,"⋮","\\varvdots");A(Be,$,me,"⋮","\\varvdots");A(D,$,jr,"ˊ","\\acute");A(D,$,jr,"ˋ","\\grave");A(D,$,jr,"¨","\\ddot");A(D,$,jr,"~","\\tilde");A(D,$,jr,"ˉ","\\bar");A(D,$,jr,"˘","\\breve");A(D,$,jr,"ˇ","\\check");A(D,$,jr,"^","\\hat");A(D,$,jr,"⃗","\\vec");A(D,$,jr,"˙","\\dot");A(D,$,jr,"˚","\\mathring");A(D,$,Tt,"","\\@imath");A(D,$,Tt,"","\\@jmath");A(D,$,me,"ı","ı");A(D,$,me,"ȷ","ȷ");A(Be,$,me,"ı","\\i",!0);A(Be,$,me,"ȷ","\\j",!0);A(Be,$,me,"ß","\\ss",!0);A(Be,$,me,"æ","\\ae",!0);A(Be,$,me,"œ","\\oe",!0);A(Be,$,me,"ø","\\o",!0);A(Be,$,me,"Æ","\\AE",!0);A(Be,$,me,"Œ","\\OE",!0);A(Be,$,me,"Ø","\\O",!0);A(Be,$,jr,"ˊ","\\'");A(Be,$,jr,"ˋ","\\`");A(Be,$,jr,"ˆ","\\^");A(Be,$,jr,"˜","\\~");A(Be,$,jr,"ˉ","\\=");A(Be,$,jr,"˘","\\u");A(Be,$,jr,"˙","\\.");A(Be,$,jr,"¸","\\c");A(Be,$,jr,"˚","\\r");A(Be,$,jr,"ˇ","\\v");A(Be,$,jr,"¨",'\\"');A(Be,$,jr,"˝","\\H");A(Be,$,jr,"◯","\\textcircled");var GV={"--":!0,"---":!0,"``":!0,"''":!0};A(Be,$,me,"–","--",!0);A(Be,$,me,"–","\\textendash");A(Be,$,me,"—","---",!0);A(Be,$,me,"—","\\textemdash");A(Be,$,me,"‘","`",!0);A(Be,$,me,"‘","\\textquoteleft");A(Be,$,me,"’","'",!0);A(Be,$,me,"’","\\textquoteright");A(Be,$,me,"“","``",!0);A(Be,$,me,"“","\\textquotedblleft");A(Be,$,me,"”","''",!0);A(Be,$,me,"”","\\textquotedblright");A(D,$,me,"°","\\degree",!0);A(Be,$,me,"°","\\degree");A(Be,$,me,"°","\\textdegree",!0);A(D,$,me,"£","\\pounds");A(D,$,me,"£","\\mathsterling",!0);A(Be,$,me,"£","\\pounds");A(Be,$,me,"£","\\textsterling",!0);A(D,le,me,"✠","\\maltese");A(Be,le,me,"✠","\\maltese");var cR='0123456789/@."';for(var FS=0;FS0)return $a(i,d,s,n,a.concat(h));if(c){var m,g;if(c==="boldsymbol"){var x=U5e(i,s,n,a,r);m=x.fontName,g=[x.fontClass]}else l?(m=KV[c].fontName,g=[c]):(m=R1(c,n.fontWeight,n.fontShape),g=[c,n.fontWeight,n.fontShape]);if(zb(i,m,s).metrics)return $a(i,m,s,n,a.concat(g));if(GV.hasOwnProperty(i)&&m.slice(0,10)==="Typewriter"){for(var y=[],w=0;w{if(eu(t.classes)!==eu(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize)return!1;if(t.classes.length===1){var n=t.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r in t.style)if(t.style.hasOwnProperty(r)&&t.style[r]!==e.style[r])return!1;for(var s in e.style)if(e.style.hasOwnProperty(s)&&t.style[s]!==e.style[s])return!1;return!0},X5e=t=>{for(var e=0;en&&(n=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>s&&(s=a.maxFontSize)}e.height=n,e.depth=r,e.maxFontSize=s},mi=function(e,n,r,s){var i=new fg(e,n,r,s);return ON(i),i},XV=(t,e,n,r)=>new fg(t,e,n,r),Y5e=function(e,n,r){var s=mi([e],[],n);return s.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),s.style.borderBottomWidth=Xe(s.height),s.maxFontSize=1,s},K5e=function(e,n,r,s){var i=new kN(e,n,r,s);return ON(i),i},YV=function(e){var n=new hg(e);return ON(n),n},Z5e=function(e,n){return e instanceof hg?mi([],[e],n):e},J5e=function(e){if(e.positionType==="individualShift"){for(var n=e.children,r=[n[0]],s=-n[0].shift-n[0].elem.depth,i=s,a=1;a{var n=mi(["mspace"],[],e),r=Rr(t,e);return n.style.marginRight=Xe(r),n},R1=function(e,n,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 n==="textbf"&&r==="textit"?i="BoldItalic":n==="textbf"?i="Bold":n==="textit"?i="Italic":i="Regular",s+"-"+i},KV={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"}},ZV={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},n3e=function(e,n){var[r,s,i]=ZV[e],a=new tu(r),l=new Hl([a],{width:Xe(s),height:Xe(i),style:"width:"+Xe(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),c=XV(["overlay"],[l],n);return c.height=i,c.style.height=Xe(i),c.style.width=Xe(s),c},be={fontMap:KV,makeSymbol:$a,mathsym:V5e,makeSpan:mi,makeSvgSpan:XV,makeLineSpan:Y5e,makeAnchor:K5e,makeFragment:YV,wrapFragment:Z5e,makeVList:e3e,makeOrd:W5e,makeGlue:t3e,staticSvg:n3e,svgData:ZV,tryCombineChars:X5e},_r={number:3,unit:"mu"},zu={number:4,unit:"mu"},vl={number:5,unit:"mu"},r3e={mord:{mop:_r,mbin:zu,mrel:vl,minner:_r},mop:{mord:_r,mop:_r,mrel:vl,minner:_r},mbin:{mord:zu,mop:zu,mopen:zu,minner:zu},mrel:{mord:vl,mop:vl,mopen:vl,minner:vl},mopen:{},mclose:{mop:_r,mbin:zu,mrel:vl,minner:_r},mpunct:{mord:_r,mop:_r,mrel:vl,mopen:_r,mclose:_r,mpunct:_r,minner:_r},minner:{mord:_r,mop:_r,mbin:zu,mrel:vl,mopen:_r,mpunct:_r,minner:_r}},s3e={mord:{mop:_r},mop:{mord:_r,mop:_r},mbin:{},mrel:{},mopen:{},mclose:{mop:_r},mpunct:{},minner:{mop:_r}},JV={},yy={},by={};function tt(t){for(var{type:e,names:n,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=t,l={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},c=0;c{var S=w.classes[0],k=y.classes[0];S==="mbin"&&a3e.includes(k)?w.classes[0]="mord":k==="mbin"&&i3e.includes(S)&&(y.classes[0]="mord")},{node:m},g,x),mR(i,(y,w)=>{var S=zO(w),k=zO(y),j=S&&k?y.hasClass("mtight")?s3e[S][k]:r3e[S][k]:null;if(j)return be.makeGlue(j,d)},{node:m},g,x),i},mR=function t(e,n,r,s,i){s&&e.push(s);for(var a=0;ag=>{e.splice(m+1,0,g),a++})(a)}s&&e.pop()},eU=function(e){return e instanceof hg||e instanceof kN||e instanceof fg&&e.hasClass("enclosing")?e:null},c3e=function t(e,n){var r=eU(e);if(r){var s=r.children;if(s.length){if(n==="right")return t(s[s.length-1],"right");if(n==="left")return t(s[0],"left")}}return e},zO=function(e,n){return e?(n&&(e=c3e(e,n)),l3e[e.classes[0]]||null):null},pp=function(e,n){var r=["nulldelimiter"].concat(e.baseSizingClasses());return Ql(n.concat(r))},Pn=function(e,n,r){if(!e)return Ql();if(yy[e.type]){var s=yy[e.type](e,n);if(r&&n.size!==r.size){s=Ql(n.sizingClasses(r),[s],n);var i=n.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new $e("Got group of unknown type: '"+e.type+"'")};function D1(t,e){var n=Ql(["base"],t,e),r=Ql(["strut"]);return r.style.height=Xe(n.height+n.depth),n.depth&&(r.style.verticalAlign=Xe(-n.depth)),n.children.unshift(r),n}function IO(t,e){var n=null;t.length===1&&t[0].type==="tag"&&(n=t[0].tag,t=t[0].body);var r=hs(t,e,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],a=[],l=0;l0&&(i.push(D1(a,e)),a=[]),i.push(r[l]));a.length>0&&i.push(D1(a,e));var d;n?(d=D1(hs(n,e,!0)),d.classes=["tag"],i.push(d)):s&&i.push(s);var h=Ql(["katex-html"],i);if(h.setAttribute("aria-hidden","true"),d){var m=d.children[0];m.style.height=Xe(h.height+h.depth),h.depth&&(m.style.verticalAlign=Xe(-h.depth))}return h}function tU(t){return new hg(t)}class Qi{constructor(e,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(e,n){this.attributes[e]=n}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&e.setAttribute(n,this.attributes[n]);this.classes.length>0&&(e.className=eu(this.classes));for(var r=0;r0&&(e+=' class ="'+$n.escape(eu(this.classes))+'"'),e+=">";for(var r=0;r",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Mo{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return $n.escape(this.toText())}toText(){return this.text}}class u3e{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",Xe(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var qe={MathNode:Qi,TextNode:Mo,SpaceNode:u3e,newDocumentFragment:tU},Aa=function(e,n,r){return dr[n][e]&&dr[n][e].replace&&e.charCodeAt(0)!==55349&&!(GV.hasOwnProperty(e)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(e=dr[n][e].replace),new qe.TextNode(e)},jN=function(e){return e.length===1?e[0]:new qe.MathNode("mrow",e)},NN=function(e,n){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold";var r=n.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;dr[s][i]&&dr[s][i].replace&&(i=dr[s][i].replace);var a=be.fontMap[r].fontName;return SN(i,a,s)?be.fontMap[r].variant:null};function QS(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof Mo&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var n=t.children[0];return n instanceof Mo&&n.text===","}else return!1}var _i=function(e,n,r){if(e.length===1){var s=lr(e[0],n);return r&&s instanceof Qi&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],a,l=0;l=1&&(a.type==="mn"||QS(a))){var d=c.children[0];d instanceof Qi&&d.type==="mn"&&(d.children=[...a.children,...d.children],i.pop())}else if(a.type==="mi"&&a.children.length===1){var h=a.children[0];if(h instanceof Mo&&h.text==="̸"&&(c.type==="mo"||c.type==="mi"||c.type==="mn")){var m=c.children[0];m instanceof Mo&&m.text.length>0&&(m.text=m.text.slice(0,1)+"̸"+m.text.slice(1),i.pop())}}}i.push(c),a=c}return i},nu=function(e,n,r){return jN(_i(e,n,r))},lr=function(e,n){if(!e)return new qe.MathNode("mrow");if(by[e.type]){var r=by[e.type](e,n);return r}else throw new $e("Got group of unknown type: '"+e.type+"'")};function pR(t,e,n,r,s){var i=_i(t,n),a;i.length===1&&i[0]instanceof Qi&&["mrow","mtable"].includes(i[0].type)?a=i[0]:a=new qe.MathNode("mrow",i);var l=new qe.MathNode("annotation",[new qe.TextNode(e)]);l.setAttribute("encoding","application/x-tex");var c=new qe.MathNode("semantics",[a,l]),d=new qe.MathNode("math",[c]);d.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&d.setAttribute("display","block");var h=s?"katex":"katex-mathml";return be.makeSpan([h],[d])}var nU=function(e){return new Cl({style:e.displayMode?Et.DISPLAY:Et.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},rU=function(e,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),e=be.makeSpan(r,[e])}return e},d3e=function(e,n,r){var s=nU(r),i;if(r.output==="mathml")return pR(e,n,s,r.displayMode,!0);if(r.output==="html"){var a=IO(e,s);i=be.makeSpan(["katex"],[a])}else{var l=pR(e,n,s,r.displayMode,!1),c=IO(e,s);i=be.makeSpan(["katex"],[l,c])}return rU(i,r)},h3e=function(e,n,r){var s=nU(r),i=IO(e,s),a=be.makeSpan(["katex"],[i]);return rU(a,r)},f3e={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":"="},m3e=function(e){var n=new qe.MathNode("mo",[new qe.TextNode(f3e[e.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},p3e={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]},g3e=function(e){return e.type==="ordgroup"?e.body.length:1},x3e=function(e,n){function r(){var l=4e5,c=e.label.slice(1);if(["widehat","widecheck","widetilde","utilde"].includes(c)){var d=e,h=g3e(d.base),m,g,x;if(h>5)c==="widehat"||c==="widecheck"?(m=420,l=2364,x=.42,g=c+"4"):(m=312,l=2340,x=.34,g="tilde4");else{var y=[1,1,2,2,3,3][h];c==="widehat"||c==="widecheck"?(l=[0,1062,2364,2364,2364][y],m=[0,239,300,360,420][y],x=[0,.24,.3,.3,.36,.42][y],g=c+y):(l=[0,600,1033,2339,2340][y],m=[0,260,286,306,312][y],x=[0,.26,.286,.3,.306,.34][y],g="tilde"+y)}var w=new tu(g),S=new Hl([w],{width:"100%",height:Xe(x),viewBox:"0 0 "+l+" "+m,preserveAspectRatio:"none"});return{span:be.makeSvgSpan([],[S],n),minWidth:0,height:x}}else{var k=[],j=p3e[c],[N,T,E]=j,_=E/1e3,M=N.length,I,P;if(M===1){var L=j[3];I=["hide-tail"],P=[L]}else if(M===2)I=["halfarrow-left","halfarrow-right"],P=["xMinYMin","xMaxYMin"];else if(M===3)I=["brace-left","brace-center","brace-right"],P=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+M+" children.");for(var H=0;H0&&(s.style.minWidth=Xe(i)),s},v3e=function(e,n,r,s,i){var a,l=e.height+e.depth+r+s;if(/fbox|color|angl/.test(n)){if(a=be.makeSpan(["stretchy",n],[],i),n==="fbox"){var c=i.color&&i.getColor();c&&(a.style.borderColor=c)}}else{var d=[];/^[bx]cancel$/.test(n)&&d.push(new DO({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&d.push(new DO({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new Hl(d,{width:"100%",height:Xe(l)});a=be.makeSvgSpan([],[h],i)}return a.height=l,a.style.height=Xe(l),a},Vl={encloseSpan:v3e,mathMLnode:m3e,svgSpan:x3e};function en(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function CN(t){var e=Ib(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function Ib(t){return t&&(t.type==="atom"||H5e.hasOwnProperty(t.type))?t:null}var TN=(t,e)=>{var n,r,s;t&&t.type==="supsub"?(r=en(t.base,"accent"),n=r.base,t.base=n,s=q5e(Pn(t,e)),t.base=r):(r=en(t,"accent"),n=r.base);var i=Pn(n,e.havingCrampedStyle()),a=r.isShifty&&$n.isCharacterBox(n),l=0;if(a){var c=$n.getBaseElem(n),d=Pn(c,e.havingCrampedStyle());l=lR(d).skew}var h=r.label==="\\c",m=h?i.height+i.depth:Math.min(i.height,e.fontMetrics().xHeight),g;if(r.isStretchy)g=Vl.svgSpan(r,e),g=be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:g,wrapperClasses:["svg-align"],wrapperStyle:l>0?{width:"calc(100% - "+Xe(2*l)+")",marginLeft:Xe(2*l)}:void 0}]},e);else{var x,y;r.label==="\\vec"?(x=be.staticSvg("vec",e),y=be.svgData.vec[1]):(x=be.makeOrd({mode:r.mode,text:r.label},e,"textord"),x=lR(x),x.italic=0,y=x.width,h&&(m+=x.depth)),g=be.makeSpan(["accent-body"],[x]);var w=r.label==="\\textcircled";w&&(g.classes.push("accent-full"),m=i.height);var S=l;w||(S-=y/2),g.style.left=Xe(S),r.label==="\\textcircled"&&(g.style.top=".2em"),g=be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-m},{type:"elem",elem:g}]},e)}var k=be.makeSpan(["mord","accent"],[g],e);return s?(s.children[0]=k,s.height=Math.max(k.height,s.height),s.classes[0]="mord",s):k},sU=(t,e)=>{var n=t.isStretchy?Vl.mathMLnode(t.label):new qe.MathNode("mo",[Aa(t.label,t.mode)]),r=new qe.MathNode("mover",[lr(t.base,e),n]);return r.setAttribute("accent","true"),r},y3e=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));tt({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:(t,e)=>{var n=wy(e[0]),r=!y3e.test(t.funcName),s=!r||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:r,isShifty:s,base:n}},htmlBuilder:TN,mathmlBuilder:sU});tt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var n=e[0],r=t.parser.mode;return r==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:t.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:TN,mathmlBuilder:sU});tt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0];return{type:"accentUnder",mode:n.mode,label:r,base:s}},htmlBuilder:(t,e)=>{var n=Pn(t.base,e),r=Vl.svgSpan(t,e),s=t.label==="\\utilde"?.12:0,i=be.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:n}]},e);return be.makeSpan(["mord","accentunder"],[i],e)},mathmlBuilder:(t,e)=>{var n=Vl.mathMLnode(t.label),r=new qe.MathNode("munder",[lr(t.base,e),n]);return r.setAttribute("accentunder","true"),r}});var P1=t=>{var e=new qe.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};tt({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(t,e,n){var{parser:r,funcName:s}=t;return{type:"xArrow",mode:r.mode,label:s,body:e[0],below:n[0]}},htmlBuilder(t,e){var n=e.style,r=e.havingStyle(n.sup()),s=be.wrapFragment(Pn(t.body,r,e),e),i=t.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var a;t.below&&(r=e.havingStyle(n.sub()),a=be.wrapFragment(Pn(t.below,r,e),e),a.classes.push(i+"-arrow-pad"));var l=Vl.svgSpan(t,e),c=-e.fontMetrics().axisHeight+.5*l.height,d=-e.fontMetrics().axisHeight-.5*l.height-.111;(s.depth>.25||t.label==="\\xleftequilibrium")&&(d-=s.depth);var h;if(a){var m=-e.fontMetrics().axisHeight+a.height+.5*l.height+.111;h=be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:l,shift:c},{type:"elem",elem:a,shift:m}]},e)}else h=be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:l,shift:c}]},e);return h.children[0].children[0].children[1].classes.push("svg-align"),be.makeSpan(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var n=Vl.mathMLnode(t.label);n.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(t.body){var s=P1(lr(t.body,e));if(t.below){var i=P1(lr(t.below,e));r=new qe.MathNode("munderover",[n,i,s])}else r=new qe.MathNode("mover",[n,s])}else if(t.below){var a=P1(lr(t.below,e));r=new qe.MathNode("munder",[n,a])}else r=P1(),r=new qe.MathNode("mover",[n,r]);return r}});var b3e=be.makeSpan;function iU(t,e){var n=hs(t.body,e,!0);return b3e([t.mclass],n,e)}function aU(t,e){var n,r=_i(t.body,e);return t.mclass==="minner"?n=new qe.MathNode("mpadded",r):t.mclass==="mord"?t.isCharacterBox?(n=r[0],n.type="mi"):n=new qe.MathNode("mi",r):(t.isCharacterBox?(n=r[0],n.type="mo"):n=new qe.MathNode("mo",r),t.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):t.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):t.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}tt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:n,funcName:r}=t,s=e[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:Qr(s),isCharacterBox:$n.isCharacterBox(s)}},htmlBuilder:iU,mathmlBuilder:aU});var Lb=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};tt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:n}=t;return{type:"mclass",mode:n.mode,mclass:Lb(e[0]),body:Qr(e[1]),isCharacterBox:$n.isCharacterBox(e[1])}}});tt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:n,funcName:r}=t,s=e[1],i=e[0],a;r!=="\\stackrel"?a=Lb(s):a="mrel";var l={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:Qr(s)},c={type:"supsub",mode:i.mode,base:l,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:n.mode,mclass:a,body:[c],isCharacterBox:$n.isCharacterBox(c)}},htmlBuilder:iU,mathmlBuilder:aU});tt({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"pmb",mode:n.mode,mclass:Lb(e[0]),body:Qr(e[0])}},htmlBuilder(t,e){var n=hs(t.body,e,!0),r=be.makeSpan([t.mclass],n,e);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(t,e){var n=_i(t.body,e),r=new qe.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var w3e={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},gR=()=>({type:"styling",body:[],mode:"math",style:"display"}),xR=t=>t.type==="textord"&&t.text==="@",S3e=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function k3e(t,e,n){var r=w3e[t];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var s=n.callFunction("\\\\cdleft",[e[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},a=n.callFunction("\\Big",[i],[]),l=n.callFunction("\\\\cdright",[e[1]],[]),c={type:"ordgroup",mode:"math",body:[s,a,l]};return n.callFunction("\\\\cdparent",[c],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var d={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[d],[])}default:return{type:"textord",text:" ",mode:"math"}}}function O3e(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var n=t.fetch().text;if(n==="&"||n==="\\\\")t.consume();else if(n==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new $e("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var r=[],s=[r],i=0;i-1))if("<>AV".indexOf(d)>-1)for(var m=0;m<2;m++){for(var g=!0,x=c+1;xAV=|." after @',a[c]);var y=k3e(d,h,t),w={type:"styling",body:[y],mode:"math",style:"display"};r.push(w),l=gR()}i%2===0?r.push(l):r.shift(),r=[],s.push(r)}t.gullet.endGroup(),t.gullet.endGroup();var S=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:S,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}tt({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:e[0]}},htmlBuilder(t,e){var n=e.havingStyle(e.style.sup()),r=be.wrapFragment(Pn(t.label,n,e),e);return r.classes.push("cd-label-"+t.side),r.style.bottom=Xe(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(t,e){var n=new qe.MathNode("mrow",[lr(t.label,e)]);return n=new qe.MathNode("mpadded",[n]),n.setAttribute("width","0"),t.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new qe.MathNode("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});tt({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:n}=t;return{type:"cdlabelparent",mode:n.mode,fragment:e[0]}},htmlBuilder(t,e){var n=be.wrapFragment(Pn(t.fragment,e),e);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(t,e){return new qe.MathNode("mrow",[lr(t.fragment,e)])}});tt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:n}=t,r=en(e[0],"ordgroup"),s=r.body,i="",a=0;a=1114111)throw new $e("\\@char with invalid code point "+i);return c<=65535?d=String.fromCharCode(c):(c-=65536,d=String.fromCharCode((c>>10)+55296,(c&1023)+56320)),{type:"textord",mode:n.mode,text:d}}});var oU=(t,e)=>{var n=hs(t.body,e.withColor(t.color),!1);return be.makeFragment(n)},lU=(t,e)=>{var n=_i(t.body,e.withColor(t.color)),r=new qe.MathNode("mstyle",n);return r.setAttribute("mathcolor",t.color),r};tt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:n}=t,r=en(e[0],"color-token").color,s=e[1];return{type:"color",mode:n.mode,color:r,body:Qr(s)}},htmlBuilder:oU,mathmlBuilder:lU});tt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:n,breakOnTokenText:r}=t,s=en(e[0],"color-token").color;n.gullet.macros.set("\\current@color",s);var i=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:s,body:i}},htmlBuilder:oU,mathmlBuilder:lU});tt({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,n){var{parser:r}=t,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&&en(s,"size").value}},htmlBuilder(t,e){var n=be.makeSpan(["mspace"],[],e);return t.newLine&&(n.classes.push("newline"),t.size&&(n.style.marginTop=Xe(Rr(t.size,e)))),n},mathmlBuilder(t,e){var n=new qe.MathNode("mspace");return t.newLine&&(n.setAttribute("linebreak","newline"),t.size&&n.setAttribute("height",Xe(Rr(t.size,e)))),n}});var LO={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},cU=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new $e("Expected a control sequence",t);return e},j3e=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},uU=(t,e,n,r)=>{var s=t.gullet.macros.get(n.text);s==null&&(n.noexpand=!0,s={tokens:[n],numArgs:0,unexpandable:!t.gullet.isExpandable(n.text)}),t.gullet.macros.set(e,s,r)};tt({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:n}=t;e.consumeSpaces();var r=e.fetch();if(LO[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=LO[r.text]),en(e.parseFunction(),"internal");throw new $e("Invalid token after macro prefix",r)}});tt({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=e.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new $e("Expected a control sequence",r);for(var i=0,a,l=[[]];e.gullet.future().text!=="{";)if(r=e.gullet.popToken(),r.text==="#"){if(e.gullet.future().text==="{"){a=e.gullet.future(),l[i].push("{");break}if(r=e.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new $e('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new $e('Argument number "'+r.text+'" out of order');i++,l.push([])}else{if(r.text==="EOF")throw new $e("Expected a macro definition");l[i].push(r.text)}var{tokens:c}=e.gullet.consumeArg();return a&&c.unshift(a),(n==="\\edef"||n==="\\xdef")&&(c=e.gullet.expandTokens(c),c.reverse()),e.gullet.macros.set(s,{tokens:c,numArgs:i,delimiters:l},n===LO[n]),{type:"internal",mode:e.mode}}});tt({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=cU(e.gullet.popToken());e.gullet.consumeSpaces();var s=j3e(e);return uU(e,r,s,n==="\\\\globallet"),{type:"internal",mode:e.mode}}});tt({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=cU(e.gullet.popToken()),s=e.gullet.popToken(),i=e.gullet.popToken();return uU(e,r,i,n==="\\\\globalfuture"),e.gullet.pushToken(i),e.gullet.pushToken(s),{type:"internal",mode:e.mode}}});var c0=function(e,n,r){var s=dr.math[e]&&dr.math[e].replace,i=SN(s||e,n,r);if(!i)throw new Error("Unsupported symbol "+e+" and font size "+n+".");return i},EN=function(e,n,r,s){var i=r.havingBaseStyle(n),a=be.makeSpan(s.concat(i.sizingClasses(r)),[e],r),l=i.sizeMultiplier/r.sizeMultiplier;return a.height*=l,a.depth*=l,a.maxFontSize=i.sizeMultiplier,a},dU=function(e,n,r){var s=n.havingBaseStyle(r),i=(1-n.sizeMultiplier/s.sizeMultiplier)*n.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Xe(i),e.height-=i,e.depth+=i},N3e=function(e,n,r,s,i,a){var l=be.makeSymbol(e,"Main-Regular",i,s),c=EN(l,n,s,a);return r&&dU(c,s,n),c},C3e=function(e,n,r,s){return be.makeSymbol(e,"Size"+n+"-Regular",r,s)},hU=function(e,n,r,s,i,a){var l=C3e(e,n,i,s),c=EN(be.makeSpan(["delimsizing","size"+n],[l],s),Et.TEXT,s,a);return r&&dU(c,s,Et.TEXT),c},VS=function(e,n,r){var s;n==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=be.makeSpan(["delimsizinginner",s],[be.makeSpan([],[be.makeSymbol(e,n,r)])]);return{type:"elem",elem:i}},US=function(e,n,r){var s=_o["Size4-Regular"][e.charCodeAt(0)]?_o["Size4-Regular"][e.charCodeAt(0)][4]:_o["Size1-Regular"][e.charCodeAt(0)][4],i=new tu("inner",A5e(e,Math.round(1e3*n))),a=new Hl([i],{width:Xe(s),height:Xe(n),style:"width:"+Xe(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),l=be.makeSvgSpan([],[a],r);return l.height=n,l.style.height=Xe(n),l.style.width=Xe(s),{type:"elem",elem:l}},BO=.008,z1={type:"kern",size:-1*BO},T3e=["|","\\lvert","\\rvert","\\vert"],E3e=["\\|","\\lVert","\\rVert","\\Vert"],fU=function(e,n,r,s,i,a){var l,c,d,h,m="",g=0;l=d=h=e,c=null;var x="Size1-Regular";e==="\\uparrow"?d=h="⏐":e==="\\Uparrow"?d=h="‖":e==="\\downarrow"?l=d="⏐":e==="\\Downarrow"?l=d="‖":e==="\\updownarrow"?(l="\\uparrow",d="⏐",h="\\downarrow"):e==="\\Updownarrow"?(l="\\Uparrow",d="‖",h="\\Downarrow"):T3e.includes(e)?(d="∣",m="vert",g=333):E3e.includes(e)?(d="∥",m="doublevert",g=556):e==="["||e==="\\lbrack"?(l="⎡",d="⎢",h="⎣",x="Size4-Regular",m="lbrack",g=667):e==="]"||e==="\\rbrack"?(l="⎤",d="⎥",h="⎦",x="Size4-Regular",m="rbrack",g=667):e==="\\lfloor"||e==="⌊"?(d=l="⎢",h="⎣",x="Size4-Regular",m="lfloor",g=667):e==="\\lceil"||e==="⌈"?(l="⎡",d=h="⎢",x="Size4-Regular",m="lceil",g=667):e==="\\rfloor"||e==="⌋"?(d=l="⎥",h="⎦",x="Size4-Regular",m="rfloor",g=667):e==="\\rceil"||e==="⌉"?(l="⎤",d=h="⎥",x="Size4-Regular",m="rceil",g=667):e==="("||e==="\\lparen"?(l="⎛",d="⎜",h="⎝",x="Size4-Regular",m="lparen",g=875):e===")"||e==="\\rparen"?(l="⎞",d="⎟",h="⎠",x="Size4-Regular",m="rparen",g=875):e==="\\{"||e==="\\lbrace"?(l="⎧",c="⎨",h="⎩",d="⎪",x="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(l="⎫",c="⎬",h="⎭",d="⎪",x="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(l="⎧",h="⎩",d="⎪",x="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(l="⎫",h="⎭",d="⎪",x="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(l="⎧",h="⎭",d="⎪",x="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(l="⎫",h="⎩",d="⎪",x="Size4-Regular");var y=c0(l,x,i),w=y.height+y.depth,S=c0(d,x,i),k=S.height+S.depth,j=c0(h,x,i),N=j.height+j.depth,T=0,E=1;if(c!==null){var _=c0(c,x,i);T=_.height+_.depth,E=2}var M=w+N+T,I=Math.max(0,Math.ceil((n-M)/(E*k))),P=M+I*E*k,L=s.fontMetrics().axisHeight;r&&(L*=s.sizeMultiplier);var H=P/2-L,U=[];if(m.length>0){var ee=P-w-N,z=Math.round(P*1e3),Q=R5e(m,Math.round(ee*1e3)),B=new tu(m,Q),X=(g/1e3).toFixed(3)+"em",J=(z/1e3).toFixed(3)+"em",G=new Hl([B],{width:X,height:J,viewBox:"0 0 "+g+" "+z}),R=be.makeSvgSpan([],[G],s);R.height=z/1e3,R.style.width=X,R.style.height=J,U.push({type:"elem",elem:R})}else{if(U.push(VS(h,x,i)),U.push(z1),c===null){var ie=P-w-N+2*BO;U.push(US(d,ie,s))}else{var W=(P-w-N-T)/2+2*BO;U.push(US(d,W,s)),U.push(z1),U.push(VS(c,x,i)),U.push(z1),U.push(US(d,W,s))}U.push(z1),U.push(VS(l,x,i))}var q=s.havingBaseStyle(Et.TEXT),V=be.makeVList({positionType:"bottom",positionData:H,children:U},q);return EN(be.makeSpan(["delimsizing","mult"],[V],q),Et.TEXT,s,a)},WS=80,GS=.08,XS=function(e,n,r,s,i){var a=M5e(e,s,r),l=new tu(e,a),c=new Hl([l],{width:"400em",height:Xe(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return be.makeSvgSpan(["hide-tail"],[c],i)},_3e=function(e,n){var r=n.havingBaseSizing(),s=xU("\\surd",e*r.sizeMultiplier,gU,r),i=r.sizeMultiplier,a=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),l,c=0,d=0,h=0,m;return s.type==="small"?(h=1e3+1e3*a+WS,e<1?i=1:e<1.4&&(i=.7),c=(1+a+GS)/i,d=(1+a)/i,l=XS("sqrtMain",c,h,a,n),l.style.minWidth="0.853em",m=.833/i):s.type==="large"?(h=(1e3+WS)*_0[s.size],d=(_0[s.size]+a)/i,c=(_0[s.size]+a+GS)/i,l=XS("sqrtSize"+s.size,c,h,a,n),l.style.minWidth="1.02em",m=1/i):(c=e+a+GS,d=e+a,h=Math.floor(1e3*e+a)+WS,l=XS("sqrtTall",c,h,a,n),l.style.minWidth="0.742em",m=1.056),l.height=d,l.style.height=Xe(c),{span:l,advanceWidth:m,ruleWidth:(n.fontMetrics().sqrtRuleThickness+a)*i}},mU=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],M3e=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],pU=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],_0=[0,1.2,1.8,2.4,3],A3e=function(e,n,r,s,i){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),mU.includes(e)||pU.includes(e))return hU(e,n,!1,r,s,i);if(M3e.includes(e))return fU(e,_0[n],!1,r,s,i);throw new $e("Illegal delimiter: '"+e+"'")},R3e=[{type:"small",style:Et.SCRIPTSCRIPT},{type:"small",style:Et.SCRIPT},{type:"small",style:Et.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],D3e=[{type:"small",style:Et.SCRIPTSCRIPT},{type:"small",style:Et.SCRIPT},{type:"small",style:Et.TEXT},{type:"stack"}],gU=[{type:"small",style:Et.SCRIPTSCRIPT},{type:"small",style:Et.SCRIPT},{type:"small",style:Et.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],P3e=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.")},xU=function(e,n,r,s){for(var i=Math.min(2,3-s.style.size),a=i;an)return r[a]}return r[r.length-1]},vU=function(e,n,r,s,i,a){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var l;pU.includes(e)?l=R3e:mU.includes(e)?l=gU:l=D3e;var c=xU(e,n,l,s);return c.type==="small"?N3e(e,c.style,r,s,i,a):c.type==="large"?hU(e,c.size,r,s,i,a):fU(e,n,r,s,i,a)},z3e=function(e,n,r,s,i,a){var l=s.fontMetrics().axisHeight*s.sizeMultiplier,c=901,d=5/s.fontMetrics().ptPerEm,h=Math.max(n-l,r+l),m=Math.max(h/500*c,2*h-d);return vU(e,m,!0,s,i,a)},Ll={sqrtImage:_3e,sizedDelim:A3e,sizeToMaxHeight:_0,customSizedDelim:vU,leftRightDelim:z3e},vR={"\\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}},I3e=["(","\\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 Bb(t,e){var n=Ib(t);if(n&&I3e.includes(n.text))return n;throw n?new $e("Invalid delimiter '"+n.text+"' after '"+e.funcName+"'",t):new $e("Invalid delimiter type '"+t.type+"'",t)}tt({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:(t,e)=>{var n=Bb(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:vR[t.funcName].size,mclass:vR[t.funcName].mclass,delim:n.text}},htmlBuilder:(t,e)=>t.delim==="."?be.makeSpan([t.mclass]):Ll.sizedDelim(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(Aa(t.delim,t.mode));var n=new qe.MathNode("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=Xe(Ll.sizeToMaxHeight[t.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function yR(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}tt({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=t.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new $e("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:Bb(e[0],t).text,color:n}}});tt({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=Bb(e[0],t),r=t.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=en(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(t,e)=>{yR(t);for(var n=hs(t.body,e,!0,["mopen","mclose"]),r=0,s=0,i=!1,a=0;a{yR(t);var n=_i(t.body,e);if(t.left!=="."){var r=new qe.MathNode("mo",[Aa(t.left,t.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(t.right!=="."){var s=new qe.MathNode("mo",[Aa(t.right,t.mode)]);s.setAttribute("fence","true"),t.rightColor&&s.setAttribute("mathcolor",t.rightColor),n.push(s)}return jN(n)}});tt({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=Bb(e[0],t);if(!t.parser.leftrightDepth)throw new $e("\\middle without preceding \\left",n);return{type:"middle",mode:t.parser.mode,delim:n.text}},htmlBuilder:(t,e)=>{var n;if(t.delim===".")n=pp(e,[]);else{n=Ll.sizedDelim(t.delim,1,e,t.mode,[]);var r={delim:t.delim,options:e};n.isMiddle=r}return n},mathmlBuilder:(t,e)=>{var n=t.delim==="\\vert"||t.delim==="|"?Aa("|","text"):Aa(t.delim,t.mode),r=new qe.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var _N=(t,e)=>{var n=be.wrapFragment(Pn(t.body,e),e),r=t.label.slice(1),s=e.sizeMultiplier,i,a=0,l=$n.isCharacterBox(t.body);if(r==="sout")i=be.makeSpan(["stretchy","sout"]),i.height=e.fontMetrics().defaultRuleThickness/s,a=-.5*e.fontMetrics().xHeight;else if(r==="phase"){var c=Rr({number:.6,unit:"pt"},e),d=Rr({number:.35,unit:"ex"},e),h=e.havingBaseSizing();s=s/h.sizeMultiplier;var m=n.height+n.depth+c+d;n.style.paddingLeft=Xe(m/2+c);var g=Math.floor(1e3*m*s),x=E5e(g),y=new Hl([new tu("phase",x)],{width:"400em",height:Xe(g/1e3),viewBox:"0 0 400000 "+g,preserveAspectRatio:"xMinYMin slice"});i=be.makeSvgSpan(["hide-tail"],[y],e),i.style.height=Xe(m),a=n.depth+c+d}else{/cancel/.test(r)?l||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var w=0,S=0,k=0;/box/.test(r)?(k=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),w=e.fontMetrics().fboxsep+(r==="colorbox"?0:k),S=w):r==="angl"?(k=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),w=4*k,S=Math.max(0,.25-n.depth)):(w=l?.2:0,S=w),i=Vl.encloseSpan(n,r,w,S,e),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=Xe(k)):r==="angl"&&k!==.049&&(i.style.borderTopWidth=Xe(k),i.style.borderRightWidth=Xe(k)),a=n.depth+S,t.backgroundColor&&(i.style.backgroundColor=t.backgroundColor,t.borderColor&&(i.style.borderColor=t.borderColor))}var j;if(t.backgroundColor)j=be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:a},{type:"elem",elem:n,shift:0}]},e);else{var N=/cancel|phase/.test(r)?["svg-align"]:[];j=be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:i,shift:a,wrapperClasses:N}]},e)}return/cancel/.test(r)&&(j.height=n.height,j.depth=n.depth),/cancel/.test(r)&&!l?be.makeSpan(["mord","cancel-lap"],[j],e):be.makeSpan(["mord"],[j],e)},MN=(t,e)=>{var n=0,r=new qe.MathNode(t.label.indexOf("colorbox")>-1?"mpadded":"menclose",[lr(t.body,e)]);switch(t.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(n=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),t.label==="\\fcolorbox"){var s=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);r.setAttribute("style","border: "+s+"em solid "+String(t.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&r.setAttribute("mathbackground",t.backgroundColor),r};tt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(t,e,n){var{parser:r,funcName:s}=t,i=en(e[0],"color-token").color,a=e[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:a}},htmlBuilder:_N,mathmlBuilder:MN});tt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(t,e,n){var{parser:r,funcName:s}=t,i=en(e[0],"color-token").color,a=en(e[1],"color-token").color,l=e[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,borderColor:i,body:l}},htmlBuilder:_N,mathmlBuilder:MN});tt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"enclose",mode:n.mode,label:"\\fbox",body:e[0]}}});tt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t,s=e[0];return{type:"enclose",mode:n.mode,label:r,body:s}},htmlBuilder:_N,mathmlBuilder:MN});tt({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:n}=t;return{type:"enclose",mode:n.mode,label:"\\angl",body:e[0]}}});var yU={};function Qo(t){for(var{type:e,names:n,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=t,l={type:e,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},c=0;c{var e=t.parser.settings;if(!e.displayMode)throw new $e("{"+t.envName+"} can be used only in display mode.")};function AN(t){if(t.indexOf("ed")===-1)return t.indexOf("*")===-1}function du(t,e,n){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:a,colSeparationType:l,autoTag:c,singleRow:d,emptySingleRow:h,maxNumCols:m,leqno:g}=e;if(t.gullet.beginGroup(),d||t.gullet.macros.set("\\cr","\\\\\\relax"),!a){var x=t.gullet.expandMacroAsText("\\arraystretch");if(x==null)a=1;else if(a=parseFloat(x),!a||a<0)throw new $e("Invalid \\arraystretch: "+x)}t.gullet.beginGroup();var y=[],w=[y],S=[],k=[],j=c!=null?[]:void 0;function N(){c&&t.gullet.macros.set("\\@eqnsw","1",!0)}function T(){j&&(t.gullet.macros.get("\\df@tag")?(j.push(t.subparse([new Xi("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):j.push(!!c&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(N(),k.push(bR(t));;){var E=t.parseExpression(!1,d?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup(),E={type:"ordgroup",mode:t.mode,body:E},n&&(E={type:"styling",mode:t.mode,style:n,body:[E]}),y.push(E);var _=t.fetch().text;if(_==="&"){if(m&&y.length===m){if(d||l)throw new $e("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(_==="\\end"){T(),y.length===1&&E.type==="styling"&&E.body[0].body.length===0&&(w.length>1||!h)&&w.pop(),k.length0&&(N+=.25),d.push({pos:N,isDashed:He[Ot]})}for(T(a[0]),r=0;r0&&(H+=j,MHe))for(r=0;r=l)){var K=void 0;(s>0||e.hskipBeforeAndAfter)&&(K=$n.deflt(W.pregap,g),K!==0&&(Q=be.makeSpan(["arraycolsep"],[]),Q.style.width=Xe(K),z.push(Q)));var se=[];for(r=0;r0){for(var We=be.makeLineSpan("hline",n,h),Ye=be.makeLineSpan("hdashline",n,h),Je=[{type:"elem",elem:c,shift:0}];d.length>0;){var Oe=d.pop(),Ve=Oe.pos-U;Oe.isDashed?Je.push({type:"elem",elem:Ye,shift:Ve}):Je.push({type:"elem",elem:We,shift:Ve})}c=be.makeVList({positionType:"individualShift",children:Je},n)}if(X.length===0)return be.makeSpan(["mord"],[c],n);var Ue=be.makeVList({positionType:"individualShift",children:X},n);return Ue=be.makeSpan(["tag"],[Ue],n),be.makeFragment([c,Ue])},L3e={c:"center ",l:"left ",r:"right "},Uo=function(e,n){for(var r=[],s=new qe.MathNode("mtd",[],["mtr-glue"]),i=new qe.MathNode("mtd",[],["mml-eqn-num"]),a=0;a0){var y=e.cols,w="",S=!1,k=0,j=y.length;y[0].type==="separator"&&(g+="top ",k=1),y[y.length-1].type==="separator"&&(g+="bottom ",j-=1);for(var N=k;N0?"left ":"",g+=I[I.length-1].length>0?"right ":"";for(var P=1;P-1?"alignat":"align",i=e.envName==="split",a=du(e.parser,{cols:r,addJot:!0,autoTag:i?void 0:AN(e.envName),emptySingleRow:!0,colSeparationType:s,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},"display"),l,c=0,d={type:"ordgroup",mode:e.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var h="",m=0;m0&&x&&(S=1),r[y]={type:"align",align:w,pregap:S,postgap:0}}return a.colSeparationType=x?"align":"alignat",a};Qo({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var n=Ib(e[0]),r=n?[e[0]]:en(e[0],"ordgroup").body,s=r.map(function(a){var l=CN(a),c=l.text;if("lcr".indexOf(c)!==-1)return{type:"align",align:c};if(c==="|")return{type:"separator",separator:"|"};if(c===":")return{type:"separator",separator:":"};throw new $e("Unknown column alignment: "+c,a)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return du(t.parser,i,RN(t.envName))},htmlBuilder:Vo,mathmlBuilder:Uo});Qo({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(t.envName.charAt(t.envName.length-1)==="*"){var s=t.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),n=s.fetch().text,"lcr".indexOf(n)===-1)throw new $e("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:n}]}}var i=du(t.parser,r,RN(t.envName)),a=Math.max(0,...i.body.map(l=>l.length));return i.cols=new Array(a).fill({type:"align",align:n}),e?{type:"leftright",mode:t.mode,body:[i],left:e[0],right:e[1],rightColor:void 0}:i},htmlBuilder:Vo,mathmlBuilder:Uo});Qo({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},n=du(t.parser,e,"script");return n.colSeparationType="small",n},htmlBuilder:Vo,mathmlBuilder:Uo});Qo({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var n=Ib(e[0]),r=n?[e[0]]:en(e[0],"ordgroup").body,s=r.map(function(a){var l=CN(a),c=l.text;if("lc".indexOf(c)!==-1)return{type:"align",align:c};throw new $e("Unknown column alignment: "+c,a)});if(s.length>1)throw new $e("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5};if(i=du(t.parser,i,"script"),i.body.length>0&&i.body[0].length>1)throw new $e("{subarray} can contain only one column");return i},htmlBuilder:Vo,mathmlBuilder:Uo});Qo({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=du(t.parser,e,RN(t.envName));return{type:"leftright",mode:t.mode,body:[n],left:t.envName.indexOf("r")>-1?".":"\\{",right:t.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Vo,mathmlBuilder:Uo});Qo({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:wU,htmlBuilder:Vo,mathmlBuilder:Uo});Qo({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){["gather","gather*"].includes(t.envName)&&Fb(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:AN(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return du(t.parser,e,"display")},htmlBuilder:Vo,mathmlBuilder:Uo});Qo({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:wU,htmlBuilder:Vo,mathmlBuilder:Uo});Qo({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){Fb(t);var e={autoTag:AN(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return du(t.parser,e,"display")},htmlBuilder:Vo,mathmlBuilder:Uo});Qo({type:"array",names:["CD"],props:{numArgs:0},handler(t){return Fb(t),O3e(t.parser)},htmlBuilder:Vo,mathmlBuilder:Uo});Z("\\nonumber","\\gdef\\@eqnsw{0}");Z("\\notag","\\nonumber");tt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new $e(t.funcName+" valid only within array environment")}});var wR=yU;tt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:n,funcName:r}=t,s=e[0];if(s.type!=="ordgroup")throw new $e("Invalid environment name",s);for(var i="",a=0;a{var n=t.font,r=e.withFont(n);return Pn(t.body,r)},kU=(t,e)=>{var n=t.font,r=e.withFont(n);return lr(t.body,r)},SR={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};tt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=wy(e[0]),i=r;return i in SR&&(i=SR[i]),{type:"font",mode:n.mode,font:i.slice(1),body:s}},htmlBuilder:SU,mathmlBuilder:kU});tt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:n}=t,r=e[0],s=$n.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:Lb(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:s}}});tt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r,breakOnTokenText:s}=t,{mode:i}=n,a=n.parseExpression(!0,s),l="math"+r.slice(1);return{type:"font",mode:i,font:l,body:{type:"ordgroup",mode:n.mode,body:a}}},htmlBuilder:SU,mathmlBuilder:kU});var OU=(t,e)=>{var n=e;return t==="display"?n=n.id>=Et.SCRIPT.id?n.text():Et.DISPLAY:t==="text"&&n.size===Et.DISPLAY.size?n=Et.TEXT:t==="script"?n=Et.SCRIPT:t==="scriptscript"&&(n=Et.SCRIPTSCRIPT),n},DN=(t,e)=>{var n=OU(t.size,e.style),r=n.fracNum(),s=n.fracDen(),i;i=e.havingStyle(r);var a=Pn(t.numer,i,e);if(t.continued){var l=8.5/e.fontMetrics().ptPerEm,c=3.5/e.fontMetrics().ptPerEm;a.height=a.height0?y=3*g:y=7*g,w=e.fontMetrics().denom1):(m>0?(x=e.fontMetrics().num2,y=g):(x=e.fontMetrics().num3,y=3*g),w=e.fontMetrics().denom2);var S;if(h){var j=e.fontMetrics().axisHeight;x-a.depth-(j+.5*m){var n=new qe.MathNode("mfrac",[lr(t.numer,e),lr(t.denom,e)]);if(!t.hasBarLine)n.setAttribute("linethickness","0px");else if(t.barSize){var r=Rr(t.barSize,e);n.setAttribute("linethickness",Xe(r))}var s=OU(t.size,e.style);if(s.size!==e.style.size){n=new qe.MathNode("mstyle",[n]);var i=s.size===Et.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",i),n.setAttribute("scriptlevel","0")}if(t.leftDelim!=null||t.rightDelim!=null){var a=[];if(t.leftDelim!=null){var l=new qe.MathNode("mo",[new qe.TextNode(t.leftDelim.replace("\\",""))]);l.setAttribute("fence","true"),a.push(l)}if(a.push(n),t.rightDelim!=null){var c=new qe.MathNode("mo",[new qe.TextNode(t.rightDelim.replace("\\",""))]);c.setAttribute("fence","true"),a.push(c)}return jN(a)}return n};tt({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0],i=e[1],a,l=null,c=null,d="auto";switch(r){case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,l="(",c=")";break;case"\\\\bracefrac":a=!1,l="\\{",c="\\}";break;case"\\\\brackfrac":a=!1,l="[",c="]";break;default:throw new Error("Unrecognized genfrac command")}switch(r){case"\\dfrac":case"\\dbinom":d="display";break;case"\\tfrac":case"\\tbinom":d="text";break}return{type:"genfrac",mode:n.mode,continued:!1,numer:s,denom:i,hasBarLine:a,leftDelim:l,rightDelim:c,size:d,barSize:null}},htmlBuilder:DN,mathmlBuilder:PN});tt({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0],i=e[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:s,denom:i,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});tt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:n,token:r}=t,s;switch(n){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 kR=["display","text","script","scriptscript"],OR=function(e){var n=null;return e.length>0&&(n=e,n=n==="."?null:n),n};tt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:n}=t,r=e[4],s=e[5],i=wy(e[0]),a=i.type==="atom"&&i.family==="open"?OR(i.text):null,l=wy(e[1]),c=l.type==="atom"&&l.family==="close"?OR(l.text):null,d=en(e[2],"size"),h,m=null;d.isBlank?h=!0:(m=d.value,h=m.number>0);var g="auto",x=e[3];if(x.type==="ordgroup"){if(x.body.length>0){var y=en(x.body[0],"textord");g=kR[Number(y.text)]}}else x=en(x,"textord"),g=kR[Number(x.text)];return{type:"genfrac",mode:n.mode,numer:r,denom:s,continued:!1,hasBarLine:h,barSize:m,leftDelim:a,rightDelim:c,size:g}},htmlBuilder:DN,mathmlBuilder:PN});tt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:n,funcName:r,token:s}=t;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:en(e[0],"size").value,token:s}}});tt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0],i=m5e(en(e[1],"infix").size),a=e[2],l=i.number>0;return{type:"genfrac",mode:n.mode,numer:s,denom:a,continued:!1,hasBarLine:l,barSize:i,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:DN,mathmlBuilder:PN});var jU=(t,e)=>{var n=e.style,r,s;t.type==="supsub"?(r=t.sup?Pn(t.sup,e.havingStyle(n.sup()),e):Pn(t.sub,e.havingStyle(n.sub()),e),s=en(t.base,"horizBrace")):s=en(t,"horizBrace");var i=Pn(s.base,e.havingBaseStyle(Et.DISPLAY)),a=Vl.svgSpan(s,e),l;if(s.isOver?(l=be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:a}]},e),l.children[0].children[0].children[1].classes.push("svg-align")):(l=be.makeVList({positionType:"bottom",positionData:i.depth+.1+a.height,children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:i}]},e),l.children[0].children[0].children[0].classes.push("svg-align")),r){var c=be.makeSpan(["mord",s.isOver?"mover":"munder"],[l],e);s.isOver?l=be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:c},{type:"kern",size:.2},{type:"elem",elem:r}]},e):l=be.makeVList({positionType:"bottom",positionData:c.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:c}]},e)}return be.makeSpan(["mord",s.isOver?"mover":"munder"],[l],e)},B3e=(t,e)=>{var n=Vl.mathMLnode(t.label);return new qe.MathNode(t.isOver?"mover":"munder",[lr(t.base,e),n])};tt({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:e[0]}},htmlBuilder:jU,mathmlBuilder:B3e});tt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[1],s=en(e[0],"url").url;return n.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:n.mode,href:s,body:Qr(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var n=hs(t.body,e,!1);return be.makeAnchor(t.href,[],n,e)},mathmlBuilder:(t,e)=>{var n=nu(t.body,e);return n instanceof Qi||(n=new Qi("mrow",[n])),n.setAttribute("href",t.href),n}});tt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=en(e[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var s=[],i=0;i{var{parser:n,funcName:r,token:s}=t,i=en(e[0],"raw").string,a=e[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l,c={};switch(r){case"\\htmlClass":c.class=i,l={command:"\\htmlClass",class:i};break;case"\\htmlId":c.id=i,l={command:"\\htmlId",id:i};break;case"\\htmlStyle":c.style=i,l={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var d=i.split(","),h=0;h{var n=hs(t.body,e,!1),r=["enclosing"];t.attributes.class&&r.push(...t.attributes.class.trim().split(/\s+/));var s=be.makeSpan(r,n,e);for(var i in t.attributes)i!=="class"&&t.attributes.hasOwnProperty(i)&&s.setAttribute(i,t.attributes[i]);return s},mathmlBuilder:(t,e)=>nu(t.body,e)});tt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t;return{type:"htmlmathml",mode:n.mode,html:Qr(e[0]),mathml:Qr(e[1])}},htmlBuilder:(t,e)=>{var n=hs(t.html,e,!1);return be.makeFragment(n)},mathmlBuilder:(t,e)=>nu(t.mathml,e)});var YS=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!n)throw new $e("Invalid size: '"+e+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!QV(r))throw new $e("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};tt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,n)=>{var{parser:r}=t,s={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},l="";if(n[0])for(var c=en(n[0],"raw").string,d=c.split(","),h=0;h{var n=Rr(t.height,e),r=0;t.totalheight.number>0&&(r=Rr(t.totalheight,e)-n);var s=0;t.width.number>0&&(s=Rr(t.width,e));var i={height:Xe(n+r)};s>0&&(i.width=Xe(s)),r>0&&(i.verticalAlign=Xe(-r));var a=new B5e(t.src,t.alt,i);return a.height=n,a.depth=r,a},mathmlBuilder:(t,e)=>{var n=new qe.MathNode("mglyph",[]);n.setAttribute("alt",t.alt);var r=Rr(t.height,e),s=0;if(t.totalheight.number>0&&(s=Rr(t.totalheight,e)-r,n.setAttribute("valign",Xe(-s))),n.setAttribute("height",Xe(r+s)),t.width.number>0){var i=Rr(t.width,e);n.setAttribute("width",Xe(i))}return n.setAttribute("src",t.src),n}});tt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t,s=en(e[0],"size");if(n.settings.strict){var i=r[1]==="m",a=s.value.unit==="mu";i?(a||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:s.value}},htmlBuilder(t,e){return be.makeGlue(t.dimension,e)},mathmlBuilder(t,e){var n=Rr(t.dimension,e);return new qe.SpaceNode(n)}});tt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:s}},htmlBuilder:(t,e)=>{var n;t.alignment==="clap"?(n=be.makeSpan([],[Pn(t.body,e)]),n=be.makeSpan(["inner"],[n],e)):n=be.makeSpan(["inner"],[Pn(t.body,e)]);var r=be.makeSpan(["fix"],[]),s=be.makeSpan([t.alignment],[n,r],e),i=be.makeSpan(["strut"]);return i.style.height=Xe(s.height+s.depth),s.depth&&(i.style.verticalAlign=Xe(-s.depth)),s.children.unshift(i),s=be.makeSpan(["thinbox"],[s],e),be.makeSpan(["mord","vbox"],[s],e)},mathmlBuilder:(t,e)=>{var n=new qe.MathNode("mpadded",[lr(t.body,e)]);if(t.alignment!=="rlap"){var r=t.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});tt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:n,parser:r}=t,s=r.mode;r.switchMode("math");var i=n==="\\("?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",body:a}}});tt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new $e("Mismatched "+t.funcName)}});var jR=(t,e)=>{switch(e.style.size){case Et.DISPLAY.size:return t.display;case Et.TEXT.size:return t.text;case Et.SCRIPT.size:return t.script;case Et.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};tt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:n}=t;return{type:"mathchoice",mode:n.mode,display:Qr(e[0]),text:Qr(e[1]),script:Qr(e[2]),scriptscript:Qr(e[3])}},htmlBuilder:(t,e)=>{var n=jR(t,e),r=hs(n,e,!1);return be.makeFragment(r)},mathmlBuilder:(t,e)=>{var n=jR(t,e);return nu(n,e)}});var NU=(t,e,n,r,s,i,a)=>{t=be.makeSpan([],[t]);var l=n&&$n.isCharacterBox(n),c,d;if(e){var h=Pn(e,r.havingStyle(s.sup()),r);d={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-h.depth)}}if(n){var m=Pn(n,r.havingStyle(s.sub()),r);c={elem:m,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-m.height)}}var g;if(d&&c){var x=r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+t.depth+a;g=be.makeVList({positionType:"bottom",positionData:x,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:Xe(-i)},{type:"kern",size:c.kern},{type:"elem",elem:t},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:Xe(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(c){var y=t.height-a;g=be.makeVList({positionType:"top",positionData:y,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:Xe(-i)},{type:"kern",size:c.kern},{type:"elem",elem:t}]},r)}else if(d){var w=t.depth+a;g=be.makeVList({positionType:"bottom",positionData:w,children:[{type:"elem",elem:t},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:Xe(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else return t;var S=[g];if(c&&i!==0&&!l){var k=be.makeSpan(["mspace"],[],r);k.style.marginRight=Xe(i),S.unshift(k)}return be.makeSpan(["mop","op-limits"],S,r)},CU=["\\smallint"],Ff=(t,e)=>{var n,r,s=!1,i;t.type==="supsub"?(n=t.sup,r=t.sub,i=en(t.base,"op"),s=!0):i=en(t,"op");var a=e.style,l=!1;a.size===Et.DISPLAY.size&&i.symbol&&!CU.includes(i.name)&&(l=!0);var c;if(i.symbol){var d=l?"Size2-Regular":"Size1-Regular",h="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(h=i.name.slice(1),i.name=h==="oiint"?"\\iint":"\\iiint"),c=be.makeSymbol(i.name,d,"math",e,["mop","op-symbol",l?"large-op":"small-op"]),h.length>0){var m=c.italic,g=be.staticSvg(h+"Size"+(l?"2":"1"),e);c=be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:c,shift:0},{type:"elem",elem:g,shift:l?.08:0}]},e),i.name="\\"+h,c.classes.unshift("mop"),c.italic=m}}else if(i.body){var x=hs(i.body,e,!0);x.length===1&&x[0]instanceof Ma?(c=x[0],c.classes[0]="mop"):c=be.makeSpan(["mop"],x,e)}else{for(var y=[],w=1;w{var n;if(t.symbol)n=new Qi("mo",[Aa(t.name,t.mode)]),CU.includes(t.name)&&n.setAttribute("largeop","false");else if(t.body)n=new Qi("mo",_i(t.body,e));else{n=new Qi("mi",[new Mo(t.name.slice(1))]);var r=new Qi("mo",[Aa("⁡","text")]);t.parentIsSupSub?n=new Qi("mrow",[n,r]):n=tU([n,r])}return n},F3e={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};tt({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=r;return s.length===1&&(s=F3e[s]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:Ff,mathmlBuilder:mg});tt({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Qr(r)}},htmlBuilder:Ff,mathmlBuilder:mg});var q3e={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};tt({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(t){var{parser:e,funcName:n}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Ff,mathmlBuilder:mg});tt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Ff,mathmlBuilder:mg});tt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t,r=n;return r.length===1&&(r=q3e[r]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Ff,mathmlBuilder:mg});var TU=(t,e)=>{var n,r,s=!1,i;t.type==="supsub"?(n=t.sup,r=t.sub,i=en(t.base,"operatorname"),s=!0):i=en(t,"operatorname");var a;if(i.body.length>0){for(var l=i.body.map(m=>{var g=m.text;return typeof g=="string"?{type:"textord",mode:m.mode,text:g}:m}),c=hs(l,e.withFont("mathrm"),!0),d=0;d{for(var n=_i(t.body,e.withFont("mathrm")),r=!0,s=0;sh.toText()).join("");n=[new qe.TextNode(l)]}var c=new qe.MathNode("mi",n);c.setAttribute("mathvariant","normal");var d=new qe.MathNode("mo",[Aa("⁡","text")]);return t.parentIsSupSub?new qe.MathNode("mrow",[c,d]):qe.newDocumentFragment([c,d])};tt({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0];return{type:"operatorname",mode:n.mode,body:Qr(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:TU,mathmlBuilder:$3e});Z("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Sd({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?be.makeFragment(hs(t.body,e,!1)):be.makeSpan(["mord"],hs(t.body,e,!0),e)},mathmlBuilder(t,e){return nu(t.body,e,!0)}});tt({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:n}=t,r=e[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(t,e){var n=Pn(t.body,e.havingCrampedStyle()),r=be.makeLineSpan("overline-line",e),s=e.fontMetrics().defaultRuleThickness,i=be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]},e);return be.makeSpan(["mord","overline"],[i],e)},mathmlBuilder(t,e){var n=new qe.MathNode("mo",[new qe.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new qe.MathNode("mover",[lr(t.body,e),n]);return r.setAttribute("accent","true"),r}});tt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"phantom",mode:n.mode,body:Qr(r)}},htmlBuilder:(t,e)=>{var n=hs(t.body,e.withPhantom(),!1);return be.makeFragment(n)},mathmlBuilder:(t,e)=>{var n=_i(t.body,e);return new qe.MathNode("mphantom",n)}});tt({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(t,e)=>{var n=be.makeSpan([],[Pn(t.body,e.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r{var n=_i(Qr(t.body),e),r=new qe.MathNode("mphantom",n),s=new qe.MathNode("mpadded",[r]);return s.setAttribute("height","0px"),s.setAttribute("depth","0px"),s}});tt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(t,e)=>{var n=be.makeSpan(["inner"],[Pn(t.body,e.withPhantom())]),r=be.makeSpan(["fix"],[]);return be.makeSpan(["mord","rlap"],[n,r],e)},mathmlBuilder:(t,e)=>{var n=_i(Qr(t.body),e),r=new qe.MathNode("mphantom",n),s=new qe.MathNode("mpadded",[r]);return s.setAttribute("width","0px"),s}});tt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t,r=en(e[0],"size").value,s=e[1];return{type:"raisebox",mode:n.mode,dy:r,body:s}},htmlBuilder(t,e){var n=Pn(t.body,e),r=Rr(t.dy,e);return be.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},e)},mathmlBuilder(t,e){var n=new qe.MathNode("mpadded",[lr(t.body,e)]),r=t.dy.number+t.dy.unit;return n.setAttribute("voffset",r),n}});tt({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});tt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,n){var{parser:r}=t,s=n[0],i=en(e[0],"size"),a=en(e[1],"size");return{type:"rule",mode:r.mode,shift:s&&en(s,"size").value,width:i.value,height:a.value}},htmlBuilder(t,e){var n=be.makeSpan(["mord","rule"],[],e),r=Rr(t.width,e),s=Rr(t.height,e),i=t.shift?Rr(t.shift,e):0;return n.style.borderRightWidth=Xe(r),n.style.borderTopWidth=Xe(s),n.style.bottom=Xe(i),n.width=r,n.height=s+i,n.depth=-i,n.maxFontSize=s*1.125*e.sizeMultiplier,n},mathmlBuilder(t,e){var n=Rr(t.width,e),r=Rr(t.height,e),s=t.shift?Rr(t.shift,e):0,i=e.color&&e.getColor()||"black",a=new qe.MathNode("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",Xe(n)),a.setAttribute("height",Xe(r));var l=new qe.MathNode("mpadded",[a]);return s>=0?l.setAttribute("height",Xe(s)):(l.setAttribute("height",Xe(s)),l.setAttribute("depth",Xe(-s))),l.setAttribute("voffset",Xe(s)),l}});function EU(t,e,n){for(var r=hs(t,e,!1),s=e.sizeMultiplier/n.sizeMultiplier,i=0;i{var n=e.havingSize(t.size);return EU(t.body,n,e)};tt({type:"sizing",names:NR,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:n,funcName:r,parser:s}=t,i=s.parseExpression(!1,n);return{type:"sizing",mode:s.mode,size:NR.indexOf(r)+1,body:i}},htmlBuilder:H3e,mathmlBuilder:(t,e)=>{var n=e.havingSize(t.size),r=_i(t.body,n),s=new qe.MathNode("mstyle",r);return s.setAttribute("mathsize",Xe(n.sizeMultiplier)),s}});tt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,n)=>{var{parser:r}=t,s=!1,i=!1,a=n[0]&&en(n[0],"ordgroup");if(a)for(var l="",c=0;c{var n=be.makeSpan([],[Pn(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return n;if(t.smashHeight&&(n.height=0,n.children))for(var r=0;r{var n=new qe.MathNode("mpadded",[lr(t.body,e)]);return t.smashHeight&&n.setAttribute("height","0px"),t.smashDepth&&n.setAttribute("depth","0px"),n}});tt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,n){var{parser:r}=t,s=n[0],i=e[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(t,e){var n=Pn(t.body,e.havingCrampedStyle());n.height===0&&(n.height=e.fontMetrics().xHeight),n=be.wrapFragment(n,e);var r=e.fontMetrics(),s=r.defaultRuleThickness,i=s;e.style.idn.height+n.depth+a&&(a=(a+m-n.height-n.depth)/2);var g=c.height-n.height-a-d;n.style.paddingLeft=Xe(h);var x=be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+g)},{type:"elem",elem:c},{type:"kern",size:d}]},e);if(t.index){var y=e.havingStyle(Et.SCRIPTSCRIPT),w=Pn(t.index,y,e),S=.6*(x.height-x.depth),k=be.makeVList({positionType:"shift",positionData:-S,children:[{type:"elem",elem:w}]},e),j=be.makeSpan(["root"],[k]);return be.makeSpan(["mord","sqrt"],[j,x],e)}else return be.makeSpan(["mord","sqrt"],[x],e)},mathmlBuilder(t,e){var{body:n,index:r}=t;return r?new qe.MathNode("mroot",[lr(n,e),lr(r,e)]):new qe.MathNode("msqrt",[lr(n,e)])}});var CR={display:Et.DISPLAY,text:Et.TEXT,script:Et.SCRIPT,scriptscript:Et.SCRIPTSCRIPT};tt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:n,funcName:r,parser:s}=t,i=s.parseExpression(!0,n),a=r.slice(1,r.length-5);return{type:"styling",mode:s.mode,style:a,body:i}},htmlBuilder(t,e){var n=CR[t.style],r=e.havingStyle(n).withFont("");return EU(t.body,r,e)},mathmlBuilder(t,e){var n=CR[t.style],r=e.havingStyle(n),s=_i(t.body,r),i=new qe.MathNode("mstyle",s),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},l=a[t.style];return i.setAttribute("scriptlevel",l[0]),i.setAttribute("displaystyle",l[1]),i}});var Q3e=function(e,n){var r=e.base;if(r)if(r.type==="op"){var s=r.limits&&(n.style.size===Et.DISPLAY.size||r.alwaysHandleSupSub);return s?Ff:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(n.style.size===Et.DISPLAY.size||r.limits);return i?TU:null}else{if(r.type==="accent")return $n.isCharacterBox(r.base)?TN:null;if(r.type==="horizBrace"){var a=!e.sub;return a===r.isOver?jU:null}else return null}else return null};Sd({type:"supsub",htmlBuilder(t,e){var n=Q3e(t,e);if(n)return n(t,e);var{base:r,sup:s,sub:i}=t,a=Pn(r,e),l,c,d=e.fontMetrics(),h=0,m=0,g=r&&$n.isCharacterBox(r);if(s){var x=e.havingStyle(e.style.sup());l=Pn(s,x,e),g||(h=a.height-x.fontMetrics().supDrop*x.sizeMultiplier/e.sizeMultiplier)}if(i){var y=e.havingStyle(e.style.sub());c=Pn(i,y,e),g||(m=a.depth+y.fontMetrics().subDrop*y.sizeMultiplier/e.sizeMultiplier)}var w;e.style===Et.DISPLAY?w=d.sup1:e.style.cramped?w=d.sup3:w=d.sup2;var S=e.sizeMultiplier,k=Xe(.5/d.ptPerEm/S),j=null;if(c){var N=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");(a instanceof Ma||N)&&(j=Xe(-a.italic))}var T;if(l&&c){h=Math.max(h,w,l.depth+.25*d.xHeight),m=Math.max(m,d.sub2);var E=d.defaultRuleThickness,_=4*E;if(h-l.depth-(c.height-m)<_){m=_-(h-l.depth)+c.height;var M=.8*d.xHeight-(h-l.depth);M>0&&(h+=M,m-=M)}var I=[{type:"elem",elem:c,shift:m,marginRight:k,marginLeft:j},{type:"elem",elem:l,shift:-h,marginRight:k}];T=be.makeVList({positionType:"individualShift",children:I},e)}else if(c){m=Math.max(m,d.sub1,c.height-.8*d.xHeight);var P=[{type:"elem",elem:c,marginLeft:j,marginRight:k}];T=be.makeVList({positionType:"shift",positionData:m,children:P},e)}else if(l)h=Math.max(h,w,l.depth+.25*d.xHeight),T=be.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:l,marginRight:k}]},e);else throw new Error("supsub must have either sup or sub.");var L=zO(a,"right")||"mord";return be.makeSpan([L],[a,be.makeSpan(["msupsub"],[T])],e)},mathmlBuilder(t,e){var n=!1,r,s;t.base&&t.base.type==="horizBrace"&&(s=!!t.sup,s===t.base.isOver&&(n=!0,r=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var i=[lr(t.base,e)];t.sub&&i.push(lr(t.sub,e)),t.sup&&i.push(lr(t.sup,e));var a;if(n)a=r?"mover":"munder";else if(t.sub)if(t.sup){var d=t.base;d&&d.type==="op"&&d.limits&&e.style===Et.DISPLAY||d&&d.type==="operatorname"&&d.alwaysHandleSupSub&&(e.style===Et.DISPLAY||d.limits)?a="munderover":a="msubsup"}else{var c=t.base;c&&c.type==="op"&&c.limits&&(e.style===Et.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||e.style===Et.DISPLAY)?a="munder":a="msub"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===Et.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Et.DISPLAY)?a="mover":a="msup"}return new qe.MathNode(a,i)}});Sd({type:"atom",htmlBuilder(t,e){return be.mathsym(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var n=new qe.MathNode("mo",[Aa(t.text,t.mode)]);if(t.family==="bin"){var r=NN(t,e);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else t.family==="punct"?n.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&n.setAttribute("stretchy","false");return n}});var _U={mi:"italic",mn:"normal",mtext:"normal"};Sd({type:"mathord",htmlBuilder(t,e){return be.makeOrd(t,e,"mathord")},mathmlBuilder(t,e){var n=new qe.MathNode("mi",[Aa(t.text,t.mode,e)]),r=NN(t,e)||"italic";return r!==_U[n.type]&&n.setAttribute("mathvariant",r),n}});Sd({type:"textord",htmlBuilder(t,e){return be.makeOrd(t,e,"textord")},mathmlBuilder(t,e){var n=Aa(t.text,t.mode,e),r=NN(t,e)||"normal",s;return t.mode==="text"?s=new qe.MathNode("mtext",[n]):/[0-9]/.test(t.text)?s=new qe.MathNode("mn",[n]):t.text==="\\prime"?s=new qe.MathNode("mo",[n]):s=new qe.MathNode("mi",[n]),r!==_U[s.type]&&s.setAttribute("mathvariant",r),s}});var KS={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},ZS={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Sd({type:"spacing",htmlBuilder(t,e){if(ZS.hasOwnProperty(t.text)){var n=ZS[t.text].className||"";if(t.mode==="text"){var r=be.makeOrd(t,e,"textord");return r.classes.push(n),r}else return be.makeSpan(["mspace",n],[be.mathsym(t.text,t.mode,e)],e)}else{if(KS.hasOwnProperty(t.text))return be.makeSpan(["mspace",KS[t.text]],[],e);throw new $e('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var n;if(ZS.hasOwnProperty(t.text))n=new qe.MathNode("mtext",[new qe.TextNode(" ")]);else{if(KS.hasOwnProperty(t.text))return new qe.MathNode("mspace");throw new $e('Unknown type of space "'+t.text+'"')}return n}});var TR=()=>{var t=new qe.MathNode("mtd",[]);return t.setAttribute("width","50%"),t};Sd({type:"tag",mathmlBuilder(t,e){var n=new qe.MathNode("mtable",[new qe.MathNode("mtr",[TR(),new qe.MathNode("mtd",[nu(t.body,e)]),TR(),new qe.MathNode("mtd",[nu(t.tag,e)])])]);return n.setAttribute("width","100%"),n}});var ER={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},_R={"\\textbf":"textbf","\\textmd":"textmd"},V3e={"\\textit":"textit","\\textup":"textup"},MR=(t,e)=>{var n=t.font;if(n){if(ER[n])return e.withTextFontFamily(ER[n]);if(_R[n])return e.withTextFontWeight(_R[n]);if(n==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(V3e[n])};tt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t,s=e[0];return{type:"text",mode:n.mode,body:Qr(s),font:r}},htmlBuilder(t,e){var n=MR(t,e),r=hs(t.body,n,!0);return be.makeSpan(["mord","text"],r,n)},mathmlBuilder(t,e){var n=MR(t,e);return nu(t.body,n)}});tt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"underline",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=Pn(t.body,e),r=be.makeLineSpan("underline-line",e),s=e.fontMetrics().defaultRuleThickness,i=be.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:n}]},e);return be.makeSpan(["mord","underline"],[i],e)},mathmlBuilder(t,e){var n=new qe.MathNode("mo",[new qe.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new qe.MathNode("munder",[lr(t.body,e),n]);return r.setAttribute("accentunder","true"),r}});tt({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:n}=t;return{type:"vcenter",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=Pn(t.body,e),r=e.fontMetrics().axisHeight,s=.5*(n.height-r-(n.depth+r));return be.makeVList({positionType:"shift",positionData:s,children:[{type:"elem",elem:n}]},e)},mathmlBuilder(t,e){return new qe.MathNode("mpadded",[lr(t.body,e)],["vcenter"])}});tt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,n){throw new $e("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var n=AR(t),r=[],s=e.havingStyle(e.style.text()),i=0;it.body.replace(/ /g,t.star?"␣":" "),Fc=JV,MU=`[ \r - ]`,U3e="\\\\[a-zA-Z@]+",W3e="\\\\[^\uD800-\uDFFF]",G3e="("+U3e+")"+MU+"*",X3e=`\\\\( +-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 mg{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(),n=0;nn.toText();return this.children.map(e).join("")}}var _o={"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]}},A1={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]},dR={Å:"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 J5e(t,e){_o[t]=e}function NN(t,e,n){if(!_o[e])throw new Error("Font metrics not found for font: "+e+".");var r=t.charCodeAt(0),s=_o[e][r];if(!s&&t[0]in dR&&(r=dR[t[0]].charCodeAt(0),s=_o[e][r]),!s&&n==="text"&&XV(r)&&(s=_o[e][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var VS={};function e3e(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!VS[e]){var n=VS[e]={cssEmPerMu:A1.quad[e]/18};for(var r in A1)A1.hasOwnProperty(r)&&(n[r]=A1[r][e])}return VS[e]}var t3e=[[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]],hR=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],fR=function(e,n){return n.size<2?e:t3e[e-1][n.size-1]};class Tl{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||Tl.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=hR[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var n={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)&&(n[r]=e[r]);return new Tl(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:fR(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:hR[e-1]})}havingBaseStyle(e){e=e||this.style.text();var n=fR(Tl.BASESIZE,e);return this.size===n&&this.textSize===Tl.BASESIZE&&this.style===e?this:this.extend({style:e,size:n})}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!==Tl.BASESIZE?["sizing","reset-size"+this.size,"size"+Tl.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=e3e(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Tl.BASESIZE=6;var BO={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},n3e={ex:!0,em:!0,mu:!0},YV=function(e){return typeof e!="string"&&(e=e.unit),e in BO||e in n3e||e==="ex"},Rr=function(e,n){var r;if(e.unit in BO)r=BO[e.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(e.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var s;if(n.style.isTight()?s=n.havingStyle(n.style.text()):s=n,e.unit==="ex")r=s.fontMetrics().xHeight;else if(e.unit==="em")r=s.fontMetrics().quad;else throw new $e("Invalid unit: '"+e.unit+"'");s!==n&&(r*=s.sizeMultiplier/n.sizeMultiplier)}return Math.min(e.number*r,n.maxSize)},Xe=function(e){return+e.toFixed(4)+"em"},eu=function(e){return e.filter(n=>n).join(" ")},KV=function(e,n,r){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var s=n.getColor();s&&(this.style.color=s)}},ZV=function(e){var n=document.createElement(e);n.className=eu(this.classes);for(var r in this.style)this.style.hasOwnProperty(r)&&(n.style[r]=this.style[r]);for(var s in this.attributes)this.attributes.hasOwnProperty(s)&&n.setAttribute(s,this.attributes[s]);for(var i=0;i/=\x00-\x1f]/,JV=function(e){var n="<"+e;this.classes.length&&(n+=' class="'+$n.escape(eu(this.classes))+'"');var r="";for(var s in this.style)this.style.hasOwnProperty(s)&&(r+=$n.hyphenate(s)+":"+this.style[s]+";");r&&(n+=' style="'+$n.escape(r)+'"');for(var i in this.attributes)if(this.attributes.hasOwnProperty(i)){if(r3e.test(i))throw new $e("Invalid attribute name '"+i+"'");n+=" "+i+'="'+$n.escape(this.attributes[i])+'"'}n+=">";for(var a=0;a",n};class pg{constructor(e,n,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,KV.call(this,e,r,s),this.children=n||[]}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return ZV.call(this,"span")}toMarkup(){return JV.call(this,"span")}}class CN{constructor(e,n,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,KV.call(this,n,s),this.children=r||[],this.setAttribute("href",e)}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return ZV.call(this,"a")}toMarkup(){return JV.call(this,"a")}}class s3e{constructor(e,n,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=n,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 n in this.style)this.style.hasOwnProperty(n)&&(e.style[n]=this.style[n]);return e}toMarkup(){var e=''+$n.escape(this.alt)+'0&&(n=document.createElement("span"),n.style.marginRight=Xe(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=eu(this.classes));for(var r in this.style)this.style.hasOwnProperty(r)&&(n=n||document.createElement("span"),n.style[r]=this.style[r]);return n?(n.appendChild(e),n):e}toMarkup(){var e=!1,n="0&&(r+="margin-right:"+this.italic+"em;");for(var s in this.style)this.style.hasOwnProperty(s)&&(r+=$n.hyphenate(s)+":"+this.style[s]+";");r&&(e=!0,n+=' style="'+$n.escape(r)+'"');var i=$n.escape(this.text);return e?(n+=">",n+=i,n+="",n):i}}class Ql{constructor(e,n){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=n||{}}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"svg");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);for(var s=0;s':''}}class FO{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"line");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var e=" but got "+String(t)+".")}var o3e={bin:1,close:1,inner:1,open:1,punct:1,rel:1},l3e={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},dr={math:{},text:{}};function M(t,e,n,r,s,i){dr[t][s]={font:e,group:n,replace:r},i&&r&&(dr[t][r]=dr[t][s])}var D="math",Be="text",H="main",le="ams",jr="accent-token",lt="bin",ai="close",qf="inner",Tt="mathord",os="op-token",Ji="open",qb="punct",ce="rel",Zl="spacing",me="textord";M(D,H,ce,"≡","\\equiv",!0);M(D,H,ce,"≺","\\prec",!0);M(D,H,ce,"≻","\\succ",!0);M(D,H,ce,"∼","\\sim",!0);M(D,H,ce,"⊥","\\perp");M(D,H,ce,"⪯","\\preceq",!0);M(D,H,ce,"⪰","\\succeq",!0);M(D,H,ce,"≃","\\simeq",!0);M(D,H,ce,"∣","\\mid",!0);M(D,H,ce,"≪","\\ll",!0);M(D,H,ce,"≫","\\gg",!0);M(D,H,ce,"≍","\\asymp",!0);M(D,H,ce,"∥","\\parallel");M(D,H,ce,"⋈","\\bowtie",!0);M(D,H,ce,"⌣","\\smile",!0);M(D,H,ce,"⊑","\\sqsubseteq",!0);M(D,H,ce,"⊒","\\sqsupseteq",!0);M(D,H,ce,"≐","\\doteq",!0);M(D,H,ce,"⌢","\\frown",!0);M(D,H,ce,"∋","\\ni",!0);M(D,H,ce,"∝","\\propto",!0);M(D,H,ce,"⊢","\\vdash",!0);M(D,H,ce,"⊣","\\dashv",!0);M(D,H,ce,"∋","\\owns");M(D,H,qb,".","\\ldotp");M(D,H,qb,"⋅","\\cdotp");M(D,H,me,"#","\\#");M(Be,H,me,"#","\\#");M(D,H,me,"&","\\&");M(Be,H,me,"&","\\&");M(D,H,me,"ℵ","\\aleph",!0);M(D,H,me,"∀","\\forall",!0);M(D,H,me,"ℏ","\\hbar",!0);M(D,H,me,"∃","\\exists",!0);M(D,H,me,"∇","\\nabla",!0);M(D,H,me,"♭","\\flat",!0);M(D,H,me,"ℓ","\\ell",!0);M(D,H,me,"♮","\\natural",!0);M(D,H,me,"♣","\\clubsuit",!0);M(D,H,me,"℘","\\wp",!0);M(D,H,me,"♯","\\sharp",!0);M(D,H,me,"♢","\\diamondsuit",!0);M(D,H,me,"ℜ","\\Re",!0);M(D,H,me,"♡","\\heartsuit",!0);M(D,H,me,"ℑ","\\Im",!0);M(D,H,me,"♠","\\spadesuit",!0);M(D,H,me,"§","\\S",!0);M(Be,H,me,"§","\\S");M(D,H,me,"¶","\\P",!0);M(Be,H,me,"¶","\\P");M(D,H,me,"†","\\dag");M(Be,H,me,"†","\\dag");M(Be,H,me,"†","\\textdagger");M(D,H,me,"‡","\\ddag");M(Be,H,me,"‡","\\ddag");M(Be,H,me,"‡","\\textdaggerdbl");M(D,H,ai,"⎱","\\rmoustache",!0);M(D,H,Ji,"⎰","\\lmoustache",!0);M(D,H,ai,"⟯","\\rgroup",!0);M(D,H,Ji,"⟮","\\lgroup",!0);M(D,H,lt,"∓","\\mp",!0);M(D,H,lt,"⊖","\\ominus",!0);M(D,H,lt,"⊎","\\uplus",!0);M(D,H,lt,"⊓","\\sqcap",!0);M(D,H,lt,"∗","\\ast");M(D,H,lt,"⊔","\\sqcup",!0);M(D,H,lt,"◯","\\bigcirc",!0);M(D,H,lt,"∙","\\bullet",!0);M(D,H,lt,"‡","\\ddagger");M(D,H,lt,"≀","\\wr",!0);M(D,H,lt,"⨿","\\amalg");M(D,H,lt,"&","\\And");M(D,H,ce,"⟵","\\longleftarrow",!0);M(D,H,ce,"⇐","\\Leftarrow",!0);M(D,H,ce,"⟸","\\Longleftarrow",!0);M(D,H,ce,"⟶","\\longrightarrow",!0);M(D,H,ce,"⇒","\\Rightarrow",!0);M(D,H,ce,"⟹","\\Longrightarrow",!0);M(D,H,ce,"↔","\\leftrightarrow",!0);M(D,H,ce,"⟷","\\longleftrightarrow",!0);M(D,H,ce,"⇔","\\Leftrightarrow",!0);M(D,H,ce,"⟺","\\Longleftrightarrow",!0);M(D,H,ce,"↦","\\mapsto",!0);M(D,H,ce,"⟼","\\longmapsto",!0);M(D,H,ce,"↗","\\nearrow",!0);M(D,H,ce,"↩","\\hookleftarrow",!0);M(D,H,ce,"↪","\\hookrightarrow",!0);M(D,H,ce,"↘","\\searrow",!0);M(D,H,ce,"↼","\\leftharpoonup",!0);M(D,H,ce,"⇀","\\rightharpoonup",!0);M(D,H,ce,"↙","\\swarrow",!0);M(D,H,ce,"↽","\\leftharpoondown",!0);M(D,H,ce,"⇁","\\rightharpoondown",!0);M(D,H,ce,"↖","\\nwarrow",!0);M(D,H,ce,"⇌","\\rightleftharpoons",!0);M(D,le,ce,"≮","\\nless",!0);M(D,le,ce,"","\\@nleqslant");M(D,le,ce,"","\\@nleqq");M(D,le,ce,"⪇","\\lneq",!0);M(D,le,ce,"≨","\\lneqq",!0);M(D,le,ce,"","\\@lvertneqq");M(D,le,ce,"⋦","\\lnsim",!0);M(D,le,ce,"⪉","\\lnapprox",!0);M(D,le,ce,"⊀","\\nprec",!0);M(D,le,ce,"⋠","\\npreceq",!0);M(D,le,ce,"⋨","\\precnsim",!0);M(D,le,ce,"⪹","\\precnapprox",!0);M(D,le,ce,"≁","\\nsim",!0);M(D,le,ce,"","\\@nshortmid");M(D,le,ce,"∤","\\nmid",!0);M(D,le,ce,"⊬","\\nvdash",!0);M(D,le,ce,"⊭","\\nvDash",!0);M(D,le,ce,"⋪","\\ntriangleleft");M(D,le,ce,"⋬","\\ntrianglelefteq",!0);M(D,le,ce,"⊊","\\subsetneq",!0);M(D,le,ce,"","\\@varsubsetneq");M(D,le,ce,"⫋","\\subsetneqq",!0);M(D,le,ce,"","\\@varsubsetneqq");M(D,le,ce,"≯","\\ngtr",!0);M(D,le,ce,"","\\@ngeqslant");M(D,le,ce,"","\\@ngeqq");M(D,le,ce,"⪈","\\gneq",!0);M(D,le,ce,"≩","\\gneqq",!0);M(D,le,ce,"","\\@gvertneqq");M(D,le,ce,"⋧","\\gnsim",!0);M(D,le,ce,"⪊","\\gnapprox",!0);M(D,le,ce,"⊁","\\nsucc",!0);M(D,le,ce,"⋡","\\nsucceq",!0);M(D,le,ce,"⋩","\\succnsim",!0);M(D,le,ce,"⪺","\\succnapprox",!0);M(D,le,ce,"≆","\\ncong",!0);M(D,le,ce,"","\\@nshortparallel");M(D,le,ce,"∦","\\nparallel",!0);M(D,le,ce,"⊯","\\nVDash",!0);M(D,le,ce,"⋫","\\ntriangleright");M(D,le,ce,"⋭","\\ntrianglerighteq",!0);M(D,le,ce,"","\\@nsupseteqq");M(D,le,ce,"⊋","\\supsetneq",!0);M(D,le,ce,"","\\@varsupsetneq");M(D,le,ce,"⫌","\\supsetneqq",!0);M(D,le,ce,"","\\@varsupsetneqq");M(D,le,ce,"⊮","\\nVdash",!0);M(D,le,ce,"⪵","\\precneqq",!0);M(D,le,ce,"⪶","\\succneqq",!0);M(D,le,ce,"","\\@nsubseteqq");M(D,le,lt,"⊴","\\unlhd");M(D,le,lt,"⊵","\\unrhd");M(D,le,ce,"↚","\\nleftarrow",!0);M(D,le,ce,"↛","\\nrightarrow",!0);M(D,le,ce,"⇍","\\nLeftarrow",!0);M(D,le,ce,"⇏","\\nRightarrow",!0);M(D,le,ce,"↮","\\nleftrightarrow",!0);M(D,le,ce,"⇎","\\nLeftrightarrow",!0);M(D,le,ce,"△","\\vartriangle");M(D,le,me,"ℏ","\\hslash");M(D,le,me,"▽","\\triangledown");M(D,le,me,"◊","\\lozenge");M(D,le,me,"Ⓢ","\\circledS");M(D,le,me,"®","\\circledR");M(Be,le,me,"®","\\circledR");M(D,le,me,"∡","\\measuredangle",!0);M(D,le,me,"∄","\\nexists");M(D,le,me,"℧","\\mho");M(D,le,me,"Ⅎ","\\Finv",!0);M(D,le,me,"⅁","\\Game",!0);M(D,le,me,"‵","\\backprime");M(D,le,me,"▲","\\blacktriangle");M(D,le,me,"▼","\\blacktriangledown");M(D,le,me,"■","\\blacksquare");M(D,le,me,"⧫","\\blacklozenge");M(D,le,me,"★","\\bigstar");M(D,le,me,"∢","\\sphericalangle",!0);M(D,le,me,"∁","\\complement",!0);M(D,le,me,"ð","\\eth",!0);M(Be,H,me,"ð","ð");M(D,le,me,"╱","\\diagup");M(D,le,me,"╲","\\diagdown");M(D,le,me,"□","\\square");M(D,le,me,"□","\\Box");M(D,le,me,"◊","\\Diamond");M(D,le,me,"¥","\\yen",!0);M(Be,le,me,"¥","\\yen",!0);M(D,le,me,"✓","\\checkmark",!0);M(Be,le,me,"✓","\\checkmark");M(D,le,me,"ℶ","\\beth",!0);M(D,le,me,"ℸ","\\daleth",!0);M(D,le,me,"ℷ","\\gimel",!0);M(D,le,me,"ϝ","\\digamma",!0);M(D,le,me,"ϰ","\\varkappa");M(D,le,Ji,"┌","\\@ulcorner",!0);M(D,le,ai,"┐","\\@urcorner",!0);M(D,le,Ji,"└","\\@llcorner",!0);M(D,le,ai,"┘","\\@lrcorner",!0);M(D,le,ce,"≦","\\leqq",!0);M(D,le,ce,"⩽","\\leqslant",!0);M(D,le,ce,"⪕","\\eqslantless",!0);M(D,le,ce,"≲","\\lesssim",!0);M(D,le,ce,"⪅","\\lessapprox",!0);M(D,le,ce,"≊","\\approxeq",!0);M(D,le,lt,"⋖","\\lessdot");M(D,le,ce,"⋘","\\lll",!0);M(D,le,ce,"≶","\\lessgtr",!0);M(D,le,ce,"⋚","\\lesseqgtr",!0);M(D,le,ce,"⪋","\\lesseqqgtr",!0);M(D,le,ce,"≑","\\doteqdot");M(D,le,ce,"≓","\\risingdotseq",!0);M(D,le,ce,"≒","\\fallingdotseq",!0);M(D,le,ce,"∽","\\backsim",!0);M(D,le,ce,"⋍","\\backsimeq",!0);M(D,le,ce,"⫅","\\subseteqq",!0);M(D,le,ce,"⋐","\\Subset",!0);M(D,le,ce,"⊏","\\sqsubset",!0);M(D,le,ce,"≼","\\preccurlyeq",!0);M(D,le,ce,"⋞","\\curlyeqprec",!0);M(D,le,ce,"≾","\\precsim",!0);M(D,le,ce,"⪷","\\precapprox",!0);M(D,le,ce,"⊲","\\vartriangleleft");M(D,le,ce,"⊴","\\trianglelefteq");M(D,le,ce,"⊨","\\vDash",!0);M(D,le,ce,"⊪","\\Vvdash",!0);M(D,le,ce,"⌣","\\smallsmile");M(D,le,ce,"⌢","\\smallfrown");M(D,le,ce,"≏","\\bumpeq",!0);M(D,le,ce,"≎","\\Bumpeq",!0);M(D,le,ce,"≧","\\geqq",!0);M(D,le,ce,"⩾","\\geqslant",!0);M(D,le,ce,"⪖","\\eqslantgtr",!0);M(D,le,ce,"≳","\\gtrsim",!0);M(D,le,ce,"⪆","\\gtrapprox",!0);M(D,le,lt,"⋗","\\gtrdot");M(D,le,ce,"⋙","\\ggg",!0);M(D,le,ce,"≷","\\gtrless",!0);M(D,le,ce,"⋛","\\gtreqless",!0);M(D,le,ce,"⪌","\\gtreqqless",!0);M(D,le,ce,"≖","\\eqcirc",!0);M(D,le,ce,"≗","\\circeq",!0);M(D,le,ce,"≜","\\triangleq",!0);M(D,le,ce,"∼","\\thicksim");M(D,le,ce,"≈","\\thickapprox");M(D,le,ce,"⫆","\\supseteqq",!0);M(D,le,ce,"⋑","\\Supset",!0);M(D,le,ce,"⊐","\\sqsupset",!0);M(D,le,ce,"≽","\\succcurlyeq",!0);M(D,le,ce,"⋟","\\curlyeqsucc",!0);M(D,le,ce,"≿","\\succsim",!0);M(D,le,ce,"⪸","\\succapprox",!0);M(D,le,ce,"⊳","\\vartriangleright");M(D,le,ce,"⊵","\\trianglerighteq");M(D,le,ce,"⊩","\\Vdash",!0);M(D,le,ce,"∣","\\shortmid");M(D,le,ce,"∥","\\shortparallel");M(D,le,ce,"≬","\\between",!0);M(D,le,ce,"⋔","\\pitchfork",!0);M(D,le,ce,"∝","\\varpropto");M(D,le,ce,"◀","\\blacktriangleleft");M(D,le,ce,"∴","\\therefore",!0);M(D,le,ce,"∍","\\backepsilon");M(D,le,ce,"▶","\\blacktriangleright");M(D,le,ce,"∵","\\because",!0);M(D,le,ce,"⋘","\\llless");M(D,le,ce,"⋙","\\gggtr");M(D,le,lt,"⊲","\\lhd");M(D,le,lt,"⊳","\\rhd");M(D,le,ce,"≂","\\eqsim",!0);M(D,H,ce,"⋈","\\Join");M(D,le,ce,"≑","\\Doteq",!0);M(D,le,lt,"∔","\\dotplus",!0);M(D,le,lt,"∖","\\smallsetminus");M(D,le,lt,"⋒","\\Cap",!0);M(D,le,lt,"⋓","\\Cup",!0);M(D,le,lt,"⩞","\\doublebarwedge",!0);M(D,le,lt,"⊟","\\boxminus",!0);M(D,le,lt,"⊞","\\boxplus",!0);M(D,le,lt,"⋇","\\divideontimes",!0);M(D,le,lt,"⋉","\\ltimes",!0);M(D,le,lt,"⋊","\\rtimes",!0);M(D,le,lt,"⋋","\\leftthreetimes",!0);M(D,le,lt,"⋌","\\rightthreetimes",!0);M(D,le,lt,"⋏","\\curlywedge",!0);M(D,le,lt,"⋎","\\curlyvee",!0);M(D,le,lt,"⊝","\\circleddash",!0);M(D,le,lt,"⊛","\\circledast",!0);M(D,le,lt,"⋅","\\centerdot");M(D,le,lt,"⊺","\\intercal",!0);M(D,le,lt,"⋒","\\doublecap");M(D,le,lt,"⋓","\\doublecup");M(D,le,lt,"⊠","\\boxtimes",!0);M(D,le,ce,"⇢","\\dashrightarrow",!0);M(D,le,ce,"⇠","\\dashleftarrow",!0);M(D,le,ce,"⇇","\\leftleftarrows",!0);M(D,le,ce,"⇆","\\leftrightarrows",!0);M(D,le,ce,"⇚","\\Lleftarrow",!0);M(D,le,ce,"↞","\\twoheadleftarrow",!0);M(D,le,ce,"↢","\\leftarrowtail",!0);M(D,le,ce,"↫","\\looparrowleft",!0);M(D,le,ce,"⇋","\\leftrightharpoons",!0);M(D,le,ce,"↶","\\curvearrowleft",!0);M(D,le,ce,"↺","\\circlearrowleft",!0);M(D,le,ce,"↰","\\Lsh",!0);M(D,le,ce,"⇈","\\upuparrows",!0);M(D,le,ce,"↿","\\upharpoonleft",!0);M(D,le,ce,"⇃","\\downharpoonleft",!0);M(D,H,ce,"⊶","\\origof",!0);M(D,H,ce,"⊷","\\imageof",!0);M(D,le,ce,"⊸","\\multimap",!0);M(D,le,ce,"↭","\\leftrightsquigarrow",!0);M(D,le,ce,"⇉","\\rightrightarrows",!0);M(D,le,ce,"⇄","\\rightleftarrows",!0);M(D,le,ce,"↠","\\twoheadrightarrow",!0);M(D,le,ce,"↣","\\rightarrowtail",!0);M(D,le,ce,"↬","\\looparrowright",!0);M(D,le,ce,"↷","\\curvearrowright",!0);M(D,le,ce,"↻","\\circlearrowright",!0);M(D,le,ce,"↱","\\Rsh",!0);M(D,le,ce,"⇊","\\downdownarrows",!0);M(D,le,ce,"↾","\\upharpoonright",!0);M(D,le,ce,"⇂","\\downharpoonright",!0);M(D,le,ce,"⇝","\\rightsquigarrow",!0);M(D,le,ce,"⇝","\\leadsto");M(D,le,ce,"⇛","\\Rrightarrow",!0);M(D,le,ce,"↾","\\restriction");M(D,H,me,"‘","`");M(D,H,me,"$","\\$");M(Be,H,me,"$","\\$");M(Be,H,me,"$","\\textdollar");M(D,H,me,"%","\\%");M(Be,H,me,"%","\\%");M(D,H,me,"_","\\_");M(Be,H,me,"_","\\_");M(Be,H,me,"_","\\textunderscore");M(D,H,me,"∠","\\angle",!0);M(D,H,me,"∞","\\infty",!0);M(D,H,me,"′","\\prime");M(D,H,me,"△","\\triangle");M(D,H,me,"Γ","\\Gamma",!0);M(D,H,me,"Δ","\\Delta",!0);M(D,H,me,"Θ","\\Theta",!0);M(D,H,me,"Λ","\\Lambda",!0);M(D,H,me,"Ξ","\\Xi",!0);M(D,H,me,"Π","\\Pi",!0);M(D,H,me,"Σ","\\Sigma",!0);M(D,H,me,"Υ","\\Upsilon",!0);M(D,H,me,"Φ","\\Phi",!0);M(D,H,me,"Ψ","\\Psi",!0);M(D,H,me,"Ω","\\Omega",!0);M(D,H,me,"A","Α");M(D,H,me,"B","Β");M(D,H,me,"E","Ε");M(D,H,me,"Z","Ζ");M(D,H,me,"H","Η");M(D,H,me,"I","Ι");M(D,H,me,"K","Κ");M(D,H,me,"M","Μ");M(D,H,me,"N","Ν");M(D,H,me,"O","Ο");M(D,H,me,"P","Ρ");M(D,H,me,"T","Τ");M(D,H,me,"X","Χ");M(D,H,me,"¬","\\neg",!0);M(D,H,me,"¬","\\lnot");M(D,H,me,"⊤","\\top");M(D,H,me,"⊥","\\bot");M(D,H,me,"∅","\\emptyset");M(D,le,me,"∅","\\varnothing");M(D,H,Tt,"α","\\alpha",!0);M(D,H,Tt,"β","\\beta",!0);M(D,H,Tt,"γ","\\gamma",!0);M(D,H,Tt,"δ","\\delta",!0);M(D,H,Tt,"ϵ","\\epsilon",!0);M(D,H,Tt,"ζ","\\zeta",!0);M(D,H,Tt,"η","\\eta",!0);M(D,H,Tt,"θ","\\theta",!0);M(D,H,Tt,"ι","\\iota",!0);M(D,H,Tt,"κ","\\kappa",!0);M(D,H,Tt,"λ","\\lambda",!0);M(D,H,Tt,"μ","\\mu",!0);M(D,H,Tt,"ν","\\nu",!0);M(D,H,Tt,"ξ","\\xi",!0);M(D,H,Tt,"ο","\\omicron",!0);M(D,H,Tt,"π","\\pi",!0);M(D,H,Tt,"ρ","\\rho",!0);M(D,H,Tt,"σ","\\sigma",!0);M(D,H,Tt,"τ","\\tau",!0);M(D,H,Tt,"υ","\\upsilon",!0);M(D,H,Tt,"ϕ","\\phi",!0);M(D,H,Tt,"χ","\\chi",!0);M(D,H,Tt,"ψ","\\psi",!0);M(D,H,Tt,"ω","\\omega",!0);M(D,H,Tt,"ε","\\varepsilon",!0);M(D,H,Tt,"ϑ","\\vartheta",!0);M(D,H,Tt,"ϖ","\\varpi",!0);M(D,H,Tt,"ϱ","\\varrho",!0);M(D,H,Tt,"ς","\\varsigma",!0);M(D,H,Tt,"φ","\\varphi",!0);M(D,H,lt,"∗","*",!0);M(D,H,lt,"+","+");M(D,H,lt,"−","-",!0);M(D,H,lt,"⋅","\\cdot",!0);M(D,H,lt,"∘","\\circ",!0);M(D,H,lt,"÷","\\div",!0);M(D,H,lt,"±","\\pm",!0);M(D,H,lt,"×","\\times",!0);M(D,H,lt,"∩","\\cap",!0);M(D,H,lt,"∪","\\cup",!0);M(D,H,lt,"∖","\\setminus",!0);M(D,H,lt,"∧","\\land");M(D,H,lt,"∨","\\lor");M(D,H,lt,"∧","\\wedge",!0);M(D,H,lt,"∨","\\vee",!0);M(D,H,me,"√","\\surd");M(D,H,Ji,"⟨","\\langle",!0);M(D,H,Ji,"∣","\\lvert");M(D,H,Ji,"∥","\\lVert");M(D,H,ai,"?","?");M(D,H,ai,"!","!");M(D,H,ai,"⟩","\\rangle",!0);M(D,H,ai,"∣","\\rvert");M(D,H,ai,"∥","\\rVert");M(D,H,ce,"=","=");M(D,H,ce,":",":");M(D,H,ce,"≈","\\approx",!0);M(D,H,ce,"≅","\\cong",!0);M(D,H,ce,"≥","\\ge");M(D,H,ce,"≥","\\geq",!0);M(D,H,ce,"←","\\gets");M(D,H,ce,">","\\gt",!0);M(D,H,ce,"∈","\\in",!0);M(D,H,ce,"","\\@not");M(D,H,ce,"⊂","\\subset",!0);M(D,H,ce,"⊃","\\supset",!0);M(D,H,ce,"⊆","\\subseteq",!0);M(D,H,ce,"⊇","\\supseteq",!0);M(D,le,ce,"⊈","\\nsubseteq",!0);M(D,le,ce,"⊉","\\nsupseteq",!0);M(D,H,ce,"⊨","\\models");M(D,H,ce,"←","\\leftarrow",!0);M(D,H,ce,"≤","\\le");M(D,H,ce,"≤","\\leq",!0);M(D,H,ce,"<","\\lt",!0);M(D,H,ce,"→","\\rightarrow",!0);M(D,H,ce,"→","\\to");M(D,le,ce,"≱","\\ngeq",!0);M(D,le,ce,"≰","\\nleq",!0);M(D,H,Zl," ","\\ ");M(D,H,Zl," ","\\space");M(D,H,Zl," ","\\nobreakspace");M(Be,H,Zl," ","\\ ");M(Be,H,Zl," "," ");M(Be,H,Zl," ","\\space");M(Be,H,Zl," ","\\nobreakspace");M(D,H,Zl,null,"\\nobreak");M(D,H,Zl,null,"\\allowbreak");M(D,H,qb,",",",");M(D,H,qb,";",";");M(D,le,lt,"⊼","\\barwedge",!0);M(D,le,lt,"⊻","\\veebar",!0);M(D,H,lt,"⊙","\\odot",!0);M(D,H,lt,"⊕","\\oplus",!0);M(D,H,lt,"⊗","\\otimes",!0);M(D,H,me,"∂","\\partial",!0);M(D,H,lt,"⊘","\\oslash",!0);M(D,le,lt,"⊚","\\circledcirc",!0);M(D,le,lt,"⊡","\\boxdot",!0);M(D,H,lt,"△","\\bigtriangleup");M(D,H,lt,"▽","\\bigtriangledown");M(D,H,lt,"†","\\dagger");M(D,H,lt,"⋄","\\diamond");M(D,H,lt,"⋆","\\star");M(D,H,lt,"◃","\\triangleleft");M(D,H,lt,"▹","\\triangleright");M(D,H,Ji,"{","\\{");M(Be,H,me,"{","\\{");M(Be,H,me,"{","\\textbraceleft");M(D,H,ai,"}","\\}");M(Be,H,me,"}","\\}");M(Be,H,me,"}","\\textbraceright");M(D,H,Ji,"{","\\lbrace");M(D,H,ai,"}","\\rbrace");M(D,H,Ji,"[","\\lbrack",!0);M(Be,H,me,"[","\\lbrack",!0);M(D,H,ai,"]","\\rbrack",!0);M(Be,H,me,"]","\\rbrack",!0);M(D,H,Ji,"(","\\lparen",!0);M(D,H,ai,")","\\rparen",!0);M(Be,H,me,"<","\\textless",!0);M(Be,H,me,">","\\textgreater",!0);M(D,H,Ji,"⌊","\\lfloor",!0);M(D,H,ai,"⌋","\\rfloor",!0);M(D,H,Ji,"⌈","\\lceil",!0);M(D,H,ai,"⌉","\\rceil",!0);M(D,H,me,"\\","\\backslash");M(D,H,me,"∣","|");M(D,H,me,"∣","\\vert");M(Be,H,me,"|","\\textbar",!0);M(D,H,me,"∥","\\|");M(D,H,me,"∥","\\Vert");M(Be,H,me,"∥","\\textbardbl");M(Be,H,me,"~","\\textasciitilde");M(Be,H,me,"\\","\\textbackslash");M(Be,H,me,"^","\\textasciicircum");M(D,H,ce,"↑","\\uparrow",!0);M(D,H,ce,"⇑","\\Uparrow",!0);M(D,H,ce,"↓","\\downarrow",!0);M(D,H,ce,"⇓","\\Downarrow",!0);M(D,H,ce,"↕","\\updownarrow",!0);M(D,H,ce,"⇕","\\Updownarrow",!0);M(D,H,os,"∐","\\coprod");M(D,H,os,"⋁","\\bigvee");M(D,H,os,"⋀","\\bigwedge");M(D,H,os,"⨄","\\biguplus");M(D,H,os,"⋂","\\bigcap");M(D,H,os,"⋃","\\bigcup");M(D,H,os,"∫","\\int");M(D,H,os,"∫","\\intop");M(D,H,os,"∬","\\iint");M(D,H,os,"∭","\\iiint");M(D,H,os,"∏","\\prod");M(D,H,os,"∑","\\sum");M(D,H,os,"⨂","\\bigotimes");M(D,H,os,"⨁","\\bigoplus");M(D,H,os,"⨀","\\bigodot");M(D,H,os,"∮","\\oint");M(D,H,os,"∯","\\oiint");M(D,H,os,"∰","\\oiiint");M(D,H,os,"⨆","\\bigsqcup");M(D,H,os,"∫","\\smallint");M(Be,H,qf,"…","\\textellipsis");M(D,H,qf,"…","\\mathellipsis");M(Be,H,qf,"…","\\ldots",!0);M(D,H,qf,"…","\\ldots",!0);M(D,H,qf,"⋯","\\@cdots",!0);M(D,H,qf,"⋱","\\ddots",!0);M(D,H,me,"⋮","\\varvdots");M(Be,H,me,"⋮","\\varvdots");M(D,H,jr,"ˊ","\\acute");M(D,H,jr,"ˋ","\\grave");M(D,H,jr,"¨","\\ddot");M(D,H,jr,"~","\\tilde");M(D,H,jr,"ˉ","\\bar");M(D,H,jr,"˘","\\breve");M(D,H,jr,"ˇ","\\check");M(D,H,jr,"^","\\hat");M(D,H,jr,"⃗","\\vec");M(D,H,jr,"˙","\\dot");M(D,H,jr,"˚","\\mathring");M(D,H,Tt,"","\\@imath");M(D,H,Tt,"","\\@jmath");M(D,H,me,"ı","ı");M(D,H,me,"ȷ","ȷ");M(Be,H,me,"ı","\\i",!0);M(Be,H,me,"ȷ","\\j",!0);M(Be,H,me,"ß","\\ss",!0);M(Be,H,me,"æ","\\ae",!0);M(Be,H,me,"œ","\\oe",!0);M(Be,H,me,"ø","\\o",!0);M(Be,H,me,"Æ","\\AE",!0);M(Be,H,me,"Œ","\\OE",!0);M(Be,H,me,"Ø","\\O",!0);M(Be,H,jr,"ˊ","\\'");M(Be,H,jr,"ˋ","\\`");M(Be,H,jr,"ˆ","\\^");M(Be,H,jr,"˜","\\~");M(Be,H,jr,"ˉ","\\=");M(Be,H,jr,"˘","\\u");M(Be,H,jr,"˙","\\.");M(Be,H,jr,"¸","\\c");M(Be,H,jr,"˚","\\r");M(Be,H,jr,"ˇ","\\v");M(Be,H,jr,"¨",'\\"');M(Be,H,jr,"˝","\\H");M(Be,H,jr,"◯","\\textcircled");var eU={"--":!0,"---":!0,"``":!0,"''":!0};M(Be,H,me,"–","--",!0);M(Be,H,me,"–","\\textendash");M(Be,H,me,"—","---",!0);M(Be,H,me,"—","\\textemdash");M(Be,H,me,"‘","`",!0);M(Be,H,me,"‘","\\textquoteleft");M(Be,H,me,"’","'",!0);M(Be,H,me,"’","\\textquoteright");M(Be,H,me,"“","``",!0);M(Be,H,me,"“","\\textquotedblleft");M(Be,H,me,"”","''",!0);M(Be,H,me,"”","\\textquotedblright");M(D,H,me,"°","\\degree",!0);M(Be,H,me,"°","\\degree");M(Be,H,me,"°","\\textdegree",!0);M(D,H,me,"£","\\pounds");M(D,H,me,"£","\\mathsterling",!0);M(Be,H,me,"£","\\pounds");M(Be,H,me,"£","\\textsterling",!0);M(D,le,me,"✠","\\maltese");M(Be,le,me,"✠","\\maltese");var pR='0123456789/@."';for(var US=0;US0)return $a(i,d,s,n,a.concat(h));if(c){var m,g;if(c==="boldsymbol"){var x=d3e(i,s,n,a,r);m=x.fontName,g=[x.fontClass]}else l?(m=rU[c].fontName,g=[c]):(m=P1(c,n.fontWeight,n.fontShape),g=[c,n.fontWeight,n.fontShape]);if($b(i,m,s).metrics)return $a(i,m,s,n,a.concat(g));if(eU.hasOwnProperty(i)&&m.slice(0,10)==="Typewriter"){for(var y=[],w=0;w{if(eu(t.classes)!==eu(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize)return!1;if(t.classes.length===1){var n=t.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r in t.style)if(t.style.hasOwnProperty(r)&&t.style[r]!==e.style[r])return!1;for(var s in e.style)if(e.style.hasOwnProperty(s)&&t.style[s]!==e.style[s])return!1;return!0},m3e=t=>{for(var e=0;en&&(n=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>s&&(s=a.maxFontSize)}e.height=n,e.depth=r,e.maxFontSize=s},mi=function(e,n,r,s){var i=new pg(e,n,r,s);return TN(i),i},tU=(t,e,n,r)=>new pg(t,e,n,r),p3e=function(e,n,r){var s=mi([e],[],n);return s.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),s.style.borderBottomWidth=Xe(s.height),s.maxFontSize=1,s},g3e=function(e,n,r,s){var i=new CN(e,n,r,s);return TN(i),i},nU=function(e){var n=new mg(e);return TN(n),n},x3e=function(e,n){return e instanceof mg?mi([],[e],n):e},v3e=function(e){if(e.positionType==="individualShift"){for(var n=e.children,r=[n[0]],s=-n[0].shift-n[0].elem.depth,i=s,a=1;a{var n=mi(["mspace"],[],e),r=Rr(t,e);return n.style.marginRight=Xe(r),n},P1=function(e,n,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 n==="textbf"&&r==="textit"?i="BoldItalic":n==="textbf"?i="Bold":n==="textit"?i="Italic":i="Regular",s+"-"+i},rU={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"}},sU={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},w3e=function(e,n){var[r,s,i]=sU[e],a=new tu(r),l=new Ql([a],{width:Xe(s),height:Xe(i),style:"width:"+Xe(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),c=tU(["overlay"],[l],n);return c.height=i,c.style.height=Xe(i),c.style.width=Xe(s),c},be={fontMap:rU,makeSymbol:$a,mathsym:u3e,makeSpan:mi,makeSvgSpan:tU,makeLineSpan:p3e,makeAnchor:g3e,makeFragment:nU,wrapFragment:x3e,makeVList:y3e,makeOrd:h3e,makeGlue:b3e,staticSvg:w3e,svgData:sU,tryCombineChars:m3e},_r={number:3,unit:"mu"},zu={number:4,unit:"mu"},yl={number:5,unit:"mu"},S3e={mord:{mop:_r,mbin:zu,mrel:yl,minner:_r},mop:{mord:_r,mop:_r,mrel:yl,minner:_r},mbin:{mord:zu,mop:zu,mopen:zu,minner:zu},mrel:{mord:yl,mop:yl,mopen:yl,minner:yl},mopen:{},mclose:{mop:_r,mbin:zu,mrel:yl,minner:_r},mpunct:{mord:_r,mop:_r,mrel:yl,mopen:_r,mclose:_r,mpunct:_r,minner:_r},minner:{mord:_r,mop:_r,mbin:zu,mrel:yl,mopen:_r,mpunct:_r,minner:_r}},k3e={mord:{mop:_r},mop:{mord:_r,mop:_r},mbin:{},mrel:{},mopen:{},mclose:{mop:_r},mpunct:{},minner:{mop:_r}},iU={},Oy={},jy={};function tt(t){for(var{type:e,names:n,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=t,l={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},c=0;c{var S=w.classes[0],k=y.classes[0];S==="mbin"&&j3e.includes(k)?w.classes[0]="mord":k==="mbin"&&O3e.includes(S)&&(y.classes[0]="mord")},{node:m},g,x),bR(i,(y,w)=>{var S=$O(w),k=$O(y),j=S&&k?y.hasClass("mtight")?k3e[S][k]:S3e[S][k]:null;if(j)return be.makeGlue(j,d)},{node:m},g,x),i},bR=function t(e,n,r,s,i){s&&e.push(s);for(var a=0;ag=>{e.splice(m+1,0,g),a++})(a)}s&&e.pop()},aU=function(e){return e instanceof mg||e instanceof CN||e instanceof pg&&e.hasClass("enclosing")?e:null},T3e=function t(e,n){var r=aU(e);if(r){var s=r.children;if(s.length){if(n==="right")return t(s[s.length-1],"right");if(n==="left")return t(s[0],"left")}}return e},$O=function(e,n){return e?(n&&(e=T3e(e,n)),C3e[e.classes[0]]||null):null},vp=function(e,n){var r=["nulldelimiter"].concat(e.baseSizingClasses());return Vl(n.concat(r))},Pn=function(e,n,r){if(!e)return Vl();if(Oy[e.type]){var s=Oy[e.type](e,n);if(r&&n.size!==r.size){s=Vl(n.sizingClasses(r),[s],n);var i=n.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new $e("Got group of unknown type: '"+e.type+"'")};function z1(t,e){var n=Vl(["base"],t,e),r=Vl(["strut"]);return r.style.height=Xe(n.height+n.depth),n.depth&&(r.style.verticalAlign=Xe(-n.depth)),n.children.unshift(r),n}function HO(t,e){var n=null;t.length===1&&t[0].type==="tag"&&(n=t[0].tag,t=t[0].body);var r=fs(t,e,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],a=[],l=0;l0&&(i.push(z1(a,e)),a=[]),i.push(r[l]));a.length>0&&i.push(z1(a,e));var d;n?(d=z1(fs(n,e,!0)),d.classes=["tag"],i.push(d)):s&&i.push(s);var h=Vl(["katex-html"],i);if(h.setAttribute("aria-hidden","true"),d){var m=d.children[0];m.style.height=Xe(h.height+h.depth),h.depth&&(m.style.verticalAlign=Xe(-h.depth))}return h}function oU(t){return new mg(t)}class Qi{constructor(e,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(e,n){this.attributes[e]=n}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&e.setAttribute(n,this.attributes[n]);this.classes.length>0&&(e.className=eu(this.classes));for(var r=0;r0&&(e+=' class ="'+$n.escape(eu(this.classes))+'"'),e+=">";for(var r=0;r",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Ao{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return $n.escape(this.toText())}toText(){return this.text}}class E3e{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",Xe(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var qe={MathNode:Qi,TextNode:Ao,SpaceNode:E3e,newDocumentFragment:oU},Ma=function(e,n,r){return dr[n][e]&&dr[n][e].replace&&e.charCodeAt(0)!==55349&&!(eU.hasOwnProperty(e)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(e=dr[n][e].replace),new qe.TextNode(e)},EN=function(e){return e.length===1?e[0]:new qe.MathNode("mrow",e)},_N=function(e,n){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold";var r=n.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;dr[s][i]&&dr[s][i].replace&&(i=dr[s][i].replace);var a=be.fontMap[r].fontName;return NN(i,a,s)?be.fontMap[r].variant:null};function YS(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof Ao&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var n=t.children[0];return n instanceof Ao&&n.text===","}else return!1}var _i=function(e,n,r){if(e.length===1){var s=lr(e[0],n);return r&&s instanceof Qi&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],a,l=0;l=1&&(a.type==="mn"||YS(a))){var d=c.children[0];d instanceof Qi&&d.type==="mn"&&(d.children=[...a.children,...d.children],i.pop())}else if(a.type==="mi"&&a.children.length===1){var h=a.children[0];if(h instanceof Ao&&h.text==="̸"&&(c.type==="mo"||c.type==="mi"||c.type==="mn")){var m=c.children[0];m instanceof Ao&&m.text.length>0&&(m.text=m.text.slice(0,1)+"̸"+m.text.slice(1),i.pop())}}}i.push(c),a=c}return i},nu=function(e,n,r){return EN(_i(e,n,r))},lr=function(e,n){if(!e)return new qe.MathNode("mrow");if(jy[e.type]){var r=jy[e.type](e,n);return r}else throw new $e("Got group of unknown type: '"+e.type+"'")};function wR(t,e,n,r,s){var i=_i(t,n),a;i.length===1&&i[0]instanceof Qi&&["mrow","mtable"].includes(i[0].type)?a=i[0]:a=new qe.MathNode("mrow",i);var l=new qe.MathNode("annotation",[new qe.TextNode(e)]);l.setAttribute("encoding","application/x-tex");var c=new qe.MathNode("semantics",[a,l]),d=new qe.MathNode("math",[c]);d.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&d.setAttribute("display","block");var h=s?"katex":"katex-mathml";return be.makeSpan([h],[d])}var lU=function(e){return new Tl({style:e.displayMode?Et.DISPLAY:Et.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},cU=function(e,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),e=be.makeSpan(r,[e])}return e},_3e=function(e,n,r){var s=lU(r),i;if(r.output==="mathml")return wR(e,n,s,r.displayMode,!0);if(r.output==="html"){var a=HO(e,s);i=be.makeSpan(["katex"],[a])}else{var l=wR(e,n,s,r.displayMode,!1),c=HO(e,s);i=be.makeSpan(["katex"],[l,c])}return cU(i,r)},A3e=function(e,n,r){var s=lU(r),i=HO(e,s),a=be.makeSpan(["katex"],[i]);return cU(a,r)},M3e={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":"="},R3e=function(e){var n=new qe.MathNode("mo",[new qe.TextNode(M3e[e.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},D3e={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]},P3e=function(e){return e.type==="ordgroup"?e.body.length:1},z3e=function(e,n){function r(){var l=4e5,c=e.label.slice(1);if(["widehat","widecheck","widetilde","utilde"].includes(c)){var d=e,h=P3e(d.base),m,g,x;if(h>5)c==="widehat"||c==="widecheck"?(m=420,l=2364,x=.42,g=c+"4"):(m=312,l=2340,x=.34,g="tilde4");else{var y=[1,1,2,2,3,3][h];c==="widehat"||c==="widecheck"?(l=[0,1062,2364,2364,2364][y],m=[0,239,300,360,420][y],x=[0,.24,.3,.3,.36,.42][y],g=c+y):(l=[0,600,1033,2339,2340][y],m=[0,260,286,306,312][y],x=[0,.26,.286,.3,.306,.34][y],g="tilde"+y)}var w=new tu(g),S=new Ql([w],{width:"100%",height:Xe(x),viewBox:"0 0 "+l+" "+m,preserveAspectRatio:"none"});return{span:be.makeSvgSpan([],[S],n),minWidth:0,height:x}}else{var k=[],j=D3e[c],[N,T,E]=j,_=E/1e3,A=N.length,L,P;if(A===1){var B=j[3];L=["hide-tail"],P=[B]}else if(A===2)L=["halfarrow-left","halfarrow-right"],P=["xMinYMin","xMaxYMin"];else if(A===3)L=["brace-left","brace-center","brace-right"],P=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+A+" children.");for(var $=0;$0&&(s.style.minWidth=Xe(i)),s},I3e=function(e,n,r,s,i){var a,l=e.height+e.depth+r+s;if(/fbox|color|angl/.test(n)){if(a=be.makeSpan(["stretchy",n],[],i),n==="fbox"){var c=i.color&&i.getColor();c&&(a.style.borderColor=c)}}else{var d=[];/^[bx]cancel$/.test(n)&&d.push(new FO({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&d.push(new FO({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new Ql(d,{width:"100%",height:Xe(l)});a=be.makeSvgSpan([],[h],i)}return a.height=l,a.style.height=Xe(l),a},Ul={encloseSpan:I3e,mathMLnode:R3e,svgSpan:z3e};function en(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function AN(t){var e=Hb(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function Hb(t){return t&&(t.type==="atom"||l3e.hasOwnProperty(t.type))?t:null}var MN=(t,e)=>{var n,r,s;t&&t.type==="supsub"?(r=en(t.base,"accent"),n=r.base,t.base=n,s=a3e(Pn(t,e)),t.base=r):(r=en(t,"accent"),n=r.base);var i=Pn(n,e.havingCrampedStyle()),a=r.isShifty&&$n.isCharacterBox(n),l=0;if(a){var c=$n.getBaseElem(n),d=Pn(c,e.havingCrampedStyle());l=mR(d).skew}var h=r.label==="\\c",m=h?i.height+i.depth:Math.min(i.height,e.fontMetrics().xHeight),g;if(r.isStretchy)g=Ul.svgSpan(r,e),g=be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:g,wrapperClasses:["svg-align"],wrapperStyle:l>0?{width:"calc(100% - "+Xe(2*l)+")",marginLeft:Xe(2*l)}:void 0}]},e);else{var x,y;r.label==="\\vec"?(x=be.staticSvg("vec",e),y=be.svgData.vec[1]):(x=be.makeOrd({mode:r.mode,text:r.label},e,"textord"),x=mR(x),x.italic=0,y=x.width,h&&(m+=x.depth)),g=be.makeSpan(["accent-body"],[x]);var w=r.label==="\\textcircled";w&&(g.classes.push("accent-full"),m=i.height);var S=l;w||(S-=y/2),g.style.left=Xe(S),r.label==="\\textcircled"&&(g.style.top=".2em"),g=be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-m},{type:"elem",elem:g}]},e)}var k=be.makeSpan(["mord","accent"],[g],e);return s?(s.children[0]=k,s.height=Math.max(k.height,s.height),s.classes[0]="mord",s):k},uU=(t,e)=>{var n=t.isStretchy?Ul.mathMLnode(t.label):new qe.MathNode("mo",[Ma(t.label,t.mode)]),r=new qe.MathNode("mover",[lr(t.base,e),n]);return r.setAttribute("accent","true"),r},L3e=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));tt({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:(t,e)=>{var n=Ny(e[0]),r=!L3e.test(t.funcName),s=!r||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:r,isShifty:s,base:n}},htmlBuilder:MN,mathmlBuilder:uU});tt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var n=e[0],r=t.parser.mode;return r==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:t.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:MN,mathmlBuilder:uU});tt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0];return{type:"accentUnder",mode:n.mode,label:r,base:s}},htmlBuilder:(t,e)=>{var n=Pn(t.base,e),r=Ul.svgSpan(t,e),s=t.label==="\\utilde"?.12:0,i=be.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:n}]},e);return be.makeSpan(["mord","accentunder"],[i],e)},mathmlBuilder:(t,e)=>{var n=Ul.mathMLnode(t.label),r=new qe.MathNode("munder",[lr(t.base,e),n]);return r.setAttribute("accentunder","true"),r}});var I1=t=>{var e=new qe.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};tt({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(t,e,n){var{parser:r,funcName:s}=t;return{type:"xArrow",mode:r.mode,label:s,body:e[0],below:n[0]}},htmlBuilder(t,e){var n=e.style,r=e.havingStyle(n.sup()),s=be.wrapFragment(Pn(t.body,r,e),e),i=t.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var a;t.below&&(r=e.havingStyle(n.sub()),a=be.wrapFragment(Pn(t.below,r,e),e),a.classes.push(i+"-arrow-pad"));var l=Ul.svgSpan(t,e),c=-e.fontMetrics().axisHeight+.5*l.height,d=-e.fontMetrics().axisHeight-.5*l.height-.111;(s.depth>.25||t.label==="\\xleftequilibrium")&&(d-=s.depth);var h;if(a){var m=-e.fontMetrics().axisHeight+a.height+.5*l.height+.111;h=be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:l,shift:c},{type:"elem",elem:a,shift:m}]},e)}else h=be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:l,shift:c}]},e);return h.children[0].children[0].children[1].classes.push("svg-align"),be.makeSpan(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var n=Ul.mathMLnode(t.label);n.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(t.body){var s=I1(lr(t.body,e));if(t.below){var i=I1(lr(t.below,e));r=new qe.MathNode("munderover",[n,i,s])}else r=new qe.MathNode("mover",[n,s])}else if(t.below){var a=I1(lr(t.below,e));r=new qe.MathNode("munder",[n,a])}else r=I1(),r=new qe.MathNode("mover",[n,r]);return r}});var B3e=be.makeSpan;function dU(t,e){var n=fs(t.body,e,!0);return B3e([t.mclass],n,e)}function hU(t,e){var n,r=_i(t.body,e);return t.mclass==="minner"?n=new qe.MathNode("mpadded",r):t.mclass==="mord"?t.isCharacterBox?(n=r[0],n.type="mi"):n=new qe.MathNode("mi",r):(t.isCharacterBox?(n=r[0],n.type="mo"):n=new qe.MathNode("mo",r),t.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):t.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):t.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}tt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:n,funcName:r}=t,s=e[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:Qr(s),isCharacterBox:$n.isCharacterBox(s)}},htmlBuilder:dU,mathmlBuilder:hU});var Qb=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};tt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:n}=t;return{type:"mclass",mode:n.mode,mclass:Qb(e[0]),body:Qr(e[1]),isCharacterBox:$n.isCharacterBox(e[1])}}});tt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:n,funcName:r}=t,s=e[1],i=e[0],a;r!=="\\stackrel"?a=Qb(s):a="mrel";var l={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:Qr(s)},c={type:"supsub",mode:i.mode,base:l,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:n.mode,mclass:a,body:[c],isCharacterBox:$n.isCharacterBox(c)}},htmlBuilder:dU,mathmlBuilder:hU});tt({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"pmb",mode:n.mode,mclass:Qb(e[0]),body:Qr(e[0])}},htmlBuilder(t,e){var n=fs(t.body,e,!0),r=be.makeSpan([t.mclass],n,e);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(t,e){var n=_i(t.body,e),r=new qe.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var F3e={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},SR=()=>({type:"styling",body:[],mode:"math",style:"display"}),kR=t=>t.type==="textord"&&t.text==="@",q3e=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function $3e(t,e,n){var r=F3e[t];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var s=n.callFunction("\\\\cdleft",[e[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},a=n.callFunction("\\Big",[i],[]),l=n.callFunction("\\\\cdright",[e[1]],[]),c={type:"ordgroup",mode:"math",body:[s,a,l]};return n.callFunction("\\\\cdparent",[c],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var d={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[d],[])}default:return{type:"textord",text:" ",mode:"math"}}}function H3e(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var n=t.fetch().text;if(n==="&"||n==="\\\\")t.consume();else if(n==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new $e("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var r=[],s=[r],i=0;i-1))if("<>AV".indexOf(d)>-1)for(var m=0;m<2;m++){for(var g=!0,x=c+1;xAV=|." after @',a[c]);var y=$3e(d,h,t),w={type:"styling",body:[y],mode:"math",style:"display"};r.push(w),l=SR()}i%2===0?r.push(l):r.shift(),r=[],s.push(r)}t.gullet.endGroup(),t.gullet.endGroup();var S=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:S,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}tt({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:e[0]}},htmlBuilder(t,e){var n=e.havingStyle(e.style.sup()),r=be.wrapFragment(Pn(t.label,n,e),e);return r.classes.push("cd-label-"+t.side),r.style.bottom=Xe(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(t,e){var n=new qe.MathNode("mrow",[lr(t.label,e)]);return n=new qe.MathNode("mpadded",[n]),n.setAttribute("width","0"),t.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new qe.MathNode("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});tt({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:n}=t;return{type:"cdlabelparent",mode:n.mode,fragment:e[0]}},htmlBuilder(t,e){var n=be.wrapFragment(Pn(t.fragment,e),e);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(t,e){return new qe.MathNode("mrow",[lr(t.fragment,e)])}});tt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:n}=t,r=en(e[0],"ordgroup"),s=r.body,i="",a=0;a=1114111)throw new $e("\\@char with invalid code point "+i);return c<=65535?d=String.fromCharCode(c):(c-=65536,d=String.fromCharCode((c>>10)+55296,(c&1023)+56320)),{type:"textord",mode:n.mode,text:d}}});var fU=(t,e)=>{var n=fs(t.body,e.withColor(t.color),!1);return be.makeFragment(n)},mU=(t,e)=>{var n=_i(t.body,e.withColor(t.color)),r=new qe.MathNode("mstyle",n);return r.setAttribute("mathcolor",t.color),r};tt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:n}=t,r=en(e[0],"color-token").color,s=e[1];return{type:"color",mode:n.mode,color:r,body:Qr(s)}},htmlBuilder:fU,mathmlBuilder:mU});tt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:n,breakOnTokenText:r}=t,s=en(e[0],"color-token").color;n.gullet.macros.set("\\current@color",s);var i=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:s,body:i}},htmlBuilder:fU,mathmlBuilder:mU});tt({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,n){var{parser:r}=t,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&&en(s,"size").value}},htmlBuilder(t,e){var n=be.makeSpan(["mspace"],[],e);return t.newLine&&(n.classes.push("newline"),t.size&&(n.style.marginTop=Xe(Rr(t.size,e)))),n},mathmlBuilder(t,e){var n=new qe.MathNode("mspace");return t.newLine&&(n.setAttribute("linebreak","newline"),t.size&&n.setAttribute("height",Xe(Rr(t.size,e)))),n}});var QO={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},pU=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new $e("Expected a control sequence",t);return e},Q3e=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},gU=(t,e,n,r)=>{var s=t.gullet.macros.get(n.text);s==null&&(n.noexpand=!0,s={tokens:[n],numArgs:0,unexpandable:!t.gullet.isExpandable(n.text)}),t.gullet.macros.set(e,s,r)};tt({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:n}=t;e.consumeSpaces();var r=e.fetch();if(QO[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=QO[r.text]),en(e.parseFunction(),"internal");throw new $e("Invalid token after macro prefix",r)}});tt({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=e.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new $e("Expected a control sequence",r);for(var i=0,a,l=[[]];e.gullet.future().text!=="{";)if(r=e.gullet.popToken(),r.text==="#"){if(e.gullet.future().text==="{"){a=e.gullet.future(),l[i].push("{");break}if(r=e.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new $e('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new $e('Argument number "'+r.text+'" out of order');i++,l.push([])}else{if(r.text==="EOF")throw new $e("Expected a macro definition");l[i].push(r.text)}var{tokens:c}=e.gullet.consumeArg();return a&&c.unshift(a),(n==="\\edef"||n==="\\xdef")&&(c=e.gullet.expandTokens(c),c.reverse()),e.gullet.macros.set(s,{tokens:c,numArgs:i,delimiters:l},n===QO[n]),{type:"internal",mode:e.mode}}});tt({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=pU(e.gullet.popToken());e.gullet.consumeSpaces();var s=Q3e(e);return gU(e,r,s,n==="\\\\globallet"),{type:"internal",mode:e.mode}}});tt({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=pU(e.gullet.popToken()),s=e.gullet.popToken(),i=e.gullet.popToken();return gU(e,r,i,n==="\\\\globalfuture"),e.gullet.pushToken(i),e.gullet.pushToken(s),{type:"internal",mode:e.mode}}});var h0=function(e,n,r){var s=dr.math[e]&&dr.math[e].replace,i=NN(s||e,n,r);if(!i)throw new Error("Unsupported symbol "+e+" and font size "+n+".");return i},RN=function(e,n,r,s){var i=r.havingBaseStyle(n),a=be.makeSpan(s.concat(i.sizingClasses(r)),[e],r),l=i.sizeMultiplier/r.sizeMultiplier;return a.height*=l,a.depth*=l,a.maxFontSize=i.sizeMultiplier,a},xU=function(e,n,r){var s=n.havingBaseStyle(r),i=(1-n.sizeMultiplier/s.sizeMultiplier)*n.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Xe(i),e.height-=i,e.depth+=i},V3e=function(e,n,r,s,i,a){var l=be.makeSymbol(e,"Main-Regular",i,s),c=RN(l,n,s,a);return r&&xU(c,s,n),c},U3e=function(e,n,r,s){return be.makeSymbol(e,"Size"+n+"-Regular",r,s)},vU=function(e,n,r,s,i,a){var l=U3e(e,n,i,s),c=RN(be.makeSpan(["delimsizing","size"+n],[l],s),Et.TEXT,s,a);return r&&xU(c,s,Et.TEXT),c},KS=function(e,n,r){var s;n==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=be.makeSpan(["delimsizinginner",s],[be.makeSpan([],[be.makeSymbol(e,n,r)])]);return{type:"elem",elem:i}},ZS=function(e,n,r){var s=_o["Size4-Regular"][e.charCodeAt(0)]?_o["Size4-Regular"][e.charCodeAt(0)][4]:_o["Size1-Regular"][e.charCodeAt(0)][4],i=new tu("inner",K5e(e,Math.round(1e3*n))),a=new Ql([i],{width:Xe(s),height:Xe(n),style:"width:"+Xe(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),l=be.makeSvgSpan([],[a],r);return l.height=n,l.style.height=Xe(n),l.style.width=Xe(s),{type:"elem",elem:l}},VO=.008,L1={type:"kern",size:-1*VO},W3e=["|","\\lvert","\\rvert","\\vert"],G3e=["\\|","\\lVert","\\rVert","\\Vert"],yU=function(e,n,r,s,i,a){var l,c,d,h,m="",g=0;l=d=h=e,c=null;var x="Size1-Regular";e==="\\uparrow"?d=h="⏐":e==="\\Uparrow"?d=h="‖":e==="\\downarrow"?l=d="⏐":e==="\\Downarrow"?l=d="‖":e==="\\updownarrow"?(l="\\uparrow",d="⏐",h="\\downarrow"):e==="\\Updownarrow"?(l="\\Uparrow",d="‖",h="\\Downarrow"):W3e.includes(e)?(d="∣",m="vert",g=333):G3e.includes(e)?(d="∥",m="doublevert",g=556):e==="["||e==="\\lbrack"?(l="⎡",d="⎢",h="⎣",x="Size4-Regular",m="lbrack",g=667):e==="]"||e==="\\rbrack"?(l="⎤",d="⎥",h="⎦",x="Size4-Regular",m="rbrack",g=667):e==="\\lfloor"||e==="⌊"?(d=l="⎢",h="⎣",x="Size4-Regular",m="lfloor",g=667):e==="\\lceil"||e==="⌈"?(l="⎡",d=h="⎢",x="Size4-Regular",m="lceil",g=667):e==="\\rfloor"||e==="⌋"?(d=l="⎥",h="⎦",x="Size4-Regular",m="rfloor",g=667):e==="\\rceil"||e==="⌉"?(l="⎤",d=h="⎥",x="Size4-Regular",m="rceil",g=667):e==="("||e==="\\lparen"?(l="⎛",d="⎜",h="⎝",x="Size4-Regular",m="lparen",g=875):e===")"||e==="\\rparen"?(l="⎞",d="⎟",h="⎠",x="Size4-Regular",m="rparen",g=875):e==="\\{"||e==="\\lbrace"?(l="⎧",c="⎨",h="⎩",d="⎪",x="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(l="⎫",c="⎬",h="⎭",d="⎪",x="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(l="⎧",h="⎩",d="⎪",x="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(l="⎫",h="⎭",d="⎪",x="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(l="⎧",h="⎭",d="⎪",x="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(l="⎫",h="⎩",d="⎪",x="Size4-Regular");var y=h0(l,x,i),w=y.height+y.depth,S=h0(d,x,i),k=S.height+S.depth,j=h0(h,x,i),N=j.height+j.depth,T=0,E=1;if(c!==null){var _=h0(c,x,i);T=_.height+_.depth,E=2}var A=w+N+T,L=Math.max(0,Math.ceil((n-A)/(E*k))),P=A+L*E*k,B=s.fontMetrics().axisHeight;r&&(B*=s.sizeMultiplier);var $=P/2-B,U=[];if(m.length>0){var te=P-w-N,z=Math.round(P*1e3),Q=Z5e(m,Math.round(te*1e3)),F=new tu(m,Q),Y=(g/1e3).toFixed(3)+"em",J=(z/1e3).toFixed(3)+"em",X=new Ql([F],{width:Y,height:J,viewBox:"0 0 "+g+" "+z}),R=be.makeSvgSpan([],[X],s);R.height=z/1e3,R.style.width=Y,R.style.height=J,U.push({type:"elem",elem:R})}else{if(U.push(KS(h,x,i)),U.push(L1),c===null){var ie=P-w-N+2*VO;U.push(ZS(d,ie,s))}else{var G=(P-w-N-T)/2+2*VO;U.push(ZS(d,G,s)),U.push(L1),U.push(KS(c,x,i)),U.push(L1),U.push(ZS(d,G,s))}U.push(L1),U.push(KS(l,x,i))}var I=s.havingBaseStyle(Et.TEXT),V=be.makeVList({positionType:"bottom",positionData:$,children:U},I);return RN(be.makeSpan(["delimsizing","mult"],[V],I),Et.TEXT,s,a)},JS=80,e5=.08,t5=function(e,n,r,s,i){var a=Y5e(e,s,r),l=new tu(e,a),c=new Ql([l],{width:"400em",height:Xe(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return be.makeSvgSpan(["hide-tail"],[c],i)},X3e=function(e,n){var r=n.havingBaseSizing(),s=kU("\\surd",e*r.sizeMultiplier,SU,r),i=r.sizeMultiplier,a=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),l,c=0,d=0,h=0,m;return s.type==="small"?(h=1e3+1e3*a+JS,e<1?i=1:e<1.4&&(i=.7),c=(1+a+e5)/i,d=(1+a)/i,l=t5("sqrtMain",c,h,a,n),l.style.minWidth="0.853em",m=.833/i):s.type==="large"?(h=(1e3+JS)*R0[s.size],d=(R0[s.size]+a)/i,c=(R0[s.size]+a+e5)/i,l=t5("sqrtSize"+s.size,c,h,a,n),l.style.minWidth="1.02em",m=1/i):(c=e+a+e5,d=e+a,h=Math.floor(1e3*e+a)+JS,l=t5("sqrtTall",c,h,a,n),l.style.minWidth="0.742em",m=1.056),l.height=d,l.style.height=Xe(c),{span:l,advanceWidth:m,ruleWidth:(n.fontMetrics().sqrtRuleThickness+a)*i}},bU=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],Y3e=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],wU=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],R0=[0,1.2,1.8,2.4,3],K3e=function(e,n,r,s,i){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),bU.includes(e)||wU.includes(e))return vU(e,n,!1,r,s,i);if(Y3e.includes(e))return yU(e,R0[n],!1,r,s,i);throw new $e("Illegal delimiter: '"+e+"'")},Z3e=[{type:"small",style:Et.SCRIPTSCRIPT},{type:"small",style:Et.SCRIPT},{type:"small",style:Et.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],J3e=[{type:"small",style:Et.SCRIPTSCRIPT},{type:"small",style:Et.SCRIPT},{type:"small",style:Et.TEXT},{type:"stack"}],SU=[{type:"small",style:Et.SCRIPTSCRIPT},{type:"small",style:Et.SCRIPT},{type:"small",style:Et.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],eke=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.")},kU=function(e,n,r,s){for(var i=Math.min(2,3-s.style.size),a=i;an)return r[a]}return r[r.length-1]},OU=function(e,n,r,s,i,a){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var l;wU.includes(e)?l=Z3e:bU.includes(e)?l=SU:l=J3e;var c=kU(e,n,l,s);return c.type==="small"?V3e(e,c.style,r,s,i,a):c.type==="large"?vU(e,c.size,r,s,i,a):yU(e,n,r,s,i,a)},tke=function(e,n,r,s,i,a){var l=s.fontMetrics().axisHeight*s.sizeMultiplier,c=901,d=5/s.fontMetrics().ptPerEm,h=Math.max(n-l,r+l),m=Math.max(h/500*c,2*h-d);return OU(e,m,!0,s,i,a)},Bl={sqrtImage:X3e,sizedDelim:K3e,sizeToMaxHeight:R0,customSizedDelim:OU,leftRightDelim:tke},OR={"\\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}},nke=["(","\\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 Vb(t,e){var n=Hb(t);if(n&&nke.includes(n.text))return n;throw n?new $e("Invalid delimiter '"+n.text+"' after '"+e.funcName+"'",t):new $e("Invalid delimiter type '"+t.type+"'",t)}tt({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:(t,e)=>{var n=Vb(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:OR[t.funcName].size,mclass:OR[t.funcName].mclass,delim:n.text}},htmlBuilder:(t,e)=>t.delim==="."?be.makeSpan([t.mclass]):Bl.sizedDelim(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(Ma(t.delim,t.mode));var n=new qe.MathNode("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=Xe(Bl.sizeToMaxHeight[t.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function jR(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}tt({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=t.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new $e("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:Vb(e[0],t).text,color:n}}});tt({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=Vb(e[0],t),r=t.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=en(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(t,e)=>{jR(t);for(var n=fs(t.body,e,!0,["mopen","mclose"]),r=0,s=0,i=!1,a=0;a{jR(t);var n=_i(t.body,e);if(t.left!=="."){var r=new qe.MathNode("mo",[Ma(t.left,t.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(t.right!=="."){var s=new qe.MathNode("mo",[Ma(t.right,t.mode)]);s.setAttribute("fence","true"),t.rightColor&&s.setAttribute("mathcolor",t.rightColor),n.push(s)}return EN(n)}});tt({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=Vb(e[0],t);if(!t.parser.leftrightDepth)throw new $e("\\middle without preceding \\left",n);return{type:"middle",mode:t.parser.mode,delim:n.text}},htmlBuilder:(t,e)=>{var n;if(t.delim===".")n=vp(e,[]);else{n=Bl.sizedDelim(t.delim,1,e,t.mode,[]);var r={delim:t.delim,options:e};n.isMiddle=r}return n},mathmlBuilder:(t,e)=>{var n=t.delim==="\\vert"||t.delim==="|"?Ma("|","text"):Ma(t.delim,t.mode),r=new qe.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var DN=(t,e)=>{var n=be.wrapFragment(Pn(t.body,e),e),r=t.label.slice(1),s=e.sizeMultiplier,i,a=0,l=$n.isCharacterBox(t.body);if(r==="sout")i=be.makeSpan(["stretchy","sout"]),i.height=e.fontMetrics().defaultRuleThickness/s,a=-.5*e.fontMetrics().xHeight;else if(r==="phase"){var c=Rr({number:.6,unit:"pt"},e),d=Rr({number:.35,unit:"ex"},e),h=e.havingBaseSizing();s=s/h.sizeMultiplier;var m=n.height+n.depth+c+d;n.style.paddingLeft=Xe(m/2+c);var g=Math.floor(1e3*m*s),x=G5e(g),y=new Ql([new tu("phase",x)],{width:"400em",height:Xe(g/1e3),viewBox:"0 0 400000 "+g,preserveAspectRatio:"xMinYMin slice"});i=be.makeSvgSpan(["hide-tail"],[y],e),i.style.height=Xe(m),a=n.depth+c+d}else{/cancel/.test(r)?l||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var w=0,S=0,k=0;/box/.test(r)?(k=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),w=e.fontMetrics().fboxsep+(r==="colorbox"?0:k),S=w):r==="angl"?(k=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),w=4*k,S=Math.max(0,.25-n.depth)):(w=l?.2:0,S=w),i=Ul.encloseSpan(n,r,w,S,e),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=Xe(k)):r==="angl"&&k!==.049&&(i.style.borderTopWidth=Xe(k),i.style.borderRightWidth=Xe(k)),a=n.depth+S,t.backgroundColor&&(i.style.backgroundColor=t.backgroundColor,t.borderColor&&(i.style.borderColor=t.borderColor))}var j;if(t.backgroundColor)j=be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:a},{type:"elem",elem:n,shift:0}]},e);else{var N=/cancel|phase/.test(r)?["svg-align"]:[];j=be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:i,shift:a,wrapperClasses:N}]},e)}return/cancel/.test(r)&&(j.height=n.height,j.depth=n.depth),/cancel/.test(r)&&!l?be.makeSpan(["mord","cancel-lap"],[j],e):be.makeSpan(["mord"],[j],e)},PN=(t,e)=>{var n=0,r=new qe.MathNode(t.label.indexOf("colorbox")>-1?"mpadded":"menclose",[lr(t.body,e)]);switch(t.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(n=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),t.label==="\\fcolorbox"){var s=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);r.setAttribute("style","border: "+s+"em solid "+String(t.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&r.setAttribute("mathbackground",t.backgroundColor),r};tt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(t,e,n){var{parser:r,funcName:s}=t,i=en(e[0],"color-token").color,a=e[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:a}},htmlBuilder:DN,mathmlBuilder:PN});tt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(t,e,n){var{parser:r,funcName:s}=t,i=en(e[0],"color-token").color,a=en(e[1],"color-token").color,l=e[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,borderColor:i,body:l}},htmlBuilder:DN,mathmlBuilder:PN});tt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"enclose",mode:n.mode,label:"\\fbox",body:e[0]}}});tt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t,s=e[0];return{type:"enclose",mode:n.mode,label:r,body:s}},htmlBuilder:DN,mathmlBuilder:PN});tt({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:n}=t;return{type:"enclose",mode:n.mode,label:"\\angl",body:e[0]}}});var jU={};function Vo(t){for(var{type:e,names:n,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=t,l={type:e,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},c=0;c{var e=t.parser.settings;if(!e.displayMode)throw new $e("{"+t.envName+"} can be used only in display mode.")};function zN(t){if(t.indexOf("ed")===-1)return t.indexOf("*")===-1}function du(t,e,n){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:a,colSeparationType:l,autoTag:c,singleRow:d,emptySingleRow:h,maxNumCols:m,leqno:g}=e;if(t.gullet.beginGroup(),d||t.gullet.macros.set("\\cr","\\\\\\relax"),!a){var x=t.gullet.expandMacroAsText("\\arraystretch");if(x==null)a=1;else if(a=parseFloat(x),!a||a<0)throw new $e("Invalid \\arraystretch: "+x)}t.gullet.beginGroup();var y=[],w=[y],S=[],k=[],j=c!=null?[]:void 0;function N(){c&&t.gullet.macros.set("\\@eqnsw","1",!0)}function T(){j&&(t.gullet.macros.get("\\df@tag")?(j.push(t.subparse([new Xi("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):j.push(!!c&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(N(),k.push(NR(t));;){var E=t.parseExpression(!1,d?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup(),E={type:"ordgroup",mode:t.mode,body:E},n&&(E={type:"styling",mode:t.mode,style:n,body:[E]}),y.push(E);var _=t.fetch().text;if(_==="&"){if(m&&y.length===m){if(d||l)throw new $e("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(_==="\\end"){T(),y.length===1&&E.type==="styling"&&E.body[0].body.length===0&&(w.length>1||!h)&&w.pop(),k.length0&&(N+=.25),d.push({pos:N,isDashed:He[Ot]})}for(T(a[0]),r=0;r0&&($+=j,A<$&&(A=$),$=0)),e.addJot&&(A+=w),L.height=_,L.depth=A,N+=_,L.pos=N,N+=A+$,c[r]=L,T(a[r+1])}var U=N/2+n.fontMetrics().axisHeight,te=e.cols||[],z=[],Q,F,Y=[];if(e.tags&&e.tags.some(He=>He))for(r=0;r=l)){var W=void 0;(s>0||e.hskipBeforeAndAfter)&&(W=$n.deflt(G.pregap,g),W!==0&&(Q=be.makeSpan(["arraycolsep"],[]),Q.style.width=Xe(W),z.push(Q)));var se=[];for(r=0;r0){for(var We=be.makeLineSpan("hline",n,h),Ye=be.makeLineSpan("hdashline",n,h),Je=[{type:"elem",elem:c,shift:0}];d.length>0;){var Oe=d.pop(),Ve=Oe.pos-U;Oe.isDashed?Je.push({type:"elem",elem:Ye,shift:Ve}):Je.push({type:"elem",elem:We,shift:Ve})}c=be.makeVList({positionType:"individualShift",children:Je},n)}if(Y.length===0)return be.makeSpan(["mord"],[c],n);var Ue=be.makeVList({positionType:"individualShift",children:Y},n);return Ue=be.makeSpan(["tag"],[Ue],n),be.makeFragment([c,Ue])},rke={c:"center ",l:"left ",r:"right "},Wo=function(e,n){for(var r=[],s=new qe.MathNode("mtd",[],["mtr-glue"]),i=new qe.MathNode("mtd",[],["mml-eqn-num"]),a=0;a0){var y=e.cols,w="",S=!1,k=0,j=y.length;y[0].type==="separator"&&(g+="top ",k=1),y[y.length-1].type==="separator"&&(g+="bottom ",j-=1);for(var N=k;N0?"left ":"",g+=L[L.length-1].length>0?"right ":"";for(var P=1;P-1?"alignat":"align",i=e.envName==="split",a=du(e.parser,{cols:r,addJot:!0,autoTag:i?void 0:zN(e.envName),emptySingleRow:!0,colSeparationType:s,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},"display"),l,c=0,d={type:"ordgroup",mode:e.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var h="",m=0;m0&&x&&(S=1),r[y]={type:"align",align:w,pregap:S,postgap:0}}return a.colSeparationType=x?"align":"alignat",a};Vo({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var n=Hb(e[0]),r=n?[e[0]]:en(e[0],"ordgroup").body,s=r.map(function(a){var l=AN(a),c=l.text;if("lcr".indexOf(c)!==-1)return{type:"align",align:c};if(c==="|")return{type:"separator",separator:"|"};if(c===":")return{type:"separator",separator:":"};throw new $e("Unknown column alignment: "+c,a)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return du(t.parser,i,IN(t.envName))},htmlBuilder:Uo,mathmlBuilder:Wo});Vo({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(t.envName.charAt(t.envName.length-1)==="*"){var s=t.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),n=s.fetch().text,"lcr".indexOf(n)===-1)throw new $e("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:n}]}}var i=du(t.parser,r,IN(t.envName)),a=Math.max(0,...i.body.map(l=>l.length));return i.cols=new Array(a).fill({type:"align",align:n}),e?{type:"leftright",mode:t.mode,body:[i],left:e[0],right:e[1],rightColor:void 0}:i},htmlBuilder:Uo,mathmlBuilder:Wo});Vo({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},n=du(t.parser,e,"script");return n.colSeparationType="small",n},htmlBuilder:Uo,mathmlBuilder:Wo});Vo({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var n=Hb(e[0]),r=n?[e[0]]:en(e[0],"ordgroup").body,s=r.map(function(a){var l=AN(a),c=l.text;if("lc".indexOf(c)!==-1)return{type:"align",align:c};throw new $e("Unknown column alignment: "+c,a)});if(s.length>1)throw new $e("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5};if(i=du(t.parser,i,"script"),i.body.length>0&&i.body[0].length>1)throw new $e("{subarray} can contain only one column");return i},htmlBuilder:Uo,mathmlBuilder:Wo});Vo({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=du(t.parser,e,IN(t.envName));return{type:"leftright",mode:t.mode,body:[n],left:t.envName.indexOf("r")>-1?".":"\\{",right:t.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Uo,mathmlBuilder:Wo});Vo({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:CU,htmlBuilder:Uo,mathmlBuilder:Wo});Vo({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){["gather","gather*"].includes(t.envName)&&Ub(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:zN(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return du(t.parser,e,"display")},htmlBuilder:Uo,mathmlBuilder:Wo});Vo({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:CU,htmlBuilder:Uo,mathmlBuilder:Wo});Vo({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){Ub(t);var e={autoTag:zN(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return du(t.parser,e,"display")},htmlBuilder:Uo,mathmlBuilder:Wo});Vo({type:"array",names:["CD"],props:{numArgs:0},handler(t){return Ub(t),H3e(t.parser)},htmlBuilder:Uo,mathmlBuilder:Wo});Z("\\nonumber","\\gdef\\@eqnsw{0}");Z("\\notag","\\nonumber");tt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new $e(t.funcName+" valid only within array environment")}});var CR=jU;tt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:n,funcName:r}=t,s=e[0];if(s.type!=="ordgroup")throw new $e("Invalid environment name",s);for(var i="",a=0;a{var n=t.font,r=e.withFont(n);return Pn(t.body,r)},EU=(t,e)=>{var n=t.font,r=e.withFont(n);return lr(t.body,r)},TR={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};tt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=Ny(e[0]),i=r;return i in TR&&(i=TR[i]),{type:"font",mode:n.mode,font:i.slice(1),body:s}},htmlBuilder:TU,mathmlBuilder:EU});tt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:n}=t,r=e[0],s=$n.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:Qb(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:s}}});tt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r,breakOnTokenText:s}=t,{mode:i}=n,a=n.parseExpression(!0,s),l="math"+r.slice(1);return{type:"font",mode:i,font:l,body:{type:"ordgroup",mode:n.mode,body:a}}},htmlBuilder:TU,mathmlBuilder:EU});var _U=(t,e)=>{var n=e;return t==="display"?n=n.id>=Et.SCRIPT.id?n.text():Et.DISPLAY:t==="text"&&n.size===Et.DISPLAY.size?n=Et.TEXT:t==="script"?n=Et.SCRIPT:t==="scriptscript"&&(n=Et.SCRIPTSCRIPT),n},LN=(t,e)=>{var n=_U(t.size,e.style),r=n.fracNum(),s=n.fracDen(),i;i=e.havingStyle(r);var a=Pn(t.numer,i,e);if(t.continued){var l=8.5/e.fontMetrics().ptPerEm,c=3.5/e.fontMetrics().ptPerEm;a.height=a.height0?y=3*g:y=7*g,w=e.fontMetrics().denom1):(m>0?(x=e.fontMetrics().num2,y=g):(x=e.fontMetrics().num3,y=3*g),w=e.fontMetrics().denom2);var S;if(h){var j=e.fontMetrics().axisHeight;x-a.depth-(j+.5*m){var n=new qe.MathNode("mfrac",[lr(t.numer,e),lr(t.denom,e)]);if(!t.hasBarLine)n.setAttribute("linethickness","0px");else if(t.barSize){var r=Rr(t.barSize,e);n.setAttribute("linethickness",Xe(r))}var s=_U(t.size,e.style);if(s.size!==e.style.size){n=new qe.MathNode("mstyle",[n]);var i=s.size===Et.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",i),n.setAttribute("scriptlevel","0")}if(t.leftDelim!=null||t.rightDelim!=null){var a=[];if(t.leftDelim!=null){var l=new qe.MathNode("mo",[new qe.TextNode(t.leftDelim.replace("\\",""))]);l.setAttribute("fence","true"),a.push(l)}if(a.push(n),t.rightDelim!=null){var c=new qe.MathNode("mo",[new qe.TextNode(t.rightDelim.replace("\\",""))]);c.setAttribute("fence","true"),a.push(c)}return EN(a)}return n};tt({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0],i=e[1],a,l=null,c=null,d="auto";switch(r){case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,l="(",c=")";break;case"\\\\bracefrac":a=!1,l="\\{",c="\\}";break;case"\\\\brackfrac":a=!1,l="[",c="]";break;default:throw new Error("Unrecognized genfrac command")}switch(r){case"\\dfrac":case"\\dbinom":d="display";break;case"\\tfrac":case"\\tbinom":d="text";break}return{type:"genfrac",mode:n.mode,continued:!1,numer:s,denom:i,hasBarLine:a,leftDelim:l,rightDelim:c,size:d,barSize:null}},htmlBuilder:LN,mathmlBuilder:BN});tt({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0],i=e[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:s,denom:i,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});tt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:n,token:r}=t,s;switch(n){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 ER=["display","text","script","scriptscript"],_R=function(e){var n=null;return e.length>0&&(n=e,n=n==="."?null:n),n};tt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:n}=t,r=e[4],s=e[5],i=Ny(e[0]),a=i.type==="atom"&&i.family==="open"?_R(i.text):null,l=Ny(e[1]),c=l.type==="atom"&&l.family==="close"?_R(l.text):null,d=en(e[2],"size"),h,m=null;d.isBlank?h=!0:(m=d.value,h=m.number>0);var g="auto",x=e[3];if(x.type==="ordgroup"){if(x.body.length>0){var y=en(x.body[0],"textord");g=ER[Number(y.text)]}}else x=en(x,"textord"),g=ER[Number(x.text)];return{type:"genfrac",mode:n.mode,numer:r,denom:s,continued:!1,hasBarLine:h,barSize:m,leftDelim:a,rightDelim:c,size:g}},htmlBuilder:LN,mathmlBuilder:BN});tt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:n,funcName:r,token:s}=t;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:en(e[0],"size").value,token:s}}});tt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0],i=R5e(en(e[1],"infix").size),a=e[2],l=i.number>0;return{type:"genfrac",mode:n.mode,numer:s,denom:a,continued:!1,hasBarLine:l,barSize:i,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:LN,mathmlBuilder:BN});var AU=(t,e)=>{var n=e.style,r,s;t.type==="supsub"?(r=t.sup?Pn(t.sup,e.havingStyle(n.sup()),e):Pn(t.sub,e.havingStyle(n.sub()),e),s=en(t.base,"horizBrace")):s=en(t,"horizBrace");var i=Pn(s.base,e.havingBaseStyle(Et.DISPLAY)),a=Ul.svgSpan(s,e),l;if(s.isOver?(l=be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:a}]},e),l.children[0].children[0].children[1].classes.push("svg-align")):(l=be.makeVList({positionType:"bottom",positionData:i.depth+.1+a.height,children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:i}]},e),l.children[0].children[0].children[0].classes.push("svg-align")),r){var c=be.makeSpan(["mord",s.isOver?"mover":"munder"],[l],e);s.isOver?l=be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:c},{type:"kern",size:.2},{type:"elem",elem:r}]},e):l=be.makeVList({positionType:"bottom",positionData:c.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:c}]},e)}return be.makeSpan(["mord",s.isOver?"mover":"munder"],[l],e)},ske=(t,e)=>{var n=Ul.mathMLnode(t.label);return new qe.MathNode(t.isOver?"mover":"munder",[lr(t.base,e),n])};tt({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:e[0]}},htmlBuilder:AU,mathmlBuilder:ske});tt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[1],s=en(e[0],"url").url;return n.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:n.mode,href:s,body:Qr(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var n=fs(t.body,e,!1);return be.makeAnchor(t.href,[],n,e)},mathmlBuilder:(t,e)=>{var n=nu(t.body,e);return n instanceof Qi||(n=new Qi("mrow",[n])),n.setAttribute("href",t.href),n}});tt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=en(e[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var s=[],i=0;i{var{parser:n,funcName:r,token:s}=t,i=en(e[0],"raw").string,a=e[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l,c={};switch(r){case"\\htmlClass":c.class=i,l={command:"\\htmlClass",class:i};break;case"\\htmlId":c.id=i,l={command:"\\htmlId",id:i};break;case"\\htmlStyle":c.style=i,l={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var d=i.split(","),h=0;h{var n=fs(t.body,e,!1),r=["enclosing"];t.attributes.class&&r.push(...t.attributes.class.trim().split(/\s+/));var s=be.makeSpan(r,n,e);for(var i in t.attributes)i!=="class"&&t.attributes.hasOwnProperty(i)&&s.setAttribute(i,t.attributes[i]);return s},mathmlBuilder:(t,e)=>nu(t.body,e)});tt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t;return{type:"htmlmathml",mode:n.mode,html:Qr(e[0]),mathml:Qr(e[1])}},htmlBuilder:(t,e)=>{var n=fs(t.html,e,!1);return be.makeFragment(n)},mathmlBuilder:(t,e)=>nu(t.mathml,e)});var n5=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!n)throw new $e("Invalid size: '"+e+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!YV(r))throw new $e("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};tt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,n)=>{var{parser:r}=t,s={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},l="";if(n[0])for(var c=en(n[0],"raw").string,d=c.split(","),h=0;h{var n=Rr(t.height,e),r=0;t.totalheight.number>0&&(r=Rr(t.totalheight,e)-n);var s=0;t.width.number>0&&(s=Rr(t.width,e));var i={height:Xe(n+r)};s>0&&(i.width=Xe(s)),r>0&&(i.verticalAlign=Xe(-r));var a=new s3e(t.src,t.alt,i);return a.height=n,a.depth=r,a},mathmlBuilder:(t,e)=>{var n=new qe.MathNode("mglyph",[]);n.setAttribute("alt",t.alt);var r=Rr(t.height,e),s=0;if(t.totalheight.number>0&&(s=Rr(t.totalheight,e)-r,n.setAttribute("valign",Xe(-s))),n.setAttribute("height",Xe(r+s)),t.width.number>0){var i=Rr(t.width,e);n.setAttribute("width",Xe(i))}return n.setAttribute("src",t.src),n}});tt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t,s=en(e[0],"size");if(n.settings.strict){var i=r[1]==="m",a=s.value.unit==="mu";i?(a||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:s.value}},htmlBuilder(t,e){return be.makeGlue(t.dimension,e)},mathmlBuilder(t,e){var n=Rr(t.dimension,e);return new qe.SpaceNode(n)}});tt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:s}},htmlBuilder:(t,e)=>{var n;t.alignment==="clap"?(n=be.makeSpan([],[Pn(t.body,e)]),n=be.makeSpan(["inner"],[n],e)):n=be.makeSpan(["inner"],[Pn(t.body,e)]);var r=be.makeSpan(["fix"],[]),s=be.makeSpan([t.alignment],[n,r],e),i=be.makeSpan(["strut"]);return i.style.height=Xe(s.height+s.depth),s.depth&&(i.style.verticalAlign=Xe(-s.depth)),s.children.unshift(i),s=be.makeSpan(["thinbox"],[s],e),be.makeSpan(["mord","vbox"],[s],e)},mathmlBuilder:(t,e)=>{var n=new qe.MathNode("mpadded",[lr(t.body,e)]);if(t.alignment!=="rlap"){var r=t.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});tt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:n,parser:r}=t,s=r.mode;r.switchMode("math");var i=n==="\\("?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",body:a}}});tt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new $e("Mismatched "+t.funcName)}});var AR=(t,e)=>{switch(e.style.size){case Et.DISPLAY.size:return t.display;case Et.TEXT.size:return t.text;case Et.SCRIPT.size:return t.script;case Et.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};tt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:n}=t;return{type:"mathchoice",mode:n.mode,display:Qr(e[0]),text:Qr(e[1]),script:Qr(e[2]),scriptscript:Qr(e[3])}},htmlBuilder:(t,e)=>{var n=AR(t,e),r=fs(n,e,!1);return be.makeFragment(r)},mathmlBuilder:(t,e)=>{var n=AR(t,e);return nu(n,e)}});var MU=(t,e,n,r,s,i,a)=>{t=be.makeSpan([],[t]);var l=n&&$n.isCharacterBox(n),c,d;if(e){var h=Pn(e,r.havingStyle(s.sup()),r);d={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-h.depth)}}if(n){var m=Pn(n,r.havingStyle(s.sub()),r);c={elem:m,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-m.height)}}var g;if(d&&c){var x=r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+t.depth+a;g=be.makeVList({positionType:"bottom",positionData:x,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:Xe(-i)},{type:"kern",size:c.kern},{type:"elem",elem:t},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:Xe(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(c){var y=t.height-a;g=be.makeVList({positionType:"top",positionData:y,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:Xe(-i)},{type:"kern",size:c.kern},{type:"elem",elem:t}]},r)}else if(d){var w=t.depth+a;g=be.makeVList({positionType:"bottom",positionData:w,children:[{type:"elem",elem:t},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:Xe(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else return t;var S=[g];if(c&&i!==0&&!l){var k=be.makeSpan(["mspace"],[],r);k.style.marginRight=Xe(i),S.unshift(k)}return be.makeSpan(["mop","op-limits"],S,r)},RU=["\\smallint"],$f=(t,e)=>{var n,r,s=!1,i;t.type==="supsub"?(n=t.sup,r=t.sub,i=en(t.base,"op"),s=!0):i=en(t,"op");var a=e.style,l=!1;a.size===Et.DISPLAY.size&&i.symbol&&!RU.includes(i.name)&&(l=!0);var c;if(i.symbol){var d=l?"Size2-Regular":"Size1-Regular",h="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(h=i.name.slice(1),i.name=h==="oiint"?"\\iint":"\\iiint"),c=be.makeSymbol(i.name,d,"math",e,["mop","op-symbol",l?"large-op":"small-op"]),h.length>0){var m=c.italic,g=be.staticSvg(h+"Size"+(l?"2":"1"),e);c=be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:c,shift:0},{type:"elem",elem:g,shift:l?.08:0}]},e),i.name="\\"+h,c.classes.unshift("mop"),c.italic=m}}else if(i.body){var x=fs(i.body,e,!0);x.length===1&&x[0]instanceof Aa?(c=x[0],c.classes[0]="mop"):c=be.makeSpan(["mop"],x,e)}else{for(var y=[],w=1;w{var n;if(t.symbol)n=new Qi("mo",[Ma(t.name,t.mode)]),RU.includes(t.name)&&n.setAttribute("largeop","false");else if(t.body)n=new Qi("mo",_i(t.body,e));else{n=new Qi("mi",[new Ao(t.name.slice(1))]);var r=new Qi("mo",[Ma("⁡","text")]);t.parentIsSupSub?n=new Qi("mrow",[n,r]):n=oU([n,r])}return n},ike={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};tt({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=r;return s.length===1&&(s=ike[s]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:$f,mathmlBuilder:gg});tt({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Qr(r)}},htmlBuilder:$f,mathmlBuilder:gg});var ake={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};tt({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(t){var{parser:e,funcName:n}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:$f,mathmlBuilder:gg});tt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:$f,mathmlBuilder:gg});tt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t,r=n;return r.length===1&&(r=ake[r]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:$f,mathmlBuilder:gg});var DU=(t,e)=>{var n,r,s=!1,i;t.type==="supsub"?(n=t.sup,r=t.sub,i=en(t.base,"operatorname"),s=!0):i=en(t,"operatorname");var a;if(i.body.length>0){for(var l=i.body.map(m=>{var g=m.text;return typeof g=="string"?{type:"textord",mode:m.mode,text:g}:m}),c=fs(l,e.withFont("mathrm"),!0),d=0;d{for(var n=_i(t.body,e.withFont("mathrm")),r=!0,s=0;sh.toText()).join("");n=[new qe.TextNode(l)]}var c=new qe.MathNode("mi",n);c.setAttribute("mathvariant","normal");var d=new qe.MathNode("mo",[Ma("⁡","text")]);return t.parentIsSupSub?new qe.MathNode("mrow",[c,d]):qe.newDocumentFragment([c,d])};tt({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0];return{type:"operatorname",mode:n.mode,body:Qr(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:DU,mathmlBuilder:oke});Z("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Sd({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?be.makeFragment(fs(t.body,e,!1)):be.makeSpan(["mord"],fs(t.body,e,!0),e)},mathmlBuilder(t,e){return nu(t.body,e,!0)}});tt({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:n}=t,r=e[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(t,e){var n=Pn(t.body,e.havingCrampedStyle()),r=be.makeLineSpan("overline-line",e),s=e.fontMetrics().defaultRuleThickness,i=be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]},e);return be.makeSpan(["mord","overline"],[i],e)},mathmlBuilder(t,e){var n=new qe.MathNode("mo",[new qe.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new qe.MathNode("mover",[lr(t.body,e),n]);return r.setAttribute("accent","true"),r}});tt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"phantom",mode:n.mode,body:Qr(r)}},htmlBuilder:(t,e)=>{var n=fs(t.body,e.withPhantom(),!1);return be.makeFragment(n)},mathmlBuilder:(t,e)=>{var n=_i(t.body,e);return new qe.MathNode("mphantom",n)}});tt({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(t,e)=>{var n=be.makeSpan([],[Pn(t.body,e.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r{var n=_i(Qr(t.body),e),r=new qe.MathNode("mphantom",n),s=new qe.MathNode("mpadded",[r]);return s.setAttribute("height","0px"),s.setAttribute("depth","0px"),s}});tt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(t,e)=>{var n=be.makeSpan(["inner"],[Pn(t.body,e.withPhantom())]),r=be.makeSpan(["fix"],[]);return be.makeSpan(["mord","rlap"],[n,r],e)},mathmlBuilder:(t,e)=>{var n=_i(Qr(t.body),e),r=new qe.MathNode("mphantom",n),s=new qe.MathNode("mpadded",[r]);return s.setAttribute("width","0px"),s}});tt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t,r=en(e[0],"size").value,s=e[1];return{type:"raisebox",mode:n.mode,dy:r,body:s}},htmlBuilder(t,e){var n=Pn(t.body,e),r=Rr(t.dy,e);return be.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},e)},mathmlBuilder(t,e){var n=new qe.MathNode("mpadded",[lr(t.body,e)]),r=t.dy.number+t.dy.unit;return n.setAttribute("voffset",r),n}});tt({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});tt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,n){var{parser:r}=t,s=n[0],i=en(e[0],"size"),a=en(e[1],"size");return{type:"rule",mode:r.mode,shift:s&&en(s,"size").value,width:i.value,height:a.value}},htmlBuilder(t,e){var n=be.makeSpan(["mord","rule"],[],e),r=Rr(t.width,e),s=Rr(t.height,e),i=t.shift?Rr(t.shift,e):0;return n.style.borderRightWidth=Xe(r),n.style.borderTopWidth=Xe(s),n.style.bottom=Xe(i),n.width=r,n.height=s+i,n.depth=-i,n.maxFontSize=s*1.125*e.sizeMultiplier,n},mathmlBuilder(t,e){var n=Rr(t.width,e),r=Rr(t.height,e),s=t.shift?Rr(t.shift,e):0,i=e.color&&e.getColor()||"black",a=new qe.MathNode("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",Xe(n)),a.setAttribute("height",Xe(r));var l=new qe.MathNode("mpadded",[a]);return s>=0?l.setAttribute("height",Xe(s)):(l.setAttribute("height",Xe(s)),l.setAttribute("depth",Xe(-s))),l.setAttribute("voffset",Xe(s)),l}});function PU(t,e,n){for(var r=fs(t,e,!1),s=e.sizeMultiplier/n.sizeMultiplier,i=0;i{var n=e.havingSize(t.size);return PU(t.body,n,e)};tt({type:"sizing",names:MR,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:n,funcName:r,parser:s}=t,i=s.parseExpression(!1,n);return{type:"sizing",mode:s.mode,size:MR.indexOf(r)+1,body:i}},htmlBuilder:lke,mathmlBuilder:(t,e)=>{var n=e.havingSize(t.size),r=_i(t.body,n),s=new qe.MathNode("mstyle",r);return s.setAttribute("mathsize",Xe(n.sizeMultiplier)),s}});tt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,n)=>{var{parser:r}=t,s=!1,i=!1,a=n[0]&&en(n[0],"ordgroup");if(a)for(var l="",c=0;c{var n=be.makeSpan([],[Pn(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return n;if(t.smashHeight&&(n.height=0,n.children))for(var r=0;r{var n=new qe.MathNode("mpadded",[lr(t.body,e)]);return t.smashHeight&&n.setAttribute("height","0px"),t.smashDepth&&n.setAttribute("depth","0px"),n}});tt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,n){var{parser:r}=t,s=n[0],i=e[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(t,e){var n=Pn(t.body,e.havingCrampedStyle());n.height===0&&(n.height=e.fontMetrics().xHeight),n=be.wrapFragment(n,e);var r=e.fontMetrics(),s=r.defaultRuleThickness,i=s;e.style.idn.height+n.depth+a&&(a=(a+m-n.height-n.depth)/2);var g=c.height-n.height-a-d;n.style.paddingLeft=Xe(h);var x=be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+g)},{type:"elem",elem:c},{type:"kern",size:d}]},e);if(t.index){var y=e.havingStyle(Et.SCRIPTSCRIPT),w=Pn(t.index,y,e),S=.6*(x.height-x.depth),k=be.makeVList({positionType:"shift",positionData:-S,children:[{type:"elem",elem:w}]},e),j=be.makeSpan(["root"],[k]);return be.makeSpan(["mord","sqrt"],[j,x],e)}else return be.makeSpan(["mord","sqrt"],[x],e)},mathmlBuilder(t,e){var{body:n,index:r}=t;return r?new qe.MathNode("mroot",[lr(n,e),lr(r,e)]):new qe.MathNode("msqrt",[lr(n,e)])}});var RR={display:Et.DISPLAY,text:Et.TEXT,script:Et.SCRIPT,scriptscript:Et.SCRIPTSCRIPT};tt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:n,funcName:r,parser:s}=t,i=s.parseExpression(!0,n),a=r.slice(1,r.length-5);return{type:"styling",mode:s.mode,style:a,body:i}},htmlBuilder(t,e){var n=RR[t.style],r=e.havingStyle(n).withFont("");return PU(t.body,r,e)},mathmlBuilder(t,e){var n=RR[t.style],r=e.havingStyle(n),s=_i(t.body,r),i=new qe.MathNode("mstyle",s),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},l=a[t.style];return i.setAttribute("scriptlevel",l[0]),i.setAttribute("displaystyle",l[1]),i}});var cke=function(e,n){var r=e.base;if(r)if(r.type==="op"){var s=r.limits&&(n.style.size===Et.DISPLAY.size||r.alwaysHandleSupSub);return s?$f:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(n.style.size===Et.DISPLAY.size||r.limits);return i?DU:null}else{if(r.type==="accent")return $n.isCharacterBox(r.base)?MN:null;if(r.type==="horizBrace"){var a=!e.sub;return a===r.isOver?AU:null}else return null}else return null};Sd({type:"supsub",htmlBuilder(t,e){var n=cke(t,e);if(n)return n(t,e);var{base:r,sup:s,sub:i}=t,a=Pn(r,e),l,c,d=e.fontMetrics(),h=0,m=0,g=r&&$n.isCharacterBox(r);if(s){var x=e.havingStyle(e.style.sup());l=Pn(s,x,e),g||(h=a.height-x.fontMetrics().supDrop*x.sizeMultiplier/e.sizeMultiplier)}if(i){var y=e.havingStyle(e.style.sub());c=Pn(i,y,e),g||(m=a.depth+y.fontMetrics().subDrop*y.sizeMultiplier/e.sizeMultiplier)}var w;e.style===Et.DISPLAY?w=d.sup1:e.style.cramped?w=d.sup3:w=d.sup2;var S=e.sizeMultiplier,k=Xe(.5/d.ptPerEm/S),j=null;if(c){var N=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");(a instanceof Aa||N)&&(j=Xe(-a.italic))}var T;if(l&&c){h=Math.max(h,w,l.depth+.25*d.xHeight),m=Math.max(m,d.sub2);var E=d.defaultRuleThickness,_=4*E;if(h-l.depth-(c.height-m)<_){m=_-(h-l.depth)+c.height;var A=.8*d.xHeight-(h-l.depth);A>0&&(h+=A,m-=A)}var L=[{type:"elem",elem:c,shift:m,marginRight:k,marginLeft:j},{type:"elem",elem:l,shift:-h,marginRight:k}];T=be.makeVList({positionType:"individualShift",children:L},e)}else if(c){m=Math.max(m,d.sub1,c.height-.8*d.xHeight);var P=[{type:"elem",elem:c,marginLeft:j,marginRight:k}];T=be.makeVList({positionType:"shift",positionData:m,children:P},e)}else if(l)h=Math.max(h,w,l.depth+.25*d.xHeight),T=be.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:l,marginRight:k}]},e);else throw new Error("supsub must have either sup or sub.");var B=$O(a,"right")||"mord";return be.makeSpan([B],[a,be.makeSpan(["msupsub"],[T])],e)},mathmlBuilder(t,e){var n=!1,r,s;t.base&&t.base.type==="horizBrace"&&(s=!!t.sup,s===t.base.isOver&&(n=!0,r=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var i=[lr(t.base,e)];t.sub&&i.push(lr(t.sub,e)),t.sup&&i.push(lr(t.sup,e));var a;if(n)a=r?"mover":"munder";else if(t.sub)if(t.sup){var d=t.base;d&&d.type==="op"&&d.limits&&e.style===Et.DISPLAY||d&&d.type==="operatorname"&&d.alwaysHandleSupSub&&(e.style===Et.DISPLAY||d.limits)?a="munderover":a="msubsup"}else{var c=t.base;c&&c.type==="op"&&c.limits&&(e.style===Et.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||e.style===Et.DISPLAY)?a="munder":a="msub"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===Et.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Et.DISPLAY)?a="mover":a="msup"}return new qe.MathNode(a,i)}});Sd({type:"atom",htmlBuilder(t,e){return be.mathsym(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var n=new qe.MathNode("mo",[Ma(t.text,t.mode)]);if(t.family==="bin"){var r=_N(t,e);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else t.family==="punct"?n.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&n.setAttribute("stretchy","false");return n}});var zU={mi:"italic",mn:"normal",mtext:"normal"};Sd({type:"mathord",htmlBuilder(t,e){return be.makeOrd(t,e,"mathord")},mathmlBuilder(t,e){var n=new qe.MathNode("mi",[Ma(t.text,t.mode,e)]),r=_N(t,e)||"italic";return r!==zU[n.type]&&n.setAttribute("mathvariant",r),n}});Sd({type:"textord",htmlBuilder(t,e){return be.makeOrd(t,e,"textord")},mathmlBuilder(t,e){var n=Ma(t.text,t.mode,e),r=_N(t,e)||"normal",s;return t.mode==="text"?s=new qe.MathNode("mtext",[n]):/[0-9]/.test(t.text)?s=new qe.MathNode("mn",[n]):t.text==="\\prime"?s=new qe.MathNode("mo",[n]):s=new qe.MathNode("mi",[n]),r!==zU[s.type]&&s.setAttribute("mathvariant",r),s}});var r5={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},s5={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Sd({type:"spacing",htmlBuilder(t,e){if(s5.hasOwnProperty(t.text)){var n=s5[t.text].className||"";if(t.mode==="text"){var r=be.makeOrd(t,e,"textord");return r.classes.push(n),r}else return be.makeSpan(["mspace",n],[be.mathsym(t.text,t.mode,e)],e)}else{if(r5.hasOwnProperty(t.text))return be.makeSpan(["mspace",r5[t.text]],[],e);throw new $e('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var n;if(s5.hasOwnProperty(t.text))n=new qe.MathNode("mtext",[new qe.TextNode(" ")]);else{if(r5.hasOwnProperty(t.text))return new qe.MathNode("mspace");throw new $e('Unknown type of space "'+t.text+'"')}return n}});var DR=()=>{var t=new qe.MathNode("mtd",[]);return t.setAttribute("width","50%"),t};Sd({type:"tag",mathmlBuilder(t,e){var n=new qe.MathNode("mtable",[new qe.MathNode("mtr",[DR(),new qe.MathNode("mtd",[nu(t.body,e)]),DR(),new qe.MathNode("mtd",[nu(t.tag,e)])])]);return n.setAttribute("width","100%"),n}});var PR={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},zR={"\\textbf":"textbf","\\textmd":"textmd"},uke={"\\textit":"textit","\\textup":"textup"},IR=(t,e)=>{var n=t.font;if(n){if(PR[n])return e.withTextFontFamily(PR[n]);if(zR[n])return e.withTextFontWeight(zR[n]);if(n==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(uke[n])};tt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t,s=e[0];return{type:"text",mode:n.mode,body:Qr(s),font:r}},htmlBuilder(t,e){var n=IR(t,e),r=fs(t.body,n,!0);return be.makeSpan(["mord","text"],r,n)},mathmlBuilder(t,e){var n=IR(t,e);return nu(t.body,n)}});tt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"underline",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=Pn(t.body,e),r=be.makeLineSpan("underline-line",e),s=e.fontMetrics().defaultRuleThickness,i=be.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:n}]},e);return be.makeSpan(["mord","underline"],[i],e)},mathmlBuilder(t,e){var n=new qe.MathNode("mo",[new qe.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new qe.MathNode("munder",[lr(t.body,e),n]);return r.setAttribute("accentunder","true"),r}});tt({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:n}=t;return{type:"vcenter",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=Pn(t.body,e),r=e.fontMetrics().axisHeight,s=.5*(n.height-r-(n.depth+r));return be.makeVList({positionType:"shift",positionData:s,children:[{type:"elem",elem:n}]},e)},mathmlBuilder(t,e){return new qe.MathNode("mpadded",[lr(t.body,e)],["vcenter"])}});tt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,n){throw new $e("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var n=LR(t),r=[],s=e.havingStyle(e.style.text()),i=0;it.body.replace(/ /g,t.star?"␣":" "),qc=iU,IU=`[ \r + ]`,dke="\\\\[a-zA-Z@]+",hke="\\\\[^\uD800-\uDFFF]",fke="("+dke+")"+IU+"*",mke=`\\\\( |[ \r ]+ -?)[ \r ]*`,FO="[̀-ͯ]",Y3e=new RegExp(FO+"+$"),K3e="("+MU+"+)|"+(X3e+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(FO+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(FO+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+G3e)+("|"+W3e+")");class RR{constructor(e,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=n,this.tokenRegex=new RegExp(K3e,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,n){this.catcodes[e]=n}lex(){var e=this.input,n=this.tokenRegex.lastIndex;if(n===e.length)return new Xi("EOF",new pi(this,n,n));var r=this.tokenRegex.exec(e);if(r===null||r.index!==n)throw new $e("Unexpected character: '"+e[n]+"'",new Xi(e[n],new pi(this,n,n+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 Xi(s,new pi(this,n,this.tokenRegex.lastIndex))}}class Z3e{constructor(e,n){e===void 0&&(e={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new $e("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var n in e)e.hasOwnProperty(n)&&(e[n]==null?delete this.current[n]:this.current[n]=e[n])}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,n,r){if(r===void 0&&(r=!1),r){for(var s=0;s0&&(this.undefStack[this.undefStack.length-1][e]=n)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}n==null?delete this.current[e]:this.current[e]=n}}var J3e=bU;Z("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});Z("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});Z("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});Z("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});Z("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var n=t.future();return e[0].length===1&&e[0][0].text===n.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});Z("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");Z("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var DR={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};Z("\\char",function(t){var e=t.popToken(),n,r="";if(e.text==="'")n=8,e=t.popToken();else if(e.text==='"')n=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")r=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new $e("\\char` missing argument");r=e.text.charCodeAt(0)}else n=10;if(n){if(r=DR[e.text],r==null||r>=n)throw new $e("Invalid base-"+n+" digit "+e.text);for(var s;(s=DR[t.future().text])!=null&&s{var s=t.consumeArg().tokens;if(s.length!==1)throw new $e("\\newcommand's first argument must be a macro name");var i=s[0].text,a=t.isDefined(i);if(a&&!e)throw new $e("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!n)throw new $e("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var l=0;if(s=t.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var c="",d=t.expandNextToken();d.text!=="]"&&d.text!=="EOF";)c+=d.text,d=t.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new $e("Invalid number of arguments: "+c);l=parseInt(c),s=t.consumeArg().tokens}return a&&r||t.macros.set(i,{tokens:s,numArgs:l}),""};Z("\\newcommand",t=>zN(t,!1,!0,!1));Z("\\renewcommand",t=>zN(t,!0,!1,!1));Z("\\providecommand",t=>zN(t,!0,!0,!0));Z("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(n=>n.text).join("")),""});Z("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(n=>n.text).join("")),""});Z("\\show",t=>{var e=t.popToken(),n=e.text;return console.log(e,t.macros.get(n),Fc[n],dr.math[n],dr.text[n]),""});Z("\\bgroup","{");Z("\\egroup","}");Z("~","\\nobreakspace");Z("\\lq","`");Z("\\rq","'");Z("\\aa","\\r a");Z("\\AA","\\r A");Z("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");Z("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");Z("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");Z("ℬ","\\mathscr{B}");Z("ℰ","\\mathscr{E}");Z("ℱ","\\mathscr{F}");Z("ℋ","\\mathscr{H}");Z("ℐ","\\mathscr{I}");Z("ℒ","\\mathscr{L}");Z("ℳ","\\mathscr{M}");Z("ℛ","\\mathscr{R}");Z("ℭ","\\mathfrak{C}");Z("ℌ","\\mathfrak{H}");Z("ℨ","\\mathfrak{Z}");Z("\\Bbbk","\\Bbb{k}");Z("·","\\cdotp");Z("\\llap","\\mathllap{\\textrm{#1}}");Z("\\rlap","\\mathrlap{\\textrm{#1}}");Z("\\clap","\\mathclap{\\textrm{#1}}");Z("\\mathstrut","\\vphantom{(}");Z("\\underbar","\\underline{\\text{#1}}");Z("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');Z("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");Z("\\ne","\\neq");Z("≠","\\neq");Z("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");Z("∉","\\notin");Z("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");Z("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");Z("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");Z("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");Z("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");Z("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");Z("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");Z("⟂","\\perp");Z("‼","\\mathclose{!\\mkern-0.8mu!}");Z("∌","\\notni");Z("⌜","\\ulcorner");Z("⌝","\\urcorner");Z("⌞","\\llcorner");Z("⌟","\\lrcorner");Z("©","\\copyright");Z("®","\\textregistered");Z("️","\\textregistered");Z("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');Z("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');Z("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');Z("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');Z("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");Z("⋮","\\vdots");Z("\\varGamma","\\mathit{\\Gamma}");Z("\\varDelta","\\mathit{\\Delta}");Z("\\varTheta","\\mathit{\\Theta}");Z("\\varLambda","\\mathit{\\Lambda}");Z("\\varXi","\\mathit{\\Xi}");Z("\\varPi","\\mathit{\\Pi}");Z("\\varSigma","\\mathit{\\Sigma}");Z("\\varUpsilon","\\mathit{\\Upsilon}");Z("\\varPhi","\\mathit{\\Phi}");Z("\\varPsi","\\mathit{\\Psi}");Z("\\varOmega","\\mathit{\\Omega}");Z("\\substack","\\begin{subarray}{c}#1\\end{subarray}");Z("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");Z("\\boxed","\\fbox{$\\displaystyle{#1}$}");Z("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");Z("\\implies","\\DOTSB\\;\\Longrightarrow\\;");Z("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");Z("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");Z("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var PR={",":"\\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"};Z("\\dots",function(t){var e="\\dotso",n=t.expandAfterFuture().text;return n in PR?e=PR[n]:(n.slice(0,4)==="\\not"||n in dr.math&&["bin","rel"].includes(dr.math[n].group))&&(e="\\dotsb"),e});var IN={")":!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};Z("\\dotso",function(t){var e=t.future().text;return e in IN?"\\ldots\\,":"\\ldots"});Z("\\dotsc",function(t){var e=t.future().text;return e in IN&&e!==","?"\\ldots\\,":"\\ldots"});Z("\\cdots",function(t){var e=t.future().text;return e in IN?"\\@cdots\\,":"\\@cdots"});Z("\\dotsb","\\cdots");Z("\\dotsm","\\cdots");Z("\\dotsi","\\!\\cdots");Z("\\dotsx","\\ldots\\,");Z("\\DOTSI","\\relax");Z("\\DOTSB","\\relax");Z("\\DOTSX","\\relax");Z("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");Z("\\,","\\tmspace+{3mu}{.1667em}");Z("\\thinspace","\\,");Z("\\>","\\mskip{4mu}");Z("\\:","\\tmspace+{4mu}{.2222em}");Z("\\medspace","\\:");Z("\\;","\\tmspace+{5mu}{.2777em}");Z("\\thickspace","\\;");Z("\\!","\\tmspace-{3mu}{.1667em}");Z("\\negthinspace","\\!");Z("\\negmedspace","\\tmspace-{4mu}{.2222em}");Z("\\negthickspace","\\tmspace-{5mu}{.277em}");Z("\\enspace","\\kern.5em ");Z("\\enskip","\\hskip.5em\\relax");Z("\\quad","\\hskip1em\\relax");Z("\\qquad","\\hskip2em\\relax");Z("\\tag","\\@ifstar\\tag@literal\\tag@paren");Z("\\tag@paren","\\tag@literal{({#1})}");Z("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new $e("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});Z("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");Z("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");Z("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");Z("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");Z("\\newline","\\\\\\relax");Z("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var AU=Xe(_o["Main-Regular"][84][1]-.7*_o["Main-Regular"][65][1]);Z("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+AU+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");Z("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+AU+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");Z("\\hspace","\\@ifstar\\@hspacer\\@hspace");Z("\\@hspace","\\hskip #1\\relax");Z("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");Z("\\ordinarycolon",":");Z("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");Z("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');Z("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');Z("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');Z("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');Z("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');Z("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');Z("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');Z("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');Z("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');Z("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');Z("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');Z("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');Z("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');Z("∷","\\dblcolon");Z("∹","\\eqcolon");Z("≔","\\coloneqq");Z("≕","\\eqqcolon");Z("⩴","\\Coloneqq");Z("\\ratio","\\vcentcolon");Z("\\coloncolon","\\dblcolon");Z("\\colonequals","\\coloneqq");Z("\\coloncolonequals","\\Coloneqq");Z("\\equalscolon","\\eqqcolon");Z("\\equalscoloncolon","\\Eqqcolon");Z("\\colonminus","\\coloneq");Z("\\coloncolonminus","\\Coloneq");Z("\\minuscolon","\\eqcolon");Z("\\minuscoloncolon","\\Eqcolon");Z("\\coloncolonapprox","\\Colonapprox");Z("\\coloncolonsim","\\Colonsim");Z("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");Z("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");Z("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");Z("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");Z("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");Z("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");Z("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");Z("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");Z("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");Z("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");Z("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");Z("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");Z("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");Z("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");Z("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");Z("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");Z("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");Z("\\nleqq","\\html@mathml{\\@nleqq}{≰}");Z("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");Z("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");Z("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");Z("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");Z("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");Z("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");Z("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");Z("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");Z("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");Z("\\imath","\\html@mathml{\\@imath}{ı}");Z("\\jmath","\\html@mathml{\\@jmath}{ȷ}");Z("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");Z("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");Z("⟦","\\llbracket");Z("⟧","\\rrbracket");Z("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");Z("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");Z("⦃","\\lBrace");Z("⦄","\\rBrace");Z("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");Z("⦵","\\minuso");Z("\\darr","\\downarrow");Z("\\dArr","\\Downarrow");Z("\\Darr","\\Downarrow");Z("\\lang","\\langle");Z("\\rang","\\rangle");Z("\\uarr","\\uparrow");Z("\\uArr","\\Uparrow");Z("\\Uarr","\\Uparrow");Z("\\N","\\mathbb{N}");Z("\\R","\\mathbb{R}");Z("\\Z","\\mathbb{Z}");Z("\\alef","\\aleph");Z("\\alefsym","\\aleph");Z("\\Alpha","\\mathrm{A}");Z("\\Beta","\\mathrm{B}");Z("\\bull","\\bullet");Z("\\Chi","\\mathrm{X}");Z("\\clubs","\\clubsuit");Z("\\cnums","\\mathbb{C}");Z("\\Complex","\\mathbb{C}");Z("\\Dagger","\\ddagger");Z("\\diamonds","\\diamondsuit");Z("\\empty","\\emptyset");Z("\\Epsilon","\\mathrm{E}");Z("\\Eta","\\mathrm{H}");Z("\\exist","\\exists");Z("\\harr","\\leftrightarrow");Z("\\hArr","\\Leftrightarrow");Z("\\Harr","\\Leftrightarrow");Z("\\hearts","\\heartsuit");Z("\\image","\\Im");Z("\\infin","\\infty");Z("\\Iota","\\mathrm{I}");Z("\\isin","\\in");Z("\\Kappa","\\mathrm{K}");Z("\\larr","\\leftarrow");Z("\\lArr","\\Leftarrow");Z("\\Larr","\\Leftarrow");Z("\\lrarr","\\leftrightarrow");Z("\\lrArr","\\Leftrightarrow");Z("\\Lrarr","\\Leftrightarrow");Z("\\Mu","\\mathrm{M}");Z("\\natnums","\\mathbb{N}");Z("\\Nu","\\mathrm{N}");Z("\\Omicron","\\mathrm{O}");Z("\\plusmn","\\pm");Z("\\rarr","\\rightarrow");Z("\\rArr","\\Rightarrow");Z("\\Rarr","\\Rightarrow");Z("\\real","\\Re");Z("\\reals","\\mathbb{R}");Z("\\Reals","\\mathbb{R}");Z("\\Rho","\\mathrm{P}");Z("\\sdot","\\cdot");Z("\\sect","\\S");Z("\\spades","\\spadesuit");Z("\\sub","\\subset");Z("\\sube","\\subseteq");Z("\\supe","\\supseteq");Z("\\Tau","\\mathrm{T}");Z("\\thetasym","\\vartheta");Z("\\weierp","\\wp");Z("\\Zeta","\\mathrm{Z}");Z("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");Z("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");Z("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");Z("\\bra","\\mathinner{\\langle{#1}|}");Z("\\ket","\\mathinner{|{#1}\\rangle}");Z("\\braket","\\mathinner{\\langle{#1}\\rangle}");Z("\\Bra","\\left\\langle#1\\right|");Z("\\Ket","\\left|#1\\right\\rangle");var RU=t=>e=>{var n=e.consumeArg().tokens,r=e.consumeArg().tokens,s=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.macros.get("|"),l=e.macros.get("\\|");e.macros.beginGroup();var c=m=>g=>{t&&(g.macros.set("|",a),s.length&&g.macros.set("\\|",l));var x=m;if(!m&&s.length){var y=g.future();y.text==="|"&&(g.popToken(),x=!0)}return{tokens:x?s:r,numArgs:0}};e.macros.set("|",c(!1)),s.length&&e.macros.set("\\|",c(!0));var d=e.consumeArg().tokens,h=e.expandTokens([...i,...d,...n]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};Z("\\bra@ket",RU(!1));Z("\\bra@set",RU(!0));Z("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");Z("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");Z("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");Z("\\angln","{\\angl n}");Z("\\blue","\\textcolor{##6495ed}{#1}");Z("\\orange","\\textcolor{##ffa500}{#1}");Z("\\pink","\\textcolor{##ff00af}{#1}");Z("\\red","\\textcolor{##df0030}{#1}");Z("\\green","\\textcolor{##28ae7b}{#1}");Z("\\gray","\\textcolor{gray}{#1}");Z("\\purple","\\textcolor{##9d38bd}{#1}");Z("\\blueA","\\textcolor{##ccfaff}{#1}");Z("\\blueB","\\textcolor{##80f6ff}{#1}");Z("\\blueC","\\textcolor{##63d9ea}{#1}");Z("\\blueD","\\textcolor{##11accd}{#1}");Z("\\blueE","\\textcolor{##0c7f99}{#1}");Z("\\tealA","\\textcolor{##94fff5}{#1}");Z("\\tealB","\\textcolor{##26edd5}{#1}");Z("\\tealC","\\textcolor{##01d1c1}{#1}");Z("\\tealD","\\textcolor{##01a995}{#1}");Z("\\tealE","\\textcolor{##208170}{#1}");Z("\\greenA","\\textcolor{##b6ffb0}{#1}");Z("\\greenB","\\textcolor{##8af281}{#1}");Z("\\greenC","\\textcolor{##74cf70}{#1}");Z("\\greenD","\\textcolor{##1fab54}{#1}");Z("\\greenE","\\textcolor{##0d923f}{#1}");Z("\\goldA","\\textcolor{##ffd0a9}{#1}");Z("\\goldB","\\textcolor{##ffbb71}{#1}");Z("\\goldC","\\textcolor{##ff9c39}{#1}");Z("\\goldD","\\textcolor{##e07d10}{#1}");Z("\\goldE","\\textcolor{##a75a05}{#1}");Z("\\redA","\\textcolor{##fca9a9}{#1}");Z("\\redB","\\textcolor{##ff8482}{#1}");Z("\\redC","\\textcolor{##f9685d}{#1}");Z("\\redD","\\textcolor{##e84d39}{#1}");Z("\\redE","\\textcolor{##bc2612}{#1}");Z("\\maroonA","\\textcolor{##ffbde0}{#1}");Z("\\maroonB","\\textcolor{##ff92c6}{#1}");Z("\\maroonC","\\textcolor{##ed5fa6}{#1}");Z("\\maroonD","\\textcolor{##ca337c}{#1}");Z("\\maroonE","\\textcolor{##9e034e}{#1}");Z("\\purpleA","\\textcolor{##ddd7ff}{#1}");Z("\\purpleB","\\textcolor{##c6b9fc}{#1}");Z("\\purpleC","\\textcolor{##aa87ff}{#1}");Z("\\purpleD","\\textcolor{##7854ab}{#1}");Z("\\purpleE","\\textcolor{##543b78}{#1}");Z("\\mintA","\\textcolor{##f5f9e8}{#1}");Z("\\mintB","\\textcolor{##edf2df}{#1}");Z("\\mintC","\\textcolor{##e0e5cc}{#1}");Z("\\grayA","\\textcolor{##f6f7f7}{#1}");Z("\\grayB","\\textcolor{##f0f1f2}{#1}");Z("\\grayC","\\textcolor{##e3e5e6}{#1}");Z("\\grayD","\\textcolor{##d6d8da}{#1}");Z("\\grayE","\\textcolor{##babec2}{#1}");Z("\\grayF","\\textcolor{##888d93}{#1}");Z("\\grayG","\\textcolor{##626569}{#1}");Z("\\grayH","\\textcolor{##3b3e40}{#1}");Z("\\grayI","\\textcolor{##21242c}{#1}");Z("\\kaBlue","\\textcolor{##314453}{#1}");Z("\\kaGreen","\\textcolor{##71B307}{#1}");var DU={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class eke{constructor(e,n,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=n,this.expansionCount=0,this.feed(e),this.macros=new Z3e(J3e,n.macros),this.mode=r,this.stack=[]}feed(e){this.lexer=new RR(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 n,r,s;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:n,end:r}=this.consumeArg());return this.pushToken(new Xi("EOF",r.loc)),this.pushTokens(s),new Xi("",pi.range(n,r))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var n=[],r=e&&e.length>0;r||this.consumeSpaces();var s=this.future(),i,a=0,l=0;do{if(i=this.popToken(),n.push(i),i.text==="{")++a;else if(i.text==="}"){if(--a,a===-1)throw new $e("Extra }",i)}else if(i.text==="EOF")throw new $e("Unexpected end of input in a macro argument, expected '"+(e&&r?e[l]:"}")+"'",i);if(e&&r)if((a===0||a===1&&e[l]==="{")&&i.text===e[l]){if(++l,l===e.length){n.splice(-l,l);break}}else l=0}while(a!==0||r);return s.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:s,end:i}}consumeArgs(e,n){if(n){if(n.length!==e+1)throw new $e("The length of delimiters doesn't match the number of args!");for(var r=n[0],s=0;sthis.settings.maxExpand)throw new $e("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var n=this.popToken(),r=n.text,s=n.noexpand?null:this._getExpansion(r);if(s==null||e&&s.unexpandable){if(e&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new $e("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var i=s.tokens,a=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var l=i.length-1;l>=0;--l){var c=i[l];if(c.text==="#"){if(l===0)throw new $e("Incomplete placeholder at end of macro body",c);if(c=i[--l],c.text==="#")i.splice(l+1,1);else if(/^[1-9]$/.test(c.text))i.splice(l,2,...a[+c.text-1]);else throw new $e("Not a valid argument number",c)}}}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 Xi(e)]):void 0}expandTokens(e){var n=[],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),n.push(s)}return this.countExpansion(n.length),n}expandMacroAsText(e){var n=this.expandMacro(e);return n&&n.map(r=>r.text).join("")}_getExpansion(e){var n=this.macros.get(e);if(n==null)return n;if(e.length===1){var r=this.lexer.catcodes[e];if(r!=null&&r!==13)return}var s=typeof n=="function"?n(this):n;if(typeof s=="string"){var i=0;if(s.indexOf("#")!==-1)for(var a=s.replace(/##/g,"");a.indexOf("#"+(i+1))!==-1;)++i;for(var l=new RR(s,this.settings),c=[],d=l.lex();d.text!=="EOF";)c.push(d),d=l.lex();c.reverse();var h={tokens:c,numArgs:i};return h}return s}isDefined(e){return this.macros.has(e)||Fc.hasOwnProperty(e)||dr.math.hasOwnProperty(e)||dr.text.hasOwnProperty(e)||DU.hasOwnProperty(e)}isExpandable(e){var n=this.macros.get(e);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:Fc.hasOwnProperty(e)&&!Fc[e].primitive}}var zR=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,I1=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),JS={"́":{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"}},IR={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class qb{constructor(e,n){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 eke(e,n,this.mode),this.settings=n,this.leftrightDepth=0}expect(e,n){if(n===void 0&&(n=!0),this.fetch().text!==e)throw new $e("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());n&&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 n=this.nextToken;this.consume(),this.gullet.pushToken(new Xi("}")),this.gullet.pushTokens(e);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(e,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(qb.endOfExpression.indexOf(s.text)!==-1||n&&s.text===n||e&&Fc[s.text]&&Fc[s.text].infix)break;var i=this.parseAtom(n);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 n=-1,r,s=0;s=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',e);var l=dr[this.mode][n].group,c=pi.range(e),d;if($5e.hasOwnProperty(l)){var h=l;d={type:"atom",mode:this.mode,family:h,loc:c,text:n}}else d={type:l,mode:this.mode,loc:c,text:n};a=d}else if(n.charCodeAt(0)>=128)this.settings.strict&&(HV(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),e)),a={type:"textord",mode:"text",loc:pi.range(e),text:n};else return null;if(this.consume(),i)for(var m=0;md&&(d=h):h&&(d!==void 0&&d>-1&&c.push(` -`.repeat(d)||" "),d=-1,c.push(h))}return c.join("")}function qU(t,e,n){return t.type==="element"?Mke(t,e,n):t.type==="text"?n.whitespace==="normal"?$U(t,n):Ake(t):[]}function Mke(t,e,n){const r=HU(t,n),s=t.children||[];let i=-1,a=[];if(Eke(t))return a;let l,c;for($O(t)||UR(t)&&$R(e,t,UR)?c=` -`:Tke(t)?(l=2,c=2):FU(t)&&(l=1,c=1);++i{try{i(!0);const Oe=await $ke({page:a,page_size:h,is_registered:g==="all"?void 0:g==="registered",is_banned:y==="all"?void 0:y==="banned",format:S==="all"?void 0:S,sort_by:j,sort_order:T});e(Oe.data),d(Oe.total)}catch(Oe){const Ve=Oe instanceof Error?Oe.message:"加载表情包列表失败";W({title:"错误",description:Ve,variant:"destructive"})}finally{i(!1)}},[a,h,g,y,S,j,T,W]),V=async()=>{try{const Oe=await Uke();r(Oe.data)}catch(Oe){console.error("加载统计数据失败:",Oe)}};b.useEffect(()=>{q()},[q]),b.useEffect(()=>{V()},[]);const te=async Oe=>{try{const Ve=await Hke(Oe.id);M(Ve.data),P(!0)}catch(Ve){const Ue=Ve instanceof Error?Ve.message:"加载详情失败";W({title:"错误",description:Ue,variant:"destructive"})}},ne=Oe=>{M(Oe),H(!0)},K=Oe=>{M(Oe),ee(!0)},se=async()=>{if(_)try{await Vke(_.id),W({title:"成功",description:"表情包已删除"}),ee(!1),M(null),q(),V()}catch(Oe){const Ve=Oe instanceof Error?Oe.message:"删除失败";W({title:"错误",description:Ve,variant:"destructive"})}},re=async Oe=>{try{await Wke(Oe.id),W({title:"成功",description:"表情包已注册"}),q(),V()}catch(Ve){const Ue=Ve instanceof Error?Ve.message:"注册失败";W({title:"错误",description:Ue,variant:"destructive"})}},oe=async Oe=>{try{await Gke(Oe.id),W({title:"成功",description:"表情包已封禁"}),q(),V()}catch(Ve){const Ue=Ve instanceof Error?Ve.message:"封禁失败";W({title:"错误",description:Ue,variant:"destructive"})}},Te=Oe=>{const Ve=new Set(z);Ve.has(Oe)?Ve.delete(Oe):Ve.add(Oe),Q(Ve)},We=async()=>{try{const Oe=await Xke(Array.from(z));W({title:"批量删除完成",description:Oe.message}),Q(new Set),X(!1),q(),V()}catch(Oe){W({title:"批量删除失败",description:Oe instanceof Error?Oe.message:"批量删除失败",variant:"destructive"})}},Ye=()=>{const Oe=parseInt(J),Ve=Math.ceil(c/h);Oe>=1&&Oe<=Ve?(l(Oe),G("")):W({title:"无效的页码",description:`请输入1-${Ve}之间的页码`,variant:"destructive"})},Je=n?.formats?Object.keys(n.formats):[];return o.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[o.jsxs("div",{className:"mb-4 sm:mb-6",children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"表情包管理"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理麦麦的表情包资源"})]}),o.jsx(wn,{className:"flex-1",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[n&&o.jsxs("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:[o.jsx(qt,{children:o.jsxs(Fn,{className:"pb-2",children:[o.jsx(ts,{children:"总数"}),o.jsx(qn,{className:"text-2xl",children:n.total})]})}),o.jsx(qt,{children:o.jsxs(Fn,{className:"pb-2",children:[o.jsx(ts,{children:"已注册"}),o.jsx(qn,{className:"text-2xl text-green-600",children:n.registered})]})}),o.jsx(qt,{children:o.jsxs(Fn,{className:"pb-2",children:[o.jsx(ts,{children:"已封禁"}),o.jsx(qn,{className:"text-2xl text-red-600",children:n.banned})]})}),o.jsx(qt,{children:o.jsxs(Fn,{className:"pb-2",children:[o.jsx(ts,{children:"未注册"}),o.jsx(qn,{className:"text-2xl text-gray-600",children:n.unregistered})]})})]}),o.jsxs(qt,{children:[o.jsx(Fn,{children:o.jsxs(qn,{className:"flex items-center gap-2",children:[o.jsx(Z3,{className:"h-5 w-5"}),"筛选和排序"]})}),o.jsxs(Gn,{className:"space-y-4",children:[o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{children:"排序方式"}),o.jsxs(Vt,{value:`${j}-${T}`,onValueChange:Oe=>{const[Ve,Ue]=Oe.split("-");N(Ve),E(Ue),l(1)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"usage_count-desc",children:"使用次数 (多→少)"}),o.jsx(De,{value:"usage_count-asc",children:"使用次数 (少→多)"}),o.jsx(De,{value:"register_time-desc",children:"注册时间 (新→旧)"}),o.jsx(De,{value:"register_time-asc",children:"注册时间 (旧→新)"}),o.jsx(De,{value:"record_time-desc",children:"记录时间 (新→旧)"}),o.jsx(De,{value:"record_time-asc",children:"记录时间 (旧→新)"}),o.jsx(De,{value:"last_used_time-desc",children:"最后使用 (新→旧)"}),o.jsx(De,{value:"last_used_time-asc",children:"最后使用 (旧→新)"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{children:"注册状态"}),o.jsxs(Vt,{value:g,onValueChange:Oe=>{x(Oe),l(1)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部"}),o.jsx(De,{value:"registered",children:"已注册"}),o.jsx(De,{value:"unregistered",children:"未注册"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{children:"封禁状态"}),o.jsxs(Vt,{value:y,onValueChange:Oe=>{w(Oe),l(1)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部"}),o.jsx(De,{value:"banned",children:"已封禁"}),o.jsx(De,{value:"unbanned",children:"未封禁"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{children:"格式"}),o.jsxs(Vt,{value:S,onValueChange:Oe=>{k(Oe),l(1)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部"}),Je.map(Oe=>o.jsxs(De,{value:Oe,children:[Oe.toUpperCase()," (",n?.formats[Oe],")"]},Oe))]})]})]})]}),o.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 pt-4 border-t",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[z.size>0&&o.jsxs("span",{className:"text-sm text-muted-foreground",children:["已选择 ",z.size," 个表情包"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(de,{className:"text-sm whitespace-nowrap",children:"卡片大小"}),o.jsxs(Vt,{value:R,onValueChange:Oe=>ie(Oe),children:[o.jsx($t,{className:"w-24",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"small",children:"小"}),o.jsx(De,{value:"medium",children:"中"}),o.jsx(De,{value:"large",children:"大"})]})]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(de,{htmlFor:"emoji-page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),o.jsxs(Vt,{value:h.toString(),onValueChange:Oe=>{m(parseInt(Oe)),l(1),Q(new Set)},children:[o.jsx($t,{id:"emoji-page-size",className:"w-20",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"20",children:"20"}),o.jsx(De,{value:"40",children:"40"}),o.jsx(De,{value:"60",children:"60"}),o.jsx(De,{value:"100",children:"100"})]})]}),z.size>0&&o.jsxs(o.Fragment,{children:[o.jsx(he,{variant:"outline",size:"sm",onClick:()=>Q(new Set),children:"取消选择"}),o.jsxs(he,{variant:"destructive",size:"sm",onClick:()=>X(!0),children:[o.jsx(Sn,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]}),o.jsx("div",{className:"flex justify-end pt-4 border-t",children:o.jsxs(he,{variant:"outline",size:"sm",onClick:q,disabled:s,children:[o.jsx(Qs,{className:`h-4 w-4 mr-2 ${s?"animate-spin":""}`}),"刷新"]})})]})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{children:[o.jsx(qn,{children:"表情包列表"}),o.jsxs(ts,{children:["共 ",c," 个表情包,当前第 ",a," 页"]})]}),o.jsxs(Gn,{children:[t.length===0?o.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"暂无数据"}):o.jsx("div",{className:`grid gap-3 ${R==="small"?"grid-cols-3 sm:grid-cols-4 md:grid-cols-6 lg:grid-cols-8 xl:grid-cols-10":R==="medium"?"grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 xl:grid-cols-8":"grid-cols-2 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5"}`,children:t.map(Oe=>o.jsxs("div",{className:`group relative rounded-lg border bg-card overflow-hidden hover:ring-2 hover:ring-primary transition-all cursor-pointer ${z.has(Oe.id)?"ring-2 ring-primary bg-primary/5":""}`,onClick:()=>Te(Oe.id),children:[o.jsx("div",{className:`absolute top-1 left-1 z-10 transition-opacity ${z.has(Oe.id)?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:o.jsx("div",{className:`w-5 h-5 rounded-full border-2 flex items-center justify-center ${z.has(Oe.id)?"bg-primary border-primary text-primary-foreground":"bg-background/80 border-muted-foreground/50"}`,children:z.has(Oe.id)&&o.jsx(Qc,{className:"h-3 w-3"})})}),o.jsxs("div",{className:"absolute top-1 right-1 z-10 flex flex-col gap-0.5",children:[Oe.is_registered&&o.jsx(Xn,{variant:"default",className:"bg-green-600 text-[10px] px-1 py-0",children:"已注册"}),Oe.is_banned&&o.jsx(Xn,{variant:"destructive",className:"text-[10px] px-1 py-0",children:"已封禁"})]}),o.jsx("div",{className:`aspect-square bg-muted flex items-center justify-center overflow-hidden ${R==="small"?"p-1":R==="medium"?"p-2":"p-3"}`,children:o.jsx("img",{src:QU(Oe.id),alt:"表情包",className:"w-full h-full object-contain",loading:"lazy",onError:Ve=>{const Ue=Ve.target;Ue.style.display="none";const He=Ue.parentElement;He&&(He.innerHTML='')}})}),o.jsxs("div",{className:`border-t bg-card ${R==="small"?"p-1":"p-2"}`,children:[o.jsxs("div",{className:"flex items-center justify-between gap-1 text-xs text-muted-foreground mb-1",children:[o.jsx(Xn,{variant:"outline",className:"text-[10px] px-1 py-0",children:Oe.format.toUpperCase()}),o.jsxs("span",{className:"font-mono",children:[Oe.usage_count,"次"]})]}),o.jsxs("div",{className:`flex gap-1 justify-center opacity-0 group-hover:opacity-100 transition-opacity ${R==="small"?"flex-wrap":""}`,children:[o.jsx(he,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:Ve=>{Ve.stopPropagation(),ne(Oe)},title:"编辑",children:o.jsx(R0,{className:"h-3 w-3"})}),o.jsx(he,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:Ve=>{Ve.stopPropagation(),te(Oe)},title:"详情",children:o.jsx(Oa,{className:"h-3 w-3"})}),!Oe.is_registered&&o.jsx(he,{variant:"ghost",size:"icon",className:"h-6 w-6 text-green-600 hover:text-green-700",onClick:Ve=>{Ve.stopPropagation(),re(Oe)},title:"注册",children:o.jsx(Qc,{className:"h-3 w-3"})}),!Oe.is_banned&&o.jsx(he,{variant:"ghost",size:"icon",className:"h-6 w-6 text-orange-600 hover:text-orange-700",onClick:Ve=>{Ve.stopPropagation(),oe(Oe)},title:"封禁",children:o.jsx(Lee,{className:"h-3 w-3"})}),o.jsx(he,{variant:"ghost",size:"icon",className:"h-6 w-6 text-red-600 hover:text-red-700",onClick:Ve=>{Ve.stopPropagation(),K(Oe)},title:"删除",children:o.jsx(Sn,{className:"h-3 w-3"})})]})]})]},Oe.id))}),c>0&&o.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[o.jsxs("div",{className:"text-sm text-muted-foreground",children:["显示 ",(a-1)*h+1," 到"," ",Math.min(a*h,c)," 条,共 ",c," 条"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{variant:"outline",size:"sm",onClick:()=>l(1),disabled:a===1,className:"hidden sm:flex",children:o.jsx(Ep,{className:"h-4 w-4"})}),o.jsxs(he,{variant:"outline",size:"sm",onClick:()=>l(Oe=>Math.max(1,Oe-1)),disabled:a===1,children:[o.jsx(vd,{className:"h-4 w-4 sm:mr-1"}),o.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ze,{type:"number",value:J,onChange:Oe=>G(Oe.target.value),onKeyDown:Oe=>Oe.key==="Enter"&&Ye(),placeholder:a.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(c/h)}),o.jsx(he,{variant:"outline",size:"sm",onClick:Ye,disabled:!J,className:"h-8",children:"跳转"})]}),o.jsxs(he,{variant:"outline",size:"sm",onClick:()=>l(Oe=>Oe+1),disabled:a>=Math.ceil(c/h),children:[o.jsx("span",{className:"hidden sm:inline",children:"下一页"}),o.jsx(yd,{className:"h-4 w-4 sm:ml-1"})]}),o.jsx(he,{variant:"outline",size:"sm",onClick:()=>l(Math.ceil(c/h)),disabled:a>=Math.ceil(c/h),className:"hidden sm:flex",children:o.jsx(_p,{className:"h-4 w-4"})})]})]})]})]}),o.jsx(Kke,{emoji:_,open:I,onOpenChange:P}),o.jsx(Zke,{emoji:_,open:L,onOpenChange:H,onSuccess:()=>{q(),V()}})]})}),o.jsx(Dn,{open:B,onOpenChange:X,children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认批量删除"}),o.jsxs(_n,{children:["你确定要删除选中的 ",z.size," 个表情包吗?此操作不可撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:We,children:"确认删除"})]})]})}),o.jsx(Dr,{open:U,onOpenChange:ee,children:o.jsxs(Sr,{children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"确认删除"}),o.jsx(ss,{children:"确定要删除这个表情包吗?此操作无法撤销。"})]}),o.jsxs(bs,{children:[o.jsx(he,{variant:"outline",onClick:()=>ee(!1),children:"取消"}),o.jsx(he,{variant:"destructive",onClick:se,children:"删除"})]})]})})]})}function Kke({emoji:t,open:e,onOpenChange:n}){if(!t)return null;const r=s=>s?new Date(s*1e3).toLocaleString("zh-CN"):"-";return o.jsx(Dr,{open:e,onOpenChange:n,children:o.jsxs(Sr,{className:"max-w-2xl max-h-[90vh]",children:[o.jsx(kr,{children:o.jsx(Or,{children:"表情包详情"})}),o.jsx(wn,{className:"max-h-[calc(90vh-8rem)] pr-4",children:o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"flex justify-center",children:o.jsx("div",{className:"w-32 h-32 bg-muted rounded-lg flex items-center justify-center overflow-hidden",children:o.jsx("img",{src:QU(t.id),alt:t.description||"表情包",className:"w-full h-full object-cover",onError:s=>{const i=s.target;i.style.display="none";const a=i.parentElement;a&&(a.innerHTML='')}})})}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx(de,{className:"text-muted-foreground",children:"ID"}),o.jsx("div",{className:"mt-1 font-mono",children:t.id})]}),o.jsxs("div",{children:[o.jsx(de,{className:"text-muted-foreground",children:"格式"}),o.jsx("div",{className:"mt-1",children:o.jsx(Xn,{variant:"outline",children:t.format.toUpperCase()})})]})]}),o.jsxs("div",{children:[o.jsx(de,{className:"text-muted-foreground",children:"文件路径"}),o.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:t.full_path})]}),o.jsxs("div",{children:[o.jsx(de,{className:"text-muted-foreground",children:"哈希值"}),o.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:t.emoji_hash})]}),o.jsxs("div",{children:[o.jsx(de,{className:"text-muted-foreground",children:"描述"}),t.description?o.jsx("div",{className:"mt-1 rounded-lg border bg-muted/50 p-3",children:o.jsx(qke,{className:"prose-sm",children:t.description})}):o.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:"-"})]}),o.jsxs("div",{children:[o.jsx(de,{className:"text-muted-foreground",children:"情绪"}),o.jsx("div",{className:"mt-1",children:t.emotion?o.jsx("span",{className:"text-sm",children:t.emotion}):o.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx(de,{className:"text-muted-foreground",children:"状态"}),o.jsxs("div",{className:"mt-2 flex gap-2",children:[t.is_registered&&o.jsx(Xn,{variant:"default",className:"bg-green-600",children:"已注册"}),t.is_banned&&o.jsx(Xn,{variant:"destructive",children:"已封禁"}),!t.is_registered&&!t.is_banned&&o.jsx(Xn,{variant:"outline",children:"未注册"})]})]}),o.jsxs("div",{children:[o.jsx(de,{className:"text-muted-foreground",children:"使用次数"}),o.jsx("div",{className:"mt-1 font-mono text-lg",children:t.usage_count})]})]}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx(de,{className:"text-muted-foreground",children:"记录时间"}),o.jsx("div",{className:"mt-1 text-sm",children:r(t.record_time)})]}),o.jsxs("div",{children:[o.jsx(de,{className:"text-muted-foreground",children:"注册时间"}),o.jsx("div",{className:"mt-1 text-sm",children:r(t.register_time)})]})]}),o.jsxs("div",{children:[o.jsx(de,{className:"text-muted-foreground",children:"最后使用"}),o.jsx("div",{className:"mt-1 text-sm",children:r(t.last_used_time)})]})]})})]})})}function Zke({emoji:t,open:e,onOpenChange:n,onSuccess:r}){const[s,i]=b.useState(""),[a,l]=b.useState(!1),[c,d]=b.useState(!1),[h,m]=b.useState(!1),{toast:g}=fs();b.useEffect(()=>{t&&(i(t.emotion||""),l(t.is_registered),d(t.is_banned))},[t]);const x=async()=>{if(t)try{m(!0);const y=s.split(/[,,]/).map(w=>w.trim()).filter(Boolean).join(",");await Qke(t.id,{emotion:y||void 0,is_registered:a,is_banned:c}),g({title:"成功",description:"表情包信息已更新"}),n(!1),r()}catch(y){const w=y instanceof Error?y.message:"保存失败";g({title:"错误",description:w,variant:"destructive"})}finally{m(!1)}};return t?o.jsx(Dr,{open:e,onOpenChange:n,children:o.jsxs(Sr,{className:"max-w-2xl",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"编辑表情包"}),o.jsx(ss,{children:"修改表情包的情绪和状态信息"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx(de,{children:"情绪"}),o.jsx(Ar,{value:s,onChange:y=>i(y.target.value),placeholder:"输入情绪描述...",rows:2,className:"mt-1"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"输入情绪相关的文本描述"})]}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Oi,{id:"is_registered",checked:a,onCheckedChange:y=>{y===!0?(l(!0),d(!1)):l(!1)}}),o.jsx(de,{htmlFor:"is_registered",className:"cursor-pointer",children:"已注册"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Oi,{id:"is_banned",checked:c,onCheckedChange:y=>{y===!0?(d(!0),l(!1)):d(!1)}}),o.jsx(de,{htmlFor:"is_banned",className:"cursor-pointer",children:"已封禁"})]})]})]}),o.jsxs(bs,{children:[o.jsx(he,{variant:"outline",onClick:()=>n(!1),children:"取消"}),o.jsx(he,{onClick:x,disabled:h,children:h?"保存中...":"保存"})]})]})}):null}const hu="/api/webui/expression";async function Jke(){const t=await St(`${hu}/chats`,{headers:Dt()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"获取聊天列表失败")}return t.json()}async function eOe(t){const e=new URLSearchParams;t.page&&e.append("page",t.page.toString()),t.page_size&&e.append("page_size",t.page_size.toString()),t.search&&e.append("search",t.search),t.chat_id&&e.append("chat_id",t.chat_id);const n=await St(`${hu}/list?${e}`,{headers:Dt()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取表达方式列表失败")}return n.json()}async function tOe(t){const e=await St(`${hu}/${t}`,{headers:Dt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"获取表达方式详情失败")}return e.json()}async function nOe(t){const e=await St(`${hu}/`,{method:"POST",headers:Dt(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"创建表达方式失败")}return e.json()}async function rOe(t,e){const n=await St(`${hu}/${t}`,{method:"PATCH",headers:Dt(),body:JSON.stringify(e)});if(!n.ok){const r=await n.json();throw new Error(r.detail||"更新表达方式失败")}return n.json()}async function sOe(t){const e=await St(`${hu}/${t}`,{method:"DELETE",headers:Dt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"删除表达方式失败")}return e.json()}async function iOe(t){const e=await St(`${hu}/batch/delete`,{method:"POST",headers:Dt(),body:JSON.stringify({ids:t})});if(!e.ok){const n=await e.json();throw new Error(n.detail||"批量删除表达方式失败")}return e.json()}async function aOe(){const t=await St(`${hu}/stats/summary`,{headers:Dt()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"获取统计数据失败")}return t.json()}function oOe(){const[t,e]=b.useState([]),[n,r]=b.useState(!0),[s,i]=b.useState(0),[a,l]=b.useState(1),[c,d]=b.useState(20),[h,m]=b.useState(""),[g,x]=b.useState(null),[y,w]=b.useState(!1),[S,k]=b.useState(!1),[j,N]=b.useState(!1),[T,E]=b.useState(null),[_,M]=b.useState(new Set),[I,P]=b.useState(!1),[L,H]=b.useState(""),[U,ee]=b.useState({total:0,recent_7days:0,chat_count:0,top_chats:{}}),[z,Q]=b.useState([]),[B,X]=b.useState(new Map),{toast:J}=fs(),G=async()=>{try{r(!0);const oe=await eOe({page:a,page_size:c,search:h||void 0});e(oe.data),i(oe.total)}catch(oe){J({title:"加载失败",description:oe instanceof Error?oe.message:"无法加载表达方式",variant:"destructive"})}finally{r(!1)}},R=async()=>{try{const oe=await aOe();oe?.data&&ee(oe.data)}catch(oe){console.error("加载统计数据失败:",oe)}},ie=async()=>{try{const oe=await Jke();if(oe?.data){Q(oe.data);const Te=new Map;oe.data.forEach(We=>{Te.set(We.chat_id,We.chat_name)}),X(Te)}}catch(oe){console.error("加载聊天列表失败:",oe)}},W=oe=>B.get(oe)||oe;b.useEffect(()=>{G(),R(),ie()},[a,c,h]);const q=async oe=>{try{const Te=await tOe(oe.id);x(Te.data),w(!0)}catch(Te){J({title:"加载详情失败",description:Te instanceof Error?Te.message:"无法加载表达方式详情",variant:"destructive"})}},V=oe=>{x(oe),k(!0)},te=async oe=>{try{await sOe(oe.id),J({title:"删除成功",description:`已删除表达方式: ${oe.situation}`}),E(null),G(),R()}catch(Te){J({title:"删除失败",description:Te instanceof Error?Te.message:"无法删除表达方式",variant:"destructive"})}},ne=oe=>{const Te=new Set(_);Te.has(oe)?Te.delete(oe):Te.add(oe),M(Te)},K=()=>{_.size===t.length&&t.length>0?M(new Set):M(new Set(t.map(oe=>oe.id)))},se=async()=>{try{await iOe(Array.from(_)),J({title:"批量删除成功",description:`已删除 ${_.size} 个表达方式`}),M(new Set),P(!1),G(),R()}catch(oe){J({title:"批量删除失败",description:oe instanceof Error?oe.message:"无法批量删除表达方式",variant:"destructive"})}},re=()=>{const oe=parseInt(L),Te=Math.ceil(s/c);oe>=1&&oe<=Te?(l(oe),H("")):J({title:"无效的页码",description:`请输入1-${Te}之间的页码`,variant:"destructive"})};return o.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[o.jsx("div",{className:"mb-4 sm:mb-6",children:o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[o.jsx(Cp,{className:"h-8 w-8",strokeWidth:2}),"表达方式管理"]}),o.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦的表达方式和话术模板"})]}),o.jsxs(he,{onClick:()=>N(!0),className:"gap-2",children:[o.jsx(zs,{className:"h-4 w-4"}),"新增表达方式"]})]})}),o.jsx(wn,{className:"flex-1",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"总数量"}),o.jsx("div",{className:"text-2xl font-bold mt-1",children:U.total})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"近7天新增"}),o.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:U.recent_7days})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"关联聊天数"}),o.jsx("div",{className:"text-2xl font-bold mt-1 text-blue-600",children:U.chat_count})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx(de,{htmlFor:"search",children:"搜索"}),o.jsx("div",{className:"flex flex-col sm:flex-row gap-2 mt-1.5",children:o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(Ni,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),o.jsx(ze,{id:"search",placeholder:"搜索情境、风格或上下文...",value:h,onChange:oe=>m(oe.target.value),className:"pl-9"})]})}),o.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:[o.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:_.size>0&&o.jsxs("span",{children:["已选择 ",_.size," 个表达方式"]})}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(de,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),o.jsxs(Vt,{value:c.toString(),onValueChange:oe=>{d(parseInt(oe)),l(1),M(new Set)},children:[o.jsx($t,{id:"page-size",className:"w-20",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"10",children:"10"}),o.jsx(De,{value:"20",children:"20"}),o.jsx(De,{value:"50",children:"50"}),o.jsx(De,{value:"100",children:"100"})]})]}),_.size>0&&o.jsxs(o.Fragment,{children:[o.jsx(he,{variant:"outline",size:"sm",onClick:()=>M(new Set),children:"取消选择"}),o.jsxs(he,{variant:"destructive",size:"sm",onClick:()=>P(!0),children:[o.jsx(Sn,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card",children:[o.jsx("div",{className:"hidden md:block",children:o.jsxs(Tf,{children:[o.jsx(Ef,{children:o.jsxs(Ps,{children:[o.jsx(pn,{className:"w-12",children:o.jsx(Oi,{checked:_.size===t.length&&t.length>0,onCheckedChange:K})}),o.jsx(pn,{children:"情境"}),o.jsx(pn,{children:"风格"}),o.jsx(pn,{children:"聊天"}),o.jsx(pn,{className:"text-right",children:"操作"})]})}),o.jsx(_f,{children:n?o.jsx(Ps,{children:o.jsx(Gt,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):t.length===0?o.jsx(Ps,{children:o.jsx(Gt,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):t.map(oe=>o.jsxs(Ps,{children:[o.jsx(Gt,{children:o.jsx(Oi,{checked:_.has(oe.id),onCheckedChange:()=>ne(oe.id)})}),o.jsx(Gt,{className:"font-medium max-w-xs truncate",children:oe.situation}),o.jsx(Gt,{className:"max-w-xs truncate",children:oe.style}),o.jsx(Gt,{className:"max-w-[200px] truncate",title:W(oe.chat_id),style:{wordBreak:"keep-all"},children:o.jsx("span",{className:"whitespace-nowrap overflow-hidden text-ellipsis block",children:W(oe.chat_id)})}),o.jsx(Gt,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsxs(he,{variant:"default",size:"sm",onClick:()=>V(oe),children:[o.jsx(R0,{className:"h-4 w-4 mr-1"}),"编辑"]}),o.jsx(he,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>q(oe),title:"查看详情",children:o.jsx(Ea,{className:"h-4 w-4"})}),o.jsxs(he,{size:"sm",onClick:()=>E(oe),className:"bg-red-600 hover:bg-red-700 text-white",children:[o.jsx(Sn,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},oe.id))})]})}),o.jsx("div",{className:"md:hidden space-y-3 p-4",children:n?o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):t.length===0?o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):t.map(oe=>o.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(Oi,{checked:_.has(oe.id),onCheckedChange:()=>ne(oe.id),className:"mt-1"}),o.jsxs("div",{className:"min-w-0 flex-1 overflow-hidden space-y-2",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"情境"}),o.jsx("h3",{className:"font-semibold text-sm line-clamp-2 w-full break-all",title:oe.situation,children:oe.situation})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"风格"}),o.jsx("p",{className:"text-sm line-clamp-2 w-full break-all",title:oe.style,children:oe.style})]})]})]}),o.jsxs("div",{className:"text-sm",children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"聊天"}),o.jsx("p",{className:"text-sm truncate",title:W(oe.chat_id),style:{wordBreak:"keep-all"},children:W(oe.chat_id)})]}),o.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[o.jsxs(he,{variant:"outline",size:"sm",onClick:()=>V(oe),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[o.jsx(R0,{className:"h-3 w-3 mr-1"}),"编辑"]}),o.jsx(he,{variant:"outline",size:"sm",onClick:()=>q(oe),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:o.jsx(Ea,{className:"h-3 w-3"})}),o.jsxs(he,{variant:"outline",size:"sm",onClick:()=>E(oe),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[o.jsx(Sn,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},oe.id))}),s>0&&o.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[o.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",s," 条记录,第 ",a," / ",Math.ceil(s/c)," 页"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{variant:"outline",size:"sm",onClick:()=>l(1),disabled:a===1,className:"hidden sm:flex",children:o.jsx(Ep,{className:"h-4 w-4"})}),o.jsxs(he,{variant:"outline",size:"sm",onClick:()=>l(a-1),disabled:a===1,children:[o.jsx(vd,{className:"h-4 w-4 sm:mr-1"}),o.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ze,{type:"number",value:L,onChange:oe=>H(oe.target.value),onKeyDown:oe=>oe.key==="Enter"&&re(),placeholder:a.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(s/c)}),o.jsx(he,{variant:"outline",size:"sm",onClick:re,disabled:!L,className:"h-8",children:"跳转"})]}),o.jsxs(he,{variant:"outline",size:"sm",onClick:()=>l(a+1),disabled:a>=Math.ceil(s/c),children:[o.jsx("span",{className:"hidden sm:inline",children:"下一页"}),o.jsx(yd,{className:"h-4 w-4 sm:ml-1"})]}),o.jsx(he,{variant:"outline",size:"sm",onClick:()=>l(Math.ceil(s/c)),disabled:a>=Math.ceil(s/c),className:"hidden sm:flex",children:o.jsx(_p,{className:"h-4 w-4"})})]})]})]})]})}),o.jsx(lOe,{expression:g,open:y,onOpenChange:w,chatNameMap:B}),o.jsx(cOe,{open:j,onOpenChange:N,chatList:z,onSuccess:()=>{G(),R(),N(!1)}}),o.jsx(uOe,{expression:g,open:S,onOpenChange:k,chatList:z,onSuccess:()=>{G(),R(),k(!1)}}),o.jsx(Dn,{open:!!T,onOpenChange:()=>E(null),children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:['确定要删除表达方式 "',T?.situation,'" 吗? 此操作不可撤销。']})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:()=>T&&te(T),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),o.jsx(dOe,{open:I,onOpenChange:P,onConfirm:se,count:_.size})]})}function lOe({expression:t,open:e,onOpenChange:n,chatNameMap:r}){if(!t)return null;const s=a=>a?new Date(a*1e3).toLocaleString("zh-CN"):"-",i=a=>r.get(a)||a;return o.jsx(Dr,{open:e,onOpenChange:n,children:o.jsxs(Sr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"表达方式详情"}),o.jsx(ss,{children:"查看表达方式的完整信息"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsx(Zm,{label:"情境",value:t.situation}),o.jsx(Zm,{label:"风格",value:t.style}),o.jsx(Zm,{label:"聊天",value:i(t.chat_id)}),o.jsx(Zm,{icon:J3,label:"记录ID",value:t.id.toString(),mono:!0})]}),o.jsx("div",{className:"grid grid-cols-2 gap-4",children:o.jsx(Zm,{icon:_h,label:"创建时间",value:s(t.create_date)})})]}),o.jsx(bs,{children:o.jsx(he,{onClick:()=>n(!1),children:"关闭"})})]})})}function Zm({icon:t,label:e,value:n,mono:r=!1}){return o.jsxs("div",{className:"space-y-1",children:[o.jsxs(de,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[t&&o.jsx(t,{className:"h-3 w-3"}),e]}),o.jsx("div",{className:ve("text-sm",r&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function cOe({open:t,onOpenChange:e,chatList:n,onSuccess:r}){const[s,i]=b.useState({situation:"",style:"",chat_id:""}),[a,l]=b.useState(!1),{toast:c}=fs(),d=async()=>{if(!s.situation||!s.style||!s.chat_id){c({title:"验证失败",description:"请填写必填字段:情境、风格和聊天",variant:"destructive"});return}try{l(!0),await nOe(s),c({title:"创建成功",description:"表达方式已创建"}),i({situation:"",style:"",chat_id:""}),r()}catch(h){c({title:"创建失败",description:h instanceof Error?h.message:"无法创建表达方式",variant:"destructive"})}finally{l(!1)}};return o.jsx(Dr,{open:t,onOpenChange:e,children:o.jsxs(Sr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"新增表达方式"}),o.jsx(ss,{children:"创建新的表达方式记录"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsxs(de,{htmlFor:"situation",children:["情境 ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsx(ze,{id:"situation",value:s.situation,onChange:h=>i({...s,situation:h.target.value}),placeholder:"描述使用场景"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs(de,{htmlFor:"style",children:["风格 ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsx(ze,{id:"style",value:s.style,onChange:h=>i({...s,style:h.target.value}),placeholder:"描述表达风格"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs(de,{htmlFor:"chat_id",children:["聊天 ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsxs(Vt,{value:s.chat_id,onValueChange:h=>i({...s,chat_id:h}),children:[o.jsx($t,{children:o.jsx(Ut,{placeholder:"选择关联的聊天"})}),o.jsx(Ht,{children:n.map(h=>o.jsx(De,{value:h.chat_id,children:o.jsxs("span",{className:"truncate",style:{wordBreak:"keep-all"},children:[h.chat_name,h.is_group&&o.jsx("span",{className:"text-muted-foreground ml-1",children:"(群聊)"})]})},h.chat_id))})]})]})]}),o.jsxs(bs,{children:[o.jsx(he,{variant:"outline",onClick:()=>e(!1),children:"取消"}),o.jsx(he,{onClick:d,disabled:a,children:a?"创建中...":"创建"})]})]})})}function uOe({expression:t,open:e,onOpenChange:n,chatList:r,onSuccess:s}){const[i,a]=b.useState({}),[l,c]=b.useState(!1),{toast:d}=fs();b.useEffect(()=>{t&&a({situation:t.situation,style:t.style,chat_id:t.chat_id})},[t]);const h=async()=>{if(t)try{c(!0),await rOe(t.id,i),d({title:"保存成功",description:"表达方式已更新"}),s()}catch(m){d({title:"保存失败",description:m instanceof Error?m.message:"无法更新表达方式",variant:"destructive"})}finally{c(!1)}};return t?o.jsx(Dr,{open:e,onOpenChange:n,children:o.jsxs(Sr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"编辑表达方式"}),o.jsx(ss,{children:"修改表达方式的信息"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{htmlFor:"edit_situation",children:"情境"}),o.jsx(ze,{id:"edit_situation",value:i.situation||"",onChange:m=>a({...i,situation:m.target.value}),placeholder:"描述使用场景"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{htmlFor:"edit_style",children:"风格"}),o.jsx(ze,{id:"edit_style",value:i.style||"",onChange:m=>a({...i,style:m.target.value}),placeholder:"描述表达风格"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{htmlFor:"edit_chat_id",children:"聊天"}),o.jsxs(Vt,{value:i.chat_id||"",onValueChange:m=>a({...i,chat_id:m}),children:[o.jsx($t,{children:o.jsx(Ut,{placeholder:"选择关联的聊天"})}),o.jsx(Ht,{children:r.map(m=>o.jsx(De,{value:m.chat_id,children:o.jsxs("span",{className:"truncate",style:{wordBreak:"keep-all"},children:[m.chat_name,m.is_group&&o.jsx("span",{className:"text-muted-foreground ml-1",children:"(群聊)"})]})},m.chat_id))})]})]})]}),o.jsxs(bs,{children:[o.jsx(he,{variant:"outline",onClick:()=>n(!1),children:"取消"}),o.jsx(he,{onClick:h,disabled:l,children:l?"保存中...":"保存"})]})]})}):null}function dOe({open:t,onOpenChange:e,onConfirm:n,count:r}){return o.jsx(Dn,{open:t,onOpenChange:e,children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认批量删除"}),o.jsxs(_n,{children:["您即将删除 ",r," 个表达方式,此操作无法撤销。确定要继续吗?"]})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:n,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"确认删除"})]})]})})}const qf="/api/webui/person";async function hOe(t){const e=new URLSearchParams;t.page&&e.append("page",t.page.toString()),t.page_size&&e.append("page_size",t.page_size.toString()),t.search&&e.append("search",t.search),t.is_known!==void 0&&e.append("is_known",t.is_known.toString()),t.platform&&e.append("platform",t.platform);const n=await St(`${qf}/list?${e}`,{headers:Dt()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取人物列表失败")}return n.json()}async function fOe(t){const e=await St(`${qf}/${t}`,{headers:Dt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"获取人物详情失败")}return e.json()}async function mOe(t,e){const n=await St(`${qf}/${t}`,{method:"PATCH",headers:Dt(),body:JSON.stringify(e)});if(!n.ok){const r=await n.json();throw new Error(r.detail||"更新人物信息失败")}return n.json()}async function pOe(t){const e=await St(`${qf}/${t}`,{method:"DELETE",headers:Dt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"删除人物信息失败")}return e.json()}async function gOe(){const t=await St(`${qf}/stats/summary`,{headers:Dt()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"获取统计数据失败")}return t.json()}async function xOe(t){const e=await St(`${qf}/batch/delete`,{method:"POST",headers:Dt(),body:JSON.stringify({person_ids:t})});if(!e.ok){const n=await e.json();throw new Error(n.detail||"批量删除失败")}return e.json()}function vOe(){const[t,e]=b.useState([]),[n,r]=b.useState(!0),[s,i]=b.useState(0),[a,l]=b.useState(1),[c,d]=b.useState(20),[h,m]=b.useState(""),[g,x]=b.useState(void 0),[y,w]=b.useState(void 0),[S,k]=b.useState(null),[j,N]=b.useState(!1),[T,E]=b.useState(!1),[_,M]=b.useState(null),[I,P]=b.useState({total:0,known:0,unknown:0,platforms:{}}),[L,H]=b.useState(new Set),[U,ee]=b.useState(!1),[z,Q]=b.useState(""),{toast:B}=fs(),X=async()=>{try{r(!0);const re=await hOe({page:a,page_size:c,search:h||void 0,is_known:g,platform:y});e(re.data),i(re.total)}catch(re){B({title:"加载失败",description:re instanceof Error?re.message:"无法加载人物信息",variant:"destructive"})}finally{r(!1)}},J=async()=>{try{const re=await gOe();re?.data&&P(re.data)}catch(re){console.error("加载统计数据失败:",re)}};b.useEffect(()=>{X(),J()},[a,c,h,g,y]);const G=async re=>{try{const oe=await fOe(re.person_id);k(oe.data),N(!0)}catch(oe){B({title:"加载详情失败",description:oe instanceof Error?oe.message:"无法加载人物详情",variant:"destructive"})}},R=re=>{k(re),E(!0)},ie=async re=>{try{await pOe(re.person_id),B({title:"删除成功",description:`已删除人物信息: ${re.person_name||re.nickname||re.user_id}`}),M(null),X(),J()}catch(oe){B({title:"删除失败",description:oe instanceof Error?oe.message:"无法删除人物信息",variant:"destructive"})}},W=b.useMemo(()=>Object.keys(I.platforms),[I.platforms]),q=re=>{const oe=new Set(L);oe.has(re)?oe.delete(re):oe.add(re),H(oe)},V=()=>{L.size===t.length&&t.length>0?H(new Set):H(new Set(t.map(re=>re.person_id)))},te=()=>{if(L.size===0){B({title:"未选择任何人物",description:"请先选择要删除的人物",variant:"destructive"});return}ee(!0)},ne=async()=>{try{const re=await xOe(Array.from(L));B({title:"批量删除完成",description:re.message}),H(new Set),ee(!1),X(),J()}catch(re){B({title:"批量删除失败",description:re instanceof Error?re.message:"批量删除失败",variant:"destructive"})}},K=()=>{const re=parseInt(z),oe=Math.ceil(s/c);re>=1&&re<=oe?(l(re),Q("")):B({title:"无效的页码",description:`请输入1-${oe}之间的页码`,variant:"destructive"})},se=re=>re?new Date(re*1e3).toLocaleString("zh-CN"):"-";return o.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[o.jsx("div",{className:"mb-4 sm:mb-6",children:o.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[o.jsx(Bee,{className:"h-8 w-8",strokeWidth:2}),"人物信息管理"]}),o.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦认识的所有人物信息"})]})})}),o.jsx(wn,{className:"flex-1",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"总人数"}),o.jsx("div",{className:"text-2xl font-bold mt-1",children:I.total})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"已认识"}),o.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:I.known})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"未认识"}),o.jsx("div",{className:"text-2xl font-bold mt-1 text-muted-foreground",children:I.unknown})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-4",children:[o.jsxs("div",{className:"sm:col-span-2",children:[o.jsx(de,{htmlFor:"search",children:"搜索"}),o.jsxs("div",{className:"relative mt-1.5",children:[o.jsx(Ni,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),o.jsx(ze,{id:"search",placeholder:"搜索名称、昵称或用户ID...",value:h,onChange:re=>m(re.target.value),className:"pl-9"})]})]}),o.jsxs("div",{children:[o.jsx(de,{htmlFor:"filter-known",children:"认识状态"}),o.jsxs(Vt,{value:g===void 0?"all":g.toString(),onValueChange:re=>{x(re==="all"?void 0:re==="true"),l(1)},children:[o.jsx($t,{id:"filter-known",className:"mt-1.5",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部"}),o.jsx(De,{value:"true",children:"已认识"}),o.jsx(De,{value:"false",children:"未认识"})]})]})]}),o.jsxs("div",{children:[o.jsx(de,{htmlFor:"filter-platform",children:"平台"}),o.jsxs(Vt,{value:y||"all",onValueChange:re=>{w(re==="all"?void 0:re),l(1)},children:[o.jsx($t,{id:"filter-platform",className:"mt-1.5",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部平台"}),W.map(re=>o.jsxs(De,{value:re,children:[re," (",I.platforms[re],")"]},re))]})]})]})]}),o.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:[o.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:L.size>0&&o.jsxs("span",{children:["已选择 ",L.size," 个人物"]})}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(de,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),o.jsxs(Vt,{value:c.toString(),onValueChange:re=>{d(parseInt(re)),l(1),H(new Set)},children:[o.jsx($t,{id:"page-size",className:"w-20",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"10",children:"10"}),o.jsx(De,{value:"20",children:"20"}),o.jsx(De,{value:"50",children:"50"}),o.jsx(De,{value:"100",children:"100"})]})]}),L.size>0&&o.jsxs(o.Fragment,{children:[o.jsx(he,{variant:"outline",size:"sm",onClick:()=>H(new Set),children:"取消选择"}),o.jsxs(he,{variant:"destructive",size:"sm",onClick:te,children:[o.jsx(Sn,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card",children:[o.jsx("div",{className:"hidden md:block",children:o.jsxs(Tf,{children:[o.jsx(Ef,{children:o.jsxs(Ps,{children:[o.jsx(pn,{className:"w-12",children:o.jsx(Oi,{checked:t.length>0&&L.size===t.length,onCheckedChange:V,"aria-label":"全选"})}),o.jsx(pn,{children:"状态"}),o.jsx(pn,{children:"名称"}),o.jsx(pn,{children:"昵称"}),o.jsx(pn,{children:"平台"}),o.jsx(pn,{children:"用户ID"}),o.jsx(pn,{children:"最后更新"}),o.jsx(pn,{className:"text-right",children:"操作"})]})}),o.jsx(_f,{children:n?o.jsx(Ps,{children:o.jsx(Gt,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):t.length===0?o.jsx(Ps,{children:o.jsx(Gt,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):t.map(re=>o.jsxs(Ps,{children:[o.jsx(Gt,{children:o.jsx(Oi,{checked:L.has(re.person_id),onCheckedChange:()=>q(re.person_id),"aria-label":`选择 ${re.person_name||re.nickname||re.user_id}`})}),o.jsx(Gt,{children:o.jsx("div",{className:ve("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",re.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:re.is_known?"已认识":"未认识"})}),o.jsx(Gt,{className:"font-medium",children:re.person_name||o.jsx("span",{className:"text-muted-foreground",children:"-"})}),o.jsx(Gt,{children:re.nickname||"-"}),o.jsx(Gt,{children:re.platform}),o.jsx(Gt,{className:"font-mono text-sm",children:re.user_id}),o.jsx(Gt,{className:"text-sm text-muted-foreground",children:se(re.last_know)}),o.jsx(Gt,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsxs(he,{variant:"default",size:"sm",onClick:()=>G(re),children:[o.jsx(Ea,{className:"h-4 w-4 mr-1"}),"详情"]}),o.jsxs(he,{variant:"default",size:"sm",onClick:()=>R(re),children:[o.jsx(R0,{className:"h-4 w-4 mr-1"}),"编辑"]}),o.jsxs(he,{size:"sm",onClick:()=>M(re),className:"bg-red-600 hover:bg-red-700 text-white",children:[o.jsx(Sn,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},re.id))})]})}),o.jsx("div",{className:"md:hidden space-y-3 p-4",children:n?o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):t.length===0?o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):t.map(re=>o.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(Oi,{checked:L.has(re.person_id),onCheckedChange:()=>q(re.person_id),className:"mt-1"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:ve("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium mb-2",re.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:re.is_known?"已认识":"未认识"}),o.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",children:re.person_name||o.jsx("span",{className:"text-muted-foreground",children:"未命名"})}),re.nickname&&o.jsxs("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-1 w-full break-all",children:["昵称: ",re.nickname]})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"平台"}),o.jsx("p",{className:"font-medium text-xs",children:re.platform})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"用户ID"}),o.jsx("p",{className:"font-mono text-xs truncate",title:re.user_id,children:re.user_id})]}),o.jsxs("div",{className:"col-span-2",children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"最后更新"}),o.jsx("p",{className:"text-xs",children:se(re.last_know)})]})]}),o.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[o.jsxs(he,{variant:"outline",size:"sm",onClick:()=>G(re),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[o.jsx(Ea,{className:"h-3 w-3 mr-1"}),"查看"]}),o.jsxs(he,{variant:"outline",size:"sm",onClick:()=>R(re),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[o.jsx(R0,{className:"h-3 w-3 mr-1"}),"编辑"]}),o.jsxs(he,{variant:"outline",size:"sm",onClick:()=>M(re),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[o.jsx(Sn,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},re.id))}),s>0&&o.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[o.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",s," 条记录,第 ",a," / ",Math.ceil(s/c)," 页"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{variant:"outline",size:"sm",onClick:()=>l(1),disabled:a===1,className:"hidden sm:flex",children:o.jsx(Ep,{className:"h-4 w-4"})}),o.jsxs(he,{variant:"outline",size:"sm",onClick:()=>l(a-1),disabled:a===1,children:[o.jsx(vd,{className:"h-4 w-4 sm:mr-1"}),o.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ze,{type:"number",value:z,onChange:re=>Q(re.target.value),onKeyDown:re=>re.key==="Enter"&&K(),placeholder:a.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(s/c)}),o.jsx(he,{variant:"outline",size:"sm",onClick:K,disabled:!z,className:"h-8",children:"跳转"})]}),o.jsxs(he,{variant:"outline",size:"sm",onClick:()=>l(a+1),disabled:a>=Math.ceil(s/c),children:[o.jsx("span",{className:"hidden sm:inline",children:"下一页"}),o.jsx(yd,{className:"h-4 w-4 sm:ml-1"})]}),o.jsx(he,{variant:"outline",size:"sm",onClick:()=>l(Math.ceil(s/c)),disabled:a>=Math.ceil(s/c),className:"hidden sm:flex",children:o.jsx(_p,{className:"h-4 w-4"})})]})]})]})]})}),o.jsx(yOe,{person:S,open:j,onOpenChange:N}),o.jsx(bOe,{person:S,open:T,onOpenChange:E,onSuccess:()=>{X(),J(),E(!1)}}),o.jsx(Dn,{open:!!_,onOpenChange:()=>M(null),children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:['确定要删除人物信息 "',_?.person_name||_?.nickname||_?.user_id,'" 吗? 此操作不可撤销。']})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:()=>_&&ie(_),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),o.jsx(Dn,{open:U,onOpenChange:ee,children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认批量删除"}),o.jsxs(_n,{children:["确定要删除选中的 ",L.size," 个人物信息吗? 此操作不可撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(An,{children:"取消"}),o.jsx(Mn,{onClick:ne,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})})]})}function yOe({person:t,open:e,onOpenChange:n}){if(!t)return null;const r=s=>s?new Date(s*1e3).toLocaleString("zh-CN"):"-";return o.jsx(Dr,{open:e,onOpenChange:n,children:o.jsxs(Sr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"人物详情"}),o.jsxs(ss,{children:["查看 ",t.person_name||t.nickname||t.user_id," 的完整信息"]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsx(yl,{icon:mI,label:"人物名称",value:t.person_name}),o.jsx(yl,{icon:Cp,label:"昵称",value:t.nickname}),o.jsx(yl,{icon:J3,label:"用户ID",value:t.user_id,mono:!0}),o.jsx(yl,{icon:J3,label:"人物ID",value:t.person_id,mono:!0}),o.jsx(yl,{label:"平台",value:t.platform}),o.jsx(yl,{label:"状态",value:t.is_known?"已认识":"未认识"})]}),t.name_reason&&o.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[o.jsx(de,{className:"text-xs text-muted-foreground",children:"名称设定原因"}),o.jsx("p",{className:"mt-1 text-sm",children:t.name_reason})]}),t.memory_points&&o.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[o.jsx(de,{className:"text-xs text-muted-foreground",children:"个人印象"}),o.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:t.memory_points})]}),t.group_nick_name&&t.group_nick_name.length>0&&o.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[o.jsx(de,{className:"text-xs text-muted-foreground",children:"群昵称"}),o.jsx("div",{className:"mt-2 space-y-1",children:t.group_nick_name.map((s,i)=>o.jsxs("div",{className:"text-sm flex items-center gap-2",children:[o.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:s.group_id}),o.jsx("span",{children:"→"}),o.jsx("span",{children:s.group_nick_name})]},i))})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[o.jsx(yl,{icon:_h,label:"认识时间",value:r(t.know_times)}),o.jsx(yl,{icon:_h,label:"首次记录",value:r(t.know_since)}),o.jsx(yl,{icon:_h,label:"最后更新",value:r(t.last_know)})]})]}),o.jsx(bs,{children:o.jsx(he,{onClick:()=>n(!1),children:"关闭"})})]})})}function yl({icon:t,label:e,value:n,mono:r=!1}){return o.jsxs("div",{className:"space-y-1",children:[o.jsxs(de,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[t&&o.jsx(t,{className:"h-3 w-3"}),e]}),o.jsx("div",{className:ve("text-sm",r&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function bOe({person:t,open:e,onOpenChange:n,onSuccess:r}){const[s,i]=b.useState({}),[a,l]=b.useState(!1),{toast:c}=fs();b.useEffect(()=>{t&&i({person_name:t.person_name||"",name_reason:t.name_reason||"",nickname:t.nickname||"",memory_points:t.memory_points||"",is_known:t.is_known})},[t]);const d=async()=>{if(t)try{l(!0),await mOe(t.person_id,s),c({title:"保存成功",description:"人物信息已更新"}),r()}catch(h){c({title:"保存失败",description:h instanceof Error?h.message:"无法更新人物信息",variant:"destructive"})}finally{l(!1)}};return t?o.jsx(Dr,{open:e,onOpenChange:n,children:o.jsxs(Sr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"编辑人物信息"}),o.jsxs(ss,{children:["修改 ",t.person_name||t.nickname||t.user_id," 的信息"]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{htmlFor:"person_name",children:"人物名称"}),o.jsx(ze,{id:"person_name",value:s.person_name||"",onChange:h=>i({...s,person_name:h.target.value}),placeholder:"为这个人设置一个名称"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{htmlFor:"nickname",children:"昵称"}),o.jsx(ze,{id:"nickname",value:s.nickname||"",onChange:h=>i({...s,nickname:h.target.value}),placeholder:"昵称"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{htmlFor:"name_reason",children:"名称设定原因"}),o.jsx(Ar,{id:"name_reason",value:s.name_reason||"",onChange:h=>i({...s,name_reason:h.target.value}),placeholder:"为什么这样称呼这个人?",rows:2})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{htmlFor:"memory_points",children:"个人印象"}),o.jsx(Ar,{id:"memory_points",value:s.memory_points||"",onChange:h=>i({...s,memory_points:h.target.value}),placeholder:"对这个人的印象和记忆点...",rows:4})]}),o.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[o.jsxs("div",{children:[o.jsx(de,{htmlFor:"is_known",className:"text-base font-medium",children:"已认识"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"标记是否已经认识这个人"})]}),o.jsx(Bt,{id:"is_known",checked:s.is_known,onCheckedChange:h=>i({...s,is_known:h})})]})]}),o.jsxs(bs,{children:[o.jsx(he,{variant:"outline",onClick:()=>n(!1),children:"取消"}),o.jsx(he,{onClick:d,disabled:a,children:a?"保存中...":"保存"})]})]})}):null}function Is(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let n=0,r;n{let e;const n=new Set,r=(h,m)=>{const g=typeof h=="function"?h(e):h;if(!Object.is(g,e)){const x=e;e=m??(typeof g!="object"||g===null)?g:Object.assign({},e,g),n.forEach(y=>y(e,x))}},s=()=>e,c={setState:r,getState:s,getInitialState:()=>d,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(wOe?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=e=t(r,s,c);return c},SOe=t=>t?WR(t):WR,{useDebugValue:kOe}=ae,{useSyncExternalStoreWithSelector:OOe}=eJ,jOe=t=>t;function VU(t,e=jOe,n){const r=OOe(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return kOe(r),r}const GR=(t,e)=>{const n=SOe(t),r=(s,i=e)=>VU(n,s,i);return Object.assign(r,n),r},NOe=(t,e)=>t?GR(t,e):GR;function Ss(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[r,s]of t)if(!Object.is(s,e.get(r)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const r of t)if(!e.has(r))return!1;return!0}const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(e,r)||!Object.is(t[r],e[r]))return!1;return!0}var COe={value:()=>{}};function $b(){for(var t=0,e=arguments.length,n={},r;t=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}kv.prototype=$b.prototype={constructor:kv,on:function(t,e){var n=this._,r=TOe(t+"",n),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var n=new Array(s),r=0,s,i;r=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),YR.hasOwnProperty(e)?{space:YR[e],local:t}:t}function _Oe(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===HO&&e.documentElement.namespaceURI===HO?e.createElement(t):e.createElementNS(n,t)}}function MOe(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function UU(t){var e=Hb(t);return(e.local?MOe:_Oe)(e)}function AOe(){}function qN(t){return t==null?AOe:function(){return this.querySelector(t)}}function ROe(t){typeof t!="function"&&(t=qN(t));for(var e=this._groups,n=e.length,r=new Array(n),s=0;s=N&&(N=j+1);!(E=S[N])&&++N=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function sje(t){t||(t=ije);function e(m,g){return m&&g?t(m.__data__,g.__data__):!m-!g}for(var n=this._groups,r=n.length,s=new Array(r),i=0;ie?1:t>=e?0:NaN}function aje(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function oje(){return Array.from(this)}function lje(){for(var t=this._groups,e=0,n=t.length;e1?this.each((e==null?yje:typeof e=="function"?wje:bje)(t,e,n??"")):hf(this.node(),t)}function hf(t,e){return t.style.getPropertyValue(e)||KU(t).getComputedStyle(t,null).getPropertyValue(e)}function kje(t){return function(){delete this[t]}}function Oje(t,e){return function(){this[t]=e}}function jje(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Nje(t,e){return arguments.length>1?this.each((e==null?kje:typeof e=="function"?jje:Oje)(t,e)):this.node()[t]}function ZU(t){return t.trim().split(/^|\s+/)}function $N(t){return t.classList||new JU(t)}function JU(t){this._node=t,this._names=ZU(t.getAttribute("class")||"")}JU.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function eW(t,e){for(var n=$N(t),r=-1,s=e.length;++r=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function e6e(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,s=e.length,i;n()=>t;function QO(t,{sourceEvent:e,subject:n,target:r,identifier:s,active:i,x:a,y:l,dx:c,dy:d,dispatch:h}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:h}})}QO.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function u6e(t){return!t.ctrlKey&&!t.button}function d6e(){return this.parentNode}function h6e(t,e){return e??{x:t.x,y:t.y}}function f6e(){return navigator.maxTouchPoints||"ontouchstart"in this}function m6e(){var t=u6e,e=d6e,n=h6e,r=f6e,s={},i=$b("start","drag","end"),a=0,l,c,d,h,m=0;function g(T){T.on("mousedown.drag",x).filter(r).on("touchstart.drag",S).on("touchmove.drag",k,c6e).on("touchend.drag touchcancel.drag",j).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(T,E){if(!(h||!t.call(this,T,E))){var _=N(this,e.call(this,T,E),T,E,"mouse");_&&(ma(T.view).on("mousemove.drag",y,gp).on("mouseup.drag",w,gp),sW(T.view),t5(T),d=!1,l=T.clientX,c=T.clientY,_("start",T))}}function y(T){if(Hh(T),!d){var E=T.clientX-l,_=T.clientY-c;d=E*E+_*_>m}s.mouse("drag",T)}function w(T){ma(T.view).on("mousemove.drag mouseup.drag",null),iW(T.view,d),Hh(T),s.mouse("end",T)}function S(T,E){if(t.call(this,T,E)){var _=T.changedTouches,M=e.call(this,T,E),I=_.length,P,L;for(P=0;P=0&&t._call.call(void 0,e),t=t._next;--ff}function KR(){md=(Oy=xp.now())+Qb,ff=u0=0;try{g6e()}finally{ff=0,v6e(),md=0}}function x6e(){var t=xp.now(),e=t-Oy;e>aW&&(Qb-=e,Oy=t)}function v6e(){for(var t,e=ky,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:ky=n);d0=t,VO(r)}function VO(t){if(!ff){u0&&(u0=clearTimeout(u0));var e=t-md;e>24?(t<1/0&&(u0=setTimeout(KR,t-xp.now()-Qb)),Jm&&(Jm=clearInterval(Jm))):(Jm||(Oy=xp.now(),Jm=setInterval(x6e,aW)),ff=1,oW(KR))}}function ZR(t,e,n){var r=new jy;return e=e==null?0:+e,r.restart(s=>{r.stop(),t(s+e)},e,n),r}var y6e=$b("start","end","cancel","interrupt"),b6e=[],cW=0,JR=1,UO=2,Ov=3,eD=4,WO=5,jv=6;function Vb(t,e,n,r,s,i){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;w6e(t,n,{name:e,index:r,group:s,on:y6e,tween:b6e,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:cW})}function QN(t,e){var n=io(t,e);if(n.state>cW)throw new Error("too late; already scheduled");return n}function Wo(t,e){var n=io(t,e);if(n.state>Ov)throw new Error("too late; already running");return n}function io(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function w6e(t,e,n){var r=t.__transition,s;r[e]=n,n.timer=lW(i,0,n.time);function i(d){n.state=JR,n.timer.restart(a,n.delay,n.time),n.delay<=d&&a(d-n.delay)}function a(d){var h,m,g,x;if(n.state!==JR)return c();for(h in r)if(x=r[h],x.name===n.name){if(x.state===Ov)return ZR(a);x.state===eD?(x.state=jv,x.timer.stop(),x.on.call("interrupt",t,t.__data__,x.index,x.group),delete r[h]):+hUO&&r.state=0&&(e=e.slice(0,n)),!e||e==="start"})}function K6e(t,e,n){var r,s,i=Y6e(e)?QN:Wo;return function(){var a=i(this,t),l=a.on;l!==r&&(s=(r=l).copy()).on(e,n),a.on=s}}function Z6e(t,e){var n=this._id;return arguments.length<2?io(this.node(),n).on.on(t):this.each(K6e(n,t,e))}function J6e(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function eNe(){return this.on("end.remove",J6e(this._id))}function tNe(t){var e=this._name,n=this._id;typeof t!="function"&&(t=qN(t));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>t;function NNe(t,{sourceEvent:e,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Al(t,e,n){this.k=t,this.x=e,this.y=n}Al.prototype={constructor:Al,scale:function(t){return t===1?this:new Al(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Al(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Bl=new Al(1,0,0);Al.prototype;function n5(t){t.stopImmediatePropagation()}function e0(t){t.preventDefault(),t.stopImmediatePropagation()}function CNe(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function TNe(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function tD(){return this.__zoom||Bl}function ENe(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function _Ne(){return navigator.maxTouchPoints||"ontouchstart"in this}function MNe(t,e,n){var r=t.invertX(e[0][0])-n[0][0],s=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function fW(){var t=CNe,e=TNe,n=MNe,r=ENe,s=_Ne,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=kJ,d=$b("start","zoom","end"),h,m,g,x=500,y=150,w=0,S=10;function k(z){z.property("__zoom",tD).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",L).filter(s).on("touchstart.zoom",H).on("touchmove.zoom",U).on("touchend.zoom touchcancel.zoom",ee).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(z,Q,B,X){var J=z.selection?z.selection():z;J.property("__zoom",tD),z!==J?E(z,Q,B,X):J.interrupt().each(function(){_(this,arguments).event(X).start().zoom(null,typeof Q=="function"?Q.apply(this,arguments):Q).end()})},k.scaleBy=function(z,Q,B,X){k.scaleTo(z,function(){var J=this.__zoom.k,G=typeof Q=="function"?Q.apply(this,arguments):Q;return J*G},B,X)},k.scaleTo=function(z,Q,B,X){k.transform(z,function(){var J=e.apply(this,arguments),G=this.__zoom,R=B==null?T(J):typeof B=="function"?B.apply(this,arguments):B,ie=G.invert(R),W=typeof Q=="function"?Q.apply(this,arguments):Q;return n(N(j(G,W),R,ie),J,a)},B,X)},k.translateBy=function(z,Q,B,X){k.transform(z,function(){return n(this.__zoom.translate(typeof Q=="function"?Q.apply(this,arguments):Q,typeof B=="function"?B.apply(this,arguments):B),e.apply(this,arguments),a)},null,X)},k.translateTo=function(z,Q,B,X,J){k.transform(z,function(){var G=e.apply(this,arguments),R=this.__zoom,ie=X==null?T(G):typeof X=="function"?X.apply(this,arguments):X;return n(Bl.translate(ie[0],ie[1]).scale(R.k).translate(typeof Q=="function"?-Q.apply(this,arguments):-Q,typeof B=="function"?-B.apply(this,arguments):-B),G,a)},X,J)};function j(z,Q){return Q=Math.max(i[0],Math.min(i[1],Q)),Q===z.k?z:new Al(Q,z.x,z.y)}function N(z,Q,B){var X=Q[0]-B[0]*z.k,J=Q[1]-B[1]*z.k;return X===z.x&&J===z.y?z:new Al(z.k,X,J)}function T(z){return[(+z[0][0]+ +z[1][0])/2,(+z[0][1]+ +z[1][1])/2]}function E(z,Q,B,X){z.on("start.zoom",function(){_(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(X).end()}).tween("zoom",function(){var J=this,G=arguments,R=_(J,G).event(X),ie=e.apply(J,G),W=B==null?T(ie):typeof B=="function"?B.apply(J,G):B,q=Math.max(ie[1][0]-ie[0][0],ie[1][1]-ie[0][1]),V=J.__zoom,te=typeof Q=="function"?Q.apply(J,G):Q,ne=c(V.invert(W).concat(q/V.k),te.invert(W).concat(q/te.k));return function(K){if(K===1)K=te;else{var se=ne(K),re=q/se[2];K=new Al(re,W[0]-se[0]*re,W[1]-se[1]*re)}R.zoom(null,K)}})}function _(z,Q,B){return!B&&z.__zooming||new M(z,Q)}function M(z,Q){this.that=z,this.args=Q,this.active=0,this.sourceEvent=null,this.extent=e.apply(z,Q),this.taps=0}M.prototype={event:function(z){return z&&(this.sourceEvent=z),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(z,Q){return this.mouse&&z!=="mouse"&&(this.mouse[1]=Q.invert(this.mouse[0])),this.touch0&&z!=="touch"&&(this.touch0[1]=Q.invert(this.touch0[0])),this.touch1&&z!=="touch"&&(this.touch1[1]=Q.invert(this.touch1[0])),this.that.__zoom=Q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(z){var Q=ma(this.that).datum();d.call(z,this.that,new NNe(z,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:d}),Q)}};function I(z,...Q){if(!t.apply(this,arguments))return;var B=_(this,Q).event(z),X=this.__zoom,J=Math.max(i[0],Math.min(i[1],X.k*Math.pow(2,r.apply(this,arguments)))),G=Ha(z);if(B.wheel)(B.mouse[0][0]!==G[0]||B.mouse[0][1]!==G[1])&&(B.mouse[1]=X.invert(B.mouse[0]=G)),clearTimeout(B.wheel);else{if(X.k===J)return;B.mouse=[G,X.invert(G)],Nv(this),B.start()}e0(z),B.wheel=setTimeout(R,y),B.zoom("mouse",n(N(j(X,J),B.mouse[0],B.mouse[1]),B.extent,a));function R(){B.wheel=null,B.end()}}function P(z,...Q){if(g||!t.apply(this,arguments))return;var B=z.currentTarget,X=_(this,Q,!0).event(z),J=ma(z.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",q,!0),G=Ha(z,B),R=z.clientX,ie=z.clientY;sW(z.view),n5(z),X.mouse=[G,this.__zoom.invert(G)],Nv(this),X.start();function W(V){if(e0(V),!X.moved){var te=V.clientX-R,ne=V.clientY-ie;X.moved=te*te+ne*ne>w}X.event(V).zoom("mouse",n(N(X.that.__zoom,X.mouse[0]=Ha(V,B),X.mouse[1]),X.extent,a))}function q(V){J.on("mousemove.zoom mouseup.zoom",null),iW(V.view,X.moved),e0(V),X.event(V).end()}}function L(z,...Q){if(t.apply(this,arguments)){var B=this.__zoom,X=Ha(z.changedTouches?z.changedTouches[0]:z,this),J=B.invert(X),G=B.k*(z.shiftKey?.5:2),R=n(N(j(B,G),X,J),e.apply(this,Q),a);e0(z),l>0?ma(this).transition().duration(l).call(E,R,X,z):ma(this).call(k.transform,R,X,z)}}function H(z,...Q){if(t.apply(this,arguments)){var B=z.touches,X=B.length,J=_(this,Q,z.changedTouches.length===X).event(z),G,R,ie,W;for(n5(z),R=0;R"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,e)=>`Couldn't create edge for ${t?"target":"source"} handle id: "${t?e.targetHandle:e.sourceHandle}", edge id: ${e.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},mW=Wl.error001();function hr(t,e){const n=b.useContext(Ub);if(n===null)throw new Error(mW);return VU(n,t,e)}const ms=()=>{const t=b.useContext(Ub);if(t===null)throw new Error(mW);return b.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe,destroy:t.destroy}),[t])},RNe=t=>t.userSelectionActive?"none":"all";function Wb({position:t,children:e,className:n,style:r,...s}){const i=hr(RNe),a=`${t}`.split("-");return ae.createElement("div",{className:Is(["react-flow__panel",n,...a]),style:{...r,pointerEvents:i},...s},e)}function DNe({proOptions:t,position:e="bottom-right"}){return t?.hideAttribution?null:ae.createElement(Wb,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},ae.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const PNe=({x:t,y:e,label:n,labelStyle:r={},labelShowBg:s=!0,labelBgStyle:i={},labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:c,className:d,...h})=>{const m=b.useRef(null),[g,x]=b.useState({x:0,y:0,width:0,height:0}),y=Is(["react-flow__edge-textwrapper",d]);return b.useEffect(()=>{if(m.current){const w=m.current.getBBox();x({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),typeof n>"u"||!n?null:ae.createElement("g",{transform:`translate(${t-g.width/2} ${e-g.height/2})`,className:y,visibility:g.width?"visible":"hidden",...h},s&&ae.createElement("rect",{width:g.width+2*a[0],x:-a[0],y:-a[1],height:g.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),ae.createElement("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:m,style:r},n),c)};var zNe=b.memo(PNe);const UN=t=>({width:t.offsetWidth,height:t.offsetHeight}),mf=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),WN=(t={x:0,y:0},e)=>({x:mf(t.x,e[0][0],e[1][0]),y:mf(t.y,e[0][1],e[1][1])}),nD=(t,e,n)=>tn?-mf(Math.abs(t-n),1,50)/50:0,pW=(t,e)=>{const n=nD(t.x,35,e.width-35)*20,r=nD(t.y,35,e.height-35)*20;return[n,r]},gW=t=>t.getRootNode?.()||window?.document,xW=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),vp=({x:t,y:e,width:n,height:r})=>({x:t,y:e,x2:t+n,y2:e+r}),vW=({x:t,y:e,x2:n,y2:r})=>({x:t,y:e,width:n-t,height:r-e}),rD=t=>({...t.positionAbsolute||{x:0,y:0},width:t.width||0,height:t.height||0}),INe=(t,e)=>vW(xW(vp(t),vp(e))),GO=(t,e)=>{const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),r=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*r)},LNe=t=>ka(t.width)&&ka(t.height)&&ka(t.x)&&ka(t.y),ka=t=>!isNaN(t)&&isFinite(t),Lr=Symbol.for("internals"),yW=["Enter"," ","Escape"],BNe=(t,e)=>{},FNe=t=>"nativeEvent"in t;function XO(t){const n=(FNe(t)?t.nativeEvent:t).composedPath?.()?.[0]||t.target;return["INPUT","SELECT","TEXTAREA"].includes(n?.nodeName)||n?.hasAttribute("contenteditable")||!!n?.closest(".nokey")}const bW=t=>"clientX"in t,$c=(t,e)=>{const n=bW(t),r=n?t.clientX:t.touches?.[0].clientX,s=n?t.clientY:t.touches?.[0].clientY;return{x:r-(e?.left??0),y:s-(e?.top??0)}},Ny=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0,gg=({id:t,path:e,labelX:n,labelY:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d,style:h,markerEnd:m,markerStart:g,interactionWidth:x=20})=>ae.createElement(ae.Fragment,null,ae.createElement("path",{id:t,style:h,d:e,fill:"none",className:"react-flow__edge-path",markerEnd:m,markerStart:g}),x&&ae.createElement("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:x,className:"react-flow__edge-interaction"}),s&&ka(n)&&ka(r)?ae.createElement(zNe,{x:n,y:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d}):null);gg.displayName="BaseEdge";function t0(t,e,n){return n===void 0?n:r=>{const s=e().edges.find(i=>i.id===t);s&&n(r,{...s})}}function wW({sourceX:t,sourceY:e,targetX:n,targetY:r}){const s=Math.abs(n-t)/2,i=n{const[S,k,j]=kW({sourceX:t,sourceY:e,sourcePosition:s,targetX:n,targetY:r,targetPosition:i});return ae.createElement(gg,{path:S,labelX:k,labelY:j,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:y,interactionWidth:w})});GN.displayName="SimpleBezierEdge";const iD={[wt.Left]:{x:-1,y:0},[wt.Right]:{x:1,y:0},[wt.Top]:{x:0,y:-1},[wt.Bottom]:{x:0,y:1}},qNe=({source:t,sourcePosition:e=wt.Bottom,target:n})=>e===wt.Left||e===wt.Right?t.xMath.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function $Ne({source:t,sourcePosition:e=wt.Bottom,target:n,targetPosition:r=wt.Top,center:s,offset:i}){const a=iD[e],l=iD[r],c={x:t.x+a.x*i,y:t.y+a.y*i},d={x:n.x+l.x*i,y:n.y+l.y*i},h=qNe({source:c,sourcePosition:e,target:d}),m=h.x!==0?"x":"y",g=h[m];let x=[],y,w;const S={x:0,y:0},k={x:0,y:0},[j,N,T,E]=wW({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(a[m]*l[m]===-1){y=s.x??j,w=s.y??N;const M=[{x:y,y:c.y},{x:y,y:d.y}],I=[{x:c.x,y:w},{x:d.x,y:w}];a[m]===g?x=m==="x"?M:I:x=m==="x"?I:M}else{const M=[{x:c.x,y:d.y}],I=[{x:d.x,y:c.y}];if(m==="x"?x=a.x===g?I:M:x=a.y===g?M:I,e===r){const ee=Math.abs(t[m]-n[m]);if(ee<=i){const z=Math.min(i-1,i-ee);a[m]===g?S[m]=(c[m]>t[m]?-1:1)*z:k[m]=(d[m]>n[m]?-1:1)*z}}if(e!==r){const ee=m==="x"?"y":"x",z=a[m]===l[ee],Q=c[ee]>d[ee],B=c[ee]=U?(y=(P.x+L.x)/2,w=x[0].y):(y=x[0].x,w=(P.y+L.y)/2)}return[[t,{x:c.x+S.x,y:c.y+S.y},...x,{x:d.x+k.x,y:d.y+k.y},n],y,w,T,E]}function HNe(t,e,n,r){const s=Math.min(aD(t,e)/2,aD(e,n)/2,r),{x:i,y:a}=e;if(t.x===i&&i===n.x||t.y===a&&a===n.y)return`L${i} ${a}`;if(t.y===a){const d=t.x{let N="";return j>0&&j{const[k,j,N]=YO({sourceX:t,sourceY:e,sourcePosition:m,targetX:n,targetY:r,targetPosition:g,borderRadius:w?.borderRadius,offset:w?.offset});return ae.createElement(gg,{path:k,labelX:j,labelY:N,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d,style:h,markerEnd:x,markerStart:y,interactionWidth:S})});Gb.displayName="SmoothStepEdge";const XN=b.memo(t=>ae.createElement(Gb,{...t,pathOptions:b.useMemo(()=>({borderRadius:0,offset:t.pathOptions?.offset}),[t.pathOptions?.offset])}));XN.displayName="StepEdge";function QNe({sourceX:t,sourceY:e,targetX:n,targetY:r}){const[s,i,a,l]=wW({sourceX:t,sourceY:e,targetX:n,targetY:r});return[`M ${t},${e}L ${n},${r}`,s,i,a,l]}const YN=b.memo(({sourceX:t,sourceY:e,targetX:n,targetY:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d,style:h,markerEnd:m,markerStart:g,interactionWidth:x})=>{const[y,w,S]=QNe({sourceX:t,sourceY:e,targetX:n,targetY:r});return ae.createElement(gg,{path:y,labelX:w,labelY:S,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d,style:h,markerEnd:m,markerStart:g,interactionWidth:x})});YN.displayName="StraightEdge";function F1(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function oD({pos:t,x1:e,y1:n,x2:r,y2:s,c:i}){switch(t){case wt.Left:return[e-F1(e-r,i),n];case wt.Right:return[e+F1(r-e,i),n];case wt.Top:return[e,n-F1(n-s,i)];case wt.Bottom:return[e,n+F1(s-n,i)]}}function OW({sourceX:t,sourceY:e,sourcePosition:n=wt.Bottom,targetX:r,targetY:s,targetPosition:i=wt.Top,curvature:a=.25}){const[l,c]=oD({pos:n,x1:t,y1:e,x2:r,y2:s,c:a}),[d,h]=oD({pos:i,x1:r,y1:s,x2:t,y2:e,c:a}),[m,g,x,y]=SW({sourceX:t,sourceY:e,targetX:r,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:d,targetControlY:h});return[`M${t},${e} C${l},${c} ${d},${h} ${r},${s}`,m,g,x,y]}const Ty=b.memo(({sourceX:t,sourceY:e,targetX:n,targetY:r,sourcePosition:s=wt.Bottom,targetPosition:i=wt.Top,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:y,pathOptions:w,interactionWidth:S})=>{const[k,j,N]=OW({sourceX:t,sourceY:e,sourcePosition:s,targetX:n,targetY:r,targetPosition:i,curvature:w?.curvature});return ae.createElement(gg,{path:k,labelX:j,labelY:N,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:y,interactionWidth:S})});Ty.displayName="BezierEdge";const KN=b.createContext(null),VNe=KN.Provider;KN.Consumer;const UNe=()=>b.useContext(KN),WNe=t=>"id"in t&&"source"in t&&"target"in t,GNe=({source:t,sourceHandle:e,target:n,targetHandle:r})=>`reactflow__edge-${t}${e||""}-${n}${r||""}`,KO=(t,e)=>typeof t>"u"?"":typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(r=>`${r}=${t[r]}`).join("&")}`,XNe=(t,e)=>e.some(n=>n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle)),YNe=(t,e)=>{if(!t.source||!t.target)return e;let n;return WNe(t)?n={...t}:n={...t,id:GNe(t)},XNe(n,e)?e:e.concat(n)},ZO=({x:t,y:e},[n,r,s],i,[a,l])=>{const c={x:(t-n)/s,y:(e-r)/s};return i?{x:a*Math.round(c.x/a),y:l*Math.round(c.y/l)}:c},jW=({x:t,y:e},[n,r,s])=>({x:t*s+n,y:e*s+r}),td=(t,e=[0,0])=>{if(!t)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(t.width??0)*e[0],r=(t.height??0)*e[1],s={x:t.position.x-n,y:t.position.y-r};return{...s,positionAbsolute:t.positionAbsolute?{x:t.positionAbsolute.x-n,y:t.positionAbsolute.y-r}:s}},Xb=(t,e=[0,0])=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const n=t.reduce((r,s)=>{const{x:i,y:a}=td(s,e).positionAbsolute;return xW(r,vp({x:i,y:a,width:s.width||0,height:s.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return vW(n)},NW=(t,e,[n,r,s]=[0,0,1],i=!1,a=!1,l=[0,0])=>{const c={x:(e.x-n)/s,y:(e.y-r)/s,width:e.width/s,height:e.height/s},d=[];return t.forEach(h=>{const{width:m,height:g,selectable:x=!0,hidden:y=!1}=h;if(a&&!x||y)return!1;const{positionAbsolute:w}=td(h,l),S={x:w.x,y:w.y,width:m||0,height:g||0},k=GO(c,S),j=typeof m>"u"||typeof g>"u"||m===null||g===null,N=i&&k>0,T=(m||0)*(g||0);(j||N||k>=T||h.dragging)&&d.push(h)}),d},CW=(t,e)=>{const n=t.map(r=>r.id);return e.filter(r=>n.includes(r.source)||n.includes(r.target))},TW=(t,e,n,r,s,i=.1)=>{const a=e/(t.width*(1+i)),l=n/(t.height*(1+i)),c=Math.min(a,l),d=mf(c,r,s),h=t.x+t.width/2,m=t.y+t.height/2,g=e/2-h*d,x=n/2-m*d;return{x:g,y:x,zoom:d}},Lu=(t,e=0)=>t.transition().duration(e);function lD(t,e,n,r){return(e[n]||[]).reduce((s,i)=>(`${t.id}-${i.id}-${n}`!==r&&s.push({id:i.id||null,type:n,nodeId:t.id,x:(t.positionAbsolute?.x??0)+i.x+i.width/2,y:(t.positionAbsolute?.y??0)+i.y+i.height/2}),s),[])}function KNe(t,e,n,r,s,i){const{x:a,y:l}=$c(t),d=e.elementsFromPoint(a,l).find(y=>y.classList.contains("react-flow__handle"));if(d){const y=d.getAttribute("data-nodeid");if(y){const w=ZN(void 0,d),S=d.getAttribute("data-handleid"),k=i({nodeId:y,id:S,type:w});if(k){const j=s.find(N=>N.nodeId===y&&N.type===w&&N.id===S);return{handle:{id:S,type:w,nodeId:y,x:j?.x||n.x,y:j?.y||n.y},validHandleResult:k}}}}let h=[],m=1/0;if(s.forEach(y=>{const w=Math.sqrt((y.x-n.x)**2+(y.y-n.y)**2);if(w<=r){const S=i(y);w<=m&&(wy.isValid),x=h.some(({handle:y})=>y.type==="target");return h.find(({handle:y,validHandleResult:w})=>x?y.type==="target":g?w.isValid:!0)||h[0]}const ZNe={source:null,target:null,sourceHandle:null,targetHandle:null},EW=()=>({handleDomNode:null,isValid:!1,connection:ZNe,endHandle:null});function _W(t,e,n,r,s,i,a){const l=s==="target",c=a.querySelector(`.react-flow__handle[data-id="${t?.nodeId}-${t?.id}-${t?.type}"]`),d={...EW(),handleDomNode:c};if(c){const h=ZN(void 0,c),m=c.getAttribute("data-nodeid"),g=c.getAttribute("data-handleid"),x=c.classList.contains("connectable"),y=c.classList.contains("connectableend"),w={source:l?m:n,sourceHandle:l?g:r,target:l?n:m,targetHandle:l?r:g};d.connection=w,x&&y&&(e===pd.Strict?l&&h==="source"||!l&&h==="target":m!==n||g!==r)&&(d.endHandle={nodeId:m,handleId:g,type:h},d.isValid=i(w))}return d}function JNe({nodes:t,nodeId:e,handleId:n,handleType:r}){return t.reduce((s,i)=>{if(i[Lr]){const{handleBounds:a}=i[Lr];let l=[],c=[];a&&(l=lD(i,a,"source",`${e}-${n}-${r}`),c=lD(i,a,"target",`${e}-${n}-${r}`)),s.push(...l,...c)}return s},[])}function ZN(t,e){return t||(e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null)}function r5(t){t?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function e7e(t,e){let n=null;return e?n="valid":t&&!e&&(n="invalid"),n}function MW({event:t,handleId:e,nodeId:n,onConnect:r,isTarget:s,getState:i,setState:a,isValidConnection:l,edgeUpdaterType:c,onReconnectEnd:d}){const h=gW(t.target),{connectionMode:m,domNode:g,autoPanOnConnect:x,connectionRadius:y,onConnectStart:w,panBy:S,getNodes:k,cancelConnection:j}=i();let N=0,T;const{x:E,y:_}=$c(t),M=h?.elementFromPoint(E,_),I=ZN(c,M),P=g?.getBoundingClientRect();if(!P||!I)return;let L,H=$c(t,P),U=!1,ee=null,z=!1,Q=null;const B=JNe({nodes:k(),nodeId:n,handleId:e,handleType:I}),X=()=>{if(!x)return;const[R,ie]=pW(H,P);S({x:R,y:ie}),N=requestAnimationFrame(X)};a({connectionPosition:H,connectionStatus:null,connectionNodeId:n,connectionHandleId:e,connectionHandleType:I,connectionStartHandle:{nodeId:n,handleId:e,type:I},connectionEndHandle:null}),w?.(t,{nodeId:n,handleId:e,handleType:I});function J(R){const{transform:ie}=i();H=$c(R,P);const{handle:W,validHandleResult:q}=KNe(R,h,ZO(H,ie,!1,[1,1]),y,B,V=>_W(V,m,n,e,s?"target":"source",l,h));if(T=W,U||(X(),U=!0),Q=q.handleDomNode,ee=q.connection,z=q.isValid,a({connectionPosition:T&&z?jW({x:T.x,y:T.y},ie):H,connectionStatus:e7e(!!T,z),connectionEndHandle:q.endHandle}),!T&&!z&&!Q)return r5(L);ee.source!==ee.target&&Q&&(r5(L),L=Q,Q.classList.add("connecting","react-flow__handle-connecting"),Q.classList.toggle("valid",z),Q.classList.toggle("react-flow__handle-valid",z))}function G(R){(T||Q)&&ee&&z&&r?.(ee),i().onConnectEnd?.(R),c&&d?.(R),r5(L),j(),cancelAnimationFrame(N),U=!1,z=!1,ee=null,Q=null,h.removeEventListener("mousemove",J),h.removeEventListener("mouseup",G),h.removeEventListener("touchmove",J),h.removeEventListener("touchend",G)}h.addEventListener("mousemove",J),h.addEventListener("mouseup",G),h.addEventListener("touchmove",J),h.addEventListener("touchend",G)}const cD=()=>!0,t7e=t=>({connectionStartHandle:t.connectionStartHandle,connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName}),n7e=(t,e,n)=>r=>{const{connectionStartHandle:s,connectionEndHandle:i,connectionClickStartHandle:a}=r;return{connecting:s?.nodeId===t&&s?.handleId===e&&s?.type===n||i?.nodeId===t&&i?.handleId===e&&i?.type===n,clickConnecting:a?.nodeId===t&&a?.handleId===e&&a?.type===n}},AW=b.forwardRef(({type:t="source",position:e=wt.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:l,children:c,className:d,onMouseDown:h,onTouchStart:m,...g},x)=>{const y=a||null,w=t==="target",S=ms(),k=UNe(),{connectOnClick:j,noPanClassName:N}=hr(t7e,Ss),{connecting:T,clickConnecting:E}=hr(n7e(k,y,t),Ss);k||S.getState().onError?.("010",Wl.error010());const _=P=>{const{defaultEdgeOptions:L,onConnect:H,hasDefaultEdges:U}=S.getState(),ee={...L,...P};if(U){const{edges:z,setEdges:Q}=S.getState();Q(YNe(ee,z))}H?.(ee),l?.(ee)},M=P=>{if(!k)return;const L=bW(P);s&&(L&&P.button===0||!L)&&MW({event:P,handleId:y,nodeId:k,onConnect:_,isTarget:w,getState:S.getState,setState:S.setState,isValidConnection:n||S.getState().isValidConnection||cD}),L?h?.(P):m?.(P)},I=P=>{const{onClickConnectStart:L,onClickConnectEnd:H,connectionClickStartHandle:U,connectionMode:ee,isValidConnection:z}=S.getState();if(!k||!U&&!s)return;if(!U){L?.(P,{nodeId:k,handleId:y,handleType:t}),S.setState({connectionClickStartHandle:{nodeId:k,type:t,handleId:y}});return}const Q=gW(P.target),B=n||z||cD,{connection:X,isValid:J}=_W({nodeId:k,id:y,type:t},ee,U.nodeId,U.handleId||null,U.type,B,Q);J&&_(X),H?.(P),S.setState({connectionClickStartHandle:null})};return ae.createElement("div",{"data-handleid":y,"data-nodeid":k,"data-handlepos":e,"data-id":`${k}-${y}-${t}`,className:Is(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",N,d,{source:!w,target:w,connectable:r,connectablestart:s,connectableend:i,connecting:E,connectionindicator:r&&(s&&!T||i&&T)}]),onMouseDown:M,onTouchStart:M,onClick:j?I:void 0,ref:x,...g},c)});AW.displayName="Handle";var ru=b.memo(AW);const RW=({data:t,isConnectable:e,targetPosition:n=wt.Top,sourcePosition:r=wt.Bottom})=>ae.createElement(ae.Fragment,null,ae.createElement(ru,{type:"target",position:n,isConnectable:e}),t?.label,ae.createElement(ru,{type:"source",position:r,isConnectable:e}));RW.displayName="DefaultNode";var JO=b.memo(RW);const DW=({data:t,isConnectable:e,sourcePosition:n=wt.Bottom})=>ae.createElement(ae.Fragment,null,t?.label,ae.createElement(ru,{type:"source",position:n,isConnectable:e}));DW.displayName="InputNode";var PW=b.memo(DW);const zW=({data:t,isConnectable:e,targetPosition:n=wt.Top})=>ae.createElement(ae.Fragment,null,ae.createElement(ru,{type:"target",position:n,isConnectable:e}),t?.label);zW.displayName="OutputNode";var IW=b.memo(zW);const JN=()=>null;JN.displayName="GroupNode";const r7e=t=>({selectedNodes:t.getNodes().filter(e=>e.selected),selectedEdges:t.edges.filter(e=>e.selected).map(e=>({...e}))}),q1=t=>t.id;function s7e(t,e){return Ss(t.selectedNodes.map(q1),e.selectedNodes.map(q1))&&Ss(t.selectedEdges.map(q1),e.selectedEdges.map(q1))}const LW=b.memo(({onSelectionChange:t})=>{const e=ms(),{selectedNodes:n,selectedEdges:r}=hr(r7e,s7e);return b.useEffect(()=>{const s={nodes:n,edges:r};t?.(s),e.getState().onSelectionChange.forEach(i=>i(s))},[n,r,t]),null});LW.displayName="SelectionListener";const i7e=t=>!!t.onSelectionChange;function a7e({onSelectionChange:t}){const e=hr(i7e);return t||e?ae.createElement(LW,{onSelectionChange:t}):null}const o7e=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset});function uh(t,e){b.useEffect(()=>{typeof t<"u"&&e(t)},[t])}function an(t,e,n){b.useEffect(()=>{typeof e<"u"&&n({[t]:e})},[e])}const l7e=({nodes:t,edges:e,defaultNodes:n,defaultEdges:r,onConnect:s,onConnectStart:i,onConnectEnd:a,onClickConnectStart:l,onClickConnectEnd:c,nodesDraggable:d,nodesConnectable:h,nodesFocusable:m,edgesFocusable:g,edgesUpdatable:x,elevateNodesOnSelect:y,minZoom:w,maxZoom:S,nodeExtent:k,onNodesChange:j,onEdgesChange:N,elementsSelectable:T,connectionMode:E,snapGrid:_,snapToGrid:M,translateExtent:I,connectOnClick:P,defaultEdgeOptions:L,fitView:H,fitViewOptions:U,onNodesDelete:ee,onEdgesDelete:z,onNodeDrag:Q,onNodeDragStart:B,onNodeDragStop:X,onSelectionDrag:J,onSelectionDragStart:G,onSelectionDragStop:R,noPanClassName:ie,nodeOrigin:W,rfId:q,autoPanOnConnect:V,autoPanOnNodeDrag:te,onError:ne,connectionRadius:K,isValidConnection:se,nodeDragThreshold:re})=>{const{setNodes:oe,setEdges:Te,setDefaultNodesAndEdges:We,setMinZoom:Ye,setMaxZoom:Je,setTranslateExtent:Oe,setNodeExtent:Ve,reset:Ue}=hr(o7e,Ss),He=ms();return b.useEffect(()=>{const Ot=r?.map(xt=>({...xt,...L}));return We(n,Ot),()=>{Ue()}},[]),an("defaultEdgeOptions",L,He.setState),an("connectionMode",E,He.setState),an("onConnect",s,He.setState),an("onConnectStart",i,He.setState),an("onConnectEnd",a,He.setState),an("onClickConnectStart",l,He.setState),an("onClickConnectEnd",c,He.setState),an("nodesDraggable",d,He.setState),an("nodesConnectable",h,He.setState),an("nodesFocusable",m,He.setState),an("edgesFocusable",g,He.setState),an("edgesUpdatable",x,He.setState),an("elementsSelectable",T,He.setState),an("elevateNodesOnSelect",y,He.setState),an("snapToGrid",M,He.setState),an("snapGrid",_,He.setState),an("onNodesChange",j,He.setState),an("onEdgesChange",N,He.setState),an("connectOnClick",P,He.setState),an("fitViewOnInit",H,He.setState),an("fitViewOnInitOptions",U,He.setState),an("onNodesDelete",ee,He.setState),an("onEdgesDelete",z,He.setState),an("onNodeDrag",Q,He.setState),an("onNodeDragStart",B,He.setState),an("onNodeDragStop",X,He.setState),an("onSelectionDrag",J,He.setState),an("onSelectionDragStart",G,He.setState),an("onSelectionDragStop",R,He.setState),an("noPanClassName",ie,He.setState),an("nodeOrigin",W,He.setState),an("rfId",q,He.setState),an("autoPanOnConnect",V,He.setState),an("autoPanOnNodeDrag",te,He.setState),an("onError",ne,He.setState),an("connectionRadius",K,He.setState),an("isValidConnection",se,He.setState),an("nodeDragThreshold",re,He.setState),uh(t,oe),uh(e,Te),uh(w,Ye),uh(S,Je),uh(I,Oe),uh(k,Ve),null},uD={display:"none"},c7e={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},BW="react-flow__node-desc",FW="react-flow__edge-desc",u7e="react-flow__aria-live",d7e=t=>t.ariaLiveMessage;function h7e({rfId:t}){const e=hr(d7e);return ae.createElement("div",{id:`${u7e}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:c7e},e)}function f7e({rfId:t,disableKeyboardA11y:e}){return ae.createElement(ae.Fragment,null,ae.createElement("div",{id:`${BW}-${t}`,style:uD},"Press enter or space to select a node.",!e&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),ae.createElement("div",{id:`${FW}-${t}`,style:uD},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!e&&ae.createElement(h7e,{rfId:t}))}var bp=(t=null,e={actInsideInputWithModifier:!0})=>{const[n,r]=b.useState(!1),s=b.useRef(!1),i=b.useRef(new Set([])),[a,l]=b.useMemo(()=>{if(t!==null){const d=(Array.isArray(t)?t:[t]).filter(m=>typeof m=="string").map(m=>m.split("+")),h=d.reduce((m,g)=>m.concat(...g),[]);return[d,h]}return[[],[]]},[t]);return b.useEffect(()=>{const c=typeof document<"u"?document:null,d=e?.target||c;if(t!==null){const h=x=>{if(s.current=x.ctrlKey||x.metaKey||x.shiftKey,(!s.current||s.current&&!e.actInsideInputWithModifier)&&XO(x))return!1;const w=hD(x.code,l);i.current.add(x[w]),dD(a,i.current,!1)&&(x.preventDefault(),r(!0))},m=x=>{if((!s.current||s.current&&!e.actInsideInputWithModifier)&&XO(x))return!1;const w=hD(x.code,l);dD(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(x[w]),x.key==="Meta"&&i.current.clear(),s.current=!1},g=()=>{i.current.clear(),r(!1)};return d?.addEventListener("keydown",h),d?.addEventListener("keyup",m),window.addEventListener("blur",g),()=>{d?.removeEventListener("keydown",h),d?.removeEventListener("keyup",m),window.removeEventListener("blur",g)}}},[t,r]),n};function dD(t,e,n){return t.filter(r=>n||r.length===e.size).some(r=>r.every(s=>e.has(s)))}function hD(t,e){return e.includes(t)?"code":"key"}function qW(t,e,n,r){const s=t.parentNode||t.parentId;if(!s)return n;const i=e.get(s),a=td(i,r);return qW(i,e,{x:(n.x??0)+a.x,y:(n.y??0)+a.y,z:(i[Lr]?.z??0)>(n.z??0)?i[Lr]?.z??0:n.z??0},r)}function $W(t,e,n){t.forEach(r=>{const s=r.parentNode||r.parentId;if(s&&!t.has(s))throw new Error(`Parent node ${s} not found`);if(s||n?.[r.id]){const{x:i,y:a,z:l}=qW(r,t,{...r.position,z:r[Lr]?.z??0},e);r.positionAbsolute={x:i,y:a},r[Lr].z=l,n?.[r.id]&&(r[Lr].isParent=!0)}})}function s5(t,e,n,r){const s=new Map,i={},a=r?1e3:0;return t.forEach(l=>{const c=(ka(l.zIndex)?l.zIndex:0)+(l.selected?a:0),d=e.get(l.id),h={...l,positionAbsolute:{x:l.position.x,y:l.position.y}},m=l.parentNode||l.parentId;m&&(i[m]=!0);const g=d?.type&&d?.type!==l.type;Object.defineProperty(h,Lr,{enumerable:!1,value:{handleBounds:g?void 0:d?.[Lr]?.handleBounds,z:c}}),s.set(l.id,h)}),$W(s,n,i),s}function HW(t,e={}){const{getNodes:n,width:r,height:s,minZoom:i,maxZoom:a,d3Zoom:l,d3Selection:c,fitViewOnInitDone:d,fitViewOnInit:h,nodeOrigin:m}=t(),g=e.initial&&!d&&h;if(l&&c&&(g||!e.initial)){const y=n().filter(S=>{const k=e.includeHiddenNodes?S.width&&S.height:!S.hidden;return e.nodes?.length?k&&e.nodes.some(j=>j.id===S.id):k}),w=y.every(S=>S.width&&S.height);if(y.length>0&&w){const S=Xb(y,m),{x:k,y:j,zoom:N}=TW(S,r,s,e.minZoom??i,e.maxZoom??a,e.padding??.1),T=Bl.translate(k,j).scale(N);return typeof e.duration=="number"&&e.duration>0?l.transform(Lu(c,e.duration),T):l.transform(c,T),!0}}return!1}function m7e(t,e){return t.forEach(n=>{const r=e.get(n.id);r&&e.set(r.id,{...r,[Lr]:r[Lr],selected:n.selected})}),new Map(e)}function p7e(t,e){return e.map(n=>{const r=t.find(s=>s.id===n.id);return r&&(n.selected=r.selected),n})}function $1({changedNodes:t,changedEdges:e,get:n,set:r}){const{nodeInternals:s,edges:i,onNodesChange:a,onEdgesChange:l,hasDefaultNodes:c,hasDefaultEdges:d}=n();t?.length&&(c&&r({nodeInternals:m7e(t,s)}),a?.(t)),e?.length&&(d&&r({edges:p7e(e,i)}),l?.(e))}const dh=()=>{},g7e={zoomIn:dh,zoomOut:dh,zoomTo:dh,getZoom:()=>1,setViewport:dh,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:dh,fitBounds:dh,project:t=>t,screenToFlowPosition:t=>t,flowToScreenPosition:t=>t,viewportInitialized:!1},x7e=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection}),v7e=()=>{const t=ms(),{d3Zoom:e,d3Selection:n}=hr(x7e,Ss);return b.useMemo(()=>n&&e?{zoomIn:s=>e.scaleBy(Lu(n,s?.duration),1.2),zoomOut:s=>e.scaleBy(Lu(n,s?.duration),1/1.2),zoomTo:(s,i)=>e.scaleTo(Lu(n,i?.duration),s),getZoom:()=>t.getState().transform[2],setViewport:(s,i)=>{const[a,l,c]=t.getState().transform,d=Bl.translate(s.x??a,s.y??l).scale(s.zoom??c);e.transform(Lu(n,i?.duration),d)},getViewport:()=>{const[s,i,a]=t.getState().transform;return{x:s,y:i,zoom:a}},fitView:s=>HW(t.getState,s),setCenter:(s,i,a)=>{const{width:l,height:c,maxZoom:d}=t.getState(),h=typeof a?.zoom<"u"?a.zoom:d,m=l/2-s*h,g=c/2-i*h,x=Bl.translate(m,g).scale(h);e.transform(Lu(n,a?.duration),x)},fitBounds:(s,i)=>{const{width:a,height:l,minZoom:c,maxZoom:d}=t.getState(),{x:h,y:m,zoom:g}=TW(s,a,l,c,d,i?.padding??.1),x=Bl.translate(h,m).scale(g);e.transform(Lu(n,i?.duration),x)},project:s=>{const{transform:i,snapToGrid:a,snapGrid:l}=t.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),ZO(s,i,a,l)},screenToFlowPosition:s=>{const{transform:i,snapToGrid:a,snapGrid:l,domNode:c}=t.getState();if(!c)return s;const{x:d,y:h}=c.getBoundingClientRect(),m={x:s.x-d,y:s.y-h};return ZO(m,i,a,l)},flowToScreenPosition:s=>{const{transform:i,domNode:a}=t.getState();if(!a)return s;const{x:l,y:c}=a.getBoundingClientRect(),d=jW(s,i);return{x:d.x+l,y:d.y+c}},viewportInitialized:!0}:g7e,[e,n])};function e7(){const t=v7e(),e=ms(),n=b.useCallback(()=>e.getState().getNodes().map(w=>({...w})),[]),r=b.useCallback(w=>e.getState().nodeInternals.get(w),[]),s=b.useCallback(()=>{const{edges:w=[]}=e.getState();return w.map(S=>({...S}))},[]),i=b.useCallback(w=>{const{edges:S=[]}=e.getState();return S.find(k=>k.id===w)},[]),a=b.useCallback(w=>{const{getNodes:S,setNodes:k,hasDefaultNodes:j,onNodesChange:N}=e.getState(),T=S(),E=typeof w=="function"?w(T):w;if(j)k(E);else if(N){const _=E.length===0?T.map(M=>({type:"remove",id:M.id})):E.map(M=>({item:M,type:"reset"}));N(_)}},[]),l=b.useCallback(w=>{const{edges:S=[],setEdges:k,hasDefaultEdges:j,onEdgesChange:N}=e.getState(),T=typeof w=="function"?w(S):w;if(j)k(T);else if(N){const E=T.length===0?S.map(_=>({type:"remove",id:_.id})):T.map(_=>({item:_,type:"reset"}));N(E)}},[]),c=b.useCallback(w=>{const S=Array.isArray(w)?w:[w],{getNodes:k,setNodes:j,hasDefaultNodes:N,onNodesChange:T}=e.getState();if(N){const _=[...k(),...S];j(_)}else if(T){const E=S.map(_=>({item:_,type:"add"}));T(E)}},[]),d=b.useCallback(w=>{const S=Array.isArray(w)?w:[w],{edges:k=[],setEdges:j,hasDefaultEdges:N,onEdgesChange:T}=e.getState();if(N)j([...k,...S]);else if(T){const E=S.map(_=>({item:_,type:"add"}));T(E)}},[]),h=b.useCallback(()=>{const{getNodes:w,edges:S=[],transform:k}=e.getState(),[j,N,T]=k;return{nodes:w().map(E=>({...E})),edges:S.map(E=>({...E})),viewport:{x:j,y:N,zoom:T}}},[]),m=b.useCallback(({nodes:w,edges:S})=>{const{nodeInternals:k,getNodes:j,edges:N,hasDefaultNodes:T,hasDefaultEdges:E,onNodesDelete:_,onEdgesDelete:M,onNodesChange:I,onEdgesChange:P}=e.getState(),L=(w||[]).map(Q=>Q.id),H=(S||[]).map(Q=>Q.id),U=j().reduce((Q,B)=>{const X=B.parentNode||B.parentId,J=!L.includes(B.id)&&X&&Q.find(R=>R.id===X);return(typeof B.deletable=="boolean"?B.deletable:!0)&&(L.includes(B.id)||J)&&Q.push(B),Q},[]),ee=N.filter(Q=>typeof Q.deletable=="boolean"?Q.deletable:!0),z=ee.filter(Q=>H.includes(Q.id));if(U||z){const Q=CW(U,ee),B=[...z,...Q],X=B.reduce((J,G)=>(J.includes(G.id)||J.push(G.id),J),[]);if((E||T)&&(E&&e.setState({edges:N.filter(J=>!X.includes(J.id))}),T&&(U.forEach(J=>{k.delete(J.id)}),e.setState({nodeInternals:new Map(k)}))),X.length>0&&(M?.(B),P&&P(X.map(J=>({id:J,type:"remove"})))),U.length>0&&(_?.(U),I)){const J=U.map(G=>({id:G.id,type:"remove"}));I(J)}}},[]),g=b.useCallback(w=>{const S=LNe(w),k=S?null:e.getState().nodeInternals.get(w.id);return!S&&!k?[null,null,S]:[S?w:rD(k),k,S]},[]),x=b.useCallback((w,S=!0,k)=>{const[j,N,T]=g(w);return j?(k||e.getState().getNodes()).filter(E=>{if(!T&&(E.id===N.id||!E.positionAbsolute))return!1;const _=rD(E),M=GO(_,j);return S&&M>0||M>=j.width*j.height}):[]},[]),y=b.useCallback((w,S,k=!0)=>{const[j]=g(w);if(!j)return!1;const N=GO(j,S);return k&&N>0||N>=j.width*j.height},[]);return b.useMemo(()=>({...t,getNodes:n,getNode:r,getEdges:s,getEdge:i,setNodes:a,setEdges:l,addNodes:c,addEdges:d,toObject:h,deleteElements:m,getIntersectingNodes:x,isNodeIntersecting:y}),[t,n,r,s,i,a,l,c,d,h,m,x,y])}const y7e={actInsideInputWithModifier:!1};var b7e=({deleteKeyCode:t,multiSelectionKeyCode:e})=>{const n=ms(),{deleteElements:r}=e7(),s=bp(t,y7e),i=bp(e);b.useEffect(()=>{if(s){const{edges:a,getNodes:l}=n.getState(),c=l().filter(h=>h.selected),d=a.filter(h=>h.selected);r({nodes:c,edges:d}),n.setState({nodesSelectionActive:!1})}},[s]),b.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])};function w7e(t){const e=ms();b.useEffect(()=>{let n;const r=()=>{if(!t.current)return;const s=UN(t.current);(s.height===0||s.width===0)&&e.getState().onError?.("004",Wl.error004()),e.setState({width:s.width||500,height:s.height||500})};return r(),window.addEventListener("resize",r),t.current&&(n=new ResizeObserver(()=>r()),n.observe(t.current)),()=>{window.removeEventListener("resize",r),n&&t.current&&n.unobserve(t.current)}},[])}const t7={position:"absolute",width:"100%",height:"100%",top:0,left:0},S7e=(t,e)=>t.x!==e.x||t.y!==e.y||t.zoom!==e.k,H1=t=>({x:t.x,y:t.y,zoom:t.k}),hh=(t,e)=>t.target.closest(`.${e}`),fD=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),mD=t=>{const e=t.ctrlKey&&Ny()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e},k7e=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection,d3ZoomHandler:t.d3ZoomHandler,userSelectionActive:t.userSelectionActive}),O7e=({onMove:t,onMoveStart:e,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:s=!0,zoomOnPinch:i=!0,panOnScroll:a=!1,panOnScrollSpeed:l=.5,panOnScrollMode:c=Wu.Free,zoomOnDoubleClick:d=!0,elementsSelectable:h,panOnDrag:m=!0,defaultViewport:g,translateExtent:x,minZoom:y,maxZoom:w,zoomActivationKeyCode:S,preventScrolling:k=!0,children:j,noWheelClassName:N,noPanClassName:T})=>{const E=b.useRef(),_=ms(),M=b.useRef(!1),I=b.useRef(!1),P=b.useRef(null),L=b.useRef({x:0,y:0,zoom:0}),{d3Zoom:H,d3Selection:U,d3ZoomHandler:ee,userSelectionActive:z}=hr(k7e,Ss),Q=bp(S),B=b.useRef(0),X=b.useRef(!1),J=b.useRef();return w7e(P),b.useEffect(()=>{if(P.current){const G=P.current.getBoundingClientRect(),R=fW().scaleExtent([y,w]).translateExtent(x),ie=ma(P.current).call(R),W=Bl.translate(g.x,g.y).scale(mf(g.zoom,y,w)),q=[[0,0],[G.width,G.height]],V=R.constrain()(W,q,x);R.transform(ie,V),R.wheelDelta(mD),_.setState({d3Zoom:R,d3Selection:ie,d3ZoomHandler:ie.on("wheel.zoom"),transform:[V.x,V.y,V.k],domNode:P.current.closest(".react-flow")})}},[]),b.useEffect(()=>{U&&H&&(a&&!Q&&!z?U.on("wheel.zoom",G=>{if(hh(G,N))return!1;G.preventDefault(),G.stopImmediatePropagation();const R=U.property("__zoom").k||1;if(G.ctrlKey&&i){const se=Ha(G),re=mD(G),oe=R*Math.pow(2,re);H.scaleTo(U,oe,se,G);return}const ie=G.deltaMode===1?20:1;let W=c===Wu.Vertical?0:G.deltaX*ie,q=c===Wu.Horizontal?0:G.deltaY*ie;!Ny()&&G.shiftKey&&c!==Wu.Vertical&&(W=G.deltaY*ie,q=0),H.translateBy(U,-(W/R)*l,-(q/R)*l,{internal:!0});const V=H1(U.property("__zoom")),{onViewportChangeStart:te,onViewportChange:ne,onViewportChangeEnd:K}=_.getState();clearTimeout(J.current),X.current||(X.current=!0,e?.(G,V),te?.(V)),X.current&&(t?.(G,V),ne?.(V),J.current=setTimeout(()=>{n?.(G,V),K?.(V),X.current=!1},150))},{passive:!1}):typeof ee<"u"&&U.on("wheel.zoom",function(G,R){if(!k&&G.type==="wheel"&&!G.ctrlKey||hh(G,N))return null;G.preventDefault(),ee.call(this,G,R)},{passive:!1}))},[z,a,c,U,H,ee,Q,i,k,N,e,t,n]),b.useEffect(()=>{H&&H.on("start",G=>{if(!G.sourceEvent||G.sourceEvent.internal)return null;B.current=G.sourceEvent?.button;const{onViewportChangeStart:R}=_.getState(),ie=H1(G.transform);M.current=!0,L.current=ie,G.sourceEvent?.type==="mousedown"&&_.setState({paneDragging:!0}),R?.(ie),e?.(G.sourceEvent,ie)})},[H,e]),b.useEffect(()=>{H&&(z&&!M.current?H.on("zoom",null):z||H.on("zoom",G=>{const{onViewportChange:R}=_.getState();if(_.setState({transform:[G.transform.x,G.transform.y,G.transform.k]}),I.current=!!(r&&fD(m,B.current??0)),(t||R)&&!G.sourceEvent?.internal){const ie=H1(G.transform);R?.(ie),t?.(G.sourceEvent,ie)}}))},[z,H,t,m,r]),b.useEffect(()=>{H&&H.on("end",G=>{if(!G.sourceEvent||G.sourceEvent.internal)return null;const{onViewportChangeEnd:R}=_.getState();if(M.current=!1,_.setState({paneDragging:!1}),r&&fD(m,B.current??0)&&!I.current&&r(G.sourceEvent),I.current=!1,(n||R)&&S7e(L.current,G.transform)){const ie=H1(G.transform);L.current=ie,clearTimeout(E.current),E.current=setTimeout(()=>{R?.(ie),n?.(G.sourceEvent,ie)},a?150:0)}})},[H,a,m,n,r]),b.useEffect(()=>{H&&H.filter(G=>{const R=Q||s,ie=i&&G.ctrlKey;if((m===!0||Array.isArray(m)&&m.includes(1))&&G.button===1&&G.type==="mousedown"&&(hh(G,"react-flow__node")||hh(G,"react-flow__edge")))return!0;if(!m&&!R&&!a&&!d&&!i||z||!d&&G.type==="dblclick"||hh(G,N)&&G.type==="wheel"||hh(G,T)&&(G.type!=="wheel"||a&&G.type==="wheel"&&!Q)||!i&&G.ctrlKey&&G.type==="wheel"||!R&&!a&&!ie&&G.type==="wheel"||!m&&(G.type==="mousedown"||G.type==="touchstart")||Array.isArray(m)&&!m.includes(G.button)&&G.type==="mousedown")return!1;const W=Array.isArray(m)&&m.includes(G.button)||!G.button||G.button<=1;return(!G.ctrlKey||G.type==="wheel")&&W})},[z,H,s,i,a,d,m,h,Q]),ae.createElement("div",{className:"react-flow__renderer",ref:P,style:t7},j)},j7e=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function N7e(){const{userSelectionActive:t,userSelectionRect:e}=hr(j7e,Ss);return t&&e?ae.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}function pD(t,e){const n=e.parentNode||e.parentId,r=t.find(s=>s.id===n);if(r){const s=e.position.x+e.width-r.width,i=e.position.y+e.height-r.height;if(s>0||i>0||e.position.x<0||e.position.y<0){if(r.style={...r.style},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,s>0&&(r.style.width+=s),i>0&&(r.style.height+=i),e.position.x<0){const a=Math.abs(e.position.x);r.position.x=r.position.x-a,r.style.width+=a,e.position.x=0}if(e.position.y<0){const a=Math.abs(e.position.y);r.position.y=r.position.y-a,r.style.height+=a,e.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function QW(t,e){if(t.some(r=>r.type==="reset"))return t.filter(r=>r.type==="reset").map(r=>r.item);const n=t.filter(r=>r.type==="add").map(r=>r.item);return e.reduce((r,s)=>{const i=t.filter(l=>l.id===s.id);if(i.length===0)return r.push(s),r;const a={...s};for(const l of i)if(l)switch(l.type){case"select":{a.selected=l.selected;break}case"position":{typeof l.position<"u"&&(a.position=l.position),typeof l.positionAbsolute<"u"&&(a.positionAbsolute=l.positionAbsolute),typeof l.dragging<"u"&&(a.dragging=l.dragging),a.expandParent&&pD(r,a);break}case"dimensions":{typeof l.dimensions<"u"&&(a.width=l.dimensions.width,a.height=l.dimensions.height),typeof l.updateStyle<"u"&&(a.style={...a.style||{},...l.dimensions}),typeof l.resizing=="boolean"&&(a.resizing=l.resizing),a.expandParent&&pD(r,a);break}case"remove":return r}return r.push(a),r},n)}function VW(t,e){return QW(t,e)}function C7e(t,e){return QW(t,e)}const Dc=(t,e)=>({id:t,type:"select",selected:e});function Eh(t,e){return t.reduce((n,r)=>{const s=e.includes(r.id);return!r.selected&&s?(r.selected=!0,n.push(Dc(r.id,!0))):r.selected&&!s&&(r.selected=!1,n.push(Dc(r.id,!1))),n},[])}const i5=(t,e)=>n=>{n.target===e.current&&t?.(n)},T7e=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,dragging:t.paneDragging}),UW=b.memo(({isSelecting:t,selectionMode:e=yp.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:s,onPaneClick:i,onPaneContextMenu:a,onPaneScroll:l,onPaneMouseEnter:c,onPaneMouseMove:d,onPaneMouseLeave:h,children:m})=>{const g=b.useRef(null),x=ms(),y=b.useRef(0),w=b.useRef(0),S=b.useRef(),{userSelectionActive:k,elementsSelectable:j,dragging:N}=hr(T7e,Ss),T=()=>{x.setState({userSelectionActive:!1,userSelectionRect:null}),y.current=0,w.current=0},E=ee=>{i?.(ee),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},_=ee=>{if(Array.isArray(n)&&n?.includes(2)){ee.preventDefault();return}a?.(ee)},M=l?ee=>l(ee):void 0,I=ee=>{const{resetSelectedElements:z,domNode:Q}=x.getState();if(S.current=Q?.getBoundingClientRect(),!j||!t||ee.button!==0||ee.target!==g.current||!S.current)return;const{x:B,y:X}=$c(ee,S.current);z(),x.setState({userSelectionRect:{width:0,height:0,startX:B,startY:X,x:B,y:X}}),r?.(ee)},P=ee=>{const{userSelectionRect:z,nodeInternals:Q,edges:B,transform:X,onNodesChange:J,onEdgesChange:G,nodeOrigin:R,getNodes:ie}=x.getState();if(!t||!S.current||!z)return;x.setState({userSelectionActive:!0,nodesSelectionActive:!1});const W=$c(ee,S.current),q=z.startX??0,V=z.startY??0,te={...z,x:W.xoe.id),re=K.map(oe=>oe.id);if(y.current!==re.length){y.current=re.length;const oe=Eh(ne,re);oe.length&&J?.(oe)}if(w.current!==se.length){w.current=se.length;const oe=Eh(B,se);oe.length&&G?.(oe)}x.setState({userSelectionRect:te})},L=ee=>{if(ee.button!==0)return;const{userSelectionRect:z}=x.getState();!k&&z&&ee.target===g.current&&E?.(ee),x.setState({nodesSelectionActive:y.current>0}),T(),s?.(ee)},H=ee=>{k&&(x.setState({nodesSelectionActive:y.current>0}),s?.(ee)),T()},U=j&&(t||k);return ae.createElement("div",{className:Is(["react-flow__pane",{dragging:N,selection:t}]),onClick:U?void 0:i5(E,g),onContextMenu:i5(_,g),onWheel:i5(M,g),onMouseEnter:U?void 0:c,onMouseDown:U?I:void 0,onMouseMove:U?P:d,onMouseUp:U?L:void 0,onMouseLeave:U?H:h,ref:g,style:t7},m,ae.createElement(N7e,null))});UW.displayName="Pane";function WW(t,e){const n=t.parentNode||t.parentId;if(!n)return!1;const r=e.get(n);return r?r.selected?!0:WW(r,e):!1}function gD(t,e,n){let r=t;do{if(r?.matches(e))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function E7e(t,e,n,r){return Array.from(t.values()).filter(s=>(s.selected||s.id===r)&&(!s.parentNode||s.parentId||!WW(s,t))&&(s.draggable||e&&typeof s.draggable>"u")).map(s=>({id:s.id,position:s.position||{x:0,y:0},positionAbsolute:s.positionAbsolute||{x:0,y:0},distance:{x:n.x-(s.positionAbsolute?.x??0),y:n.y-(s.positionAbsolute?.y??0)},delta:{x:0,y:0},extent:s.extent,parentNode:s.parentNode||s.parentId,parentId:s.parentNode||s.parentId,width:s.width,height:s.height,expandParent:s.expandParent}))}function _7e(t,e){return!e||e==="parent"?e:[e[0],[e[1][0]-(t.width||0),e[1][1]-(t.height||0)]]}function GW(t,e,n,r,s=[0,0],i){const a=_7e(t,t.extent||r);let l=a;const c=t.parentNode||t.parentId;if(t.extent==="parent"&&!t.expandParent)if(c&&t.width&&t.height){const m=n.get(c),{x:g,y:x}=td(m,s).positionAbsolute;l=m&&ka(g)&&ka(x)&&ka(m.width)&&ka(m.height)?[[g+t.width*s[0],x+t.height*s[1]],[g+m.width-t.width+t.width*s[0],x+m.height-t.height+t.height*s[1]]]:l}else i?.("005",Wl.error005()),l=a;else if(t.extent&&c&&t.extent!=="parent"){const m=n.get(c),{x:g,y:x}=td(m,s).positionAbsolute;l=[[t.extent[0][0]+g,t.extent[0][1]+x],[t.extent[1][0]+g,t.extent[1][1]+x]]}let d={x:0,y:0};if(c){const m=n.get(c);d=td(m,s).positionAbsolute}const h=l&&l!=="parent"?WN(e,l):e;return{position:{x:h.x-d.x,y:h.y-d.y},positionAbsolute:h}}function a5({nodeId:t,dragItems:e,nodeInternals:n}){const r=e.map(s=>({...n.get(s.id),position:s.position,positionAbsolute:s.positionAbsolute}));return[t?r.find(s=>s.id===t):r[0],r]}const xD=(t,e,n,r)=>{const s=e.querySelectorAll(t);if(!s||!s.length)return null;const i=Array.from(s),a=e.getBoundingClientRect(),l={x:a.width*r[0],y:a.height*r[1]};return i.map(c=>{const d=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),position:c.getAttribute("data-handlepos"),x:(d.left-a.left-l.x)/n,y:(d.top-a.top-l.y)/n,...UN(c)}})};function n0(t,e,n){return n===void 0?n:r=>{const s=e().nodeInternals.get(t);s&&n(r,{...s})}}function ej({id:t,store:e,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeInternals:l,onError:c}=e.getState(),d=l.get(t);if(!d){c?.("012",Wl.error012(t));return}e.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&a)&&(i({nodes:[d],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):s([t])}function M7e(){const t=ms();return b.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:s,snapToGrid:i}=t.getState(),a=n.touches?n.touches[0].clientX:n.clientX,l=n.touches?n.touches[0].clientY:n.clientY,c={x:(a-r[0])/r[2],y:(l-r[1])/r[2]};return{xSnapped:i?s[0]*Math.round(c.x/s[0]):c.x,ySnapped:i?s[1]*Math.round(c.y/s[1]):c.y,...c}},[])}function o5(t){return(e,n,r)=>t?.(e,r)}function XW({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:i,selectNodesOnDrag:a}){const l=ms(),[c,d]=b.useState(!1),h=b.useRef([]),m=b.useRef({x:null,y:null}),g=b.useRef(0),x=b.useRef(null),y=b.useRef({x:0,y:0}),w=b.useRef(null),S=b.useRef(!1),k=b.useRef(!1),j=b.useRef(!1),N=M7e();return b.useEffect(()=>{if(t?.current){const T=ma(t.current),E=({x:I,y:P})=>{const{nodeInternals:L,onNodeDrag:H,onSelectionDrag:U,updateNodePositions:ee,nodeExtent:z,snapGrid:Q,snapToGrid:B,nodeOrigin:X,onError:J}=l.getState();m.current={x:I,y:P};let G=!1,R={x:0,y:0,x2:0,y2:0};if(h.current.length>1&&z){const W=Xb(h.current,X);R=vp(W)}if(h.current=h.current.map(W=>{const q={x:I-W.distance.x,y:P-W.distance.y};B&&(q.x=Q[0]*Math.round(q.x/Q[0]),q.y=Q[1]*Math.round(q.y/Q[1]));const V=[[z[0][0],z[0][1]],[z[1][0],z[1][1]]];h.current.length>1&&z&&!W.extent&&(V[0][0]=W.positionAbsolute.x-R.x+z[0][0],V[1][0]=W.positionAbsolute.x+(W.width??0)-R.x2+z[1][0],V[0][1]=W.positionAbsolute.y-R.y+z[0][1],V[1][1]=W.positionAbsolute.y+(W.height??0)-R.y2+z[1][1]);const te=GW(W,q,L,V,X,J);return G=G||W.position.x!==te.position.x||W.position.y!==te.position.y,W.position=te.position,W.positionAbsolute=te.positionAbsolute,W}),!G)return;ee(h.current,!0,!0),d(!0);const ie=s?H:o5(U);if(ie&&w.current){const[W,q]=a5({nodeId:s,dragItems:h.current,nodeInternals:L});ie(w.current,W,q)}},_=()=>{if(!x.current)return;const[I,P]=pW(y.current,x.current);if(I!==0||P!==0){const{transform:L,panBy:H}=l.getState();m.current.x=(m.current.x??0)-I/L[2],m.current.y=(m.current.y??0)-P/L[2],H({x:I,y:P})&&E(m.current)}g.current=requestAnimationFrame(_)},M=I=>{const{nodeInternals:P,multiSelectionActive:L,nodesDraggable:H,unselectNodesAndEdges:U,onNodeDragStart:ee,onSelectionDragStart:z}=l.getState();k.current=!0;const Q=s?ee:o5(z);(!a||!i)&&!L&&s&&(P.get(s)?.selected||U()),s&&i&&a&&ej({id:s,store:l,nodeRef:t});const B=N(I);if(m.current=B,h.current=E7e(P,H,B,s),Q&&h.current){const[X,J]=a5({nodeId:s,dragItems:h.current,nodeInternals:P});Q(I.sourceEvent,X,J)}};if(e)T.on(".drag",null);else{const I=m6e().on("start",P=>{const{domNode:L,nodeDragThreshold:H}=l.getState();H===0&&M(P),j.current=!1;const U=N(P);m.current=U,x.current=L?.getBoundingClientRect()||null,y.current=$c(P.sourceEvent,x.current)}).on("drag",P=>{const L=N(P),{autoPanOnNodeDrag:H,nodeDragThreshold:U}=l.getState();if(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1&&(j.current=!0),!j.current){if(!S.current&&k.current&&H&&(S.current=!0,_()),!k.current){const ee=L.xSnapped-(m?.current?.x??0),z=L.ySnapped-(m?.current?.y??0);Math.sqrt(ee*ee+z*z)>U&&M(P)}(m.current.x!==L.xSnapped||m.current.y!==L.ySnapped)&&h.current&&k.current&&(w.current=P.sourceEvent,y.current=$c(P.sourceEvent,x.current),E(L))}}).on("end",P=>{if(!(!k.current||j.current)&&(d(!1),S.current=!1,k.current=!1,cancelAnimationFrame(g.current),h.current)){const{updateNodePositions:L,nodeInternals:H,onNodeDragStop:U,onSelectionDragStop:ee}=l.getState(),z=s?U:o5(ee);if(L(h.current,!1,!1),z){const[Q,B]=a5({nodeId:s,dragItems:h.current,nodeInternals:H});z(P.sourceEvent,Q,B)}}}).filter(P=>{const L=P.target;return!P.button&&(!n||!gD(L,`.${n}`,t))&&(!r||gD(L,r,t))});return T.call(I),()=>{T.on(".drag",null)}}}},[t,e,n,r,i,l,s,a,N]),c}function YW(){const t=ms();return b.useCallback(n=>{const{nodeInternals:r,nodeExtent:s,updateNodePositions:i,getNodes:a,snapToGrid:l,snapGrid:c,onError:d,nodesDraggable:h}=t.getState(),m=a().filter(j=>j.selected&&(j.draggable||h&&typeof j.draggable>"u")),g=l?c[0]:5,x=l?c[1]:5,y=n.isShiftPressed?4:1,w=n.x*g*y,S=n.y*x*y,k=m.map(j=>{if(j.positionAbsolute){const N={x:j.positionAbsolute.x+w,y:j.positionAbsolute.y+S};l&&(N.x=c[0]*Math.round(N.x/c[0]),N.y=c[1]*Math.round(N.y/c[1]));const{positionAbsolute:T,position:E}=GW(j,N,r,s,void 0,d);j.position=E,j.positionAbsolute=T}return j});i(k,!0,!1)},[])}const Qh={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var r0=t=>{const e=({id:n,type:r,data:s,xPos:i,yPos:a,xPosOrigin:l,yPosOrigin:c,selected:d,onClick:h,onMouseEnter:m,onMouseMove:g,onMouseLeave:x,onContextMenu:y,onDoubleClick:w,style:S,className:k,isDraggable:j,isSelectable:N,isConnectable:T,isFocusable:E,selectNodesOnDrag:_,sourcePosition:M,targetPosition:I,hidden:P,resizeObserver:L,dragHandle:H,zIndex:U,isParent:ee,noDragClassName:z,noPanClassName:Q,initialized:B,disableKeyboardA11y:X,ariaLabel:J,rfId:G,hasHandleBounds:R})=>{const ie=ms(),W=b.useRef(null),q=b.useRef(null),V=b.useRef(M),te=b.useRef(I),ne=b.useRef(r),K=N||j||h||m||g||x,se=YW(),re=n0(n,ie.getState,m),oe=n0(n,ie.getState,g),Te=n0(n,ie.getState,x),We=n0(n,ie.getState,y),Ye=n0(n,ie.getState,w),Je=Ue=>{const{nodeDragThreshold:He}=ie.getState();if(N&&(!_||!j||He>0)&&ej({id:n,store:ie,nodeRef:W}),h){const Ot=ie.getState().nodeInternals.get(n);Ot&&h(Ue,{...Ot})}},Oe=Ue=>{if(!XO(Ue)&&!X)if(yW.includes(Ue.key)&&N){const He=Ue.key==="Escape";ej({id:n,store:ie,unselect:He,nodeRef:W})}else j&&d&&Object.prototype.hasOwnProperty.call(Qh,Ue.key)&&(ie.setState({ariaLiveMessage:`Moved selected node ${Ue.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~a}`}),se({x:Qh[Ue.key].x,y:Qh[Ue.key].y,isShiftPressed:Ue.shiftKey}))};b.useEffect(()=>()=>{q.current&&(L?.unobserve(q.current),q.current=null)},[]),b.useEffect(()=>{if(W.current&&!P){const Ue=W.current;(!B||!R||q.current!==Ue)&&(q.current&&L?.unobserve(q.current),L?.observe(Ue),q.current=Ue)}},[P,B,R]),b.useEffect(()=>{const Ue=ne.current!==r,He=V.current!==M,Ot=te.current!==I;W.current&&(Ue||He||Ot)&&(Ue&&(ne.current=r),He&&(V.current=M),Ot&&(te.current=I),ie.getState().updateNodeDimensions([{id:n,nodeElement:W.current,forceUpdate:!0}]))},[n,r,M,I]);const Ve=XW({nodeRef:W,disabled:P||!j,noDragClassName:z,handleSelector:H,nodeId:n,isSelectable:N,selectNodesOnDrag:_});return P?null:ae.createElement("div",{className:Is(["react-flow__node",`react-flow__node-${r}`,{[Q]:j},k,{selected:d,selectable:N,parent:ee,dragging:Ve}]),ref:W,style:{zIndex:U,transform:`translate(${l}px,${c}px)`,pointerEvents:K?"all":"none",visibility:B?"visible":"hidden",...S},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:re,onMouseMove:oe,onMouseLeave:Te,onContextMenu:We,onClick:Je,onDoubleClick:Ye,onKeyDown:E?Oe:void 0,tabIndex:E?0:void 0,role:E?"button":void 0,"aria-describedby":X?void 0:`${BW}-${G}`,"aria-label":J},ae.createElement(VNe,{value:n},ae.createElement(t,{id:n,data:s,type:r,xPos:i,yPos:a,selected:d,isConnectable:T,sourcePosition:M,targetPosition:I,dragging:Ve,dragHandle:H,zIndex:U})))};return e.displayName="NodeWrapper",b.memo(e)};const A7e=t=>{const e=t.getNodes().filter(n=>n.selected);return{...Xb(e,t.nodeOrigin),transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`,userSelectionActive:t.userSelectionActive}};function R7e({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const r=ms(),{width:s,height:i,x:a,y:l,transformString:c,userSelectionActive:d}=hr(A7e,Ss),h=YW(),m=b.useRef(null);if(b.useEffect(()=>{n||m.current?.focus({preventScroll:!0})},[n]),XW({nodeRef:m}),d||!s||!i)return null;const g=t?y=>{const w=r.getState().getNodes().filter(S=>S.selected);t(y,w)}:void 0,x=y=>{Object.prototype.hasOwnProperty.call(Qh,y.key)&&h({x:Qh[y.key].x,y:Qh[y.key].y,isShiftPressed:y.shiftKey})};return ae.createElement("div",{className:Is(["react-flow__nodesselection","react-flow__container",e]),style:{transform:c}},ae.createElement("div",{ref:m,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:n?void 0:-1,onKeyDown:n?void 0:x,style:{width:s,height:i,top:l,left:a}}))}var D7e=b.memo(R7e);const P7e=t=>t.nodesSelectionActive,KW=({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,deleteKeyCode:l,onMove:c,onMoveStart:d,onMoveEnd:h,selectionKeyCode:m,selectionOnDrag:g,selectionMode:x,onSelectionStart:y,onSelectionEnd:w,multiSelectionKeyCode:S,panActivationKeyCode:k,zoomActivationKeyCode:j,elementsSelectable:N,zoomOnScroll:T,zoomOnPinch:E,panOnScroll:_,panOnScrollSpeed:M,panOnScrollMode:I,zoomOnDoubleClick:P,panOnDrag:L,defaultViewport:H,translateExtent:U,minZoom:ee,maxZoom:z,preventScrolling:Q,onSelectionContextMenu:B,noWheelClassName:X,noPanClassName:J,disableKeyboardA11y:G})=>{const R=hr(P7e),ie=bp(m),W=bp(k),q=W||L,V=W||_,te=ie||g&&q!==!0;return b7e({deleteKeyCode:l,multiSelectionKeyCode:S}),ae.createElement(O7e,{onMove:c,onMoveStart:d,onMoveEnd:h,onPaneContextMenu:i,elementsSelectable:N,zoomOnScroll:T,zoomOnPinch:E,panOnScroll:V,panOnScrollSpeed:M,panOnScrollMode:I,zoomOnDoubleClick:P,panOnDrag:!ie&&q,defaultViewport:H,translateExtent:U,minZoom:ee,maxZoom:z,zoomActivationKeyCode:j,preventScrolling:Q,noWheelClassName:X,noPanClassName:J},ae.createElement(UW,{onSelectionStart:y,onSelectionEnd:w,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:q,isSelecting:!!te,selectionMode:x},t,R&&ae.createElement(D7e,{onSelectionContextMenu:B,noPanClassName:J,disableKeyboardA11y:G})))};KW.displayName="FlowRenderer";var z7e=b.memo(KW);function I7e(t){return hr(b.useCallback(n=>t?NW(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[t]))}function L7e(t){const e={input:r0(t.input||PW),default:r0(t.default||JO),output:r0(t.output||IW),group:r0(t.group||JN)},n={},r=Object.keys(t).filter(s=>!["input","default","output","group"].includes(s)).reduce((s,i)=>(s[i]=r0(t[i]||JO),s),n);return{...e,...r}}const B7e=({x:t,y:e,width:n,height:r,origin:s})=>!n||!r?{x:t,y:e}:s[0]<0||s[1]<0||s[0]>1||s[1]>1?{x:t,y:e}:{x:t-n*s[0],y:e-r*s[1]},F7e=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,updateNodeDimensions:t.updateNodeDimensions,onError:t.onError}),ZW=t=>{const{nodesDraggable:e,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,updateNodeDimensions:i,onError:a}=hr(F7e,Ss),l=I7e(t.onlyRenderVisibleElements),c=b.useRef(),d=b.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const h=new ResizeObserver(m=>{const g=m.map(x=>({id:x.target.getAttribute("data-id"),nodeElement:x.target,forceUpdate:!0}));i(g)});return c.current=h,h},[]);return b.useEffect(()=>()=>{c?.current?.disconnect()},[]),ae.createElement("div",{className:"react-flow__nodes",style:t7},l.map(h=>{let m=h.type||"default";t.nodeTypes[m]||(a?.("003",Wl.error003(m)),m="default");const g=t.nodeTypes[m]||t.nodeTypes.default,x=!!(h.draggable||e&&typeof h.draggable>"u"),y=!!(h.selectable||s&&typeof h.selectable>"u"),w=!!(h.connectable||n&&typeof h.connectable>"u"),S=!!(h.focusable||r&&typeof h.focusable>"u"),k=t.nodeExtent?WN(h.positionAbsolute,t.nodeExtent):h.positionAbsolute,j=k?.x??0,N=k?.y??0,T=B7e({x:j,y:N,width:h.width??0,height:h.height??0,origin:t.nodeOrigin});return ae.createElement(g,{key:h.id,id:h.id,className:h.className,style:h.style,type:m,data:h.data,sourcePosition:h.sourcePosition||wt.Bottom,targetPosition:h.targetPosition||wt.Top,hidden:h.hidden,xPos:j,yPos:N,xPosOrigin:T.x,yPosOrigin:T.y,selectNodesOnDrag:t.selectNodesOnDrag,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,selected:!!h.selected,isDraggable:x,isSelectable:y,isConnectable:w,isFocusable:S,resizeObserver:d,dragHandle:h.dragHandle,zIndex:h[Lr]?.z??0,isParent:!!h[Lr]?.isParent,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,initialized:!!h.width&&!!h.height,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,ariaLabel:h.ariaLabel,hasHandleBounds:!!h[Lr]?.handleBounds})}))};ZW.displayName="NodeRenderer";var q7e=b.memo(ZW);const $7e=(t,e,n)=>n===wt.Left?t-e:n===wt.Right?t+e:t,H7e=(t,e,n)=>n===wt.Top?t-e:n===wt.Bottom?t+e:t,vD="react-flow__edgeupdater",yD=({position:t,centerX:e,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:l})=>ae.createElement("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:Is([vD,`${vD}-${l}`]),cx:$7e(e,r,t),cy:H7e(n,r,t),r,stroke:"transparent",fill:"transparent"}),Q7e=()=>!0;var fh=t=>{const e=({id:n,className:r,type:s,data:i,onClick:a,onEdgeDoubleClick:l,selected:c,animated:d,label:h,labelStyle:m,labelShowBg:g,labelBgStyle:x,labelBgPadding:y,labelBgBorderRadius:w,style:S,source:k,target:j,sourceX:N,sourceY:T,targetX:E,targetY:_,sourcePosition:M,targetPosition:I,elementsSelectable:P,hidden:L,sourceHandleId:H,targetHandleId:U,onContextMenu:ee,onMouseEnter:z,onMouseMove:Q,onMouseLeave:B,reconnectRadius:X,onReconnect:J,onReconnectStart:G,onReconnectEnd:R,markerEnd:ie,markerStart:W,rfId:q,ariaLabel:V,isFocusable:te,isReconnectable:ne,pathOptions:K,interactionWidth:se,disableKeyboardA11y:re})=>{const oe=b.useRef(null),[Te,We]=b.useState(!1),[Ye,Je]=b.useState(!1),Oe=ms(),Ve=b.useMemo(()=>`url('#${KO(W,q)}')`,[W,q]),Ue=b.useMemo(()=>`url('#${KO(ie,q)}')`,[ie,q]);if(L)return null;const He=At=>{const{edges:zn,addSelectedEdges:Fe,unselectNodesAndEdges:rt,multiSelectionActive:tn}=Oe.getState(),Rt=zn.find(ke=>ke.id===n);Rt&&(P&&(Oe.setState({nodesSelectionActive:!1}),Rt.selected&&tn?(rt({nodes:[],edges:[Rt]}),oe.current?.blur()):Fe([n])),a&&a(At,Rt))},Ot=t0(n,Oe.getState,l),xt=t0(n,Oe.getState,ee),kn=t0(n,Oe.getState,z),It=t0(n,Oe.getState,Q),Yt=t0(n,Oe.getState,B),_t=(At,zn)=>{if(At.button!==0)return;const{edges:Fe,isValidConnection:rt}=Oe.getState(),tn=zn?j:k,Rt=(zn?U:H)||null,ke=zn?"target":"source",Pe=rt||Q7e,it=zn,ot=Fe.find(pt=>pt.id===n);Je(!0),G?.(At,ot,ke);const nn=pt=>{Je(!1),R?.(pt,ot,ke)};MW({event:At,handleId:Rt,nodeId:tn,onConnect:pt=>J?.(ot,pt),isTarget:it,getState:Oe.getState,setState:Oe.setState,isValidConnection:Pe,edgeUpdaterType:ke,onReconnectEnd:nn})},mt=At=>_t(At,!0),Ne=At=>_t(At,!1),Ie=()=>We(!0),st=()=>We(!1),yt=!P&&!a,Pt=At=>{if(!re&&yW.includes(At.key)&&P){const{unselectNodesAndEdges:zn,addSelectedEdges:Fe,edges:rt}=Oe.getState();At.key==="Escape"?(oe.current?.blur(),zn({edges:[rt.find(Rt=>Rt.id===n)]})):Fe([n])}};return ae.createElement("g",{className:Is(["react-flow__edge",`react-flow__edge-${s}`,r,{selected:c,animated:d,inactive:yt,updating:Te}]),onClick:He,onDoubleClick:Ot,onContextMenu:xt,onMouseEnter:kn,onMouseMove:It,onMouseLeave:Yt,onKeyDown:te?Pt:void 0,tabIndex:te?0:void 0,role:te?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":V===null?void 0:V||`Edge from ${k} to ${j}`,"aria-describedby":te?`${FW}-${q}`:void 0,ref:oe},!Ye&&ae.createElement(t,{id:n,source:k,target:j,selected:c,animated:d,label:h,labelStyle:m,labelShowBg:g,labelBgStyle:x,labelBgPadding:y,labelBgBorderRadius:w,data:i,style:S,sourceX:N,sourceY:T,targetX:E,targetY:_,sourcePosition:M,targetPosition:I,sourceHandleId:H,targetHandleId:U,markerStart:Ve,markerEnd:Ue,pathOptions:K,interactionWidth:se}),ne&&ae.createElement(ae.Fragment,null,(ne==="source"||ne===!0)&&ae.createElement(yD,{position:M,centerX:N,centerY:T,radius:X,onMouseDown:mt,onMouseEnter:Ie,onMouseOut:st,type:"source"}),(ne==="target"||ne===!0)&&ae.createElement(yD,{position:I,centerX:E,centerY:_,radius:X,onMouseDown:Ne,onMouseEnter:Ie,onMouseOut:st,type:"target"})))};return e.displayName="EdgeWrapper",b.memo(e)};function V7e(t){const e={default:fh(t.default||Ty),straight:fh(t.bezier||YN),step:fh(t.step||XN),smoothstep:fh(t.step||Gb),simplebezier:fh(t.simplebezier||GN)},n={},r=Object.keys(t).filter(s=>!["default","bezier"].includes(s)).reduce((s,i)=>(s[i]=fh(t[i]||Ty),s),n);return{...e,...r}}function bD(t,e,n=null){const r=(n?.x||0)+e.x,s=(n?.y||0)+e.y,i=n?.width||e.width,a=n?.height||e.height;switch(t){case wt.Top:return{x:r+i/2,y:s};case wt.Right:return{x:r+i,y:s+a/2};case wt.Bottom:return{x:r+i/2,y:s+a};case wt.Left:return{x:r,y:s+a/2}}}function wD(t,e){return t?t.length===1||!e?t[0]:e&&t.find(n=>n.id===e)||null:null}const U7e=(t,e,n,r,s,i)=>{const a=bD(n,t,e),l=bD(i,r,s);return{sourceX:a.x,sourceY:a.y,targetX:l.x,targetY:l.y}};function W7e({sourcePos:t,targetPos:e,sourceWidth:n,sourceHeight:r,targetWidth:s,targetHeight:i,width:a,height:l,transform:c}){const d={x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x+n,e.x+s),y2:Math.max(t.y+r,e.y+i)};d.x===d.x2&&(d.x2+=1),d.y===d.y2&&(d.y2+=1);const h=vp({x:(0-c[0])/c[2],y:(0-c[1])/c[2],width:a/c[2],height:l/c[2]}),m=Math.max(0,Math.min(h.x2,d.x2)-Math.max(h.x,d.x)),g=Math.max(0,Math.min(h.y2,d.y2)-Math.max(h.y,d.y));return Math.ceil(m*g)>0}function SD(t){const e=t?.[Lr]?.handleBounds||null,n=e&&t?.width&&t?.height&&typeof t?.positionAbsolute?.x<"u"&&typeof t?.positionAbsolute?.y<"u";return[{x:t?.positionAbsolute?.x||0,y:t?.positionAbsolute?.y||0,width:t?.width||0,height:t?.height||0},e,!!n]}const G7e=[{level:0,isMaxLevel:!0,edges:[]}];function X7e(t,e,n=!1){let r=-1;const s=t.reduce((a,l)=>{const c=ka(l.zIndex);let d=c?l.zIndex:0;if(n){const h=e.get(l.target),m=e.get(l.source),g=l.selected||h?.selected||m?.selected,x=Math.max(m?.[Lr]?.z||0,h?.[Lr]?.z||0,1e3);d=(c?l.zIndex:0)+(g?x:0)}return a[d]?a[d].push(l):a[d]=[l],r=d>r?d:r,a},{}),i=Object.entries(s).map(([a,l])=>{const c=+a;return{edges:l,level:c,isMaxLevel:c===r}});return i.length===0?G7e:i}function Y7e(t,e,n){const r=hr(b.useCallback(s=>t?s.edges.filter(i=>{const a=e.get(i.source),l=e.get(i.target);return a?.width&&a?.height&&l?.width&&l?.height&&W7e({sourcePos:a.positionAbsolute||{x:0,y:0},targetPos:l.positionAbsolute||{x:0,y:0},sourceWidth:a.width,sourceHeight:a.height,targetWidth:l.width,targetHeight:l.height,width:s.width,height:s.height,transform:s.transform})}):s.edges,[t,e]));return X7e(r,e,n)}const K7e=({color:t="none",strokeWidth:e=1})=>ae.createElement("polyline",{style:{stroke:t,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),Z7e=({color:t="none",strokeWidth:e=1})=>ae.createElement("polyline",{style:{stroke:t,fill:t,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),kD={[Cy.Arrow]:K7e,[Cy.ArrowClosed]:Z7e};function J7e(t){const e=ms();return b.useMemo(()=>Object.prototype.hasOwnProperty.call(kD,t)?kD[t]:(e.getState().onError?.("009",Wl.error009(t)),null),[t])}const eCe=({id:t,type:e,color:n,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const c=J7e(e);return c?ae.createElement("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0"},ae.createElement(c,{color:n,strokeWidth:a})):null},tCe=({defaultColor:t,rfId:e})=>n=>{const r=[];return n.edges.reduce((s,i)=>([i.markerStart,i.markerEnd].forEach(a=>{if(a&&typeof a=="object"){const l=KO(a,e);r.includes(l)||(s.push({id:l,color:a.color||t,...a}),r.push(l))}}),s),[]).sort((s,i)=>s.id.localeCompare(i.id))},JW=({defaultColor:t,rfId:e})=>{const n=hr(b.useCallback(tCe({defaultColor:t,rfId:e}),[t,e]),(r,s)=>!(r.length!==s.length||r.some((i,a)=>i.id!==s[a].id)));return ae.createElement("defs",null,n.map(r=>ae.createElement(eCe,{id:r.id,key:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient})))};JW.displayName="MarkerDefinitions";var nCe=b.memo(JW);const rCe=t=>({nodesConnectable:t.nodesConnectable,edgesFocusable:t.edgesFocusable,edgesUpdatable:t.edgesUpdatable,elementsSelectable:t.elementsSelectable,width:t.width,height:t.height,connectionMode:t.connectionMode,nodeInternals:t.nodeInternals,onError:t.onError}),eG=({defaultMarkerColor:t,onlyRenderVisibleElements:e,elevateEdgesOnSelect:n,rfId:r,edgeTypes:s,noPanClassName:i,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:h,onEdgeDoubleClick:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:y,reconnectRadius:w,children:S,disableKeyboardA11y:k})=>{const{edgesFocusable:j,edgesUpdatable:N,elementsSelectable:T,width:E,height:_,connectionMode:M,nodeInternals:I,onError:P}=hr(rCe,Ss),L=Y7e(e,I,n);return E?ae.createElement(ae.Fragment,null,L.map(({level:H,edges:U,isMaxLevel:ee})=>ae.createElement("svg",{key:H,style:{zIndex:H},width:E,height:_,className:"react-flow__edges react-flow__container"},ee&&ae.createElement(nCe,{defaultColor:t,rfId:r}),ae.createElement("g",null,U.map(z=>{const[Q,B,X]=SD(I.get(z.source)),[J,G,R]=SD(I.get(z.target));if(!X||!R)return null;let ie=z.type||"default";s[ie]||(P?.("011",Wl.error011(ie)),ie="default");const W=s[ie]||s.default,q=M===pd.Strict?G.target:(G.target??[]).concat(G.source??[]),V=wD(B.source,z.sourceHandle),te=wD(q,z.targetHandle),ne=V?.position||wt.Bottom,K=te?.position||wt.Top,se=!!(z.focusable||j&&typeof z.focusable>"u"),re=z.reconnectable||z.updatable,oe=typeof g<"u"&&(re||N&&typeof re>"u");if(!V||!te)return P?.("008",Wl.error008(V,z)),null;const{sourceX:Te,sourceY:We,targetX:Ye,targetY:Je}=U7e(Q,V,ne,J,te,K);return ae.createElement(W,{key:z.id,id:z.id,className:Is([z.className,i]),type:ie,data:z.data,selected:!!z.selected,animated:!!z.animated,hidden:!!z.hidden,label:z.label,labelStyle:z.labelStyle,labelShowBg:z.labelShowBg,labelBgStyle:z.labelBgStyle,labelBgPadding:z.labelBgPadding,labelBgBorderRadius:z.labelBgBorderRadius,style:z.style,source:z.source,target:z.target,sourceHandleId:z.sourceHandle,targetHandleId:z.targetHandle,markerEnd:z.markerEnd,markerStart:z.markerStart,sourceX:Te,sourceY:We,targetX:Ye,targetY:Je,sourcePosition:ne,targetPosition:K,elementsSelectable:T,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,onClick:h,onEdgeDoubleClick:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:y,reconnectRadius:w,rfId:r,ariaLabel:z.ariaLabel,isFocusable:se,isReconnectable:oe,pathOptions:"pathOptions"in z?z.pathOptions:void 0,interactionWidth:z.interactionWidth,disableKeyboardA11y:k})})))),S):null};eG.displayName="EdgeRenderer";var sCe=b.memo(eG);const iCe=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function aCe({children:t}){const e=hr(iCe);return ae.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:e}},t)}function oCe(t){const e=e7(),n=b.useRef(!1);b.useEffect(()=>{!n.current&&e.viewportInitialized&&t&&(setTimeout(()=>t(e),1),n.current=!0)},[t,e.viewportInitialized])}const lCe={[wt.Left]:wt.Right,[wt.Right]:wt.Left,[wt.Top]:wt.Bottom,[wt.Bottom]:wt.Top},tG=({nodeId:t,handleType:e,style:n,type:r=Ic.Bezier,CustomComponent:s,connectionStatus:i})=>{const{fromNode:a,handleId:l,toX:c,toY:d,connectionMode:h}=hr(b.useCallback(_=>({fromNode:_.nodeInternals.get(t),handleId:_.connectionHandleId,toX:(_.connectionPosition.x-_.transform[0])/_.transform[2],toY:(_.connectionPosition.y-_.transform[1])/_.transform[2],connectionMode:_.connectionMode}),[t]),Ss),m=a?.[Lr]?.handleBounds;let g=m?.[e];if(h===pd.Loose&&(g=g||m?.[e==="source"?"target":"source"]),!a||!g)return null;const x=l?g.find(_=>_.id===l):g[0],y=x?x.x+x.width/2:(a.width??0)/2,w=x?x.y+x.height/2:a.height??0,S=(a.positionAbsolute?.x??0)+y,k=(a.positionAbsolute?.y??0)+w,j=x?.position,N=j?lCe[j]:null;if(!j||!N)return null;if(s)return ae.createElement(s,{connectionLineType:r,connectionLineStyle:n,fromNode:a,fromHandle:x,fromX:S,fromY:k,toX:c,toY:d,fromPosition:j,toPosition:N,connectionStatus:i});let T="";const E={sourceX:S,sourceY:k,sourcePosition:j,targetX:c,targetY:d,targetPosition:N};return r===Ic.Bezier?[T]=OW(E):r===Ic.Step?[T]=YO({...E,borderRadius:0}):r===Ic.SmoothStep?[T]=YO(E):r===Ic.SimpleBezier?[T]=kW(E):T=`M${S},${k} ${c},${d}`,ae.createElement("path",{d:T,fill:"none",className:"react-flow__connection-path",style:n})};tG.displayName="ConnectionLine";const cCe=t=>({nodeId:t.connectionNodeId,handleType:t.connectionHandleType,nodesConnectable:t.nodesConnectable,connectionStatus:t.connectionStatus,width:t.width,height:t.height});function uCe({containerStyle:t,style:e,type:n,component:r}){const{nodeId:s,handleType:i,nodesConnectable:a,width:l,height:c,connectionStatus:d}=hr(cCe,Ss);return!(s&&i&&l&&a)?null:ae.createElement("svg",{style:t,width:l,height:c,className:"react-flow__edges react-flow__connectionline react-flow__container"},ae.createElement("g",{className:Is(["react-flow__connection",d])},ae.createElement(tG,{nodeId:s,handleType:i,style:e,type:n,CustomComponent:r,connectionStatus:d})))}function OD(t,e){return b.useRef(null),ms(),b.useMemo(()=>e(t),[t])}const nG=({nodeTypes:t,edgeTypes:e,onMove:n,onMoveStart:r,onMoveEnd:s,onInit:i,onNodeClick:a,onEdgeClick:l,onNodeDoubleClick:c,onEdgeDoubleClick:d,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:g,onNodeContextMenu:x,onSelectionContextMenu:y,onSelectionStart:w,onSelectionEnd:S,connectionLineType:k,connectionLineStyle:j,connectionLineComponent:N,connectionLineContainerStyle:T,selectionKeyCode:E,selectionOnDrag:_,selectionMode:M,multiSelectionKeyCode:I,panActivationKeyCode:P,zoomActivationKeyCode:L,deleteKeyCode:H,onlyRenderVisibleElements:U,elementsSelectable:ee,selectNodesOnDrag:z,defaultViewport:Q,translateExtent:B,minZoom:X,maxZoom:J,preventScrolling:G,defaultMarkerColor:R,zoomOnScroll:ie,zoomOnPinch:W,panOnScroll:q,panOnScrollSpeed:V,panOnScrollMode:te,zoomOnDoubleClick:ne,panOnDrag:K,onPaneClick:se,onPaneMouseEnter:re,onPaneMouseMove:oe,onPaneMouseLeave:Te,onPaneScroll:We,onPaneContextMenu:Ye,onEdgeContextMenu:Je,onEdgeMouseEnter:Oe,onEdgeMouseMove:Ve,onEdgeMouseLeave:Ue,onReconnect:He,onReconnectStart:Ot,onReconnectEnd:xt,reconnectRadius:kn,noDragClassName:It,noWheelClassName:Yt,noPanClassName:_t,elevateEdgesOnSelect:mt,disableKeyboardA11y:Ne,nodeOrigin:Ie,nodeExtent:st,rfId:yt})=>{const Pt=OD(t,L7e),At=OD(e,V7e);return oCe(i),ae.createElement(z7e,{onPaneClick:se,onPaneMouseEnter:re,onPaneMouseMove:oe,onPaneMouseLeave:Te,onPaneContextMenu:Ye,onPaneScroll:We,deleteKeyCode:H,selectionKeyCode:E,selectionOnDrag:_,selectionMode:M,onSelectionStart:w,onSelectionEnd:S,multiSelectionKeyCode:I,panActivationKeyCode:P,zoomActivationKeyCode:L,elementsSelectable:ee,onMove:n,onMoveStart:r,onMoveEnd:s,zoomOnScroll:ie,zoomOnPinch:W,zoomOnDoubleClick:ne,panOnScroll:q,panOnScrollSpeed:V,panOnScrollMode:te,panOnDrag:K,defaultViewport:Q,translateExtent:B,minZoom:X,maxZoom:J,onSelectionContextMenu:y,preventScrolling:G,noDragClassName:It,noWheelClassName:Yt,noPanClassName:_t,disableKeyboardA11y:Ne},ae.createElement(aCe,null,ae.createElement(sCe,{edgeTypes:At,onEdgeClick:l,onEdgeDoubleClick:d,onlyRenderVisibleElements:U,onEdgeContextMenu:Je,onEdgeMouseEnter:Oe,onEdgeMouseMove:Ve,onEdgeMouseLeave:Ue,onReconnect:He,onReconnectStart:Ot,onReconnectEnd:xt,reconnectRadius:kn,defaultMarkerColor:R,noPanClassName:_t,elevateEdgesOnSelect:!!mt,disableKeyboardA11y:Ne,rfId:yt},ae.createElement(uCe,{style:j,type:k,component:N,containerStyle:T})),ae.createElement("div",{className:"react-flow__edgelabel-renderer"}),ae.createElement(q7e,{nodeTypes:Pt,onNodeClick:a,onNodeDoubleClick:c,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:g,onNodeContextMenu:x,selectNodesOnDrag:z,onlyRenderVisibleElements:U,noPanClassName:_t,noDragClassName:It,disableKeyboardA11y:Ne,nodeOrigin:Ie,nodeExtent:st,rfId:yt})))};nG.displayName="GraphView";var dCe=b.memo(nG);const tj=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Tc={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:tj,nodeExtent:tj,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:pd.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:BNe,isValidConnection:void 0},hCe=()=>NOe((t,e)=>({...Tc,setNodes:n=>{const{nodeInternals:r,nodeOrigin:s,elevateNodesOnSelect:i}=e();t({nodeInternals:s5(n,r,s,i)})},getNodes:()=>Array.from(e().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=e();t({edges:n.map(s=>({...r,...s}))})},setDefaultNodesAndEdges:(n,r)=>{const s=typeof n<"u",i=typeof r<"u",a=s?s5(n,new Map,e().nodeOrigin,e().elevateNodesOnSelect):new Map;t({nodeInternals:a,edges:i?r:[],hasDefaultNodes:s,hasDefaultEdges:i})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:s,fitViewOnInit:i,fitViewOnInitDone:a,fitViewOnInitOptions:l,domNode:c,nodeOrigin:d}=e(),h=c?.querySelector(".react-flow__viewport");if(!h)return;const m=window.getComputedStyle(h),{m22:g}=new window.DOMMatrixReadOnly(m.transform),x=n.reduce((w,S)=>{const k=s.get(S.id);if(k?.hidden)s.set(k.id,{...k,[Lr]:{...k[Lr],handleBounds:void 0}});else if(k){const j=UN(S.nodeElement);!!(j.width&&j.height&&(k.width!==j.width||k.height!==j.height||S.forceUpdate))&&(s.set(k.id,{...k,[Lr]:{...k[Lr],handleBounds:{source:xD(".source",S.nodeElement,g,d),target:xD(".target",S.nodeElement,g,d)}},...j}),w.push({id:k.id,type:"dimensions",dimensions:j}))}return w},[]);$W(s,d);const y=a||i&&!a&&HW(e,{initial:!0,...l});t({nodeInternals:new Map(s),fitViewOnInitDone:y}),x?.length>0&&r?.(x)},updateNodePositions:(n,r=!0,s=!1)=>{const{triggerNodeChanges:i}=e(),a=n.map(l=>{const c={id:l.id,type:"position",dragging:s};return r&&(c.positionAbsolute=l.positionAbsolute,c.position=l.position),c});i(a)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:s,hasDefaultNodes:i,nodeOrigin:a,getNodes:l,elevateNodesOnSelect:c}=e();if(n?.length){if(i){const d=VW(n,l()),h=s5(d,s,a,c);t({nodeInternals:h})}r?.(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:s,getNodes:i}=e();let a,l=null;r?a=n.map(c=>Dc(c,!0)):(a=Eh(i(),n),l=Eh(s,[])),$1({changedNodes:a,changedEdges:l,get:e,set:t})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:s,getNodes:i}=e();let a,l=null;r?a=n.map(c=>Dc(c,!0)):(a=Eh(s,n),l=Eh(i(),[])),$1({changedNodes:l,changedEdges:a,get:e,set:t})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:s,getNodes:i}=e(),a=n||i(),l=r||s,c=a.map(h=>(h.selected=!1,Dc(h.id,!1))),d=l.map(h=>Dc(h.id,!1));$1({changedNodes:c,changedEdges:d,get:e,set:t})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:s}=e();r?.scaleExtent([n,s]),t({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:s}=e();r?.scaleExtent([s,n]),t({maxZoom:n})},setTranslateExtent:n=>{e().d3Zoom?.translateExtent(n),t({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=e(),i=r().filter(l=>l.selected).map(l=>Dc(l.id,!1)),a=n.filter(l=>l.selected).map(l=>Dc(l.id,!1));$1({changedNodes:i,changedEdges:a,get:e,set:t})},setNodeExtent:n=>{const{nodeInternals:r}=e();r.forEach(s=>{s.positionAbsolute=WN(s.position,n)}),t({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:s,height:i,d3Zoom:a,d3Selection:l,translateExtent:c}=e();if(!a||!l||!n.x&&!n.y)return!1;const d=Bl.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),h=[[0,0],[s,i]],m=a?.constrain()(d,h,c);return a.transform(l,m),r[0]!==m.x||r[1]!==m.y||r[2]!==m.k},cancelConnection:()=>t({connectionNodeId:Tc.connectionNodeId,connectionHandleId:Tc.connectionHandleId,connectionHandleType:Tc.connectionHandleType,connectionStatus:Tc.connectionStatus,connectionStartHandle:Tc.connectionStartHandle,connectionEndHandle:Tc.connectionEndHandle}),reset:()=>t({...Tc})}),Object.is),rG=({children:t})=>{const e=b.useRef(null);return e.current||(e.current=hCe()),ae.createElement(ANe,{value:e.current},t)};rG.displayName="ReactFlowProvider";const sG=({children:t})=>b.useContext(Ub)?ae.createElement(ae.Fragment,null,t):ae.createElement(rG,null,t);sG.displayName="ReactFlowWrapper";const fCe={input:PW,default:JO,output:IW,group:JN},mCe={default:Ty,straight:YN,step:XN,smoothstep:Gb,simplebezier:GN},pCe=[0,0],gCe=[15,15],xCe={x:0,y:0,zoom:1},vCe={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},iG=b.forwardRef(({nodes:t,edges:e,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:i=fCe,edgeTypes:a=mCe,onNodeClick:l,onEdgeClick:c,onInit:d,onMove:h,onMoveStart:m,onMoveEnd:g,onConnect:x,onConnectStart:y,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:k,onNodeMouseEnter:j,onNodeMouseMove:N,onNodeMouseLeave:T,onNodeContextMenu:E,onNodeDoubleClick:_,onNodeDragStart:M,onNodeDrag:I,onNodeDragStop:P,onNodesDelete:L,onEdgesDelete:H,onSelectionChange:U,onSelectionDragStart:ee,onSelectionDrag:z,onSelectionDragStop:Q,onSelectionContextMenu:B,onSelectionStart:X,onSelectionEnd:J,connectionMode:G=pd.Strict,connectionLineType:R=Ic.Bezier,connectionLineStyle:ie,connectionLineComponent:W,connectionLineContainerStyle:q,deleteKeyCode:V="Backspace",selectionKeyCode:te="Shift",selectionOnDrag:ne=!1,selectionMode:K=yp.Full,panActivationKeyCode:se="Space",multiSelectionKeyCode:re=Ny()?"Meta":"Control",zoomActivationKeyCode:oe=Ny()?"Meta":"Control",snapToGrid:Te=!1,snapGrid:We=gCe,onlyRenderVisibleElements:Ye=!1,selectNodesOnDrag:Je=!0,nodesDraggable:Oe,nodesConnectable:Ve,nodesFocusable:Ue,nodeOrigin:He=pCe,edgesFocusable:Ot,edgesUpdatable:xt,elementsSelectable:kn,defaultViewport:It=xCe,minZoom:Yt=.5,maxZoom:_t=2,translateExtent:mt=tj,preventScrolling:Ne=!0,nodeExtent:Ie,defaultMarkerColor:st="#b1b1b7",zoomOnScroll:yt=!0,zoomOnPinch:Pt=!0,panOnScroll:At=!1,panOnScrollSpeed:zn=.5,panOnScrollMode:Fe=Wu.Free,zoomOnDoubleClick:rt=!0,panOnDrag:tn=!0,onPaneClick:Rt,onPaneMouseEnter:ke,onPaneMouseMove:Pe,onPaneMouseLeave:it,onPaneScroll:ot,onPaneContextMenu:nn,children:Kt,onEdgeContextMenu:pt,onEdgeDoubleClick:xr,onEdgeMouseEnter:Ur,onEdgeMouseMove:Wr,onEdgeMouseLeave:vr,onEdgeUpdate:In,onEdgeUpdateStart:cr,onEdgeUpdateEnd:nr,onReconnect:ps,onReconnectStart:gs,onReconnectEnd:js,reconnectRadius:ge=10,edgeUpdaterRadius:Le=10,onNodesChange:Ct,onEdgesChange:xn,noDragClassName:Fr="nodrag",noWheelClassName:Cr="nowheel",noPanClassName:Tr="nopan",fitView:Ns=!1,fitViewOptions:$f,connectOnClick:nw=!0,attributionPosition:rw,proOptions:Cg,defaultEdgeOptions:mu,elevateNodesOnSelect:Hf=!0,elevateEdgesOnSelect:Jl=!1,disableKeyboardA11y:Xo=!1,autoPanOnConnect:pu=!0,autoPanOnNodeDrag:ec=!0,connectionRadius:Gr=20,isValidConnection:Tg,onError:Eg,style:Yo,id:Ko,nodeDragThreshold:sw,..._g},Mg)=>{const Qf=Ko||"1";return ae.createElement("div",{..._g,style:{...Yo,...vCe},ref:Mg,className:Is(["react-flow",s]),"data-testid":"rf__wrapper",id:Ko},ae.createElement(sG,null,ae.createElement(dCe,{onInit:d,onMove:h,onMoveStart:m,onMoveEnd:g,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:j,onNodeMouseMove:N,onNodeMouseLeave:T,onNodeContextMenu:E,onNodeDoubleClick:_,nodeTypes:i,edgeTypes:a,connectionLineType:R,connectionLineStyle:ie,connectionLineComponent:W,connectionLineContainerStyle:q,selectionKeyCode:te,selectionOnDrag:ne,selectionMode:K,deleteKeyCode:V,multiSelectionKeyCode:re,panActivationKeyCode:se,zoomActivationKeyCode:oe,onlyRenderVisibleElements:Ye,selectNodesOnDrag:Je,defaultViewport:It,translateExtent:mt,minZoom:Yt,maxZoom:_t,preventScrolling:Ne,zoomOnScroll:yt,zoomOnPinch:Pt,zoomOnDoubleClick:rt,panOnScroll:At,panOnScrollSpeed:zn,panOnScrollMode:Fe,panOnDrag:tn,onPaneClick:Rt,onPaneMouseEnter:ke,onPaneMouseMove:Pe,onPaneMouseLeave:it,onPaneScroll:ot,onPaneContextMenu:nn,onSelectionContextMenu:B,onSelectionStart:X,onSelectionEnd:J,onEdgeContextMenu:pt,onEdgeDoubleClick:xr,onEdgeMouseEnter:Ur,onEdgeMouseMove:Wr,onEdgeMouseLeave:vr,onReconnect:ps??In,onReconnectStart:gs??cr,onReconnectEnd:js??nr,reconnectRadius:ge??Le,defaultMarkerColor:st,noDragClassName:Fr,noWheelClassName:Cr,noPanClassName:Tr,elevateEdgesOnSelect:Jl,rfId:Qf,disableKeyboardA11y:Xo,nodeOrigin:He,nodeExtent:Ie}),ae.createElement(l7e,{nodes:t,edges:e,defaultNodes:n,defaultEdges:r,onConnect:x,onConnectStart:y,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:k,nodesDraggable:Oe,nodesConnectable:Ve,nodesFocusable:Ue,edgesFocusable:Ot,edgesUpdatable:xt,elementsSelectable:kn,elevateNodesOnSelect:Hf,minZoom:Yt,maxZoom:_t,nodeExtent:Ie,onNodesChange:Ct,onEdgesChange:xn,snapToGrid:Te,snapGrid:We,connectionMode:G,translateExtent:mt,connectOnClick:nw,defaultEdgeOptions:mu,fitView:Ns,fitViewOptions:$f,onNodesDelete:L,onEdgesDelete:H,onNodeDragStart:M,onNodeDrag:I,onNodeDragStop:P,onSelectionDrag:z,onSelectionDragStart:ee,onSelectionDragStop:Q,noPanClassName:Tr,nodeOrigin:He,rfId:Qf,autoPanOnConnect:pu,autoPanOnNodeDrag:ec,onError:Eg,connectionRadius:Gr,isValidConnection:Tg,nodeDragThreshold:sw}),ae.createElement(a7e,{onSelectionChange:U}),Kt,ae.createElement(DNe,{proOptions:Cg,position:rw}),ae.createElement(f7e,{rfId:Qf,disableKeyboardA11y:Xo})))});iG.displayName="ReactFlow";function aG(t){return e=>{const[n,r]=b.useState(e),s=b.useCallback(i=>r(a=>t(i,a)),[]);return[n,r,s]}}const yCe=aG(VW),bCe=aG(C7e),oG=({id:t,x:e,y:n,width:r,height:s,style:i,color:a,strokeColor:l,strokeWidth:c,className:d,borderRadius:h,shapeRendering:m,onClick:g,selected:x})=>{const{background:y,backgroundColor:w}=i||{},S=a||y||w;return ae.createElement("rect",{className:Is(["react-flow__minimap-node",{selected:x},d]),x:e,y:n,rx:h,ry:h,width:r,height:s,fill:S,stroke:l,strokeWidth:c,shapeRendering:m,onClick:g?k=>g(k,t):void 0})};oG.displayName="MiniMapNode";var wCe=b.memo(oG);const SCe=t=>t.nodeOrigin,kCe=t=>t.getNodes().filter(e=>!e.hidden&&e.width&&e.height),l5=t=>t instanceof Function?t:()=>t;function OCe({nodeStrokeColor:t="transparent",nodeColor:e="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s=2,nodeComponent:i=wCe,onClick:a}){const l=hr(kCe,Ss),c=hr(SCe),d=l5(e),h=l5(t),m=l5(n),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return ae.createElement(ae.Fragment,null,l.map(x=>{const{x:y,y:w}=td(x,c).positionAbsolute;return ae.createElement(i,{key:x.id,x:y,y:w,width:x.width,height:x.height,style:x.style,selected:x.selected,className:m(x),color:d(x),borderRadius:r,strokeColor:h(x),strokeWidth:s,shapeRendering:g,onClick:a,id:x.id})}))}var jCe=b.memo(OCe);const NCe=200,CCe=150,TCe=t=>{const e=t.getNodes(),n={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:n,boundingRect:e.length>0?INe(Xb(e,t.nodeOrigin),n):n,rfId:t.rfId}},ECe="react-flow__minimap-desc";function lG({style:t,className:e,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a=2,nodeComponent:l,maskColor:c="rgb(240, 240, 240, 0.6)",maskStrokeColor:d="none",maskStrokeWidth:h=1,position:m="bottom-right",onClick:g,onNodeClick:x,pannable:y=!1,zoomable:w=!1,ariaLabel:S="React Flow mini map",inversePan:k=!1,zoomStep:j=10,offsetScale:N=5}){const T=ms(),E=b.useRef(null),{boundingRect:_,viewBB:M,rfId:I}=hr(TCe,Ss),P=t?.width??NCe,L=t?.height??CCe,H=_.width/P,U=_.height/L,ee=Math.max(H,U),z=ee*P,Q=ee*L,B=N*ee,X=_.x-(z-_.width)/2-B,J=_.y-(Q-_.height)/2-B,G=z+B*2,R=Q+B*2,ie=`${ECe}-${I}`,W=b.useRef(0);W.current=ee,b.useEffect(()=>{if(E.current){const te=ma(E.current),ne=re=>{const{transform:oe,d3Selection:Te,d3Zoom:We}=T.getState();if(re.sourceEvent.type!=="wheel"||!Te||!We)return;const Ye=-re.sourceEvent.deltaY*(re.sourceEvent.deltaMode===1?.05:re.sourceEvent.deltaMode?1:.002)*j,Je=oe[2]*Math.pow(2,Ye);We.scaleTo(Te,Je)},K=re=>{const{transform:oe,d3Selection:Te,d3Zoom:We,translateExtent:Ye,width:Je,height:Oe}=T.getState();if(re.sourceEvent.type!=="mousemove"||!Te||!We)return;const Ve=W.current*Math.max(1,oe[2])*(k?-1:1),Ue={x:oe[0]-re.sourceEvent.movementX*Ve,y:oe[1]-re.sourceEvent.movementY*Ve},He=[[0,0],[Je,Oe]],Ot=Bl.translate(Ue.x,Ue.y).scale(oe[2]),xt=We.constrain()(Ot,He,Ye);We.transform(Te,xt)},se=fW().on("zoom",y?K:null).on("zoom.wheel",w?ne:null);return te.call(se),()=>{te.on("zoom",null)}}},[y,w,k,j]);const q=g?te=>{const ne=Ha(te);g(te,{x:ne[0],y:ne[1]})}:void 0,V=x?(te,ne)=>{const K=T.getState().nodeInternals.get(ne);x(te,K)}:void 0;return ae.createElement(Wb,{position:m,style:t,className:Is(["react-flow__minimap",e]),"data-testid":"rf__minimap"},ae.createElement("svg",{width:P,height:L,viewBox:`${X} ${J} ${G} ${R}`,role:"img","aria-labelledby":ie,ref:E,onClick:q},S&&ae.createElement("title",{id:ie},S),ae.createElement(jCe,{onClick:V,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:l}),ae.createElement("path",{className:"react-flow__minimap-mask",d:`M${X-B},${J-B}h${G+B*2}v${R+B*2}h${-G-B*2}z - M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fill:c,fillRule:"evenodd",stroke:d,strokeWidth:h,pointerEvents:"none"})))}lG.displayName="MiniMap";var _Ce=b.memo(lG);function MCe(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},ae.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function ACe(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},ae.createElement("path",{d:"M0 0h32v4.2H0z"}))}function RCe(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},ae.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function DCe(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ae.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function PCe(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ae.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}const h0=({children:t,className:e,...n})=>ae.createElement("button",{type:"button",className:Is(["react-flow__controls-button",e]),...n},t);h0.displayName="ControlButton";const zCe=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom}),cG=({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:l,onInteractiveChange:c,className:d,children:h,position:m="bottom-left"})=>{const g=ms(),[x,y]=b.useState(!1),{isInteractive:w,minZoomReached:S,maxZoomReached:k}=hr(zCe,Ss),{zoomIn:j,zoomOut:N,fitView:T}=e7();if(b.useEffect(()=>{y(!0)},[]),!x)return null;const E=()=>{j(),i?.()},_=()=>{N(),a?.()},M=()=>{T(s),l?.()},I=()=>{g.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),c?.(!w)};return ae.createElement(Wb,{className:Is(["react-flow__controls",d]),position:m,style:t,"data-testid":"rf__controls"},e&&ae.createElement(ae.Fragment,null,ae.createElement(h0,{onClick:E,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:k},ae.createElement(MCe,null)),ae.createElement(h0,{onClick:_,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:S},ae.createElement(ACe,null))),n&&ae.createElement(h0,{className:"react-flow__controls-fitview",onClick:M,title:"fit view","aria-label":"fit view"},ae.createElement(RCe,null)),r&&ae.createElement(h0,{className:"react-flow__controls-interactive",onClick:I,title:"toggle interactivity","aria-label":"toggle interactivity"},w?ae.createElement(PCe,null):ae.createElement(DCe,null)),h)};cG.displayName="Controls";var ICe=b.memo(cG),Ca;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Ca||(Ca={}));function LCe({color:t,dimensions:e,lineWidth:n}){return ae.createElement("path",{stroke:t,strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})}function BCe({color:t,radius:e}){return ae.createElement("circle",{cx:e,cy:e,r:e,fill:t})}const FCe={[Ca.Dots]:"#91919a",[Ca.Lines]:"#eee",[Ca.Cross]:"#e2e2e2"},qCe={[Ca.Dots]:1,[Ca.Lines]:1,[Ca.Cross]:6},$Ce=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function uG({id:t,variant:e=Ca.Dots,gap:n=20,size:r,lineWidth:s=1,offset:i=2,color:a,style:l,className:c}){const d=b.useRef(null),{transform:h,patternId:m}=hr($Ce,Ss),g=a||FCe[e],x=r||qCe[e],y=e===Ca.Dots,w=e===Ca.Cross,S=Array.isArray(n)?n:[n,n],k=[S[0]*h[2]||1,S[1]*h[2]||1],j=x*h[2],N=w?[j,j]:k,T=y?[j/i,j/i]:[N[0]/i,N[1]/i];return ae.createElement("svg",{className:Is(["react-flow__background",c]),style:{...l,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:d,"data-testid":"rf__background"},ae.createElement("pattern",{id:m+t,x:h[0]%k[0],y:h[1]%k[1],width:k[0],height:k[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`},y?ae.createElement(BCe,{color:g,radius:j/i}):ae.createElement(LCe,{dimensions:N,color:g,lineWidth:s})),ae.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${m+t})`}))}uG.displayName="Background";var HCe=b.memo(uG);function n7(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var c5,jD;function QCe(){if(jD)return c5;jD=1;var t=Dz(),e=4;function n(r){return t(r,e)}return c5=n,c5}var u5,ND;function dG(){if(ND)return u5;ND=1;var t=OJ();function e(n){return typeof n=="function"?n:t}return u5=e,u5}var d5,CD;function hG(){if(CD)return d5;CD=1;var t=Pz(),e=cj(),n=dG(),r=xd();function s(i,a){var l=r(i)?t:e;return l(i,n(a))}return d5=s,d5}var h5,TD;function fG(){return TD||(TD=1,h5=hG()),h5}var f5,ED;function VCe(){if(ED)return f5;ED=1;var t=cj();function e(n,r){var s=[];return t(n,function(i,a,l){r(i,a,l)&&s.push(i)}),s}return f5=e,f5}var m5,_D;function mG(){if(_D)return m5;_D=1;var t=jJ(),e=VCe(),n=uj(),r=xd();function s(i,a){var l=r(i)?t:e;return l(i,n(a,3))}return m5=s,m5}var p5,MD;function UCe(){if(MD)return p5;MD=1;var t=Object.prototype,e=t.hasOwnProperty;function n(r,s){return r!=null&&e.call(r,s)}return p5=n,p5}var g5,AD;function pG(){if(AD)return g5;AD=1;var t=UCe(),e=NJ();function n(r,s){return r!=null&&e(r,s,t)}return g5=n,g5}var x5,RD;function WCe(){if(RD)return x5;RD=1;var t=zz(),e=Iz(),n=Lz(),r=xd(),s=dj(),i=hj(),a=CJ(),l=fj(),c="[object Map]",d="[object Set]",h=Object.prototype,m=h.hasOwnProperty;function g(x){if(x==null)return!0;if(s(x)&&(r(x)||typeof x=="string"||typeof x.splice=="function"||i(x)||l(x)||n(x)))return!x.length;var y=e(x);if(y==c||y==d)return!x.size;if(a(x))return!t(x).length;for(var w in x)if(m.call(x,w))return!1;return!0}return x5=g,x5}var v5,DD;function gG(){if(DD)return v5;DD=1;function t(e){return e===void 0}return v5=t,v5}var y5,PD;function GCe(){if(PD)return y5;PD=1;function t(e,n,r,s){var i=-1,a=e==null?0:e.length;for(s&&a&&(r=e[++i]);++i1?x.setNode(y,m):x.setNode(y)}),this},s.prototype.setNode=function(h,m){return t.has(this._nodes,h)?(arguments.length>1&&(this._nodes[h]=m),this):(this._nodes[h]=arguments.length>1?m:this._defaultNodeLabelFn(h),this._isCompound&&(this._parent[h]=n,this._children[h]={},this._children[n][h]=!0),this._in[h]={},this._preds[h]={},this._out[h]={},this._sucs[h]={},++this._nodeCount,this)},s.prototype.node=function(h){return this._nodes[h]},s.prototype.hasNode=function(h){return t.has(this._nodes,h)},s.prototype.removeNode=function(h){var m=this;if(t.has(this._nodes,h)){var g=function(x){m.removeEdge(m._edgeObjs[x])};delete this._nodes[h],this._isCompound&&(this._removeFromParentsChildList(h),delete this._parent[h],t.each(this.children(h),function(x){m.setParent(x)}),delete this._children[h]),t.each(t.keys(this._in[h]),g),delete this._in[h],delete this._preds[h],t.each(t.keys(this._out[h]),g),delete this._out[h],delete this._sucs[h],--this._nodeCount}return this},s.prototype.setParent=function(h,m){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t.isUndefined(m))m=n;else{m+="";for(var g=m;!t.isUndefined(g);g=this.parent(g))if(g===h)throw new Error("Setting "+m+" as parent of "+h+" would create a cycle");this.setNode(m)}return this.setNode(h),this._removeFromParentsChildList(h),this._parent[h]=m,this._children[m][h]=!0,this},s.prototype._removeFromParentsChildList=function(h){delete this._children[this._parent[h]][h]},s.prototype.parent=function(h){if(this._isCompound){var m=this._parent[h];if(m!==n)return m}},s.prototype.children=function(h){if(t.isUndefined(h)&&(h=n),this._isCompound){var m=this._children[h];if(m)return t.keys(m)}else{if(h===n)return this.nodes();if(this.hasNode(h))return[]}},s.prototype.predecessors=function(h){var m=this._preds[h];if(m)return t.keys(m)},s.prototype.successors=function(h){var m=this._sucs[h];if(m)return t.keys(m)},s.prototype.neighbors=function(h){var m=this.predecessors(h);if(m)return t.union(m,this.successors(h))},s.prototype.isLeaf=function(h){var m;return this.isDirected()?m=this.successors(h):m=this.neighbors(h),m.length===0},s.prototype.filterNodes=function(h){var m=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});m.setGraph(this.graph());var g=this;t.each(this._nodes,function(w,S){h(S)&&m.setNode(S,w)}),t.each(this._edgeObjs,function(w){m.hasNode(w.v)&&m.hasNode(w.w)&&m.setEdge(w,g.edge(w))});var x={};function y(w){var S=g.parent(w);return S===void 0||m.hasNode(S)?(x[w]=S,S):S in x?x[S]:y(S)}return this._isCompound&&t.each(m.nodes(),function(w){m.setParent(w,y(w))}),m},s.prototype.setDefaultEdgeLabel=function(h){return t.isFunction(h)||(h=t.constant(h)),this._defaultEdgeLabelFn=h,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return t.values(this._edgeObjs)},s.prototype.setPath=function(h,m){var g=this,x=arguments;return t.reduce(h,function(y,w){return x.length>1?g.setEdge(y,w,m):g.setEdge(y,w),w}),this},s.prototype.setEdge=function(){var h,m,g,x,y=!1,w=arguments[0];typeof w=="object"&&w!==null&&"v"in w?(h=w.v,m=w.w,g=w.name,arguments.length===2&&(x=arguments[1],y=!0)):(h=w,m=arguments[1],g=arguments[3],arguments.length>2&&(x=arguments[2],y=!0)),h=""+h,m=""+m,t.isUndefined(g)||(g=""+g);var S=l(this._isDirected,h,m,g);if(t.has(this._edgeLabels,S))return y&&(this._edgeLabels[S]=x),this;if(!t.isUndefined(g)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(h),this.setNode(m),this._edgeLabels[S]=y?x:this._defaultEdgeLabelFn(h,m,g);var k=c(this._isDirected,h,m,g);return h=k.v,m=k.w,Object.freeze(k),this._edgeObjs[S]=k,i(this._preds[m],h),i(this._sucs[h],m),this._in[m][S]=k,this._out[h][S]=k,this._edgeCount++,this},s.prototype.edge=function(h,m,g){var x=arguments.length===1?d(this._isDirected,arguments[0]):l(this._isDirected,h,m,g);return this._edgeLabels[x]},s.prototype.hasEdge=function(h,m,g){var x=arguments.length===1?d(this._isDirected,arguments[0]):l(this._isDirected,h,m,g);return t.has(this._edgeLabels,x)},s.prototype.removeEdge=function(h,m,g){var x=arguments.length===1?d(this._isDirected,arguments[0]):l(this._isDirected,h,m,g),y=this._edgeObjs[x];return y&&(h=y.v,m=y.w,delete this._edgeLabels[x],delete this._edgeObjs[x],a(this._preds[m],h),a(this._sucs[h],m),delete this._in[m][x],delete this._out[h][x],this._edgeCount--),this},s.prototype.inEdges=function(h,m){var g=this._in[h];if(g){var x=t.values(g);return m?t.filter(x,function(y){return y.v===m}):x}},s.prototype.outEdges=function(h,m){var g=this._out[h];if(g){var x=t.values(g);return m?t.filter(x,function(y){return y.w===m}):x}},s.prototype.nodeEdges=function(h,m){var g=this.inEdges(h,m);if(g)return g.concat(this.outEdges(h,m))};function i(h,m){h[m]?h[m]++:h[m]=1}function a(h,m){--h[m]||delete h[m]}function l(h,m,g,x){var y=""+m,w=""+g;if(!h&&y>w){var S=y;y=w,w=S}return y+r+w+r+(t.isUndefined(x)?e:x)}function c(h,m,g,x){var y=""+m,w=""+g;if(!h&&y>w){var S=y;y=w,w=S}var k={v:y,w};return x&&(k.name=x),k}function d(h,m){return l(h,m.v,m.w,m.name)}return A5}var R5,XD;function r8e(){return XD||(XD=1,R5="2.1.8"),R5}var D5,YD;function s8e(){return YD||(YD=1,D5={Graph:r7(),version:r8e()}),D5}var P5,KD;function i8e(){if(KD)return P5;KD=1;var t=za(),e=r7();P5={write:n,read:i};function n(a){var l={options:{directed:a.isDirected(),multigraph:a.isMultigraph(),compound:a.isCompound()},nodes:r(a),edges:s(a)};return t.isUndefined(a.graph())||(l.value=t.clone(a.graph())),l}function r(a){return t.map(a.nodes(),function(l){var c=a.node(l),d=a.parent(l),h={v:l};return t.isUndefined(c)||(h.value=c),t.isUndefined(d)||(h.parent=d),h})}function s(a){return t.map(a.edges(),function(l){var c=a.edge(l),d={v:l.v,w:l.w};return t.isUndefined(l.name)||(d.name=l.name),t.isUndefined(c)||(d.value=c),d})}function i(a){var l=new e(a.options).setGraph(a.value);return t.each(a.nodes,function(c){l.setNode(c.v,c.value),c.parent&&l.setParent(c.v,c.parent)}),t.each(a.edges,function(c){l.setEdge({v:c.v,w:c.w,name:c.name},c.value)}),l}return P5}var z5,ZD;function a8e(){if(ZD)return z5;ZD=1;var t=za();z5=e;function e(n){var r={},s=[],i;function a(l){t.has(r,l)||(r[l]=!0,i.push(l),t.each(n.successors(l),a),t.each(n.predecessors(l),a))}return t.each(n.nodes(),function(l){i=[],a(l),i.length&&s.push(i)}),s}return z5}var I5,JD;function bG(){if(JD)return I5;JD=1;var t=za();I5=e;function e(){this._arr=[],this._keyIndices={}}return e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map(function(n){return n.key})},e.prototype.has=function(n){return t.has(this._keyIndices,n)},e.prototype.priority=function(n){var r=this._keyIndices[n];if(r!==void 0)return this._arr[r].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(n,r){var s=this._keyIndices;if(n=String(n),!t.has(s,n)){var i=this._arr,a=i.length;return s[n]=a,i.push({key:n,priority:r}),this._decrease(a),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key},e.prototype.decrease=function(n,r){var s=this._keyIndices[n];if(r>this._arr[s].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[s].priority+" New: "+r);this._arr[s].priority=r,this._decrease(s)},e.prototype._heapify=function(n){var r=this._arr,s=2*n,i=s+1,a=n;s>1,!(r[i].priority0&&(m=h.removeMin(),g=d[m],g.distance!==Number.POSITIVE_INFINITY);)c(m).forEach(x);return d}return L5}var B5,tP;function o8e(){if(tP)return B5;tP=1;var t=wG(),e=za();B5=n;function n(r,s,i){return e.transform(r.nodes(),function(a,l){a[l]=t(r,l,s,i)},{})}return B5}var F5,nP;function SG(){if(nP)return F5;nP=1;var t=za();F5=e;function e(n){var r=0,s=[],i={},a=[];function l(c){var d=i[c]={onStack:!0,lowlink:r,index:r++};if(s.push(c),n.successors(c).forEach(function(g){t.has(i,g)?i[g].onStack&&(d.lowlink=Math.min(d.lowlink,i[g].index)):(l(g),d.lowlink=Math.min(d.lowlink,i[g].lowlink))}),d.lowlink===d.index){var h=[],m;do m=s.pop(),i[m].onStack=!1,h.push(m);while(c!==m);a.push(h)}}return n.nodes().forEach(function(c){t.has(i,c)||l(c)}),a}return F5}var q5,rP;function l8e(){if(rP)return q5;rP=1;var t=za(),e=SG();q5=n;function n(r){return t.filter(e(r),function(s){return s.length>1||s.length===1&&r.hasEdge(s[0],s[0])})}return q5}var $5,sP;function c8e(){if(sP)return $5;sP=1;var t=za();$5=n;var e=t.constant(1);function n(s,i,a){return r(s,i||e,a||function(l){return s.outEdges(l)})}function r(s,i,a){var l={},c=s.nodes();return c.forEach(function(d){l[d]={},l[d][d]={distance:0},c.forEach(function(h){d!==h&&(l[d][h]={distance:Number.POSITIVE_INFINITY})}),a(d).forEach(function(h){var m=h.v===d?h.w:h.v,g=i(h);l[d][m]={distance:g,predecessor:d}})}),c.forEach(function(d){var h=l[d];c.forEach(function(m){var g=l[m];c.forEach(function(x){var y=g[d],w=h[x],S=g[x],k=y.distance+w.distance;k0;){if(d=c.removeMin(),t.has(l,d))a.setEdge(d,l[d]);else{if(m)throw new Error("Input graph is not connected: "+s);m=!0}s.nodeEdges(d).forEach(h)}return a}return G5}var X5,dP;function m8e(){return dP||(dP=1,X5={components:a8e(),dijkstra:wG(),dijkstraAll:o8e(),findCycles:l8e(),floydWarshall:c8e(),isAcyclic:u8e(),postorder:d8e(),preorder:h8e(),prim:f8e(),tarjan:SG(),topsort:kG()}),X5}var Y5,hP;function p8e(){if(hP)return Y5;hP=1;var t=s8e();return Y5={Graph:t.Graph,json:i8e(),alg:m8e(),version:t.version},Y5}var K5,fP;function Ja(){if(fP)return K5;fP=1;var t;if(typeof n7=="function")try{t=p8e()}catch{}return t||(t=window.graphlib),K5=t,K5}var Z5,mP;function g8e(){if(mP)return Z5;mP=1;var t=Dz(),e=1,n=4;function r(s){return t(s,e|n)}return Z5=r,Z5}var J5,pP;function x8e(){if(pP)return J5;pP=1;var t=pj(),e=Hz(),n=$z(),r=Ry(),s=Object.prototype,i=s.hasOwnProperty,a=t(function(l,c){l=Object(l);var d=-1,h=c.length,m=h>2?c[2]:void 0;for(m&&n(c[0],c[1],m)&&(h=1);++d1?i[l-1]:void 0,d=l>2?i[2]:void 0;for(c=r.length>3&&typeof c=="function"?(l--,c):void 0,d&&e(i[0],i[1],d)&&(c=l<3?void 0:c,l=1),s=Object(s);++a0;--S)if(w=h[S].dequeue(),w){g=g.concat(a(d,h,m,w,!0));break}}}return g}function a(d,h,m,g,x){var y=x?[]:void 0;return t.forEach(d.inEdges(g.v),function(w){var S=d.edge(w),k=d.node(w.v);x&&y.push({v:w.v,w:w.w}),k.out-=S,c(h,m,k)}),t.forEach(d.outEdges(g.v),function(w){var S=d.edge(w),k=w.w,j=d.node(k);j.in-=S,c(h,m,j)}),d.removeNode(g.v),y}function l(d,h){var m=new e,g=0,x=0;t.forEach(d.nodes(),function(S){m.setNode(S,{v:S,in:0,out:0})}),t.forEach(d.edges(),function(S){var k=m.edge(S.v,S.w)||0,j=h(S),N=k+j;m.setEdge(S.v,S.w,N),x=Math.max(x,m.node(S.v).out+=j),g=Math.max(g,m.node(S.w).in+=j)});var y=t.range(x+g+3).map(function(){return new n}),w=g+1;return t.forEach(m.nodes(),function(S){c(y,w,m.node(S))}),{graph:m,buckets:y,zeroIdx:w}}function c(d,h,m){m.out?m.in?d[m.out-m.in+h].enqueue(m):d[d.length-1].enqueue(m):d[0].enqueue(m)}return x3}var v3,DP;function R8e(){if(DP)return v3;DP=1;var t=Nr(),e=A8e();v3={run:n,undo:s};function n(i){var a=i.graph().acyclicer==="greedy"?e(i,l(i)):r(i);t.forEach(a,function(c){var d=i.edge(c);i.removeEdge(c),d.forwardName=c.name,d.reversed=!0,i.setEdge(c.w,c.v,d,t.uniqueId("rev"))});function l(c){return function(d){return c.edge(d).weight}}}function r(i){var a=[],l={},c={};function d(h){t.has(c,h)||(c[h]=!0,l[h]=!0,t.forEach(i.outEdges(h),function(m){t.has(l,m.w)?a.push(m):d(m.w)}),delete l[h])}return t.forEach(i.nodes(),d),a}function s(i){t.forEach(i.edges(),function(a){var l=i.edge(a);if(l.reversed){i.removeEdge(a);var c=l.forwardName;delete l.reversed,delete l.forwardName,i.setEdge(a.w,a.v,l,c)}})}return v3}var y3,PP;function ji(){if(PP)return y3;PP=1;var t=Nr(),e=Ja().Graph;y3={addDummyNode:n,simplify:r,asNonCompoundGraph:s,successorWeights:i,predecessorWeights:a,intersectRect:l,buildLayerMatrix:c,normalizeRanks:d,removeEmptyRanks:h,addBorderNode:m,maxRank:g,partition:x,time:y,notime:w};function n(S,k,j,N){var T;do T=t.uniqueId(N);while(S.hasNode(T));return j.dummy=k,S.setNode(T,j),T}function r(S){var k=new e().setGraph(S.graph());return t.forEach(S.nodes(),function(j){k.setNode(j,S.node(j))}),t.forEach(S.edges(),function(j){var N=k.edge(j.v,j.w)||{weight:0,minlen:1},T=S.edge(j);k.setEdge(j.v,j.w,{weight:N.weight+T.weight,minlen:Math.max(N.minlen,T.minlen)})}),k}function s(S){var k=new e({multigraph:S.isMultigraph()}).setGraph(S.graph());return t.forEach(S.nodes(),function(j){S.children(j).length||k.setNode(j,S.node(j))}),t.forEach(S.edges(),function(j){k.setEdge(j,S.edge(j))}),k}function i(S){var k=t.map(S.nodes(),function(j){var N={};return t.forEach(S.outEdges(j),function(T){N[T.w]=(N[T.w]||0)+S.edge(T).weight}),N});return t.zipObject(S.nodes(),k)}function a(S){var k=t.map(S.nodes(),function(j){var N={};return t.forEach(S.inEdges(j),function(T){N[T.v]=(N[T.v]||0)+S.edge(T).weight}),N});return t.zipObject(S.nodes(),k)}function l(S,k){var j=S.x,N=S.y,T=k.x-j,E=k.y-N,_=S.width/2,M=S.height/2;if(!T&&!E)throw new Error("Not possible to find intersection inside of the rectangle");var I,P;return Math.abs(E)*_>Math.abs(T)*M?(E<0&&(M=-M),I=M*T/E,P=M):(T<0&&(_=-_),I=_,P=_*E/T),{x:j+I,y:N+P}}function c(S){var k=t.map(t.range(g(S)+1),function(){return[]});return t.forEach(S.nodes(),function(j){var N=S.node(j),T=N.rank;t.isUndefined(T)||(k[T][N.order]=j)}),k}function d(S){var k=t.min(t.map(S.nodes(),function(j){return S.node(j).rank}));t.forEach(S.nodes(),function(j){var N=S.node(j);t.has(N,"rank")&&(N.rank-=k)})}function h(S){var k=t.min(t.map(S.nodes(),function(E){return S.node(E).rank})),j=[];t.forEach(S.nodes(),function(E){var _=S.node(E).rank-k;j[_]||(j[_]=[]),j[_].push(E)});var N=0,T=S.graph().nodeRankFactor;t.forEach(j,function(E,_){t.isUndefined(E)&&_%T!==0?--N:N&&t.forEach(E,function(M){S.node(M).rank+=N})})}function m(S,k,j,N){var T={width:0,height:0};return arguments.length>=4&&(T.rank=j,T.order=N),n(S,"border",T,k)}function g(S){return t.max(t.map(S.nodes(),function(k){var j=S.node(k).rank;if(!t.isUndefined(j))return j}))}function x(S,k){var j={lhs:[],rhs:[]};return t.forEach(S,function(N){k(N)?j.lhs.push(N):j.rhs.push(N)}),j}function y(S,k){var j=t.now();try{return k()}finally{console.log(S+" time: "+(t.now()-j)+"ms")}}function w(S,k){return k()}return y3}var b3,zP;function D8e(){if(zP)return b3;zP=1;var t=Nr(),e=ji();b3={run:n,undo:s};function n(i){i.graph().dummyChains=[],t.forEach(i.edges(),function(a){r(i,a)})}function r(i,a){var l=a.v,c=i.node(l).rank,d=a.w,h=i.node(d).rank,m=a.name,g=i.edge(a),x=g.labelRank;if(h!==c+1){i.removeEdge(a);var y,w,S;for(S=0,++c;cP.lim&&(L=P,H=!0);var U=t.filter(T.edges(),function(ee){return H===j(N,N.node(ee.v),L)&&H!==j(N,N.node(ee.w),L)});return t.minBy(U,function(ee){return n(T,ee)})}function w(N,T,E,_){var M=E.v,I=E.w;N.removeEdge(M,I),N.setEdge(_.v,_.w,{}),m(N),c(N,T),S(N,T)}function S(N,T){var E=t.find(N.nodes(),function(M){return!T.node(M).parent}),_=s(N,E);_=_.slice(1),t.forEach(_,function(M){var I=N.node(M).parent,P=T.edge(M,I),L=!1;P||(P=T.edge(I,M),L=!0),T.node(M).rank=T.node(I).rank+(L?P.minlen:-P.minlen)})}function k(N,T,E){return N.hasEdge(T,E)}function j(N,T,E){return E.low<=T.lim&&T.lim<=E.lim}return k3}var O3,FP;function z8e(){if(FP)return O3;FP=1;var t=Ey(),e=t.longestPath,n=CG(),r=P8e();O3=s;function s(c){switch(c.graph().ranker){case"network-simplex":l(c);break;case"tight-tree":a(c);break;case"longest-path":i(c);break;default:l(c)}}var i=e;function a(c){e(c),n(c)}function l(c){r(c)}return O3}var j3,qP;function I8e(){if(qP)return j3;qP=1;var t=Nr();j3=e;function e(s){var i=r(s);t.forEach(s.graph().dummyChains,function(a){for(var l=s.node(a),c=l.edgeObj,d=n(s,i,c.v,c.w),h=d.path,m=d.lca,g=0,x=h[g],y=!0;a!==c.w;){if(l=s.node(a),y){for(;(x=h[g])!==m&&s.node(x).maxRankh||m>i[g].lim));for(x=g,g=l;(g=s.parent(g))!==x;)d.push(g);return{path:c.concat(d.reverse()),lca:x}}function r(s){var i={},a=0;function l(c){var d=a;t.forEach(s.children(c),l),i[c]={low:d,lim:a++}}return t.forEach(s.children(),l),i}return j3}var N3,$P;function L8e(){if($P)return N3;$P=1;var t=Nr(),e=ji();N3={run:n,cleanup:a};function n(l){var c=e.addDummyNode(l,"root",{},"_root"),d=s(l),h=t.max(t.values(d))-1,m=2*h+1;l.graph().nestingRoot=c,t.forEach(l.edges(),function(x){l.edge(x).minlen*=m});var g=i(l)+1;t.forEach(l.children(),function(x){r(l,c,m,g,h,d,x)}),l.graph().nodeRankFactor=m}function r(l,c,d,h,m,g,x){var y=l.children(x);if(!y.length){x!==c&&l.setEdge(c,x,{weight:0,minlen:d});return}var w=e.addBorderNode(l,"_bt"),S=e.addBorderNode(l,"_bb"),k=l.node(x);l.setParent(w,x),k.borderTop=w,l.setParent(S,x),k.borderBottom=S,t.forEach(y,function(j){r(l,c,d,h,m,g,j);var N=l.node(j),T=N.borderTop?N.borderTop:j,E=N.borderBottom?N.borderBottom:j,_=N.borderTop?h:2*h,M=T!==E?1:m-g[x]+1;l.setEdge(w,T,{weight:_,minlen:M,nestingEdge:!0}),l.setEdge(E,S,{weight:_,minlen:M,nestingEdge:!0})}),l.parent(x)||l.setEdge(c,w,{weight:0,minlen:m+g[x]})}function s(l){var c={};function d(h,m){var g=l.children(h);g&&g.length&&t.forEach(g,function(x){d(x,m+1)}),c[h]=m}return t.forEach(l.children(),function(h){d(h,1)}),c}function i(l){return t.reduce(l.edges(),function(c,d){return c+l.edge(d).weight},0)}function a(l){var c=l.graph();l.removeNode(c.nestingRoot),delete c.nestingRoot,t.forEach(l.edges(),function(d){var h=l.edge(d);h.nestingEdge&&l.removeEdge(d)})}return N3}var C3,HP;function B8e(){if(HP)return C3;HP=1;var t=Nr(),e=ji();C3=n;function n(s){function i(a){var l=s.children(a),c=s.node(a);if(l.length&&t.forEach(l,i),t.has(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(var d=c.minRank,h=c.maxRank+1;d0;)x%2&&(y+=h[x+1]),x=x-1>>1,h[x]+=g.weight;m+=g.weight*y})),m}return _3}var M3,WP;function H8e(){if(WP)return M3;WP=1;var t=Nr();M3=e;function e(n,r){return t.map(r,function(s){var i=n.inEdges(s);if(i.length){var a=t.reduce(i,function(l,c){var d=n.edge(c),h=n.node(c.v);return{sum:l.sum+d.weight*h.order,weight:l.weight+d.weight}},{sum:0,weight:0});return{v:s,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:s}})}return M3}var A3,GP;function Q8e(){if(GP)return A3;GP=1;var t=Nr();A3=e;function e(s,i){var a={};t.forEach(s,function(c,d){var h=a[c.v]={indegree:0,in:[],out:[],vs:[c.v],i:d};t.isUndefined(c.barycenter)||(h.barycenter=c.barycenter,h.weight=c.weight)}),t.forEach(i.edges(),function(c){var d=a[c.v],h=a[c.w];!t.isUndefined(d)&&!t.isUndefined(h)&&(h.indegree++,d.out.push(a[c.w]))});var l=t.filter(a,function(c){return!c.indegree});return n(l)}function n(s){var i=[];function a(d){return function(h){h.merged||(t.isUndefined(h.barycenter)||t.isUndefined(d.barycenter)||h.barycenter>=d.barycenter)&&r(d,h)}}function l(d){return function(h){h.in.push(d),--h.indegree===0&&s.push(h)}}for(;s.length;){var c=s.pop();i.push(c),t.forEach(c.in.reverse(),a(c)),t.forEach(c.out,l(c))}return t.map(t.filter(i,function(d){return!d.merged}),function(d){return t.pick(d,["vs","i","barycenter","weight"])})}function r(s,i){var a=0,l=0;s.weight&&(a+=s.barycenter*s.weight,l+=s.weight),i.weight&&(a+=i.barycenter*i.weight,l+=i.weight),s.vs=i.vs.concat(s.vs),s.barycenter=a/l,s.weight=l,s.i=Math.min(i.i,s.i),i.merged=!0}return A3}var R3,XP;function V8e(){if(XP)return R3;XP=1;var t=Nr(),e=ji();R3=n;function n(i,a){var l=e.partition(i,function(w){return t.has(w,"barycenter")}),c=l.lhs,d=t.sortBy(l.rhs,function(w){return-w.i}),h=[],m=0,g=0,x=0;c.sort(s(!!a)),x=r(h,d,x),t.forEach(c,function(w){x+=w.vs.length,h.push(w.vs),m+=w.barycenter*w.weight,g+=w.weight,x=r(h,d,x)});var y={vs:t.flatten(h,!0)};return g&&(y.barycenter=m/g,y.weight=g),y}function r(i,a,l){for(var c;a.length&&(c=t.last(a)).i<=l;)a.pop(),i.push(c.vs),l++;return l}function s(i){return function(a,l){return a.barycenterl.barycenter?1:i?l.i-a.i:a.i-l.i}}return R3}var D3,YP;function U8e(){if(YP)return D3;YP=1;var t=Nr(),e=H8e(),n=Q8e(),r=V8e();D3=s;function s(l,c,d,h){var m=l.children(c),g=l.node(c),x=g?g.borderLeft:void 0,y=g?g.borderRight:void 0,w={};x&&(m=t.filter(m,function(E){return E!==x&&E!==y}));var S=e(l,m);t.forEach(S,function(E){if(l.children(E.v).length){var _=s(l,E.v,d,h);w[E.v]=_,t.has(_,"barycenter")&&a(E,_)}});var k=n(S,d);i(k,w);var j=r(k,h);if(x&&(j.vs=t.flatten([x,j.vs,y],!0),l.predecessors(x).length)){var N=l.node(l.predecessors(x)[0]),T=l.node(l.predecessors(y)[0]);t.has(j,"barycenter")||(j.barycenter=0,j.weight=0),j.barycenter=(j.barycenter*j.weight+N.order+T.order)/(j.weight+2),j.weight+=2}return j}function i(l,c){t.forEach(l,function(d){d.vs=t.flatten(d.vs.map(function(h){return c[h]?c[h].vs:h}),!0)})}function a(l,c){t.isUndefined(l.barycenter)?(l.barycenter=c.barycenter,l.weight=c.weight):(l.barycenter=(l.barycenter*l.weight+c.barycenter*c.weight)/(l.weight+c.weight),l.weight+=c.weight)}return D3}var P3,KP;function W8e(){if(KP)return P3;KP=1;var t=Nr(),e=Ja().Graph;P3=n;function n(s,i,a){var l=r(s),c=new e({compound:!0}).setGraph({root:l}).setDefaultNodeLabel(function(d){return s.node(d)});return t.forEach(s.nodes(),function(d){var h=s.node(d),m=s.parent(d);(h.rank===i||h.minRank<=i&&i<=h.maxRank)&&(c.setNode(d),c.setParent(d,m||l),t.forEach(s[a](d),function(g){var x=g.v===d?g.w:g.v,y=c.edge(x,d),w=t.isUndefined(y)?0:y.weight;c.setEdge(x,d,{weight:s.edge(g).weight+w})}),t.has(h,"minRank")&&c.setNode(d,{borderLeft:h.borderLeft[i],borderRight:h.borderRight[i]}))}),c}function r(s){for(var i;s.hasNode(i=t.uniqueId("_root")););return i}return P3}var z3,ZP;function G8e(){if(ZP)return z3;ZP=1;var t=Nr();z3=e;function e(n,r,s){var i={},a;t.forEach(s,function(l){for(var c=n.parent(l),d,h;c;){if(d=n.parent(c),d?(h=i[d],i[d]=c):(h=a,a=c),h&&h!==c){r.setEdge(h,c);return}c=d}})}return z3}var I3,JP;function X8e(){if(JP)return I3;JP=1;var t=Nr(),e=q8e(),n=$8e(),r=U8e(),s=W8e(),i=G8e(),a=Ja().Graph,l=ji();I3=c;function c(g){var x=l.maxRank(g),y=d(g,t.range(1,x+1),"inEdges"),w=d(g,t.range(x-1,-1,-1),"outEdges"),S=e(g);m(g,S);for(var k=Number.POSITIVE_INFINITY,j,N=0,T=0;T<4;++N,++T){h(N%2?y:w,N%4>=2),S=l.buildLayerMatrix(g);var E=n(g,S);EL)&&a(N,ee,H)})})}function E(_,M){var I=-1,P,L=0;return t.forEach(M,function(H,U){if(k.node(H).dummy==="border"){var ee=k.predecessors(H);ee.length&&(P=k.node(ee[0]).order,T(M,L,U,I,P),L=U,I=P)}T(M,L,M.length,P,_.length)}),M}return t.reduce(j,E),N}function i(k,j){if(k.node(j).dummy)return t.find(k.predecessors(j),function(N){return k.node(N).dummy})}function a(k,j,N){if(j>N){var T=j;j=N,N=T}var E=k[j];E||(k[j]=E={}),E[N]=!0}function l(k,j,N){if(j>N){var T=j;j=N,N=T}return t.has(k[j],N)}function c(k,j,N,T){var E={},_={},M={};return t.forEach(j,function(I){t.forEach(I,function(P,L){E[P]=P,_[P]=P,M[P]=L})}),t.forEach(j,function(I){var P=-1;t.forEach(I,function(L){var H=T(L);if(H.length){H=t.sortBy(H,function(B){return M[B]});for(var U=(H.length-1)/2,ee=Math.floor(U),z=Math.ceil(U);ee<=z;++ee){var Q=H[ee];_[L]===L&&Po.jsxs("div",{className:"px-4 py-2 shadow-md rounded-lg bg-gradient-to-br from-blue-500 to-blue-600 border-2 border-blue-700 min-w-[120px]",children:[o.jsx(ru,{type:"target",position:wt.Top}),o.jsx("div",{className:"font-semibold text-white text-sm truncate max-w-[200px]",title:t.content,children:t.label}),o.jsx(ru,{type:"source",position:wt.Bottom})]}));TG.displayName="EntityNode";const EG=b.memo(({data:t})=>o.jsxs("div",{className:"px-3 py-2 shadow-md rounded-md bg-gradient-to-br from-green-500 to-green-600 border-2 border-green-700 min-w-[100px]",children:[o.jsx(ru,{type:"target",position:wt.Top}),o.jsx("div",{className:"font-medium text-white text-xs truncate max-w-[150px]",title:t.content,children:t.label}),o.jsx(ru,{type:"source",position:wt.Bottom})]}));EG.displayName="ParagraphNode";const aTe={entity:TG,paragraph:EG};function oTe(t,e){const n=new az.graphlib.Graph;n.setDefaultEdgeLabel(()=>({})),n.setGraph({rankdir:"TB",ranksep:100,nodesep:80});const r=[],s=[];return t.forEach(i=>{n.setNode(i.id,{width:150,height:50})}),e.forEach(i=>{n.setEdge(i.source,i.target)}),az.layout(n),t.forEach(i=>{const a=n.node(i.id);r.push({id:i.id,type:i.type,position:{x:a.x-75,y:a.y-25},data:{label:i.content.slice(0,20)+(i.content.length>20?"...":""),content:i.content}})}),e.forEach((i,a)=>{const l={id:`edge-${a}`,source:i.source,target:i.target,animated:t.length<=200&&i.weight>5,style:{strokeWidth:Math.min(i.weight/2,5),opacity:.6}};i.weight>10&&t.length<100&&(l.label=`${i.weight.toFixed(0)}`),s.push(l)}),{nodes:r,edges:s}}function lTe(){const t=Zi(),[e,n]=b.useState(!1),[r,s]=b.useState(null),[i,a]=b.useState(""),[l,c]=b.useState("all"),[d,h]=b.useState(50),[m,g]=b.useState("50"),[x,y]=b.useState(!1),[w,S]=b.useState(!0),[k,j]=b.useState(!1),[N,T]=b.useState(!1),[E,_,M]=yCe([]),[I,P,L]=bCe([]),[H,U]=b.useState(0),[ee,z]=b.useState(null),[Q,B]=b.useState(null),{toast:X}=fs(),J=b.useCallback(ne=>ne.type==="entity"?"#6366f1":ne.type==="paragraph"?"#10b981":"#6b7280",[]),G=b.useCallback(async(ne=!1)=>{try{if(!ne&&d>200){T(!0);return}n(!0);const[K,se]=await Promise.all([rTe(d,l),sTe()]);if(s(se),K.nodes.length===0){X({title:"提示",description:"知识库为空,请先导入知识数据"}),_([]),P([]);return}const{nodes:re,edges:oe}=oTe(K.nodes,K.edges);_(re),P(oe),U(re.length),se&&se.total_nodes>d&&X({title:"提示",description:`知识图谱包含 ${se.total_nodes} 个节点,当前显示 ${re.length} 个`}),X({title:"加载成功",description:`已加载 ${re.length} 个节点,${oe.length} 条边`})}catch(K){console.error("加载知识图谱失败:",K),X({title:"加载失败",description:K instanceof Error?K.message:"未知错误",variant:"destructive"})}finally{n(!1)}},[d,l,X]),R=b.useCallback(async()=>{if(!i.trim()){X({title:"提示",description:"请输入搜索关键词"});return}try{const ne=await iTe(i);if(ne.length===0){X({title:"未找到",description:"没有找到匹配的节点"});return}const K=new Set(ne.map(se=>se.id));_(se=>se.map(re=>({...re,style:{...re.style,opacity:K.has(re.id)?1:.3,filter:K.has(re.id)?"brightness(1.2)":"brightness(0.8)"}}))),X({title:"搜索完成",description:`找到 ${ne.length} 个匹配节点`})}catch(ne){console.error("搜索失败:",ne),X({title:"搜索失败",description:ne instanceof Error?ne.message:"未知错误",variant:"destructive"})}},[i,X]),ie=b.useCallback(()=>{_(ne=>ne.map(K=>({...K,style:{...K.style,opacity:1,filter:"brightness(1)"}})))},[]),W=b.useCallback(()=>{S(!1),j(!0),G()},[G]),q=b.useCallback(()=>{T(!1),setTimeout(()=>{G(!0)},0)},[G]),V=b.useCallback((ne,K)=>{E.find(re=>re.id===K.id)&&z({id:K.id,type:K.type,content:K.data.content})},[E]);b.useEffect(()=>{w||k&&G()},[d,l,w,k]);const te=b.useCallback((ne,K)=>{const se=E.find(Te=>Te.id===K.source),re=E.find(Te=>Te.id===K.target),oe=I.find(Te=>Te.id===K.id);se&&re&&oe&&B({source:{id:se.id,type:se.type,content:se.data.content},target:{id:re.id,type:re.type,content:re.data.content},edge:{source:K.source,target:K.target,weight:parseFloat(K.label||"0")}})},[E,I]);return o.jsxs("div",{className:"h-full flex flex-col",children:[o.jsxs("div",{className:"flex-shrink-0 p-4 border-b bg-background",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦知识库图谱"}),o.jsx("p",{className:"text-muted-foreground mt-1",children:"可视化知识实体与关系网络"})]}),r&&o.jsxs("div",{className:"flex gap-2 flex-wrap",children:[o.jsxs(Xn,{variant:"outline",className:"gap-1",children:[o.jsx(G3,{className:"h-3 w-3"}),"节点: ",r.total_nodes]}),o.jsxs(Xn,{variant:"outline",className:"gap-1",children:[o.jsx(gI,{className:"h-3 w-3"}),"边: ",r.total_edges]}),o.jsxs(Xn,{variant:"outline",className:"gap-1",children:[o.jsx(Oa,{className:"h-3 w-3"}),"实体: ",r.entity_nodes]}),o.jsxs(Xn,{variant:"outline",className:"gap-1",children:[o.jsx(Pl,{className:"h-3 w-3"}),"段落: ",r.paragraph_nodes]})]})]}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 mt-4",children:[o.jsxs("div",{className:"flex-1 flex gap-2",children:[o.jsx(ze,{placeholder:"搜索节点内容...",value:i,onChange:ne=>a(ne.target.value),onKeyDown:ne=>ne.key==="Enter"&&R(),className:"flex-1"}),o.jsx(he,{onClick:R,size:"sm",children:o.jsx(Ni,{className:"h-4 w-4"})}),o.jsx(he,{onClick:ie,variant:"outline",size:"sm",children:"重置"})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(Vt,{value:l,onValueChange:ne=>c(ne),children:[o.jsx($t,{className:"w-[120px]",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部节点"}),o.jsx(De,{value:"entity",children:"仅实体"}),o.jsx(De,{value:"paragraph",children:"仅段落"})]})]}),o.jsxs(Vt,{value:d===1e4?"all":x?"custom":d.toString(),onValueChange:ne=>{ne==="custom"?(y(!0),g(d.toString())):ne==="all"?(y(!1),h(1e4)):(y(!1),h(Number(ne)))},children:[o.jsx($t,{className:"w-[120px]",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"50",children:"50 节点"}),o.jsx(De,{value:"100",children:"100 节点"}),o.jsx(De,{value:"200",children:"200 节点"}),o.jsx(De,{value:"500",children:"500 节点"}),o.jsx(De,{value:"1000",children:"1000 节点"}),o.jsx(De,{value:"all",children:"全部 (最多10000)"}),o.jsx(De,{value:"custom",children:"自定义..."})]})]}),x&&o.jsx(ze,{type:"number",min:"50",value:m,onChange:ne=>g(ne.target.value),onBlur:()=>{const ne=parseInt(m);!isNaN(ne)&&ne>=50?h(ne):(g("50"),h(50))},onKeyDown:ne=>{if(ne.key==="Enter"){const K=parseInt(m);!isNaN(K)&&K>=50?h(K):(g("50"),h(50))}},placeholder:"最少50个",className:"w-[120px]"}),o.jsx(he,{onClick:()=>G(),variant:"outline",size:"sm",disabled:e,children:o.jsx(Qs,{className:ve("h-4 w-4",e&&"animate-spin")})})]})]})]}),o.jsx("div",{className:"flex-1 relative",children:e?o.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:o.jsxs("div",{className:"text-center",children:[o.jsx(Qs,{className:"h-8 w-8 animate-spin mx-auto mb-2 text-muted-foreground"}),o.jsx("p",{className:"text-muted-foreground",children:"加载知识图谱中..."})]})}):E.length===0?o.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:o.jsxs("div",{className:"text-center",children:[o.jsx(G3,{className:"h-12 w-12 mx-auto mb-4 text-muted-foreground"}),o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"知识库为空"}),o.jsx("p",{className:"text-muted-foreground",children:"请先导入知识数据"})]})}):o.jsxs(iG,{nodes:E,edges:I,onNodesChange:M,onEdgesChange:L,onNodeClick:V,onEdgeClick:te,nodeTypes:aTe,fitView:!0,minZoom:.05,maxZoom:1.5,defaultViewport:{x:0,y:0,zoom:.5},elevateNodesOnSelect:H<=500,nodesDraggable:H<=1e3,attributionPosition:"bottom-left",children:[o.jsx(HCe,{variant:Ca.Dots,gap:12,size:1}),o.jsx(ICe,{}),H<=500&&o.jsx(_Ce,{nodeColor:J,nodeBorderRadius:8,pannable:!0,zoomable:!0}),o.jsxs(Wb,{position:"top-right",className:"bg-background/95 backdrop-blur-sm rounded-lg border p-3 shadow-lg",children:[o.jsx("div",{className:"text-sm font-semibold mb-2",children:"图例"}),o.jsxs("div",{className:"space-y-2 text-xs",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-blue-500 to-blue-600 border-2 border-blue-700"}),o.jsx("span",{children:"实体节点"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-green-500 to-green-600 border-2 border-green-700"}),o.jsx("span",{children:"段落节点"})]}),H>200&&o.jsxs("div",{className:"mt-2 pt-2 border-t text-yellow-600 dark:text-yellow-500",children:[o.jsx("div",{className:"font-semibold",children:"性能模式"}),o.jsx("div",{children:"已禁用动画"}),H>500&&o.jsx("div",{children:"已禁用缩略图"})]})]})]})]})}),o.jsx(Dr,{open:!!ee,onOpenChange:ne=>!ne&&z(null),children:o.jsxs(Sr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsx(kr,{children:o.jsx(Or,{children:"节点详情"})}),ee&&o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"grid grid-cols-2 gap-4",children:o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"类型"}),o.jsx("div",{className:"mt-1",children:o.jsx(Xn,{variant:ee.type==="entity"?"default":"secondary",children:ee.type==="entity"?"🏷️ 实体":"📄 段落"})})]})}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"ID"}),o.jsx("code",{className:"mt-1 block p-2 bg-muted rounded text-xs break-all",children:ee.id})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"内容"}),o.jsx(wn,{className:"mt-1 h-40 p-3 bg-muted rounded",children:o.jsx("p",{className:"text-sm whitespace-pre-wrap",children:ee.content})})]})]})]})}),o.jsx(Dr,{open:!!Q,onOpenChange:ne=>!ne&&B(null),children:o.jsxs(Sr,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[o.jsx(kr,{children:o.jsx(Or,{children:"边详情"})}),Q&&o.jsx(wn,{className:"flex-1 pr-4",children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("div",{className:"flex-1 min-w-0 p-3 bg-blue-50 dark:bg-blue-950 rounded border-2 border-blue-200 dark:border-blue-800",children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"源节点"}),o.jsx("div",{className:"font-medium text-sm mb-2 truncate",children:Q.source.content}),o.jsxs("code",{className:"text-xs text-muted-foreground truncate block",children:[Q.source.id.slice(0,40),"..."]})]}),o.jsx("div",{className:"text-2xl text-muted-foreground flex-shrink-0",children:"→"}),o.jsxs("div",{className:"flex-1 min-w-0 p-3 bg-green-50 dark:bg-green-950 rounded border-2 border-green-200 dark:border-green-800",children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"目标节点"}),o.jsx("div",{className:"font-medium text-sm mb-2 truncate",children:Q.target.content}),o.jsxs("code",{className:"text-xs text-muted-foreground truncate block",children:[Q.target.id.slice(0,40),"..."]})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"权重"}),o.jsx("div",{className:"mt-1",children:o.jsx(Xn,{variant:"outline",className:"text-base font-mono",children:Q.edge.weight.toFixed(4)})})]})]})})]})}),o.jsx(Dn,{open:w,onOpenChange:S,children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"加载知识图谱"}),o.jsxs(_n,{children:["知识图谱的动态展示会消耗较多系统资源。",o.jsx("br",{}),"确定要加载知识图谱吗?"]})]}),o.jsxs(Tn,{children:[o.jsx(An,{onClick:()=>t({to:"/"}),children:"取消 (返回首页)"}),o.jsx(Mn,{onClick:W,children:"确认加载"})]})]})}),o.jsx(Dn,{open:N,onOpenChange:T,children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"⚠️ 节点数量较多"}),o.jsx(_n,{asChild:!0,children:o.jsxs("div",{children:[o.jsxs("p",{children:["您正在尝试加载 ",o.jsx("strong",{className:"text-orange-600",children:d>=1e4?"全部 (最多10000个)":d})," 个节点。"]}),o.jsx("p",{className:"mt-4",children:"节点数量过多可能导致:"}),o.jsxs("ul",{className:"list-disc list-inside mt-2 space-y-1",children:[o.jsx("li",{children:"页面加载时间较长"}),o.jsx("li",{children:"浏览器卡顿或崩溃"}),o.jsx("li",{children:"系统资源占用过高"})]}),o.jsx("p",{className:"mt-4",children:"建议先选择较少的节点数量 (50-200 个)。"})]})})]}),o.jsxs(Tn,{children:[o.jsx(An,{onClick:()=>{T(!1),d>200&&(h(50),y(!1))},children:"取消"}),o.jsx(Mn,{onClick:q,className:"bg-orange-600 hover:bg-orange-700",children:"我了解风险,继续加载"})]})]})})]})}function mh(t,e,n){let r=n.initialDeps??[],s;function i(){var a,l,c,d;let h;n.key&&((a=n.debug)!=null&&a.call(n))&&(h=Date.now());const m=t();if(!(m.length!==r.length||m.some((y,w)=>r[w]!==y)))return s;r=m;let x;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(x=Date.now()),s=e(...m),n.key&&((c=n.debug)!=null&&c.call(n))){const y=Math.round((Date.now()-h)*100)/100,w=Math.round((Date.now()-x)*100)/100,S=w/16,k=(j,N)=>{for(j=String(j);j.length0;)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,n,r){if(r===void 0&&(r=!1),r){for(var s=0;s0&&(this.undefStack[this.undefStack.length-1][e]=n)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}n==null?delete this.current[e]:this.current[e]=n}}var vke=NU;Z("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});Z("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});Z("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});Z("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});Z("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var n=t.future();return e[0].length===1&&e[0][0].text===n.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});Z("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");Z("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var FR={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};Z("\\char",function(t){var e=t.popToken(),n,r="";if(e.text==="'")n=8,e=t.popToken();else if(e.text==='"')n=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")r=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new $e("\\char` missing argument");r=e.text.charCodeAt(0)}else n=10;if(n){if(r=FR[e.text],r==null||r>=n)throw new $e("Invalid base-"+n+" digit "+e.text);for(var s;(s=FR[t.future().text])!=null&&s{var s=t.consumeArg().tokens;if(s.length!==1)throw new $e("\\newcommand's first argument must be a macro name");var i=s[0].text,a=t.isDefined(i);if(a&&!e)throw new $e("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!n)throw new $e("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var l=0;if(s=t.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var c="",d=t.expandNextToken();d.text!=="]"&&d.text!=="EOF";)c+=d.text,d=t.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new $e("Invalid number of arguments: "+c);l=parseInt(c),s=t.consumeArg().tokens}return a&&r||t.macros.set(i,{tokens:s,numArgs:l}),""};Z("\\newcommand",t=>FN(t,!1,!0,!1));Z("\\renewcommand",t=>FN(t,!0,!1,!1));Z("\\providecommand",t=>FN(t,!0,!0,!0));Z("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(n=>n.text).join("")),""});Z("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(n=>n.text).join("")),""});Z("\\show",t=>{var e=t.popToken(),n=e.text;return console.log(e,t.macros.get(n),qc[n],dr.math[n],dr.text[n]),""});Z("\\bgroup","{");Z("\\egroup","}");Z("~","\\nobreakspace");Z("\\lq","`");Z("\\rq","'");Z("\\aa","\\r a");Z("\\AA","\\r A");Z("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");Z("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");Z("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");Z("ℬ","\\mathscr{B}");Z("ℰ","\\mathscr{E}");Z("ℱ","\\mathscr{F}");Z("ℋ","\\mathscr{H}");Z("ℐ","\\mathscr{I}");Z("ℒ","\\mathscr{L}");Z("ℳ","\\mathscr{M}");Z("ℛ","\\mathscr{R}");Z("ℭ","\\mathfrak{C}");Z("ℌ","\\mathfrak{H}");Z("ℨ","\\mathfrak{Z}");Z("\\Bbbk","\\Bbb{k}");Z("·","\\cdotp");Z("\\llap","\\mathllap{\\textrm{#1}}");Z("\\rlap","\\mathrlap{\\textrm{#1}}");Z("\\clap","\\mathclap{\\textrm{#1}}");Z("\\mathstrut","\\vphantom{(}");Z("\\underbar","\\underline{\\text{#1}}");Z("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');Z("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");Z("\\ne","\\neq");Z("≠","\\neq");Z("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");Z("∉","\\notin");Z("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");Z("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");Z("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");Z("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");Z("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");Z("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");Z("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");Z("⟂","\\perp");Z("‼","\\mathclose{!\\mkern-0.8mu!}");Z("∌","\\notni");Z("⌜","\\ulcorner");Z("⌝","\\urcorner");Z("⌞","\\llcorner");Z("⌟","\\lrcorner");Z("©","\\copyright");Z("®","\\textregistered");Z("️","\\textregistered");Z("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');Z("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');Z("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');Z("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');Z("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");Z("⋮","\\vdots");Z("\\varGamma","\\mathit{\\Gamma}");Z("\\varDelta","\\mathit{\\Delta}");Z("\\varTheta","\\mathit{\\Theta}");Z("\\varLambda","\\mathit{\\Lambda}");Z("\\varXi","\\mathit{\\Xi}");Z("\\varPi","\\mathit{\\Pi}");Z("\\varSigma","\\mathit{\\Sigma}");Z("\\varUpsilon","\\mathit{\\Upsilon}");Z("\\varPhi","\\mathit{\\Phi}");Z("\\varPsi","\\mathit{\\Psi}");Z("\\varOmega","\\mathit{\\Omega}");Z("\\substack","\\begin{subarray}{c}#1\\end{subarray}");Z("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");Z("\\boxed","\\fbox{$\\displaystyle{#1}$}");Z("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");Z("\\implies","\\DOTSB\\;\\Longrightarrow\\;");Z("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");Z("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");Z("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var qR={",":"\\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"};Z("\\dots",function(t){var e="\\dotso",n=t.expandAfterFuture().text;return n in qR?e=qR[n]:(n.slice(0,4)==="\\not"||n in dr.math&&["bin","rel"].includes(dr.math[n].group))&&(e="\\dotsb"),e});var qN={")":!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};Z("\\dotso",function(t){var e=t.future().text;return e in qN?"\\ldots\\,":"\\ldots"});Z("\\dotsc",function(t){var e=t.future().text;return e in qN&&e!==","?"\\ldots\\,":"\\ldots"});Z("\\cdots",function(t){var e=t.future().text;return e in qN?"\\@cdots\\,":"\\@cdots"});Z("\\dotsb","\\cdots");Z("\\dotsm","\\cdots");Z("\\dotsi","\\!\\cdots");Z("\\dotsx","\\ldots\\,");Z("\\DOTSI","\\relax");Z("\\DOTSB","\\relax");Z("\\DOTSX","\\relax");Z("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");Z("\\,","\\tmspace+{3mu}{.1667em}");Z("\\thinspace","\\,");Z("\\>","\\mskip{4mu}");Z("\\:","\\tmspace+{4mu}{.2222em}");Z("\\medspace","\\:");Z("\\;","\\tmspace+{5mu}{.2777em}");Z("\\thickspace","\\;");Z("\\!","\\tmspace-{3mu}{.1667em}");Z("\\negthinspace","\\!");Z("\\negmedspace","\\tmspace-{4mu}{.2222em}");Z("\\negthickspace","\\tmspace-{5mu}{.277em}");Z("\\enspace","\\kern.5em ");Z("\\enskip","\\hskip.5em\\relax");Z("\\quad","\\hskip1em\\relax");Z("\\qquad","\\hskip2em\\relax");Z("\\tag","\\@ifstar\\tag@literal\\tag@paren");Z("\\tag@paren","\\tag@literal{({#1})}");Z("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new $e("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});Z("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");Z("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");Z("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");Z("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");Z("\\newline","\\\\\\relax");Z("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var LU=Xe(_o["Main-Regular"][84][1]-.7*_o["Main-Regular"][65][1]);Z("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+LU+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");Z("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+LU+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");Z("\\hspace","\\@ifstar\\@hspacer\\@hspace");Z("\\@hspace","\\hskip #1\\relax");Z("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");Z("\\ordinarycolon",":");Z("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");Z("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');Z("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');Z("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');Z("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');Z("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');Z("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');Z("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');Z("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');Z("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');Z("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');Z("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');Z("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');Z("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');Z("∷","\\dblcolon");Z("∹","\\eqcolon");Z("≔","\\coloneqq");Z("≕","\\eqqcolon");Z("⩴","\\Coloneqq");Z("\\ratio","\\vcentcolon");Z("\\coloncolon","\\dblcolon");Z("\\colonequals","\\coloneqq");Z("\\coloncolonequals","\\Coloneqq");Z("\\equalscolon","\\eqqcolon");Z("\\equalscoloncolon","\\Eqqcolon");Z("\\colonminus","\\coloneq");Z("\\coloncolonminus","\\Coloneq");Z("\\minuscolon","\\eqcolon");Z("\\minuscoloncolon","\\Eqcolon");Z("\\coloncolonapprox","\\Colonapprox");Z("\\coloncolonsim","\\Colonsim");Z("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");Z("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");Z("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");Z("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");Z("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");Z("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");Z("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");Z("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");Z("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");Z("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");Z("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");Z("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");Z("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");Z("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");Z("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");Z("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");Z("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");Z("\\nleqq","\\html@mathml{\\@nleqq}{≰}");Z("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");Z("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");Z("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");Z("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");Z("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");Z("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");Z("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");Z("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");Z("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");Z("\\imath","\\html@mathml{\\@imath}{ı}");Z("\\jmath","\\html@mathml{\\@jmath}{ȷ}");Z("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");Z("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");Z("⟦","\\llbracket");Z("⟧","\\rrbracket");Z("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");Z("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");Z("⦃","\\lBrace");Z("⦄","\\rBrace");Z("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");Z("⦵","\\minuso");Z("\\darr","\\downarrow");Z("\\dArr","\\Downarrow");Z("\\Darr","\\Downarrow");Z("\\lang","\\langle");Z("\\rang","\\rangle");Z("\\uarr","\\uparrow");Z("\\uArr","\\Uparrow");Z("\\Uarr","\\Uparrow");Z("\\N","\\mathbb{N}");Z("\\R","\\mathbb{R}");Z("\\Z","\\mathbb{Z}");Z("\\alef","\\aleph");Z("\\alefsym","\\aleph");Z("\\Alpha","\\mathrm{A}");Z("\\Beta","\\mathrm{B}");Z("\\bull","\\bullet");Z("\\Chi","\\mathrm{X}");Z("\\clubs","\\clubsuit");Z("\\cnums","\\mathbb{C}");Z("\\Complex","\\mathbb{C}");Z("\\Dagger","\\ddagger");Z("\\diamonds","\\diamondsuit");Z("\\empty","\\emptyset");Z("\\Epsilon","\\mathrm{E}");Z("\\Eta","\\mathrm{H}");Z("\\exist","\\exists");Z("\\harr","\\leftrightarrow");Z("\\hArr","\\Leftrightarrow");Z("\\Harr","\\Leftrightarrow");Z("\\hearts","\\heartsuit");Z("\\image","\\Im");Z("\\infin","\\infty");Z("\\Iota","\\mathrm{I}");Z("\\isin","\\in");Z("\\Kappa","\\mathrm{K}");Z("\\larr","\\leftarrow");Z("\\lArr","\\Leftarrow");Z("\\Larr","\\Leftarrow");Z("\\lrarr","\\leftrightarrow");Z("\\lrArr","\\Leftrightarrow");Z("\\Lrarr","\\Leftrightarrow");Z("\\Mu","\\mathrm{M}");Z("\\natnums","\\mathbb{N}");Z("\\Nu","\\mathrm{N}");Z("\\Omicron","\\mathrm{O}");Z("\\plusmn","\\pm");Z("\\rarr","\\rightarrow");Z("\\rArr","\\Rightarrow");Z("\\Rarr","\\Rightarrow");Z("\\real","\\Re");Z("\\reals","\\mathbb{R}");Z("\\Reals","\\mathbb{R}");Z("\\Rho","\\mathrm{P}");Z("\\sdot","\\cdot");Z("\\sect","\\S");Z("\\spades","\\spadesuit");Z("\\sub","\\subset");Z("\\sube","\\subseteq");Z("\\supe","\\supseteq");Z("\\Tau","\\mathrm{T}");Z("\\thetasym","\\vartheta");Z("\\weierp","\\wp");Z("\\Zeta","\\mathrm{Z}");Z("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");Z("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");Z("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");Z("\\bra","\\mathinner{\\langle{#1}|}");Z("\\ket","\\mathinner{|{#1}\\rangle}");Z("\\braket","\\mathinner{\\langle{#1}\\rangle}");Z("\\Bra","\\left\\langle#1\\right|");Z("\\Ket","\\left|#1\\right\\rangle");var BU=t=>e=>{var n=e.consumeArg().tokens,r=e.consumeArg().tokens,s=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.macros.get("|"),l=e.macros.get("\\|");e.macros.beginGroup();var c=m=>g=>{t&&(g.macros.set("|",a),s.length&&g.macros.set("\\|",l));var x=m;if(!m&&s.length){var y=g.future();y.text==="|"&&(g.popToken(),x=!0)}return{tokens:x?s:r,numArgs:0}};e.macros.set("|",c(!1)),s.length&&e.macros.set("\\|",c(!0));var d=e.consumeArg().tokens,h=e.expandTokens([...i,...d,...n]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};Z("\\bra@ket",BU(!1));Z("\\bra@set",BU(!0));Z("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");Z("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");Z("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");Z("\\angln","{\\angl n}");Z("\\blue","\\textcolor{##6495ed}{#1}");Z("\\orange","\\textcolor{##ffa500}{#1}");Z("\\pink","\\textcolor{##ff00af}{#1}");Z("\\red","\\textcolor{##df0030}{#1}");Z("\\green","\\textcolor{##28ae7b}{#1}");Z("\\gray","\\textcolor{gray}{#1}");Z("\\purple","\\textcolor{##9d38bd}{#1}");Z("\\blueA","\\textcolor{##ccfaff}{#1}");Z("\\blueB","\\textcolor{##80f6ff}{#1}");Z("\\blueC","\\textcolor{##63d9ea}{#1}");Z("\\blueD","\\textcolor{##11accd}{#1}");Z("\\blueE","\\textcolor{##0c7f99}{#1}");Z("\\tealA","\\textcolor{##94fff5}{#1}");Z("\\tealB","\\textcolor{##26edd5}{#1}");Z("\\tealC","\\textcolor{##01d1c1}{#1}");Z("\\tealD","\\textcolor{##01a995}{#1}");Z("\\tealE","\\textcolor{##208170}{#1}");Z("\\greenA","\\textcolor{##b6ffb0}{#1}");Z("\\greenB","\\textcolor{##8af281}{#1}");Z("\\greenC","\\textcolor{##74cf70}{#1}");Z("\\greenD","\\textcolor{##1fab54}{#1}");Z("\\greenE","\\textcolor{##0d923f}{#1}");Z("\\goldA","\\textcolor{##ffd0a9}{#1}");Z("\\goldB","\\textcolor{##ffbb71}{#1}");Z("\\goldC","\\textcolor{##ff9c39}{#1}");Z("\\goldD","\\textcolor{##e07d10}{#1}");Z("\\goldE","\\textcolor{##a75a05}{#1}");Z("\\redA","\\textcolor{##fca9a9}{#1}");Z("\\redB","\\textcolor{##ff8482}{#1}");Z("\\redC","\\textcolor{##f9685d}{#1}");Z("\\redD","\\textcolor{##e84d39}{#1}");Z("\\redE","\\textcolor{##bc2612}{#1}");Z("\\maroonA","\\textcolor{##ffbde0}{#1}");Z("\\maroonB","\\textcolor{##ff92c6}{#1}");Z("\\maroonC","\\textcolor{##ed5fa6}{#1}");Z("\\maroonD","\\textcolor{##ca337c}{#1}");Z("\\maroonE","\\textcolor{##9e034e}{#1}");Z("\\purpleA","\\textcolor{##ddd7ff}{#1}");Z("\\purpleB","\\textcolor{##c6b9fc}{#1}");Z("\\purpleC","\\textcolor{##aa87ff}{#1}");Z("\\purpleD","\\textcolor{##7854ab}{#1}");Z("\\purpleE","\\textcolor{##543b78}{#1}");Z("\\mintA","\\textcolor{##f5f9e8}{#1}");Z("\\mintB","\\textcolor{##edf2df}{#1}");Z("\\mintC","\\textcolor{##e0e5cc}{#1}");Z("\\grayA","\\textcolor{##f6f7f7}{#1}");Z("\\grayB","\\textcolor{##f0f1f2}{#1}");Z("\\grayC","\\textcolor{##e3e5e6}{#1}");Z("\\grayD","\\textcolor{##d6d8da}{#1}");Z("\\grayE","\\textcolor{##babec2}{#1}");Z("\\grayF","\\textcolor{##888d93}{#1}");Z("\\grayG","\\textcolor{##626569}{#1}");Z("\\grayH","\\textcolor{##3b3e40}{#1}");Z("\\grayI","\\textcolor{##21242c}{#1}");Z("\\kaBlue","\\textcolor{##314453}{#1}");Z("\\kaGreen","\\textcolor{##71B307}{#1}");var FU={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class yke{constructor(e,n,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=n,this.expansionCount=0,this.feed(e),this.macros=new xke(vke,n.macros),this.mode=r,this.stack=[]}feed(e){this.lexer=new BR(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 n,r,s;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:n,end:r}=this.consumeArg());return this.pushToken(new Xi("EOF",r.loc)),this.pushTokens(s),new Xi("",pi.range(n,r))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var n=[],r=e&&e.length>0;r||this.consumeSpaces();var s=this.future(),i,a=0,l=0;do{if(i=this.popToken(),n.push(i),i.text==="{")++a;else if(i.text==="}"){if(--a,a===-1)throw new $e("Extra }",i)}else if(i.text==="EOF")throw new $e("Unexpected end of input in a macro argument, expected '"+(e&&r?e[l]:"}")+"'",i);if(e&&r)if((a===0||a===1&&e[l]==="{")&&i.text===e[l]){if(++l,l===e.length){n.splice(-l,l);break}}else l=0}while(a!==0||r);return s.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:s,end:i}}consumeArgs(e,n){if(n){if(n.length!==e+1)throw new $e("The length of delimiters doesn't match the number of args!");for(var r=n[0],s=0;sthis.settings.maxExpand)throw new $e("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var n=this.popToken(),r=n.text,s=n.noexpand?null:this._getExpansion(r);if(s==null||e&&s.unexpandable){if(e&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new $e("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var i=s.tokens,a=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var l=i.length-1;l>=0;--l){var c=i[l];if(c.text==="#"){if(l===0)throw new $e("Incomplete placeholder at end of macro body",c);if(c=i[--l],c.text==="#")i.splice(l+1,1);else if(/^[1-9]$/.test(c.text))i.splice(l,2,...a[+c.text-1]);else throw new $e("Not a valid argument number",c)}}}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 Xi(e)]):void 0}expandTokens(e){var n=[],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),n.push(s)}return this.countExpansion(n.length),n}expandMacroAsText(e){var n=this.expandMacro(e);return n&&n.map(r=>r.text).join("")}_getExpansion(e){var n=this.macros.get(e);if(n==null)return n;if(e.length===1){var r=this.lexer.catcodes[e];if(r!=null&&r!==13)return}var s=typeof n=="function"?n(this):n;if(typeof s=="string"){var i=0;if(s.indexOf("#")!==-1)for(var a=s.replace(/##/g,"");a.indexOf("#"+(i+1))!==-1;)++i;for(var l=new BR(s,this.settings),c=[],d=l.lex();d.text!=="EOF";)c.push(d),d=l.lex();c.reverse();var h={tokens:c,numArgs:i};return h}return s}isDefined(e){return this.macros.has(e)||qc.hasOwnProperty(e)||dr.math.hasOwnProperty(e)||dr.text.hasOwnProperty(e)||FU.hasOwnProperty(e)}isExpandable(e){var n=this.macros.get(e);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:qc.hasOwnProperty(e)&&!qc[e].primitive}}var $R=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,B1=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),i5={"́":{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"}},HR={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Wb{constructor(e,n){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 yke(e,n,this.mode),this.settings=n,this.leftrightDepth=0}expect(e,n){if(n===void 0&&(n=!0),this.fetch().text!==e)throw new $e("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());n&&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 n=this.nextToken;this.consume(),this.gullet.pushToken(new Xi("}")),this.gullet.pushTokens(e);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(e,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(Wb.endOfExpression.indexOf(s.text)!==-1||n&&s.text===n||e&&qc[s.text]&&qc[s.text].infix)break;var i=this.parseAtom(n);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 n=-1,r,s=0;s=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',e);var l=dr[this.mode][n].group,c=pi.range(e),d;if(o3e.hasOwnProperty(l)){var h=l;d={type:"atom",mode:this.mode,family:h,loc:c,text:n}}else d={type:l,mode:this.mode,loc:c,text:n};a=d}else if(n.charCodeAt(0)>=128)this.settings.strict&&(XV(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),e)),a={type:"textord",mode:"text",loc:pi.range(e),text:n};else return null;if(this.consume(),i)for(var m=0;md&&(d=h):h&&(d!==void 0&&d>-1&&c.push(` +`.repeat(d)||" "),d=-1,c.push(h))}return c.join("")}function WU(t,e,n){return t.type==="element"?Yke(t,e,n):t.type==="text"?n.whitespace==="normal"?GU(t,n):Kke(t):[]}function Yke(t,e,n){const r=XU(t,n),s=t.children||[];let i=-1,a=[];if(Gke(t))return a;let l,c;for(GO(t)||ZR(t)&&GR(e,t,ZR)?c=` +`:Wke(t)?(l=2,c=2):UU(t)&&(l=1,c=1);++i{try{i(!0);const Oe=await oOe({page:a,page_size:h,is_registered:g==="all"?void 0:g==="registered",is_banned:y==="all"?void 0:y==="banned",format:S==="all"?void 0:S,sort_by:j,sort_order:T});e(Oe.data),d(Oe.total)}catch(Oe){const Ve=Oe instanceof Error?Oe.message:"加载表情包列表失败";G({title:"错误",description:Ve,variant:"destructive"})}finally{i(!1)}},[a,h,g,y,S,j,T,G]),V=async()=>{try{const Oe=await dOe();r(Oe.data)}catch(Oe){console.error("加载统计数据失败:",Oe)}};b.useEffect(()=>{I()},[I]),b.useEffect(()=>{V()},[]);const ee=async Oe=>{try{const Ve=await lOe(Oe.id);A(Ve.data),P(!0)}catch(Ve){const Ue=Ve instanceof Error?Ve.message:"加载详情失败";G({title:"错误",description:Ue,variant:"destructive"})}},ne=Oe=>{A(Oe),$(!0)},W=Oe=>{A(Oe),te(!0)},se=async()=>{if(_)try{await uOe(_.id),G({title:"成功",description:"表情包已删除"}),te(!1),A(null),I(),V()}catch(Oe){const Ve=Oe instanceof Error?Oe.message:"删除失败";G({title:"错误",description:Ve,variant:"destructive"})}},re=async Oe=>{try{await hOe(Oe.id),G({title:"成功",description:"表情包已注册"}),I(),V()}catch(Ve){const Ue=Ve instanceof Error?Ve.message:"注册失败";G({title:"错误",description:Ue,variant:"destructive"})}},oe=async Oe=>{try{await fOe(Oe.id),G({title:"成功",description:"表情包已封禁"}),I(),V()}catch(Ve){const Ue=Ve instanceof Error?Ve.message:"封禁失败";G({title:"错误",description:Ue,variant:"destructive"})}},Te=Oe=>{const Ve=new Set(z);Ve.has(Oe)?Ve.delete(Oe):Ve.add(Oe),Q(Ve)},We=async()=>{try{const Oe=await mOe(Array.from(z));G({title:"批量删除完成",description:Oe.message}),Q(new Set),Y(!1),I(),V()}catch(Oe){G({title:"批量删除失败",description:Oe instanceof Error?Oe.message:"批量删除失败",variant:"destructive"})}},Ye=()=>{const Oe=parseInt(J),Ve=Math.ceil(c/h);Oe>=1&&Oe<=Ve?(l(Oe),X("")):G({title:"无效的页码",description:`请输入1-${Ve}之间的页码`,variant:"destructive"})},Je=n?.formats?Object.keys(n.formats):[];return o.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[o.jsxs("div",{className:"mb-4 sm:mb-6",children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"表情包管理"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理麦麦的表情包资源"})]}),o.jsx(gn,{className:"flex-1",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[n&&o.jsxs("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:[o.jsx(qt,{children:o.jsxs(Fn,{className:"pb-2",children:[o.jsx(ts,{children:"总数"}),o.jsx(qn,{className:"text-2xl",children:n.total})]})}),o.jsx(qt,{children:o.jsxs(Fn,{className:"pb-2",children:[o.jsx(ts,{children:"已注册"}),o.jsx(qn,{className:"text-2xl text-green-600",children:n.registered})]})}),o.jsx(qt,{children:o.jsxs(Fn,{className:"pb-2",children:[o.jsx(ts,{children:"已封禁"}),o.jsx(qn,{className:"text-2xl text-red-600",children:n.banned})]})}),o.jsx(qt,{children:o.jsxs(Fn,{className:"pb-2",children:[o.jsx(ts,{children:"未注册"}),o.jsx(qn,{className:"text-2xl text-gray-600",children:n.unregistered})]})})]}),o.jsxs(qt,{children:[o.jsx(Fn,{children:o.jsxs(qn,{className:"flex items-center gap-2",children:[o.jsx(sk,{className:"h-5 w-5"}),"筛选和排序"]})}),o.jsxs(Gn,{className:"space-y-4",children:[o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:"排序方式"}),o.jsxs(Vt,{value:`${j}-${T}`,onValueChange:Oe=>{const[Ve,Ue]=Oe.split("-");N(Ve),E(Ue),l(1)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"usage_count-desc",children:"使用次数 (多→少)"}),o.jsx(De,{value:"usage_count-asc",children:"使用次数 (少→多)"}),o.jsx(De,{value:"register_time-desc",children:"注册时间 (新→旧)"}),o.jsx(De,{value:"register_time-asc",children:"注册时间 (旧→新)"}),o.jsx(De,{value:"record_time-desc",children:"记录时间 (新→旧)"}),o.jsx(De,{value:"record_time-asc",children:"记录时间 (旧→新)"}),o.jsx(De,{value:"last_used_time-desc",children:"最后使用 (新→旧)"}),o.jsx(De,{value:"last_used_time-asc",children:"最后使用 (旧→新)"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:"注册状态"}),o.jsxs(Vt,{value:g,onValueChange:Oe=>{x(Oe),l(1)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部"}),o.jsx(De,{value:"registered",children:"已注册"}),o.jsx(De,{value:"unregistered",children:"未注册"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:"封禁状态"}),o.jsxs(Vt,{value:y,onValueChange:Oe=>{w(Oe),l(1)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部"}),o.jsx(De,{value:"banned",children:"已封禁"}),o.jsx(De,{value:"unbanned",children:"未封禁"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:"格式"}),o.jsxs(Vt,{value:S,onValueChange:Oe=>{k(Oe),l(1)},children:[o.jsx($t,{children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部"}),Je.map(Oe=>o.jsxs(De,{value:Oe,children:[Oe.toUpperCase()," (",n?.formats[Oe],")"]},Oe))]})]})]})]}),o.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 pt-4 border-t",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[z.size>0&&o.jsxs("span",{className:"text-sm text-muted-foreground",children:["已选择 ",z.size," 个表情包"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{className:"text-sm whitespace-nowrap",children:"卡片大小"}),o.jsxs(Vt,{value:R,onValueChange:Oe=>ie(Oe),children:[o.jsx($t,{className:"w-24",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"small",children:"小"}),o.jsx(De,{value:"medium",children:"中"}),o.jsx(De,{value:"large",children:"大"})]})]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{htmlFor:"emoji-page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),o.jsxs(Vt,{value:h.toString(),onValueChange:Oe=>{m(parseInt(Oe)),l(1),Q(new Set)},children:[o.jsx($t,{id:"emoji-page-size",className:"w-20",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"20",children:"20"}),o.jsx(De,{value:"40",children:"40"}),o.jsx(De,{value:"60",children:"60"}),o.jsx(De,{value:"100",children:"100"})]})]}),z.size>0&&o.jsxs(o.Fragment,{children:[o.jsx(de,{variant:"outline",size:"sm",onClick:()=>Q(new Set),children:"取消选择"}),o.jsxs(de,{variant:"destructive",size:"sm",onClick:()=>Y(!0),children:[o.jsx(Sn,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]}),o.jsx("div",{className:"flex justify-end pt-4 border-t",children:o.jsxs(de,{variant:"outline",size:"sm",onClick:I,disabled:s,children:[o.jsx(Ps,{className:`h-4 w-4 mr-2 ${s?"animate-spin":""}`}),"刷新"]})})]})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{children:[o.jsx(qn,{children:"表情包列表"}),o.jsxs(ts,{children:["共 ",c," 个表情包,当前第 ",a," 页"]})]}),o.jsxs(Gn,{children:[t.length===0?o.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"暂无数据"}):o.jsx("div",{className:`grid gap-3 ${R==="small"?"grid-cols-3 sm:grid-cols-4 md:grid-cols-6 lg:grid-cols-8 xl:grid-cols-10":R==="medium"?"grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 xl:grid-cols-8":"grid-cols-2 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5"}`,children:t.map(Oe=>o.jsxs("div",{className:`group relative rounded-lg border bg-card overflow-hidden hover:ring-2 hover:ring-primary transition-all cursor-pointer ${z.has(Oe.id)?"ring-2 ring-primary bg-primary/5":""}`,onClick:()=>Te(Oe.id),children:[o.jsx("div",{className:`absolute top-1 left-1 z-10 transition-opacity ${z.has(Oe.id)?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:o.jsx("div",{className:`w-5 h-5 rounded-full border-2 flex items-center justify-center ${z.has(Oe.id)?"bg-primary border-primary text-primary-foreground":"bg-background/80 border-muted-foreground/50"}`,children:z.has(Oe.id)&&o.jsx(Vc,{className:"h-3 w-3"})})}),o.jsxs("div",{className:"absolute top-1 right-1 z-10 flex flex-col gap-0.5",children:[Oe.is_registered&&o.jsx(Xn,{variant:"default",className:"bg-green-600 text-[10px] px-1 py-0",children:"已注册"}),Oe.is_banned&&o.jsx(Xn,{variant:"destructive",className:"text-[10px] px-1 py-0",children:"已封禁"})]}),o.jsx("div",{className:`aspect-square bg-muted flex items-center justify-center overflow-hidden ${R==="small"?"p-1":R==="medium"?"p-2":"p-3"}`,children:o.jsx("img",{src:YU(Oe.id),alt:"表情包",className:"w-full h-full object-contain",loading:"lazy",onError:Ve=>{const Ue=Ve.target;Ue.style.display="none";const He=Ue.parentElement;He&&(He.innerHTML='')}})}),o.jsxs("div",{className:`border-t bg-card ${R==="small"?"p-1":"p-2"}`,children:[o.jsxs("div",{className:"flex items-center justify-between gap-1 text-xs text-muted-foreground mb-1",children:[o.jsx(Xn,{variant:"outline",className:"text-[10px] px-1 py-0",children:Oe.format.toUpperCase()}),o.jsxs("span",{className:"font-mono",children:[Oe.usage_count,"次"]})]}),o.jsxs("div",{className:`flex gap-1 justify-center opacity-0 group-hover:opacity-100 transition-opacity ${R==="small"?"flex-wrap":""}`,children:[o.jsx(de,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:Ve=>{Ve.stopPropagation(),ne(Oe)},title:"编辑",children:o.jsx(z0,{className:"h-3 w-3"})}),o.jsx(de,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:Ve=>{Ve.stopPropagation(),ee(Oe)},title:"详情",children:o.jsx(Oa,{className:"h-3 w-3"})}),!Oe.is_registered&&o.jsx(de,{variant:"ghost",size:"icon",className:"h-6 w-6 text-green-600 hover:text-green-700",onClick:Ve=>{Ve.stopPropagation(),re(Oe)},title:"注册",children:o.jsx(Vc,{className:"h-3 w-3"})}),!Oe.is_banned&&o.jsx(de,{variant:"ghost",size:"icon",className:"h-6 w-6 text-orange-600 hover:text-orange-700",onClick:Ve=>{Ve.stopPropagation(),oe(Oe)},title:"封禁",children:o.jsx(Jee,{className:"h-3 w-3"})}),o.jsx(de,{variant:"ghost",size:"icon",className:"h-6 w-6 text-red-600 hover:text-red-700",onClick:Ve=>{Ve.stopPropagation(),W(Oe)},title:"删除",children:o.jsx(Sn,{className:"h-3 w-3"})})]})]})]},Oe.id))}),c>0&&o.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[o.jsxs("div",{className:"text-sm text-muted-foreground",children:["显示 ",(a-1)*h+1," 到"," ",Math.min(a*h,c)," 条,共 ",c," 条"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(de,{variant:"outline",size:"sm",onClick:()=>l(1),disabled:a===1,className:"hidden sm:flex",children:o.jsx(Ap,{className:"h-4 w-4"})}),o.jsxs(de,{variant:"outline",size:"sm",onClick:()=>l(Oe=>Math.max(1,Oe-1)),disabled:a===1,children:[o.jsx(vd,{className:"h-4 w-4 sm:mr-1"}),o.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ze,{type:"number",value:J,onChange:Oe=>X(Oe.target.value),onKeyDown:Oe=>Oe.key==="Enter"&&Ye(),placeholder:a.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(c/h)}),o.jsx(de,{variant:"outline",size:"sm",onClick:Ye,disabled:!J,className:"h-8",children:"跳转"})]}),o.jsxs(de,{variant:"outline",size:"sm",onClick:()=>l(Oe=>Oe+1),disabled:a>=Math.ceil(c/h),children:[o.jsx("span",{className:"hidden sm:inline",children:"下一页"}),o.jsx(yd,{className:"h-4 w-4 sm:ml-1"})]}),o.jsx(de,{variant:"outline",size:"sm",onClick:()=>l(Math.ceil(c/h)),disabled:a>=Math.ceil(c/h),className:"hidden sm:flex",children:o.jsx(Mp,{className:"h-4 w-4"})})]})]})]})]}),o.jsx(gOe,{emoji:_,open:L,onOpenChange:P}),o.jsx(xOe,{emoji:_,open:B,onOpenChange:$,onSuccess:()=>{I(),V()}})]})}),o.jsx(Dn,{open:F,onOpenChange:Y,children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认批量删除"}),o.jsxs(_n,{children:["你确定要删除选中的 ",z.size," 个表情包吗?此操作不可撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:We,children:"确认删除"})]})]})}),o.jsx(Dr,{open:U,onOpenChange:te,children:o.jsxs(Sr,{children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"确认删除"}),o.jsx(ss,{children:"确定要删除这个表情包吗?此操作无法撤销。"})]}),o.jsxs(ws,{children:[o.jsx(de,{variant:"outline",onClick:()=>te(!1),children:"取消"}),o.jsx(de,{variant:"destructive",onClick:se,children:"删除"})]})]})})]})}function gOe({emoji:t,open:e,onOpenChange:n}){if(!t)return null;const r=s=>s?new Date(s*1e3).toLocaleString("zh-CN"):"-";return o.jsx(Dr,{open:e,onOpenChange:n,children:o.jsxs(Sr,{className:"max-w-2xl max-h-[90vh]",children:[o.jsx(kr,{children:o.jsx(Or,{children:"表情包详情"})}),o.jsx(gn,{className:"max-h-[calc(90vh-8rem)] pr-4",children:o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"flex justify-center",children:o.jsx("div",{className:"w-32 h-32 bg-muted rounded-lg flex items-center justify-center overflow-hidden",children:o.jsx("img",{src:YU(t.id),alt:t.description||"表情包",className:"w-full h-full object-cover",onError:s=>{const i=s.target;i.style.display="none";const a=i.parentElement;a&&(a.innerHTML='')}})})}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"ID"}),o.jsx("div",{className:"mt-1 font-mono",children:t.id})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"格式"}),o.jsx("div",{className:"mt-1",children:o.jsx(Xn,{variant:"outline",children:t.format.toUpperCase()})})]})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"文件路径"}),o.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:t.full_path})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"哈希值"}),o.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:t.emoji_hash})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"描述"}),t.description?o.jsx("div",{className:"mt-1 rounded-lg border bg-muted/50 p-3",children:o.jsx(aOe,{className:"prose-sm",children:t.description})}):o.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:"-"})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"情绪"}),o.jsx("div",{className:"mt-1",children:t.emotion?o.jsx("span",{className:"text-sm",children:t.emotion}):o.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"状态"}),o.jsxs("div",{className:"mt-2 flex gap-2",children:[t.is_registered&&o.jsx(Xn,{variant:"default",className:"bg-green-600",children:"已注册"}),t.is_banned&&o.jsx(Xn,{variant:"destructive",children:"已封禁"}),!t.is_registered&&!t.is_banned&&o.jsx(Xn,{variant:"outline",children:"未注册"})]})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"使用次数"}),o.jsx("div",{className:"mt-1 font-mono text-lg",children:t.usage_count})]})]}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"记录时间"}),o.jsx("div",{className:"mt-1 text-sm",children:r(t.record_time)})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"注册时间"}),o.jsx("div",{className:"mt-1 text-sm",children:r(t.register_time)})]})]}),o.jsxs("div",{children:[o.jsx(he,{className:"text-muted-foreground",children:"最后使用"}),o.jsx("div",{className:"mt-1 text-sm",children:r(t.last_used_time)})]})]})})]})})}function xOe({emoji:t,open:e,onOpenChange:n,onSuccess:r}){const[s,i]=b.useState(""),[a,l]=b.useState(!1),[c,d]=b.useState(!1),[h,m]=b.useState(!1),{toast:g}=as();b.useEffect(()=>{t&&(i(t.emotion||""),l(t.is_registered),d(t.is_banned))},[t]);const x=async()=>{if(t)try{m(!0);const y=s.split(/[,,]/).map(w=>w.trim()).filter(Boolean).join(",");await cOe(t.id,{emotion:y||void 0,is_registered:a,is_banned:c}),g({title:"成功",description:"表情包信息已更新"}),n(!1),r()}catch(y){const w=y instanceof Error?y.message:"保存失败";g({title:"错误",description:w,variant:"destructive"})}finally{m(!1)}};return t?o.jsx(Dr,{open:e,onOpenChange:n,children:o.jsxs(Sr,{className:"max-w-2xl",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"编辑表情包"}),o.jsx(ss,{children:"修改表情包的情绪和状态信息"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx(he,{children:"情绪"}),o.jsx(Mr,{value:s,onChange:y=>i(y.target.value),placeholder:"输入情绪描述...",rows:2,className:"mt-1"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"输入情绪相关的文本描述"})]}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Oi,{id:"is_registered",checked:a,onCheckedChange:y=>{y===!0?(l(!0),d(!1)):l(!1)}}),o.jsx(he,{htmlFor:"is_registered",className:"cursor-pointer",children:"已注册"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Oi,{id:"is_banned",checked:c,onCheckedChange:y=>{y===!0?(d(!0),l(!1)):d(!1)}}),o.jsx(he,{htmlFor:"is_banned",className:"cursor-pointer",children:"已封禁"})]})]})]}),o.jsxs(ws,{children:[o.jsx(de,{variant:"outline",onClick:()=>n(!1),children:"取消"}),o.jsx(de,{onClick:x,disabled:h,children:h?"保存中...":"保存"})]})]})}):null}const hu="/api/webui/expression";async function vOe(){const t=await St(`${hu}/chats`,{headers:Dt()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"获取聊天列表失败")}return t.json()}async function yOe(t){const e=new URLSearchParams;t.page&&e.append("page",t.page.toString()),t.page_size&&e.append("page_size",t.page_size.toString()),t.search&&e.append("search",t.search),t.chat_id&&e.append("chat_id",t.chat_id);const n=await St(`${hu}/list?${e}`,{headers:Dt()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取表达方式列表失败")}return n.json()}async function bOe(t){const e=await St(`${hu}/${t}`,{headers:Dt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"获取表达方式详情失败")}return e.json()}async function wOe(t){const e=await St(`${hu}/`,{method:"POST",headers:Dt(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"创建表达方式失败")}return e.json()}async function SOe(t,e){const n=await St(`${hu}/${t}`,{method:"PATCH",headers:Dt(),body:JSON.stringify(e)});if(!n.ok){const r=await n.json();throw new Error(r.detail||"更新表达方式失败")}return n.json()}async function kOe(t){const e=await St(`${hu}/${t}`,{method:"DELETE",headers:Dt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"删除表达方式失败")}return e.json()}async function OOe(t){const e=await St(`${hu}/batch/delete`,{method:"POST",headers:Dt(),body:JSON.stringify({ids:t})});if(!e.ok){const n=await e.json();throw new Error(n.detail||"批量删除表达方式失败")}return e.json()}async function jOe(){const t=await St(`${hu}/stats/summary`,{headers:Dt()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"获取统计数据失败")}return t.json()}function NOe(){const[t,e]=b.useState([]),[n,r]=b.useState(!0),[s,i]=b.useState(0),[a,l]=b.useState(1),[c,d]=b.useState(20),[h,m]=b.useState(""),[g,x]=b.useState(null),[y,w]=b.useState(!1),[S,k]=b.useState(!1),[j,N]=b.useState(!1),[T,E]=b.useState(null),[_,A]=b.useState(new Set),[L,P]=b.useState(!1),[B,$]=b.useState(""),[U,te]=b.useState({total:0,recent_7days:0,chat_count:0,top_chats:{}}),[z,Q]=b.useState([]),[F,Y]=b.useState(new Map),{toast:J}=as(),X=async()=>{try{r(!0);const oe=await yOe({page:a,page_size:c,search:h||void 0});e(oe.data),i(oe.total)}catch(oe){J({title:"加载失败",description:oe instanceof Error?oe.message:"无法加载表达方式",variant:"destructive"})}finally{r(!1)}},R=async()=>{try{const oe=await jOe();oe?.data&&te(oe.data)}catch(oe){console.error("加载统计数据失败:",oe)}},ie=async()=>{try{const oe=await vOe();if(oe?.data){Q(oe.data);const Te=new Map;oe.data.forEach(We=>{Te.set(We.chat_id,We.chat_name)}),Y(Te)}}catch(oe){console.error("加载聊天列表失败:",oe)}},G=oe=>F.get(oe)||oe;b.useEffect(()=>{X(),R(),ie()},[a,c,h]);const I=async oe=>{try{const Te=await bOe(oe.id);x(Te.data),w(!0)}catch(Te){J({title:"加载详情失败",description:Te instanceof Error?Te.message:"无法加载表达方式详情",variant:"destructive"})}},V=oe=>{x(oe),k(!0)},ee=async oe=>{try{await kOe(oe.id),J({title:"删除成功",description:`已删除表达方式: ${oe.situation}`}),E(null),X(),R()}catch(Te){J({title:"删除失败",description:Te instanceof Error?Te.message:"无法删除表达方式",variant:"destructive"})}},ne=oe=>{const Te=new Set(_);Te.has(oe)?Te.delete(oe):Te.add(oe),A(Te)},W=()=>{_.size===t.length&&t.length>0?A(new Set):A(new Set(t.map(oe=>oe.id)))},se=async()=>{try{await OOe(Array.from(_)),J({title:"批量删除成功",description:`已删除 ${_.size} 个表达方式`}),A(new Set),P(!1),X(),R()}catch(oe){J({title:"批量删除失败",description:oe instanceof Error?oe.message:"无法批量删除表达方式",variant:"destructive"})}},re=()=>{const oe=parseInt(B),Te=Math.ceil(s/c);oe>=1&&oe<=Te?(l(oe),$("")):J({title:"无效的页码",description:`请输入1-${Te}之间的页码`,variant:"destructive"})};return o.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[o.jsx("div",{className:"mb-4 sm:mb-6",children:o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[o.jsx(Wh,{className:"h-8 w-8",strokeWidth:2}),"表达方式管理"]}),o.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦的表达方式和话术模板"})]}),o.jsxs(de,{onClick:()=>N(!0),className:"gap-2",children:[o.jsx(Ls,{className:"h-4 w-4"}),"新增表达方式"]})]})}),o.jsx(gn,{className:"flex-1",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"总数量"}),o.jsx("div",{className:"text-2xl font-bold mt-1",children:U.total})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"近7天新增"}),o.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:U.recent_7days})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"关联聊天数"}),o.jsx("div",{className:"text-2xl font-bold mt-1 text-blue-600",children:U.chat_count})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx(he,{htmlFor:"search",children:"搜索"}),o.jsx("div",{className:"flex flex-col sm:flex-row gap-2 mt-1.5",children:o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(Ni,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),o.jsx(ze,{id:"search",placeholder:"搜索情境、风格或上下文...",value:h,onChange:oe=>m(oe.target.value),className:"pl-9"})]})}),o.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:[o.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:_.size>0&&o.jsxs("span",{children:["已选择 ",_.size," 个表达方式"]})}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),o.jsxs(Vt,{value:c.toString(),onValueChange:oe=>{d(parseInt(oe)),l(1),A(new Set)},children:[o.jsx($t,{id:"page-size",className:"w-20",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"10",children:"10"}),o.jsx(De,{value:"20",children:"20"}),o.jsx(De,{value:"50",children:"50"}),o.jsx(De,{value:"100",children:"100"})]})]}),_.size>0&&o.jsxs(o.Fragment,{children:[o.jsx(de,{variant:"outline",size:"sm",onClick:()=>A(new Set),children:"取消选择"}),o.jsxs(de,{variant:"destructive",size:"sm",onClick:()=>P(!0),children:[o.jsx(Sn,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card",children:[o.jsx("div",{className:"hidden md:block",children:o.jsxs(_f,{children:[o.jsx(Af,{children:o.jsxs(Is,{children:[o.jsx(pn,{className:"w-12",children:o.jsx(Oi,{checked:_.size===t.length&&t.length>0,onCheckedChange:W})}),o.jsx(pn,{children:"情境"}),o.jsx(pn,{children:"风格"}),o.jsx(pn,{children:"聊天"}),o.jsx(pn,{className:"text-right",children:"操作"})]})}),o.jsx(Mf,{children:n?o.jsx(Is,{children:o.jsx(Gt,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):t.length===0?o.jsx(Is,{children:o.jsx(Gt,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):t.map(oe=>o.jsxs(Is,{children:[o.jsx(Gt,{children:o.jsx(Oi,{checked:_.has(oe.id),onCheckedChange:()=>ne(oe.id)})}),o.jsx(Gt,{className:"font-medium max-w-xs truncate",children:oe.situation}),o.jsx(Gt,{className:"max-w-xs truncate",children:oe.style}),o.jsx(Gt,{className:"max-w-[200px] truncate",title:G(oe.chat_id),style:{wordBreak:"keep-all"},children:o.jsx("span",{className:"whitespace-nowrap overflow-hidden text-ellipsis block",children:G(oe.chat_id)})}),o.jsx(Gt,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsxs(de,{variant:"default",size:"sm",onClick:()=>V(oe),children:[o.jsx(z0,{className:"h-4 w-4 mr-1"}),"编辑"]}),o.jsx(de,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>I(oe),title:"查看详情",children:o.jsx(Ea,{className:"h-4 w-4"})}),o.jsxs(de,{size:"sm",onClick:()=>E(oe),className:"bg-red-600 hover:bg-red-700 text-white",children:[o.jsx(Sn,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},oe.id))})]})}),o.jsx("div",{className:"md:hidden space-y-3 p-4",children:n?o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):t.length===0?o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):t.map(oe=>o.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(Oi,{checked:_.has(oe.id),onCheckedChange:()=>ne(oe.id),className:"mt-1"}),o.jsxs("div",{className:"min-w-0 flex-1 overflow-hidden space-y-2",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"情境"}),o.jsx("h3",{className:"font-semibold text-sm line-clamp-2 w-full break-all",title:oe.situation,children:oe.situation})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"风格"}),o.jsx("p",{className:"text-sm line-clamp-2 w-full break-all",title:oe.style,children:oe.style})]})]})]}),o.jsxs("div",{className:"text-sm",children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"聊天"}),o.jsx("p",{className:"text-sm truncate",title:G(oe.chat_id),style:{wordBreak:"keep-all"},children:G(oe.chat_id)})]}),o.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[o.jsxs(de,{variant:"outline",size:"sm",onClick:()=>V(oe),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[o.jsx(z0,{className:"h-3 w-3 mr-1"}),"编辑"]}),o.jsx(de,{variant:"outline",size:"sm",onClick:()=>I(oe),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:o.jsx(Ea,{className:"h-3 w-3"})}),o.jsxs(de,{variant:"outline",size:"sm",onClick:()=>E(oe),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[o.jsx(Sn,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},oe.id))}),s>0&&o.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[o.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",s," 条记录,第 ",a," / ",Math.ceil(s/c)," 页"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(de,{variant:"outline",size:"sm",onClick:()=>l(1),disabled:a===1,className:"hidden sm:flex",children:o.jsx(Ap,{className:"h-4 w-4"})}),o.jsxs(de,{variant:"outline",size:"sm",onClick:()=>l(a-1),disabled:a===1,children:[o.jsx(vd,{className:"h-4 w-4 sm:mr-1"}),o.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ze,{type:"number",value:B,onChange:oe=>$(oe.target.value),onKeyDown:oe=>oe.key==="Enter"&&re(),placeholder:a.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(s/c)}),o.jsx(de,{variant:"outline",size:"sm",onClick:re,disabled:!B,className:"h-8",children:"跳转"})]}),o.jsxs(de,{variant:"outline",size:"sm",onClick:()=>l(a+1),disabled:a>=Math.ceil(s/c),children:[o.jsx("span",{className:"hidden sm:inline",children:"下一页"}),o.jsx(yd,{className:"h-4 w-4 sm:ml-1"})]}),o.jsx(de,{variant:"outline",size:"sm",onClick:()=>l(Math.ceil(s/c)),disabled:a>=Math.ceil(s/c),className:"hidden sm:flex",children:o.jsx(Mp,{className:"h-4 w-4"})})]})]})]})]})}),o.jsx(COe,{expression:g,open:y,onOpenChange:w,chatNameMap:F}),o.jsx(TOe,{open:j,onOpenChange:N,chatList:z,onSuccess:()=>{X(),R(),N(!1)}}),o.jsx(EOe,{expression:g,open:S,onOpenChange:k,chatList:z,onSuccess:()=>{X(),R(),k(!1)}}),o.jsx(Dn,{open:!!T,onOpenChange:()=>E(null),children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:['确定要删除表达方式 "',T?.situation,'" 吗? 此操作不可撤销。']})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:()=>T&&ee(T),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),o.jsx(_Oe,{open:L,onOpenChange:P,onConfirm:se,count:_.size})]})}function COe({expression:t,open:e,onOpenChange:n,chatNameMap:r}){if(!t)return null;const s=a=>a?new Date(a*1e3).toLocaleString("zh-CN"):"-",i=a=>r.get(a)||a;return o.jsx(Dr,{open:e,onOpenChange:n,children:o.jsxs(Sr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"表达方式详情"}),o.jsx(ss,{children:"查看表达方式的完整信息"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsx(e0,{label:"情境",value:t.situation}),o.jsx(e0,{label:"风格",value:t.style}),o.jsx(e0,{label:"聊天",value:i(t.chat_id)}),o.jsx(e0,{icon:ik,label:"记录ID",value:t.id.toString(),mono:!0})]}),o.jsx("div",{className:"grid grid-cols-2 gap-4",children:o.jsx(e0,{icon:_h,label:"创建时间",value:s(t.create_date)})})]}),o.jsx(ws,{children:o.jsx(de,{onClick:()=>n(!1),children:"关闭"})})]})})}function e0({icon:t,label:e,value:n,mono:r=!1}){return o.jsxs("div",{className:"space-y-1",children:[o.jsxs(he,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[t&&o.jsx(t,{className:"h-3 w-3"}),e]}),o.jsx("div",{className:xe("text-sm",r&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function TOe({open:t,onOpenChange:e,chatList:n,onSuccess:r}){const[s,i]=b.useState({situation:"",style:"",chat_id:""}),[a,l]=b.useState(!1),{toast:c}=as(),d=async()=>{if(!s.situation||!s.style||!s.chat_id){c({title:"验证失败",description:"请填写必填字段:情境、风格和聊天",variant:"destructive"});return}try{l(!0),await wOe(s),c({title:"创建成功",description:"表达方式已创建"}),i({situation:"",style:"",chat_id:""}),r()}catch(h){c({title:"创建失败",description:h instanceof Error?h.message:"无法创建表达方式",variant:"destructive"})}finally{l(!1)}};return o.jsx(Dr,{open:t,onOpenChange:e,children:o.jsxs(Sr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"新增表达方式"}),o.jsx(ss,{children:"创建新的表达方式记录"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsxs(he,{htmlFor:"situation",children:["情境 ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsx(ze,{id:"situation",value:s.situation,onChange:h=>i({...s,situation:h.target.value}),placeholder:"描述使用场景"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs(he,{htmlFor:"style",children:["风格 ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsx(ze,{id:"style",value:s.style,onChange:h=>i({...s,style:h.target.value}),placeholder:"描述表达风格"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs(he,{htmlFor:"chat_id",children:["聊天 ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsxs(Vt,{value:s.chat_id,onValueChange:h=>i({...s,chat_id:h}),children:[o.jsx($t,{children:o.jsx(Ut,{placeholder:"选择关联的聊天"})}),o.jsx(Ht,{children:n.map(h=>o.jsx(De,{value:h.chat_id,children:o.jsxs("span",{className:"truncate",style:{wordBreak:"keep-all"},children:[h.chat_name,h.is_group&&o.jsx("span",{className:"text-muted-foreground ml-1",children:"(群聊)"})]})},h.chat_id))})]})]})]}),o.jsxs(ws,{children:[o.jsx(de,{variant:"outline",onClick:()=>e(!1),children:"取消"}),o.jsx(de,{onClick:d,disabled:a,children:a?"创建中...":"创建"})]})]})})}function EOe({expression:t,open:e,onOpenChange:n,chatList:r,onSuccess:s}){const[i,a]=b.useState({}),[l,c]=b.useState(!1),{toast:d}=as();b.useEffect(()=>{t&&a({situation:t.situation,style:t.style,chat_id:t.chat_id})},[t]);const h=async()=>{if(t)try{c(!0),await SOe(t.id,i),d({title:"保存成功",description:"表达方式已更新"}),s()}catch(m){d({title:"保存失败",description:m instanceof Error?m.message:"无法更新表达方式",variant:"destructive"})}finally{c(!1)}};return t?o.jsx(Dr,{open:e,onOpenChange:n,children:o.jsxs(Sr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"编辑表达方式"}),o.jsx(ss,{children:"修改表达方式的信息"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"edit_situation",children:"情境"}),o.jsx(ze,{id:"edit_situation",value:i.situation||"",onChange:m=>a({...i,situation:m.target.value}),placeholder:"描述使用场景"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"edit_style",children:"风格"}),o.jsx(ze,{id:"edit_style",value:i.style||"",onChange:m=>a({...i,style:m.target.value}),placeholder:"描述表达风格"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"edit_chat_id",children:"聊天"}),o.jsxs(Vt,{value:i.chat_id||"",onValueChange:m=>a({...i,chat_id:m}),children:[o.jsx($t,{children:o.jsx(Ut,{placeholder:"选择关联的聊天"})}),o.jsx(Ht,{children:r.map(m=>o.jsx(De,{value:m.chat_id,children:o.jsxs("span",{className:"truncate",style:{wordBreak:"keep-all"},children:[m.chat_name,m.is_group&&o.jsx("span",{className:"text-muted-foreground ml-1",children:"(群聊)"})]})},m.chat_id))})]})]})]}),o.jsxs(ws,{children:[o.jsx(de,{variant:"outline",onClick:()=>n(!1),children:"取消"}),o.jsx(de,{onClick:h,disabled:l,children:l?"保存中...":"保存"})]})]})}):null}function _Oe({open:t,onOpenChange:e,onConfirm:n,count:r}){return o.jsx(Dn,{open:t,onOpenChange:e,children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认批量删除"}),o.jsxs(_n,{children:["您即将删除 ",r," 个表达方式,此操作无法撤销。确定要继续吗?"]})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:n,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"确认删除"})]})]})})}const Hf="/api/webui/person";async function AOe(t){const e=new URLSearchParams;t.page&&e.append("page",t.page.toString()),t.page_size&&e.append("page_size",t.page_size.toString()),t.search&&e.append("search",t.search),t.is_known!==void 0&&e.append("is_known",t.is_known.toString()),t.platform&&e.append("platform",t.platform);const n=await St(`${Hf}/list?${e}`,{headers:Dt()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取人物列表失败")}return n.json()}async function MOe(t){const e=await St(`${Hf}/${t}`,{headers:Dt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"获取人物详情失败")}return e.json()}async function ROe(t,e){const n=await St(`${Hf}/${t}`,{method:"PATCH",headers:Dt(),body:JSON.stringify(e)});if(!n.ok){const r=await n.json();throw new Error(r.detail||"更新人物信息失败")}return n.json()}async function DOe(t){const e=await St(`${Hf}/${t}`,{method:"DELETE",headers:Dt()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"删除人物信息失败")}return e.json()}async function POe(){const t=await St(`${Hf}/stats/summary`,{headers:Dt()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"获取统计数据失败")}return t.json()}async function zOe(t){const e=await St(`${Hf}/batch/delete`,{method:"POST",headers:Dt(),body:JSON.stringify({person_ids:t})});if(!e.ok){const n=await e.json();throw new Error(n.detail||"批量删除失败")}return e.json()}function IOe(){const[t,e]=b.useState([]),[n,r]=b.useState(!0),[s,i]=b.useState(0),[a,l]=b.useState(1),[c,d]=b.useState(20),[h,m]=b.useState(""),[g,x]=b.useState(void 0),[y,w]=b.useState(void 0),[S,k]=b.useState(null),[j,N]=b.useState(!1),[T,E]=b.useState(!1),[_,A]=b.useState(null),[L,P]=b.useState({total:0,known:0,unknown:0,platforms:{}}),[B,$]=b.useState(new Set),[U,te]=b.useState(!1),[z,Q]=b.useState(""),{toast:F}=as(),Y=async()=>{try{r(!0);const re=await AOe({page:a,page_size:c,search:h||void 0,is_known:g,platform:y});e(re.data),i(re.total)}catch(re){F({title:"加载失败",description:re instanceof Error?re.message:"无法加载人物信息",variant:"destructive"})}finally{r(!1)}},J=async()=>{try{const re=await POe();re?.data&&P(re.data)}catch(re){console.error("加载统计数据失败:",re)}};b.useEffect(()=>{Y(),J()},[a,c,h,g,y]);const X=async re=>{try{const oe=await MOe(re.person_id);k(oe.data),N(!0)}catch(oe){F({title:"加载详情失败",description:oe instanceof Error?oe.message:"无法加载人物详情",variant:"destructive"})}},R=re=>{k(re),E(!0)},ie=async re=>{try{await DOe(re.person_id),F({title:"删除成功",description:`已删除人物信息: ${re.person_name||re.nickname||re.user_id}`}),A(null),Y(),J()}catch(oe){F({title:"删除失败",description:oe instanceof Error?oe.message:"无法删除人物信息",variant:"destructive"})}},G=b.useMemo(()=>Object.keys(L.platforms),[L.platforms]),I=re=>{const oe=new Set(B);oe.has(re)?oe.delete(re):oe.add(re),$(oe)},V=()=>{B.size===t.length&&t.length>0?$(new Set):$(new Set(t.map(re=>re.person_id)))},ee=()=>{if(B.size===0){F({title:"未选择任何人物",description:"请先选择要删除的人物",variant:"destructive"});return}te(!0)},ne=async()=>{try{const re=await zOe(Array.from(B));F({title:"批量删除完成",description:re.message}),$(new Set),te(!1),Y(),J()}catch(re){F({title:"批量删除失败",description:re instanceof Error?re.message:"批量删除失败",variant:"destructive"})}},W=()=>{const re=parseInt(z),oe=Math.ceil(s/c);re>=1&&re<=oe?(l(re),Q("")):F({title:"无效的页码",description:`请输入1-${oe}之间的页码`,variant:"destructive"})},se=re=>re?new Date(re*1e3).toLocaleString("zh-CN"):"-";return o.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[o.jsx("div",{className:"mb-4 sm:mb-6",children:o.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[o.jsx(ete,{className:"h-8 w-8",strokeWidth:2}),"人物信息管理"]}),o.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦认识的所有人物信息"})]})})}),o.jsx(gn,{className:"flex-1",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"总人数"}),o.jsx("div",{className:"text-2xl font-bold mt-1",children:L.total})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"已认识"}),o.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:L.known})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"未认识"}),o.jsx("div",{className:"text-2xl font-bold mt-1 text-muted-foreground",children:L.unknown})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-4",children:[o.jsxs("div",{className:"sm:col-span-2",children:[o.jsx(he,{htmlFor:"search",children:"搜索"}),o.jsxs("div",{className:"relative mt-1.5",children:[o.jsx(Ni,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),o.jsx(ze,{id:"search",placeholder:"搜索名称、昵称或用户ID...",value:h,onChange:re=>m(re.target.value),className:"pl-9"})]})]}),o.jsxs("div",{children:[o.jsx(he,{htmlFor:"filter-known",children:"认识状态"}),o.jsxs(Vt,{value:g===void 0?"all":g.toString(),onValueChange:re=>{x(re==="all"?void 0:re==="true"),l(1)},children:[o.jsx($t,{id:"filter-known",className:"mt-1.5",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部"}),o.jsx(De,{value:"true",children:"已认识"}),o.jsx(De,{value:"false",children:"未认识"})]})]})]}),o.jsxs("div",{children:[o.jsx(he,{htmlFor:"filter-platform",children:"平台"}),o.jsxs(Vt,{value:y||"all",onValueChange:re=>{w(re==="all"?void 0:re),l(1)},children:[o.jsx($t,{id:"filter-platform",className:"mt-1.5",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部平台"}),G.map(re=>o.jsxs(De,{value:re,children:[re," (",L.platforms[re],")"]},re))]})]})]})]}),o.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:[o.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:B.size>0&&o.jsxs("span",{children:["已选择 ",B.size," 个人物"]})}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),o.jsxs(Vt,{value:c.toString(),onValueChange:re=>{d(parseInt(re)),l(1),$(new Set)},children:[o.jsx($t,{id:"page-size",className:"w-20",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"10",children:"10"}),o.jsx(De,{value:"20",children:"20"}),o.jsx(De,{value:"50",children:"50"}),o.jsx(De,{value:"100",children:"100"})]})]}),B.size>0&&o.jsxs(o.Fragment,{children:[o.jsx(de,{variant:"outline",size:"sm",onClick:()=>$(new Set),children:"取消选择"}),o.jsxs(de,{variant:"destructive",size:"sm",onClick:ee,children:[o.jsx(Sn,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),o.jsxs("div",{className:"rounded-lg border bg-card",children:[o.jsx("div",{className:"hidden md:block",children:o.jsxs(_f,{children:[o.jsx(Af,{children:o.jsxs(Is,{children:[o.jsx(pn,{className:"w-12",children:o.jsx(Oi,{checked:t.length>0&&B.size===t.length,onCheckedChange:V,"aria-label":"全选"})}),o.jsx(pn,{children:"状态"}),o.jsx(pn,{children:"名称"}),o.jsx(pn,{children:"昵称"}),o.jsx(pn,{children:"平台"}),o.jsx(pn,{children:"用户ID"}),o.jsx(pn,{children:"最后更新"}),o.jsx(pn,{className:"text-right",children:"操作"})]})}),o.jsx(Mf,{children:n?o.jsx(Is,{children:o.jsx(Gt,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):t.length===0?o.jsx(Is,{children:o.jsx(Gt,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):t.map(re=>o.jsxs(Is,{children:[o.jsx(Gt,{children:o.jsx(Oi,{checked:B.has(re.person_id),onCheckedChange:()=>I(re.person_id),"aria-label":`选择 ${re.person_name||re.nickname||re.user_id}`})}),o.jsx(Gt,{children:o.jsx("div",{className:xe("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",re.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:re.is_known?"已认识":"未认识"})}),o.jsx(Gt,{className:"font-medium",children:re.person_name||o.jsx("span",{className:"text-muted-foreground",children:"-"})}),o.jsx(Gt,{children:re.nickname||"-"}),o.jsx(Gt,{children:re.platform}),o.jsx(Gt,{className:"font-mono text-sm",children:re.user_id}),o.jsx(Gt,{className:"text-sm text-muted-foreground",children:se(re.last_know)}),o.jsx(Gt,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsxs(de,{variant:"default",size:"sm",onClick:()=>X(re),children:[o.jsx(Ea,{className:"h-4 w-4 mr-1"}),"详情"]}),o.jsxs(de,{variant:"default",size:"sm",onClick:()=>R(re),children:[o.jsx(z0,{className:"h-4 w-4 mr-1"}),"编辑"]}),o.jsxs(de,{size:"sm",onClick:()=>A(re),className:"bg-red-600 hover:bg-red-700 text-white",children:[o.jsx(Sn,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},re.id))})]})}),o.jsx("div",{className:"md:hidden space-y-3 p-4",children:n?o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):t.length===0?o.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):t.map(re=>o.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(Oi,{checked:B.has(re.person_id),onCheckedChange:()=>I(re.person_id),className:"mt-1"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:xe("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium mb-2",re.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:re.is_known?"已认识":"未认识"}),o.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",children:re.person_name||o.jsx("span",{className:"text-muted-foreground",children:"未命名"})}),re.nickname&&o.jsxs("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-1 w-full break-all",children:["昵称: ",re.nickname]})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"平台"}),o.jsx("p",{className:"font-medium text-xs",children:re.platform})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"用户ID"}),o.jsx("p",{className:"font-mono text-xs truncate",title:re.user_id,children:re.user_id})]}),o.jsxs("div",{className:"col-span-2",children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"最后更新"}),o.jsx("p",{className:"text-xs",children:se(re.last_know)})]})]}),o.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[o.jsxs(de,{variant:"outline",size:"sm",onClick:()=>X(re),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[o.jsx(Ea,{className:"h-3 w-3 mr-1"}),"查看"]}),o.jsxs(de,{variant:"outline",size:"sm",onClick:()=>R(re),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[o.jsx(z0,{className:"h-3 w-3 mr-1"}),"编辑"]}),o.jsxs(de,{variant:"outline",size:"sm",onClick:()=>A(re),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[o.jsx(Sn,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},re.id))}),s>0&&o.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[o.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",s," 条记录,第 ",a," / ",Math.ceil(s/c)," 页"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(de,{variant:"outline",size:"sm",onClick:()=>l(1),disabled:a===1,className:"hidden sm:flex",children:o.jsx(Ap,{className:"h-4 w-4"})}),o.jsxs(de,{variant:"outline",size:"sm",onClick:()=>l(a-1),disabled:a===1,children:[o.jsx(vd,{className:"h-4 w-4 sm:mr-1"}),o.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ze,{type:"number",value:z,onChange:re=>Q(re.target.value),onKeyDown:re=>re.key==="Enter"&&W(),placeholder:a.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(s/c)}),o.jsx(de,{variant:"outline",size:"sm",onClick:W,disabled:!z,className:"h-8",children:"跳转"})]}),o.jsxs(de,{variant:"outline",size:"sm",onClick:()=>l(a+1),disabled:a>=Math.ceil(s/c),children:[o.jsx("span",{className:"hidden sm:inline",children:"下一页"}),o.jsx(yd,{className:"h-4 w-4 sm:ml-1"})]}),o.jsx(de,{variant:"outline",size:"sm",onClick:()=>l(Math.ceil(s/c)),disabled:a>=Math.ceil(s/c),className:"hidden sm:flex",children:o.jsx(Mp,{className:"h-4 w-4"})})]})]})]})]})}),o.jsx(LOe,{person:S,open:j,onOpenChange:N}),o.jsx(BOe,{person:S,open:T,onOpenChange:E,onSuccess:()=>{Y(),J(),E(!1)}}),o.jsx(Dn,{open:!!_,onOpenChange:()=>A(null),children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认删除"}),o.jsxs(_n,{children:['确定要删除人物信息 "',_?.person_name||_?.nickname||_?.user_id,'" 吗? 此操作不可撤销。']})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:()=>_&&ie(_),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),o.jsx(Dn,{open:U,onOpenChange:te,children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"确认批量删除"}),o.jsxs(_n,{children:["确定要删除选中的 ",B.size," 个人物信息吗? 此操作不可撤销。"]})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{children:"取消"}),o.jsx(An,{onClick:ne,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})})]})}function LOe({person:t,open:e,onOpenChange:n}){if(!t)return null;const r=s=>s?new Date(s*1e3).toLocaleString("zh-CN"):"-";return o.jsx(Dr,{open:e,onOpenChange:n,children:o.jsxs(Sr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"人物详情"}),o.jsxs(ss,{children:["查看 ",t.person_name||t.nickname||t.user_id," 的完整信息"]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsx(bl,{icon:Dv,label:"人物名称",value:t.person_name}),o.jsx(bl,{icon:Wh,label:"昵称",value:t.nickname}),o.jsx(bl,{icon:ik,label:"用户ID",value:t.user_id,mono:!0}),o.jsx(bl,{icon:ik,label:"人物ID",value:t.person_id,mono:!0}),o.jsx(bl,{label:"平台",value:t.platform}),o.jsx(bl,{label:"状态",value:t.is_known?"已认识":"未认识"})]}),t.name_reason&&o.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[o.jsx(he,{className:"text-xs text-muted-foreground",children:"名称设定原因"}),o.jsx("p",{className:"mt-1 text-sm",children:t.name_reason})]}),t.memory_points&&o.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[o.jsx(he,{className:"text-xs text-muted-foreground",children:"个人印象"}),o.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:t.memory_points})]}),t.group_nick_name&&t.group_nick_name.length>0&&o.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[o.jsx(he,{className:"text-xs text-muted-foreground",children:"群昵称"}),o.jsx("div",{className:"mt-2 space-y-1",children:t.group_nick_name.map((s,i)=>o.jsxs("div",{className:"text-sm flex items-center gap-2",children:[o.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:s.group_id}),o.jsx("span",{children:"→"}),o.jsx("span",{children:s.group_nick_name})]},i))})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[o.jsx(bl,{icon:_h,label:"认识时间",value:r(t.know_times)}),o.jsx(bl,{icon:_h,label:"首次记录",value:r(t.know_since)}),o.jsx(bl,{icon:_h,label:"最后更新",value:r(t.last_know)})]})]}),o.jsx(ws,{children:o.jsx(de,{onClick:()=>n(!1),children:"关闭"})})]})})}function bl({icon:t,label:e,value:n,mono:r=!1}){return o.jsxs("div",{className:"space-y-1",children:[o.jsxs(he,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[t&&o.jsx(t,{className:"h-3 w-3"}),e]}),o.jsx("div",{className:xe("text-sm",r&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function BOe({person:t,open:e,onOpenChange:n,onSuccess:r}){const[s,i]=b.useState({}),[a,l]=b.useState(!1),{toast:c}=as();b.useEffect(()=>{t&&i({person_name:t.person_name||"",name_reason:t.name_reason||"",nickname:t.nickname||"",memory_points:t.memory_points||"",is_known:t.is_known})},[t]);const d=async()=>{if(t)try{l(!0),await ROe(t.person_id,s),c({title:"保存成功",description:"人物信息已更新"}),r()}catch(h){c({title:"保存失败",description:h instanceof Error?h.message:"无法更新人物信息",variant:"destructive"})}finally{l(!1)}};return t?o.jsx(Dr,{open:e,onOpenChange:n,children:o.jsxs(Sr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"编辑人物信息"}),o.jsxs(ss,{children:["修改 ",t.person_name||t.nickname||t.user_id," 的信息"]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"person_name",children:"人物名称"}),o.jsx(ze,{id:"person_name",value:s.person_name||"",onChange:h=>i({...s,person_name:h.target.value}),placeholder:"为这个人设置一个名称"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"nickname",children:"昵称"}),o.jsx(ze,{id:"nickname",value:s.nickname||"",onChange:h=>i({...s,nickname:h.target.value}),placeholder:"昵称"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"name_reason",children:"名称设定原因"}),o.jsx(Mr,{id:"name_reason",value:s.name_reason||"",onChange:h=>i({...s,name_reason:h.target.value}),placeholder:"为什么这样称呼这个人?",rows:2})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"memory_points",children:"个人印象"}),o.jsx(Mr,{id:"memory_points",value:s.memory_points||"",onChange:h=>i({...s,memory_points:h.target.value}),placeholder:"对这个人的印象和记忆点...",rows:4})]}),o.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[o.jsxs("div",{children:[o.jsx(he,{htmlFor:"is_known",className:"text-base font-medium",children:"已认识"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"标记是否已经认识这个人"})]}),o.jsx(Bt,{id:"is_known",checked:s.is_known,onCheckedChange:h=>i({...s,is_known:h})})]})]}),o.jsxs(ws,{children:[o.jsx(de,{variant:"outline",onClick:()=>n(!1),children:"取消"}),o.jsx(de,{onClick:d,disabled:a,children:a?"保存中...":"保存"})]})]})}):null}function Bs(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let n=0,r;n{let e;const n=new Set,r=(h,m)=>{const g=typeof h=="function"?h(e):h;if(!Object.is(g,e)){const x=e;e=m??(typeof g!="object"||g===null)?g:Object.assign({},e,g),n.forEach(y=>y(e,x))}},s=()=>e,c={setState:r,getState:s,getInitialState:()=>d,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(FOe?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=e=t(r,s,c);return c},qOe=t=>t?JR(t):JR,{useDebugValue:$Oe}=ae,{useSyncExternalStoreWithSelector:HOe}=pJ,QOe=t=>t;function KU(t,e=QOe,n){const r=HOe(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return $Oe(r),r}const eD=(t,e)=>{const n=qOe(t),r=(s,i=e)=>KU(n,s,i);return Object.assign(r,n),r},VOe=(t,e)=>t?eD(t,e):eD;function ks(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[r,s]of t)if(!Object.is(s,e.get(r)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const r of t)if(!e.has(r))return!1;return!0}const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(e,r)||!Object.is(t[r],e[r]))return!1;return!0}var UOe={value:()=>{}};function Gb(){for(var t=0,e=arguments.length,n={},r;t=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}jv.prototype=Gb.prototype={constructor:jv,on:function(t,e){var n=this._,r=WOe(t+"",n),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var n=new Array(s),r=0,s,i;r=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),nD.hasOwnProperty(e)?{space:nD[e],local:t}:t}function XOe(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===XO&&e.documentElement.namespaceURI===XO?e.createElement(t):e.createElementNS(n,t)}}function YOe(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function ZU(t){var e=Xb(t);return(e.local?YOe:XOe)(e)}function KOe(){}function VN(t){return t==null?KOe:function(){return this.querySelector(t)}}function ZOe(t){typeof t!="function"&&(t=VN(t));for(var e=this._groups,n=e.length,r=new Array(n),s=0;s=N&&(N=j+1);!(E=S[N])&&++N=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function kje(t){t||(t=Oje);function e(m,g){return m&&g?t(m.__data__,g.__data__):!m-!g}for(var n=this._groups,r=n.length,s=new Array(r),i=0;ie?1:t>=e?0:NaN}function jje(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Nje(){return Array.from(this)}function Cje(){for(var t=this._groups,e=0,n=t.length;e1?this.each((e==null?Lje:typeof e=="function"?Fje:Bje)(t,e,n??"")):mf(this.node(),t)}function mf(t,e){return t.style.getPropertyValue(e)||rW(t).getComputedStyle(t,null).getPropertyValue(e)}function $je(t){return function(){delete this[t]}}function Hje(t,e){return function(){this[t]=e}}function Qje(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Vje(t,e){return arguments.length>1?this.each((e==null?$je:typeof e=="function"?Qje:Hje)(t,e)):this.node()[t]}function sW(t){return t.trim().split(/^|\s+/)}function UN(t){return t.classList||new iW(t)}function iW(t){this._node=t,this._names=sW(t.getAttribute("class")||"")}iW.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function aW(t,e){for(var n=UN(t),r=-1,s=e.length;++r=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function y6e(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,s=e.length,i;n()=>t;function YO(t,{sourceEvent:e,subject:n,target:r,identifier:s,active:i,x:a,y:l,dx:c,dy:d,dispatch:h}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:h}})}YO.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function E6e(t){return!t.ctrlKey&&!t.button}function _6e(){return this.parentNode}function A6e(t,e){return e??{x:t.x,y:t.y}}function M6e(){return navigator.maxTouchPoints||"ontouchstart"in this}function R6e(){var t=E6e,e=_6e,n=A6e,r=M6e,s={},i=Gb("start","drag","end"),a=0,l,c,d,h,m=0;function g(T){T.on("mousedown.drag",x).filter(r).on("touchstart.drag",S).on("touchmove.drag",k,T6e).on("touchend.drag touchcancel.drag",j).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(T,E){if(!(h||!t.call(this,T,E))){var _=N(this,e.call(this,T,E),T,E,"mouse");_&&(ma(T.view).on("mousemove.drag",y,yp).on("mouseup.drag",w,yp),uW(T.view),o5(T),d=!1,l=T.clientX,c=T.clientY,_("start",T))}}function y(T){if(Hh(T),!d){var E=T.clientX-l,_=T.clientY-c;d=E*E+_*_>m}s.mouse("drag",T)}function w(T){ma(T.view).on("mousemove.drag mouseup.drag",null),dW(T.view,d),Hh(T),s.mouse("end",T)}function S(T,E){if(t.call(this,T,E)){var _=T.changedTouches,A=e.call(this,T,E),L=_.length,P,B;for(P=0;P=0&&t._call.call(void 0,e),t=t._next;--pf}function rD(){md=(Ey=bp.now())+Yb,pf=f0=0;try{P6e()}finally{pf=0,I6e(),md=0}}function z6e(){var t=bp.now(),e=t-Ey;e>hW&&(Yb-=e,Ey=t)}function I6e(){for(var t,e=Ty,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Ty=n);m0=t,KO(r)}function KO(t){if(!pf){f0&&(f0=clearTimeout(f0));var e=t-md;e>24?(t<1/0&&(f0=setTimeout(rD,t-bp.now()-Yb)),t0&&(t0=clearInterval(t0))):(t0||(Ey=bp.now(),t0=setInterval(z6e,hW)),pf=1,fW(rD))}}function sD(t,e,n){var r=new _y;return e=e==null?0:+e,r.restart(s=>{r.stop(),t(s+e)},e,n),r}var L6e=Gb("start","end","cancel","interrupt"),B6e=[],pW=0,iD=1,ZO=2,Nv=3,aD=4,JO=5,Cv=6;function Kb(t,e,n,r,s,i){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;F6e(t,n,{name:e,index:r,group:s,on:L6e,tween:B6e,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:pW})}function GN(t,e){var n=io(t,e);if(n.state>pW)throw new Error("too late; already scheduled");return n}function Go(t,e){var n=io(t,e);if(n.state>Nv)throw new Error("too late; already running");return n}function io(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function F6e(t,e,n){var r=t.__transition,s;r[e]=n,n.timer=mW(i,0,n.time);function i(d){n.state=iD,n.timer.restart(a,n.delay,n.time),n.delay<=d&&a(d-n.delay)}function a(d){var h,m,g,x;if(n.state!==iD)return c();for(h in r)if(x=r[h],x.name===n.name){if(x.state===Nv)return sD(a);x.state===aD?(x.state=Cv,x.timer.stop(),x.on.call("interrupt",t,t.__data__,x.index,x.group),delete r[h]):+hZO&&r.state=0&&(e=e.slice(0,n)),!e||e==="start"})}function gNe(t,e,n){var r,s,i=pNe(e)?GN:Go;return function(){var a=i(this,t),l=a.on;l!==r&&(s=(r=l).copy()).on(e,n),a.on=s}}function xNe(t,e){var n=this._id;return arguments.length<2?io(this.node(),n).on.on(t):this.each(gNe(n,t,e))}function vNe(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function yNe(){return this.on("end.remove",vNe(this._id))}function bNe(t){var e=this._name,n=this._id;typeof t!="function"&&(t=VN(t));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>t;function VNe(t,{sourceEvent:e,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Rl(t,e,n){this.k=t,this.x=e,this.y=n}Rl.prototype={constructor:Rl,scale:function(t){return t===1?this:new Rl(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Rl(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Fl=new Rl(1,0,0);Rl.prototype;function l5(t){t.stopImmediatePropagation()}function n0(t){t.preventDefault(),t.stopImmediatePropagation()}function UNe(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function WNe(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function oD(){return this.__zoom||Fl}function GNe(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function XNe(){return navigator.maxTouchPoints||"ontouchstart"in this}function YNe(t,e,n){var r=t.invertX(e[0][0])-n[0][0],s=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function yW(){var t=UNe,e=WNe,n=YNe,r=GNe,s=XNe,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=BJ,d=Gb("start","zoom","end"),h,m,g,x=500,y=150,w=0,S=10;function k(z){z.property("__zoom",oD).on("wheel.zoom",L,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",B).filter(s).on("touchstart.zoom",$).on("touchmove.zoom",U).on("touchend.zoom touchcancel.zoom",te).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(z,Q,F,Y){var J=z.selection?z.selection():z;J.property("__zoom",oD),z!==J?E(z,Q,F,Y):J.interrupt().each(function(){_(this,arguments).event(Y).start().zoom(null,typeof Q=="function"?Q.apply(this,arguments):Q).end()})},k.scaleBy=function(z,Q,F,Y){k.scaleTo(z,function(){var J=this.__zoom.k,X=typeof Q=="function"?Q.apply(this,arguments):Q;return J*X},F,Y)},k.scaleTo=function(z,Q,F,Y){k.transform(z,function(){var J=e.apply(this,arguments),X=this.__zoom,R=F==null?T(J):typeof F=="function"?F.apply(this,arguments):F,ie=X.invert(R),G=typeof Q=="function"?Q.apply(this,arguments):Q;return n(N(j(X,G),R,ie),J,a)},F,Y)},k.translateBy=function(z,Q,F,Y){k.transform(z,function(){return n(this.__zoom.translate(typeof Q=="function"?Q.apply(this,arguments):Q,typeof F=="function"?F.apply(this,arguments):F),e.apply(this,arguments),a)},null,Y)},k.translateTo=function(z,Q,F,Y,J){k.transform(z,function(){var X=e.apply(this,arguments),R=this.__zoom,ie=Y==null?T(X):typeof Y=="function"?Y.apply(this,arguments):Y;return n(Fl.translate(ie[0],ie[1]).scale(R.k).translate(typeof Q=="function"?-Q.apply(this,arguments):-Q,typeof F=="function"?-F.apply(this,arguments):-F),X,a)},Y,J)};function j(z,Q){return Q=Math.max(i[0],Math.min(i[1],Q)),Q===z.k?z:new Rl(Q,z.x,z.y)}function N(z,Q,F){var Y=Q[0]-F[0]*z.k,J=Q[1]-F[1]*z.k;return Y===z.x&&J===z.y?z:new Rl(z.k,Y,J)}function T(z){return[(+z[0][0]+ +z[1][0])/2,(+z[0][1]+ +z[1][1])/2]}function E(z,Q,F,Y){z.on("start.zoom",function(){_(this,arguments).event(Y).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(Y).end()}).tween("zoom",function(){var J=this,X=arguments,R=_(J,X).event(Y),ie=e.apply(J,X),G=F==null?T(ie):typeof F=="function"?F.apply(J,X):F,I=Math.max(ie[1][0]-ie[0][0],ie[1][1]-ie[0][1]),V=J.__zoom,ee=typeof Q=="function"?Q.apply(J,X):Q,ne=c(V.invert(G).concat(I/V.k),ee.invert(G).concat(I/ee.k));return function(W){if(W===1)W=ee;else{var se=ne(W),re=I/se[2];W=new Rl(re,G[0]-se[0]*re,G[1]-se[1]*re)}R.zoom(null,W)}})}function _(z,Q,F){return!F&&z.__zooming||new A(z,Q)}function A(z,Q){this.that=z,this.args=Q,this.active=0,this.sourceEvent=null,this.extent=e.apply(z,Q),this.taps=0}A.prototype={event:function(z){return z&&(this.sourceEvent=z),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(z,Q){return this.mouse&&z!=="mouse"&&(this.mouse[1]=Q.invert(this.mouse[0])),this.touch0&&z!=="touch"&&(this.touch0[1]=Q.invert(this.touch0[0])),this.touch1&&z!=="touch"&&(this.touch1[1]=Q.invert(this.touch1[0])),this.that.__zoom=Q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(z){var Q=ma(this.that).datum();d.call(z,this.that,new VNe(z,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:d}),Q)}};function L(z,...Q){if(!t.apply(this,arguments))return;var F=_(this,Q).event(z),Y=this.__zoom,J=Math.max(i[0],Math.min(i[1],Y.k*Math.pow(2,r.apply(this,arguments)))),X=Ha(z);if(F.wheel)(F.mouse[0][0]!==X[0]||F.mouse[0][1]!==X[1])&&(F.mouse[1]=Y.invert(F.mouse[0]=X)),clearTimeout(F.wheel);else{if(Y.k===J)return;F.mouse=[X,Y.invert(X)],Tv(this),F.start()}n0(z),F.wheel=setTimeout(R,y),F.zoom("mouse",n(N(j(Y,J),F.mouse[0],F.mouse[1]),F.extent,a));function R(){F.wheel=null,F.end()}}function P(z,...Q){if(g||!t.apply(this,arguments))return;var F=z.currentTarget,Y=_(this,Q,!0).event(z),J=ma(z.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",I,!0),X=Ha(z,F),R=z.clientX,ie=z.clientY;uW(z.view),l5(z),Y.mouse=[X,this.__zoom.invert(X)],Tv(this),Y.start();function G(V){if(n0(V),!Y.moved){var ee=V.clientX-R,ne=V.clientY-ie;Y.moved=ee*ee+ne*ne>w}Y.event(V).zoom("mouse",n(N(Y.that.__zoom,Y.mouse[0]=Ha(V,F),Y.mouse[1]),Y.extent,a))}function I(V){J.on("mousemove.zoom mouseup.zoom",null),dW(V.view,Y.moved),n0(V),Y.event(V).end()}}function B(z,...Q){if(t.apply(this,arguments)){var F=this.__zoom,Y=Ha(z.changedTouches?z.changedTouches[0]:z,this),J=F.invert(Y),X=F.k*(z.shiftKey?.5:2),R=n(N(j(F,X),Y,J),e.apply(this,Q),a);n0(z),l>0?ma(this).transition().duration(l).call(E,R,Y,z):ma(this).call(k.transform,R,Y,z)}}function $(z,...Q){if(t.apply(this,arguments)){var F=z.touches,Y=F.length,J=_(this,Q,z.changedTouches.length===Y).event(z),X,R,ie,G;for(l5(z),R=0;R"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,e)=>`Couldn't create edge for ${t?"target":"source"} handle id: "${t?e.targetHandle:e.sourceHandle}", edge id: ${e.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},bW=Gl.error001();function hr(t,e){const n=b.useContext(Zb);if(n===null)throw new Error(bW);return KU(n,t,e)}const ps=()=>{const t=b.useContext(Zb);if(t===null)throw new Error(bW);return b.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe,destroy:t.destroy}),[t])},ZNe=t=>t.userSelectionActive?"none":"all";function Jb({position:t,children:e,className:n,style:r,...s}){const i=hr(ZNe),a=`${t}`.split("-");return ae.createElement("div",{className:Bs(["react-flow__panel",n,...a]),style:{...r,pointerEvents:i},...s},e)}function JNe({proOptions:t,position:e="bottom-right"}){return t?.hideAttribution?null:ae.createElement(Jb,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},ae.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const e7e=({x:t,y:e,label:n,labelStyle:r={},labelShowBg:s=!0,labelBgStyle:i={},labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:c,className:d,...h})=>{const m=b.useRef(null),[g,x]=b.useState({x:0,y:0,width:0,height:0}),y=Bs(["react-flow__edge-textwrapper",d]);return b.useEffect(()=>{if(m.current){const w=m.current.getBBox();x({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),typeof n>"u"||!n?null:ae.createElement("g",{transform:`translate(${t-g.width/2} ${e-g.height/2})`,className:y,visibility:g.width?"visible":"hidden",...h},s&&ae.createElement("rect",{width:g.width+2*a[0],x:-a[0],y:-a[1],height:g.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),ae.createElement("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:m,style:r},n),c)};var t7e=b.memo(e7e);const YN=t=>({width:t.offsetWidth,height:t.offsetHeight}),gf=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),KN=(t={x:0,y:0},e)=>({x:gf(t.x,e[0][0],e[1][0]),y:gf(t.y,e[0][1],e[1][1])}),lD=(t,e,n)=>tn?-gf(Math.abs(t-n),1,50)/50:0,wW=(t,e)=>{const n=lD(t.x,35,e.width-35)*20,r=lD(t.y,35,e.height-35)*20;return[n,r]},SW=t=>t.getRootNode?.()||window?.document,kW=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),wp=({x:t,y:e,width:n,height:r})=>({x:t,y:e,x2:t+n,y2:e+r}),OW=({x:t,y:e,x2:n,y2:r})=>({x:t,y:e,width:n-t,height:r-e}),cD=t=>({...t.positionAbsolute||{x:0,y:0},width:t.width||0,height:t.height||0}),n7e=(t,e)=>OW(kW(wp(t),wp(e))),ej=(t,e)=>{const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),r=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*r)},r7e=t=>ka(t.width)&&ka(t.height)&&ka(t.x)&&ka(t.y),ka=t=>!isNaN(t)&&isFinite(t),Lr=Symbol.for("internals"),jW=["Enter"," ","Escape"],s7e=(t,e)=>{},i7e=t=>"nativeEvent"in t;function tj(t){const n=(i7e(t)?t.nativeEvent:t).composedPath?.()?.[0]||t.target;return["INPUT","SELECT","TEXTAREA"].includes(n?.nodeName)||n?.hasAttribute("contenteditable")||!!n?.closest(".nokey")}const NW=t=>"clientX"in t,Hc=(t,e)=>{const n=NW(t),r=n?t.clientX:t.touches?.[0].clientX,s=n?t.clientY:t.touches?.[0].clientY;return{x:r-(e?.left??0),y:s-(e?.top??0)}},Ay=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0,vg=({id:t,path:e,labelX:n,labelY:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d,style:h,markerEnd:m,markerStart:g,interactionWidth:x=20})=>ae.createElement(ae.Fragment,null,ae.createElement("path",{id:t,style:h,d:e,fill:"none",className:"react-flow__edge-path",markerEnd:m,markerStart:g}),x&&ae.createElement("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:x,className:"react-flow__edge-interaction"}),s&&ka(n)&&ka(r)?ae.createElement(t7e,{x:n,y:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d}):null);vg.displayName="BaseEdge";function r0(t,e,n){return n===void 0?n:r=>{const s=e().edges.find(i=>i.id===t);s&&n(r,{...s})}}function CW({sourceX:t,sourceY:e,targetX:n,targetY:r}){const s=Math.abs(n-t)/2,i=n{const[S,k,j]=EW({sourceX:t,sourceY:e,sourcePosition:s,targetX:n,targetY:r,targetPosition:i});return ae.createElement(vg,{path:S,labelX:k,labelY:j,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:y,interactionWidth:w})});ZN.displayName="SimpleBezierEdge";const dD={[wt.Left]:{x:-1,y:0},[wt.Right]:{x:1,y:0},[wt.Top]:{x:0,y:-1},[wt.Bottom]:{x:0,y:1}},a7e=({source:t,sourcePosition:e=wt.Bottom,target:n})=>e===wt.Left||e===wt.Right?t.xMath.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function o7e({source:t,sourcePosition:e=wt.Bottom,target:n,targetPosition:r=wt.Top,center:s,offset:i}){const a=dD[e],l=dD[r],c={x:t.x+a.x*i,y:t.y+a.y*i},d={x:n.x+l.x*i,y:n.y+l.y*i},h=a7e({source:c,sourcePosition:e,target:d}),m=h.x!==0?"x":"y",g=h[m];let x=[],y,w;const S={x:0,y:0},k={x:0,y:0},[j,N,T,E]=CW({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(a[m]*l[m]===-1){y=s.x??j,w=s.y??N;const A=[{x:y,y:c.y},{x:y,y:d.y}],L=[{x:c.x,y:w},{x:d.x,y:w}];a[m]===g?x=m==="x"?A:L:x=m==="x"?L:A}else{const A=[{x:c.x,y:d.y}],L=[{x:d.x,y:c.y}];if(m==="x"?x=a.x===g?L:A:x=a.y===g?A:L,e===r){const te=Math.abs(t[m]-n[m]);if(te<=i){const z=Math.min(i-1,i-te);a[m]===g?S[m]=(c[m]>t[m]?-1:1)*z:k[m]=(d[m]>n[m]?-1:1)*z}}if(e!==r){const te=m==="x"?"y":"x",z=a[m]===l[te],Q=c[te]>d[te],F=c[te]=U?(y=(P.x+B.x)/2,w=x[0].y):(y=x[0].x,w=(P.y+B.y)/2)}return[[t,{x:c.x+S.x,y:c.y+S.y},...x,{x:d.x+k.x,y:d.y+k.y},n],y,w,T,E]}function l7e(t,e,n,r){const s=Math.min(hD(t,e)/2,hD(e,n)/2,r),{x:i,y:a}=e;if(t.x===i&&i===n.x||t.y===a&&a===n.y)return`L${i} ${a}`;if(t.y===a){const d=t.x{let N="";return j>0&&j{const[k,j,N]=nj({sourceX:t,sourceY:e,sourcePosition:m,targetX:n,targetY:r,targetPosition:g,borderRadius:w?.borderRadius,offset:w?.offset});return ae.createElement(vg,{path:k,labelX:j,labelY:N,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d,style:h,markerEnd:x,markerStart:y,interactionWidth:S})});ew.displayName="SmoothStepEdge";const JN=b.memo(t=>ae.createElement(ew,{...t,pathOptions:b.useMemo(()=>({borderRadius:0,offset:t.pathOptions?.offset}),[t.pathOptions?.offset])}));JN.displayName="StepEdge";function c7e({sourceX:t,sourceY:e,targetX:n,targetY:r}){const[s,i,a,l]=CW({sourceX:t,sourceY:e,targetX:n,targetY:r});return[`M ${t},${e}L ${n},${r}`,s,i,a,l]}const e7=b.memo(({sourceX:t,sourceY:e,targetX:n,targetY:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d,style:h,markerEnd:m,markerStart:g,interactionWidth:x})=>{const[y,w,S]=c7e({sourceX:t,sourceY:e,targetX:n,targetY:r});return ae.createElement(vg,{path:y,labelX:w,labelY:S,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d,style:h,markerEnd:m,markerStart:g,interactionWidth:x})});e7.displayName="StraightEdge";function $1(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function fD({pos:t,x1:e,y1:n,x2:r,y2:s,c:i}){switch(t){case wt.Left:return[e-$1(e-r,i),n];case wt.Right:return[e+$1(r-e,i),n];case wt.Top:return[e,n-$1(n-s,i)];case wt.Bottom:return[e,n+$1(s-n,i)]}}function _W({sourceX:t,sourceY:e,sourcePosition:n=wt.Bottom,targetX:r,targetY:s,targetPosition:i=wt.Top,curvature:a=.25}){const[l,c]=fD({pos:n,x1:t,y1:e,x2:r,y2:s,c:a}),[d,h]=fD({pos:i,x1:r,y1:s,x2:t,y2:e,c:a}),[m,g,x,y]=TW({sourceX:t,sourceY:e,targetX:r,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:d,targetControlY:h});return[`M${t},${e} C${l},${c} ${d},${h} ${r},${s}`,m,g,x,y]}const Ry=b.memo(({sourceX:t,sourceY:e,targetX:n,targetY:r,sourcePosition:s=wt.Bottom,targetPosition:i=wt.Top,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:y,pathOptions:w,interactionWidth:S})=>{const[k,j,N]=_W({sourceX:t,sourceY:e,sourcePosition:s,targetX:n,targetY:r,targetPosition:i,curvature:w?.curvature});return ae.createElement(vg,{path:k,labelX:j,labelY:N,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:y,interactionWidth:S})});Ry.displayName="BezierEdge";const t7=b.createContext(null),u7e=t7.Provider;t7.Consumer;const d7e=()=>b.useContext(t7),h7e=t=>"id"in t&&"source"in t&&"target"in t,f7e=({source:t,sourceHandle:e,target:n,targetHandle:r})=>`reactflow__edge-${t}${e||""}-${n}${r||""}`,rj=(t,e)=>typeof t>"u"?"":typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(r=>`${r}=${t[r]}`).join("&")}`,m7e=(t,e)=>e.some(n=>n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle)),p7e=(t,e)=>{if(!t.source||!t.target)return e;let n;return h7e(t)?n={...t}:n={...t,id:f7e(t)},m7e(n,e)?e:e.concat(n)},sj=({x:t,y:e},[n,r,s],i,[a,l])=>{const c={x:(t-n)/s,y:(e-r)/s};return i?{x:a*Math.round(c.x/a),y:l*Math.round(c.y/l)}:c},AW=({x:t,y:e},[n,r,s])=>({x:t*s+n,y:e*s+r}),td=(t,e=[0,0])=>{if(!t)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(t.width??0)*e[0],r=(t.height??0)*e[1],s={x:t.position.x-n,y:t.position.y-r};return{...s,positionAbsolute:t.positionAbsolute?{x:t.positionAbsolute.x-n,y:t.positionAbsolute.y-r}:s}},tw=(t,e=[0,0])=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const n=t.reduce((r,s)=>{const{x:i,y:a}=td(s,e).positionAbsolute;return kW(r,wp({x:i,y:a,width:s.width||0,height:s.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return OW(n)},MW=(t,e,[n,r,s]=[0,0,1],i=!1,a=!1,l=[0,0])=>{const c={x:(e.x-n)/s,y:(e.y-r)/s,width:e.width/s,height:e.height/s},d=[];return t.forEach(h=>{const{width:m,height:g,selectable:x=!0,hidden:y=!1}=h;if(a&&!x||y)return!1;const{positionAbsolute:w}=td(h,l),S={x:w.x,y:w.y,width:m||0,height:g||0},k=ej(c,S),j=typeof m>"u"||typeof g>"u"||m===null||g===null,N=i&&k>0,T=(m||0)*(g||0);(j||N||k>=T||h.dragging)&&d.push(h)}),d},RW=(t,e)=>{const n=t.map(r=>r.id);return e.filter(r=>n.includes(r.source)||n.includes(r.target))},DW=(t,e,n,r,s,i=.1)=>{const a=e/(t.width*(1+i)),l=n/(t.height*(1+i)),c=Math.min(a,l),d=gf(c,r,s),h=t.x+t.width/2,m=t.y+t.height/2,g=e/2-h*d,x=n/2-m*d;return{x:g,y:x,zoom:d}},Lu=(t,e=0)=>t.transition().duration(e);function mD(t,e,n,r){return(e[n]||[]).reduce((s,i)=>(`${t.id}-${i.id}-${n}`!==r&&s.push({id:i.id||null,type:n,nodeId:t.id,x:(t.positionAbsolute?.x??0)+i.x+i.width/2,y:(t.positionAbsolute?.y??0)+i.y+i.height/2}),s),[])}function g7e(t,e,n,r,s,i){const{x:a,y:l}=Hc(t),d=e.elementsFromPoint(a,l).find(y=>y.classList.contains("react-flow__handle"));if(d){const y=d.getAttribute("data-nodeid");if(y){const w=n7(void 0,d),S=d.getAttribute("data-handleid"),k=i({nodeId:y,id:S,type:w});if(k){const j=s.find(N=>N.nodeId===y&&N.type===w&&N.id===S);return{handle:{id:S,type:w,nodeId:y,x:j?.x||n.x,y:j?.y||n.y},validHandleResult:k}}}}let h=[],m=1/0;if(s.forEach(y=>{const w=Math.sqrt((y.x-n.x)**2+(y.y-n.y)**2);if(w<=r){const S=i(y);w<=m&&(wy.isValid),x=h.some(({handle:y})=>y.type==="target");return h.find(({handle:y,validHandleResult:w})=>x?y.type==="target":g?w.isValid:!0)||h[0]}const x7e={source:null,target:null,sourceHandle:null,targetHandle:null},PW=()=>({handleDomNode:null,isValid:!1,connection:x7e,endHandle:null});function zW(t,e,n,r,s,i,a){const l=s==="target",c=a.querySelector(`.react-flow__handle[data-id="${t?.nodeId}-${t?.id}-${t?.type}"]`),d={...PW(),handleDomNode:c};if(c){const h=n7(void 0,c),m=c.getAttribute("data-nodeid"),g=c.getAttribute("data-handleid"),x=c.classList.contains("connectable"),y=c.classList.contains("connectableend"),w={source:l?m:n,sourceHandle:l?g:r,target:l?n:m,targetHandle:l?r:g};d.connection=w,x&&y&&(e===pd.Strict?l&&h==="source"||!l&&h==="target":m!==n||g!==r)&&(d.endHandle={nodeId:m,handleId:g,type:h},d.isValid=i(w))}return d}function v7e({nodes:t,nodeId:e,handleId:n,handleType:r}){return t.reduce((s,i)=>{if(i[Lr]){const{handleBounds:a}=i[Lr];let l=[],c=[];a&&(l=mD(i,a,"source",`${e}-${n}-${r}`),c=mD(i,a,"target",`${e}-${n}-${r}`)),s.push(...l,...c)}return s},[])}function n7(t,e){return t||(e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null)}function c5(t){t?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function y7e(t,e){let n=null;return e?n="valid":t&&!e&&(n="invalid"),n}function IW({event:t,handleId:e,nodeId:n,onConnect:r,isTarget:s,getState:i,setState:a,isValidConnection:l,edgeUpdaterType:c,onReconnectEnd:d}){const h=SW(t.target),{connectionMode:m,domNode:g,autoPanOnConnect:x,connectionRadius:y,onConnectStart:w,panBy:S,getNodes:k,cancelConnection:j}=i();let N=0,T;const{x:E,y:_}=Hc(t),A=h?.elementFromPoint(E,_),L=n7(c,A),P=g?.getBoundingClientRect();if(!P||!L)return;let B,$=Hc(t,P),U=!1,te=null,z=!1,Q=null;const F=v7e({nodes:k(),nodeId:n,handleId:e,handleType:L}),Y=()=>{if(!x)return;const[R,ie]=wW($,P);S({x:R,y:ie}),N=requestAnimationFrame(Y)};a({connectionPosition:$,connectionStatus:null,connectionNodeId:n,connectionHandleId:e,connectionHandleType:L,connectionStartHandle:{nodeId:n,handleId:e,type:L},connectionEndHandle:null}),w?.(t,{nodeId:n,handleId:e,handleType:L});function J(R){const{transform:ie}=i();$=Hc(R,P);const{handle:G,validHandleResult:I}=g7e(R,h,sj($,ie,!1,[1,1]),y,F,V=>zW(V,m,n,e,s?"target":"source",l,h));if(T=G,U||(Y(),U=!0),Q=I.handleDomNode,te=I.connection,z=I.isValid,a({connectionPosition:T&&z?AW({x:T.x,y:T.y},ie):$,connectionStatus:y7e(!!T,z),connectionEndHandle:I.endHandle}),!T&&!z&&!Q)return c5(B);te.source!==te.target&&Q&&(c5(B),B=Q,Q.classList.add("connecting","react-flow__handle-connecting"),Q.classList.toggle("valid",z),Q.classList.toggle("react-flow__handle-valid",z))}function X(R){(T||Q)&&te&&z&&r?.(te),i().onConnectEnd?.(R),c&&d?.(R),c5(B),j(),cancelAnimationFrame(N),U=!1,z=!1,te=null,Q=null,h.removeEventListener("mousemove",J),h.removeEventListener("mouseup",X),h.removeEventListener("touchmove",J),h.removeEventListener("touchend",X)}h.addEventListener("mousemove",J),h.addEventListener("mouseup",X),h.addEventListener("touchmove",J),h.addEventListener("touchend",X)}const pD=()=>!0,b7e=t=>({connectionStartHandle:t.connectionStartHandle,connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName}),w7e=(t,e,n)=>r=>{const{connectionStartHandle:s,connectionEndHandle:i,connectionClickStartHandle:a}=r;return{connecting:s?.nodeId===t&&s?.handleId===e&&s?.type===n||i?.nodeId===t&&i?.handleId===e&&i?.type===n,clickConnecting:a?.nodeId===t&&a?.handleId===e&&a?.type===n}},LW=b.forwardRef(({type:t="source",position:e=wt.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:l,children:c,className:d,onMouseDown:h,onTouchStart:m,...g},x)=>{const y=a||null,w=t==="target",S=ps(),k=d7e(),{connectOnClick:j,noPanClassName:N}=hr(b7e,ks),{connecting:T,clickConnecting:E}=hr(w7e(k,y,t),ks);k||S.getState().onError?.("010",Gl.error010());const _=P=>{const{defaultEdgeOptions:B,onConnect:$,hasDefaultEdges:U}=S.getState(),te={...B,...P};if(U){const{edges:z,setEdges:Q}=S.getState();Q(p7e(te,z))}$?.(te),l?.(te)},A=P=>{if(!k)return;const B=NW(P);s&&(B&&P.button===0||!B)&&IW({event:P,handleId:y,nodeId:k,onConnect:_,isTarget:w,getState:S.getState,setState:S.setState,isValidConnection:n||S.getState().isValidConnection||pD}),B?h?.(P):m?.(P)},L=P=>{const{onClickConnectStart:B,onClickConnectEnd:$,connectionClickStartHandle:U,connectionMode:te,isValidConnection:z}=S.getState();if(!k||!U&&!s)return;if(!U){B?.(P,{nodeId:k,handleId:y,handleType:t}),S.setState({connectionClickStartHandle:{nodeId:k,type:t,handleId:y}});return}const Q=SW(P.target),F=n||z||pD,{connection:Y,isValid:J}=zW({nodeId:k,id:y,type:t},te,U.nodeId,U.handleId||null,U.type,F,Q);J&&_(Y),$?.(P),S.setState({connectionClickStartHandle:null})};return ae.createElement("div",{"data-handleid":y,"data-nodeid":k,"data-handlepos":e,"data-id":`${k}-${y}-${t}`,className:Bs(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",N,d,{source:!w,target:w,connectable:r,connectablestart:s,connectableend:i,connecting:E,connectionindicator:r&&(s&&!T||i&&T)}]),onMouseDown:A,onTouchStart:A,onClick:j?L:void 0,ref:x,...g},c)});LW.displayName="Handle";var ru=b.memo(LW);const BW=({data:t,isConnectable:e,targetPosition:n=wt.Top,sourcePosition:r=wt.Bottom})=>ae.createElement(ae.Fragment,null,ae.createElement(ru,{type:"target",position:n,isConnectable:e}),t?.label,ae.createElement(ru,{type:"source",position:r,isConnectable:e}));BW.displayName="DefaultNode";var ij=b.memo(BW);const FW=({data:t,isConnectable:e,sourcePosition:n=wt.Bottom})=>ae.createElement(ae.Fragment,null,t?.label,ae.createElement(ru,{type:"source",position:n,isConnectable:e}));FW.displayName="InputNode";var qW=b.memo(FW);const $W=({data:t,isConnectable:e,targetPosition:n=wt.Top})=>ae.createElement(ae.Fragment,null,ae.createElement(ru,{type:"target",position:n,isConnectable:e}),t?.label);$W.displayName="OutputNode";var HW=b.memo($W);const r7=()=>null;r7.displayName="GroupNode";const S7e=t=>({selectedNodes:t.getNodes().filter(e=>e.selected),selectedEdges:t.edges.filter(e=>e.selected).map(e=>({...e}))}),H1=t=>t.id;function k7e(t,e){return ks(t.selectedNodes.map(H1),e.selectedNodes.map(H1))&&ks(t.selectedEdges.map(H1),e.selectedEdges.map(H1))}const QW=b.memo(({onSelectionChange:t})=>{const e=ps(),{selectedNodes:n,selectedEdges:r}=hr(S7e,k7e);return b.useEffect(()=>{const s={nodes:n,edges:r};t?.(s),e.getState().onSelectionChange.forEach(i=>i(s))},[n,r,t]),null});QW.displayName="SelectionListener";const O7e=t=>!!t.onSelectionChange;function j7e({onSelectionChange:t}){const e=hr(O7e);return t||e?ae.createElement(QW,{onSelectionChange:t}):null}const N7e=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset});function uh(t,e){b.useEffect(()=>{typeof t<"u"&&e(t)},[t])}function an(t,e,n){b.useEffect(()=>{typeof e<"u"&&n({[t]:e})},[e])}const C7e=({nodes:t,edges:e,defaultNodes:n,defaultEdges:r,onConnect:s,onConnectStart:i,onConnectEnd:a,onClickConnectStart:l,onClickConnectEnd:c,nodesDraggable:d,nodesConnectable:h,nodesFocusable:m,edgesFocusable:g,edgesUpdatable:x,elevateNodesOnSelect:y,minZoom:w,maxZoom:S,nodeExtent:k,onNodesChange:j,onEdgesChange:N,elementsSelectable:T,connectionMode:E,snapGrid:_,snapToGrid:A,translateExtent:L,connectOnClick:P,defaultEdgeOptions:B,fitView:$,fitViewOptions:U,onNodesDelete:te,onEdgesDelete:z,onNodeDrag:Q,onNodeDragStart:F,onNodeDragStop:Y,onSelectionDrag:J,onSelectionDragStart:X,onSelectionDragStop:R,noPanClassName:ie,nodeOrigin:G,rfId:I,autoPanOnConnect:V,autoPanOnNodeDrag:ee,onError:ne,connectionRadius:W,isValidConnection:se,nodeDragThreshold:re})=>{const{setNodes:oe,setEdges:Te,setDefaultNodesAndEdges:We,setMinZoom:Ye,setMaxZoom:Je,setTranslateExtent:Oe,setNodeExtent:Ve,reset:Ue}=hr(N7e,ks),He=ps();return b.useEffect(()=>{const Ot=r?.map(xt=>({...xt,...B}));return We(n,Ot),()=>{Ue()}},[]),an("defaultEdgeOptions",B,He.setState),an("connectionMode",E,He.setState),an("onConnect",s,He.setState),an("onConnectStart",i,He.setState),an("onConnectEnd",a,He.setState),an("onClickConnectStart",l,He.setState),an("onClickConnectEnd",c,He.setState),an("nodesDraggable",d,He.setState),an("nodesConnectable",h,He.setState),an("nodesFocusable",m,He.setState),an("edgesFocusable",g,He.setState),an("edgesUpdatable",x,He.setState),an("elementsSelectable",T,He.setState),an("elevateNodesOnSelect",y,He.setState),an("snapToGrid",A,He.setState),an("snapGrid",_,He.setState),an("onNodesChange",j,He.setState),an("onEdgesChange",N,He.setState),an("connectOnClick",P,He.setState),an("fitViewOnInit",$,He.setState),an("fitViewOnInitOptions",U,He.setState),an("onNodesDelete",te,He.setState),an("onEdgesDelete",z,He.setState),an("onNodeDrag",Q,He.setState),an("onNodeDragStart",F,He.setState),an("onNodeDragStop",Y,He.setState),an("onSelectionDrag",J,He.setState),an("onSelectionDragStart",X,He.setState),an("onSelectionDragStop",R,He.setState),an("noPanClassName",ie,He.setState),an("nodeOrigin",G,He.setState),an("rfId",I,He.setState),an("autoPanOnConnect",V,He.setState),an("autoPanOnNodeDrag",ee,He.setState),an("onError",ne,He.setState),an("connectionRadius",W,He.setState),an("isValidConnection",se,He.setState),an("nodeDragThreshold",re,He.setState),uh(t,oe),uh(e,Te),uh(w,Ye),uh(S,Je),uh(L,Oe),uh(k,Ve),null},gD={display:"none"},T7e={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},VW="react-flow__node-desc",UW="react-flow__edge-desc",E7e="react-flow__aria-live",_7e=t=>t.ariaLiveMessage;function A7e({rfId:t}){const e=hr(_7e);return ae.createElement("div",{id:`${E7e}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:T7e},e)}function M7e({rfId:t,disableKeyboardA11y:e}){return ae.createElement(ae.Fragment,null,ae.createElement("div",{id:`${VW}-${t}`,style:gD},"Press enter or space to select a node.",!e&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),ae.createElement("div",{id:`${UW}-${t}`,style:gD},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!e&&ae.createElement(A7e,{rfId:t}))}var kp=(t=null,e={actInsideInputWithModifier:!0})=>{const[n,r]=b.useState(!1),s=b.useRef(!1),i=b.useRef(new Set([])),[a,l]=b.useMemo(()=>{if(t!==null){const d=(Array.isArray(t)?t:[t]).filter(m=>typeof m=="string").map(m=>m.split("+")),h=d.reduce((m,g)=>m.concat(...g),[]);return[d,h]}return[[],[]]},[t]);return b.useEffect(()=>{const c=typeof document<"u"?document:null,d=e?.target||c;if(t!==null){const h=x=>{if(s.current=x.ctrlKey||x.metaKey||x.shiftKey,(!s.current||s.current&&!e.actInsideInputWithModifier)&&tj(x))return!1;const w=vD(x.code,l);i.current.add(x[w]),xD(a,i.current,!1)&&(x.preventDefault(),r(!0))},m=x=>{if((!s.current||s.current&&!e.actInsideInputWithModifier)&&tj(x))return!1;const w=vD(x.code,l);xD(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(x[w]),x.key==="Meta"&&i.current.clear(),s.current=!1},g=()=>{i.current.clear(),r(!1)};return d?.addEventListener("keydown",h),d?.addEventListener("keyup",m),window.addEventListener("blur",g),()=>{d?.removeEventListener("keydown",h),d?.removeEventListener("keyup",m),window.removeEventListener("blur",g)}}},[t,r]),n};function xD(t,e,n){return t.filter(r=>n||r.length===e.size).some(r=>r.every(s=>e.has(s)))}function vD(t,e){return e.includes(t)?"code":"key"}function WW(t,e,n,r){const s=t.parentNode||t.parentId;if(!s)return n;const i=e.get(s),a=td(i,r);return WW(i,e,{x:(n.x??0)+a.x,y:(n.y??0)+a.y,z:(i[Lr]?.z??0)>(n.z??0)?i[Lr]?.z??0:n.z??0},r)}function GW(t,e,n){t.forEach(r=>{const s=r.parentNode||r.parentId;if(s&&!t.has(s))throw new Error(`Parent node ${s} not found`);if(s||n?.[r.id]){const{x:i,y:a,z:l}=WW(r,t,{...r.position,z:r[Lr]?.z??0},e);r.positionAbsolute={x:i,y:a},r[Lr].z=l,n?.[r.id]&&(r[Lr].isParent=!0)}})}function u5(t,e,n,r){const s=new Map,i={},a=r?1e3:0;return t.forEach(l=>{const c=(ka(l.zIndex)?l.zIndex:0)+(l.selected?a:0),d=e.get(l.id),h={...l,positionAbsolute:{x:l.position.x,y:l.position.y}},m=l.parentNode||l.parentId;m&&(i[m]=!0);const g=d?.type&&d?.type!==l.type;Object.defineProperty(h,Lr,{enumerable:!1,value:{handleBounds:g?void 0:d?.[Lr]?.handleBounds,z:c}}),s.set(l.id,h)}),GW(s,n,i),s}function XW(t,e={}){const{getNodes:n,width:r,height:s,minZoom:i,maxZoom:a,d3Zoom:l,d3Selection:c,fitViewOnInitDone:d,fitViewOnInit:h,nodeOrigin:m}=t(),g=e.initial&&!d&&h;if(l&&c&&(g||!e.initial)){const y=n().filter(S=>{const k=e.includeHiddenNodes?S.width&&S.height:!S.hidden;return e.nodes?.length?k&&e.nodes.some(j=>j.id===S.id):k}),w=y.every(S=>S.width&&S.height);if(y.length>0&&w){const S=tw(y,m),{x:k,y:j,zoom:N}=DW(S,r,s,e.minZoom??i,e.maxZoom??a,e.padding??.1),T=Fl.translate(k,j).scale(N);return typeof e.duration=="number"&&e.duration>0?l.transform(Lu(c,e.duration),T):l.transform(c,T),!0}}return!1}function R7e(t,e){return t.forEach(n=>{const r=e.get(n.id);r&&e.set(r.id,{...r,[Lr]:r[Lr],selected:n.selected})}),new Map(e)}function D7e(t,e){return e.map(n=>{const r=t.find(s=>s.id===n.id);return r&&(n.selected=r.selected),n})}function Q1({changedNodes:t,changedEdges:e,get:n,set:r}){const{nodeInternals:s,edges:i,onNodesChange:a,onEdgesChange:l,hasDefaultNodes:c,hasDefaultEdges:d}=n();t?.length&&(c&&r({nodeInternals:R7e(t,s)}),a?.(t)),e?.length&&(d&&r({edges:D7e(e,i)}),l?.(e))}const dh=()=>{},P7e={zoomIn:dh,zoomOut:dh,zoomTo:dh,getZoom:()=>1,setViewport:dh,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:dh,fitBounds:dh,project:t=>t,screenToFlowPosition:t=>t,flowToScreenPosition:t=>t,viewportInitialized:!1},z7e=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection}),I7e=()=>{const t=ps(),{d3Zoom:e,d3Selection:n}=hr(z7e,ks);return b.useMemo(()=>n&&e?{zoomIn:s=>e.scaleBy(Lu(n,s?.duration),1.2),zoomOut:s=>e.scaleBy(Lu(n,s?.duration),1/1.2),zoomTo:(s,i)=>e.scaleTo(Lu(n,i?.duration),s),getZoom:()=>t.getState().transform[2],setViewport:(s,i)=>{const[a,l,c]=t.getState().transform,d=Fl.translate(s.x??a,s.y??l).scale(s.zoom??c);e.transform(Lu(n,i?.duration),d)},getViewport:()=>{const[s,i,a]=t.getState().transform;return{x:s,y:i,zoom:a}},fitView:s=>XW(t.getState,s),setCenter:(s,i,a)=>{const{width:l,height:c,maxZoom:d}=t.getState(),h=typeof a?.zoom<"u"?a.zoom:d,m=l/2-s*h,g=c/2-i*h,x=Fl.translate(m,g).scale(h);e.transform(Lu(n,a?.duration),x)},fitBounds:(s,i)=>{const{width:a,height:l,minZoom:c,maxZoom:d}=t.getState(),{x:h,y:m,zoom:g}=DW(s,a,l,c,d,i?.padding??.1),x=Fl.translate(h,m).scale(g);e.transform(Lu(n,i?.duration),x)},project:s=>{const{transform:i,snapToGrid:a,snapGrid:l}=t.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),sj(s,i,a,l)},screenToFlowPosition:s=>{const{transform:i,snapToGrid:a,snapGrid:l,domNode:c}=t.getState();if(!c)return s;const{x:d,y:h}=c.getBoundingClientRect(),m={x:s.x-d,y:s.y-h};return sj(m,i,a,l)},flowToScreenPosition:s=>{const{transform:i,domNode:a}=t.getState();if(!a)return s;const{x:l,y:c}=a.getBoundingClientRect(),d=AW(s,i);return{x:d.x+l,y:d.y+c}},viewportInitialized:!0}:P7e,[e,n])};function s7(){const t=I7e(),e=ps(),n=b.useCallback(()=>e.getState().getNodes().map(w=>({...w})),[]),r=b.useCallback(w=>e.getState().nodeInternals.get(w),[]),s=b.useCallback(()=>{const{edges:w=[]}=e.getState();return w.map(S=>({...S}))},[]),i=b.useCallback(w=>{const{edges:S=[]}=e.getState();return S.find(k=>k.id===w)},[]),a=b.useCallback(w=>{const{getNodes:S,setNodes:k,hasDefaultNodes:j,onNodesChange:N}=e.getState(),T=S(),E=typeof w=="function"?w(T):w;if(j)k(E);else if(N){const _=E.length===0?T.map(A=>({type:"remove",id:A.id})):E.map(A=>({item:A,type:"reset"}));N(_)}},[]),l=b.useCallback(w=>{const{edges:S=[],setEdges:k,hasDefaultEdges:j,onEdgesChange:N}=e.getState(),T=typeof w=="function"?w(S):w;if(j)k(T);else if(N){const E=T.length===0?S.map(_=>({type:"remove",id:_.id})):T.map(_=>({item:_,type:"reset"}));N(E)}},[]),c=b.useCallback(w=>{const S=Array.isArray(w)?w:[w],{getNodes:k,setNodes:j,hasDefaultNodes:N,onNodesChange:T}=e.getState();if(N){const _=[...k(),...S];j(_)}else if(T){const E=S.map(_=>({item:_,type:"add"}));T(E)}},[]),d=b.useCallback(w=>{const S=Array.isArray(w)?w:[w],{edges:k=[],setEdges:j,hasDefaultEdges:N,onEdgesChange:T}=e.getState();if(N)j([...k,...S]);else if(T){const E=S.map(_=>({item:_,type:"add"}));T(E)}},[]),h=b.useCallback(()=>{const{getNodes:w,edges:S=[],transform:k}=e.getState(),[j,N,T]=k;return{nodes:w().map(E=>({...E})),edges:S.map(E=>({...E})),viewport:{x:j,y:N,zoom:T}}},[]),m=b.useCallback(({nodes:w,edges:S})=>{const{nodeInternals:k,getNodes:j,edges:N,hasDefaultNodes:T,hasDefaultEdges:E,onNodesDelete:_,onEdgesDelete:A,onNodesChange:L,onEdgesChange:P}=e.getState(),B=(w||[]).map(Q=>Q.id),$=(S||[]).map(Q=>Q.id),U=j().reduce((Q,F)=>{const Y=F.parentNode||F.parentId,J=!B.includes(F.id)&&Y&&Q.find(R=>R.id===Y);return(typeof F.deletable=="boolean"?F.deletable:!0)&&(B.includes(F.id)||J)&&Q.push(F),Q},[]),te=N.filter(Q=>typeof Q.deletable=="boolean"?Q.deletable:!0),z=te.filter(Q=>$.includes(Q.id));if(U||z){const Q=RW(U,te),F=[...z,...Q],Y=F.reduce((J,X)=>(J.includes(X.id)||J.push(X.id),J),[]);if((E||T)&&(E&&e.setState({edges:N.filter(J=>!Y.includes(J.id))}),T&&(U.forEach(J=>{k.delete(J.id)}),e.setState({nodeInternals:new Map(k)}))),Y.length>0&&(A?.(F),P&&P(Y.map(J=>({id:J,type:"remove"})))),U.length>0&&(_?.(U),L)){const J=U.map(X=>({id:X.id,type:"remove"}));L(J)}}},[]),g=b.useCallback(w=>{const S=r7e(w),k=S?null:e.getState().nodeInternals.get(w.id);return!S&&!k?[null,null,S]:[S?w:cD(k),k,S]},[]),x=b.useCallback((w,S=!0,k)=>{const[j,N,T]=g(w);return j?(k||e.getState().getNodes()).filter(E=>{if(!T&&(E.id===N.id||!E.positionAbsolute))return!1;const _=cD(E),A=ej(_,j);return S&&A>0||A>=j.width*j.height}):[]},[]),y=b.useCallback((w,S,k=!0)=>{const[j]=g(w);if(!j)return!1;const N=ej(j,S);return k&&N>0||N>=j.width*j.height},[]);return b.useMemo(()=>({...t,getNodes:n,getNode:r,getEdges:s,getEdge:i,setNodes:a,setEdges:l,addNodes:c,addEdges:d,toObject:h,deleteElements:m,getIntersectingNodes:x,isNodeIntersecting:y}),[t,n,r,s,i,a,l,c,d,h,m,x,y])}const L7e={actInsideInputWithModifier:!1};var B7e=({deleteKeyCode:t,multiSelectionKeyCode:e})=>{const n=ps(),{deleteElements:r}=s7(),s=kp(t,L7e),i=kp(e);b.useEffect(()=>{if(s){const{edges:a,getNodes:l}=n.getState(),c=l().filter(h=>h.selected),d=a.filter(h=>h.selected);r({nodes:c,edges:d}),n.setState({nodesSelectionActive:!1})}},[s]),b.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])};function F7e(t){const e=ps();b.useEffect(()=>{let n;const r=()=>{if(!t.current)return;const s=YN(t.current);(s.height===0||s.width===0)&&e.getState().onError?.("004",Gl.error004()),e.setState({width:s.width||500,height:s.height||500})};return r(),window.addEventListener("resize",r),t.current&&(n=new ResizeObserver(()=>r()),n.observe(t.current)),()=>{window.removeEventListener("resize",r),n&&t.current&&n.unobserve(t.current)}},[])}const i7={position:"absolute",width:"100%",height:"100%",top:0,left:0},q7e=(t,e)=>t.x!==e.x||t.y!==e.y||t.zoom!==e.k,V1=t=>({x:t.x,y:t.y,zoom:t.k}),hh=(t,e)=>t.target.closest(`.${e}`),yD=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),bD=t=>{const e=t.ctrlKey&&Ay()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e},$7e=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection,d3ZoomHandler:t.d3ZoomHandler,userSelectionActive:t.userSelectionActive}),H7e=({onMove:t,onMoveStart:e,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:s=!0,zoomOnPinch:i=!0,panOnScroll:a=!1,panOnScrollSpeed:l=.5,panOnScrollMode:c=Wu.Free,zoomOnDoubleClick:d=!0,elementsSelectable:h,panOnDrag:m=!0,defaultViewport:g,translateExtent:x,minZoom:y,maxZoom:w,zoomActivationKeyCode:S,preventScrolling:k=!0,children:j,noWheelClassName:N,noPanClassName:T})=>{const E=b.useRef(),_=ps(),A=b.useRef(!1),L=b.useRef(!1),P=b.useRef(null),B=b.useRef({x:0,y:0,zoom:0}),{d3Zoom:$,d3Selection:U,d3ZoomHandler:te,userSelectionActive:z}=hr($7e,ks),Q=kp(S),F=b.useRef(0),Y=b.useRef(!1),J=b.useRef();return F7e(P),b.useEffect(()=>{if(P.current){const X=P.current.getBoundingClientRect(),R=yW().scaleExtent([y,w]).translateExtent(x),ie=ma(P.current).call(R),G=Fl.translate(g.x,g.y).scale(gf(g.zoom,y,w)),I=[[0,0],[X.width,X.height]],V=R.constrain()(G,I,x);R.transform(ie,V),R.wheelDelta(bD),_.setState({d3Zoom:R,d3Selection:ie,d3ZoomHandler:ie.on("wheel.zoom"),transform:[V.x,V.y,V.k],domNode:P.current.closest(".react-flow")})}},[]),b.useEffect(()=>{U&&$&&(a&&!Q&&!z?U.on("wheel.zoom",X=>{if(hh(X,N))return!1;X.preventDefault(),X.stopImmediatePropagation();const R=U.property("__zoom").k||1;if(X.ctrlKey&&i){const se=Ha(X),re=bD(X),oe=R*Math.pow(2,re);$.scaleTo(U,oe,se,X);return}const ie=X.deltaMode===1?20:1;let G=c===Wu.Vertical?0:X.deltaX*ie,I=c===Wu.Horizontal?0:X.deltaY*ie;!Ay()&&X.shiftKey&&c!==Wu.Vertical&&(G=X.deltaY*ie,I=0),$.translateBy(U,-(G/R)*l,-(I/R)*l,{internal:!0});const V=V1(U.property("__zoom")),{onViewportChangeStart:ee,onViewportChange:ne,onViewportChangeEnd:W}=_.getState();clearTimeout(J.current),Y.current||(Y.current=!0,e?.(X,V),ee?.(V)),Y.current&&(t?.(X,V),ne?.(V),J.current=setTimeout(()=>{n?.(X,V),W?.(V),Y.current=!1},150))},{passive:!1}):typeof te<"u"&&U.on("wheel.zoom",function(X,R){if(!k&&X.type==="wheel"&&!X.ctrlKey||hh(X,N))return null;X.preventDefault(),te.call(this,X,R)},{passive:!1}))},[z,a,c,U,$,te,Q,i,k,N,e,t,n]),b.useEffect(()=>{$&&$.on("start",X=>{if(!X.sourceEvent||X.sourceEvent.internal)return null;F.current=X.sourceEvent?.button;const{onViewportChangeStart:R}=_.getState(),ie=V1(X.transform);A.current=!0,B.current=ie,X.sourceEvent?.type==="mousedown"&&_.setState({paneDragging:!0}),R?.(ie),e?.(X.sourceEvent,ie)})},[$,e]),b.useEffect(()=>{$&&(z&&!A.current?$.on("zoom",null):z||$.on("zoom",X=>{const{onViewportChange:R}=_.getState();if(_.setState({transform:[X.transform.x,X.transform.y,X.transform.k]}),L.current=!!(r&&yD(m,F.current??0)),(t||R)&&!X.sourceEvent?.internal){const ie=V1(X.transform);R?.(ie),t?.(X.sourceEvent,ie)}}))},[z,$,t,m,r]),b.useEffect(()=>{$&&$.on("end",X=>{if(!X.sourceEvent||X.sourceEvent.internal)return null;const{onViewportChangeEnd:R}=_.getState();if(A.current=!1,_.setState({paneDragging:!1}),r&&yD(m,F.current??0)&&!L.current&&r(X.sourceEvent),L.current=!1,(n||R)&&q7e(B.current,X.transform)){const ie=V1(X.transform);B.current=ie,clearTimeout(E.current),E.current=setTimeout(()=>{R?.(ie),n?.(X.sourceEvent,ie)},a?150:0)}})},[$,a,m,n,r]),b.useEffect(()=>{$&&$.filter(X=>{const R=Q||s,ie=i&&X.ctrlKey;if((m===!0||Array.isArray(m)&&m.includes(1))&&X.button===1&&X.type==="mousedown"&&(hh(X,"react-flow__node")||hh(X,"react-flow__edge")))return!0;if(!m&&!R&&!a&&!d&&!i||z||!d&&X.type==="dblclick"||hh(X,N)&&X.type==="wheel"||hh(X,T)&&(X.type!=="wheel"||a&&X.type==="wheel"&&!Q)||!i&&X.ctrlKey&&X.type==="wheel"||!R&&!a&&!ie&&X.type==="wheel"||!m&&(X.type==="mousedown"||X.type==="touchstart")||Array.isArray(m)&&!m.includes(X.button)&&X.type==="mousedown")return!1;const G=Array.isArray(m)&&m.includes(X.button)||!X.button||X.button<=1;return(!X.ctrlKey||X.type==="wheel")&&G})},[z,$,s,i,a,d,m,h,Q]),ae.createElement("div",{className:"react-flow__renderer",ref:P,style:i7},j)},Q7e=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function V7e(){const{userSelectionActive:t,userSelectionRect:e}=hr(Q7e,ks);return t&&e?ae.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}function wD(t,e){const n=e.parentNode||e.parentId,r=t.find(s=>s.id===n);if(r){const s=e.position.x+e.width-r.width,i=e.position.y+e.height-r.height;if(s>0||i>0||e.position.x<0||e.position.y<0){if(r.style={...r.style},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,s>0&&(r.style.width+=s),i>0&&(r.style.height+=i),e.position.x<0){const a=Math.abs(e.position.x);r.position.x=r.position.x-a,r.style.width+=a,e.position.x=0}if(e.position.y<0){const a=Math.abs(e.position.y);r.position.y=r.position.y-a,r.style.height+=a,e.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function YW(t,e){if(t.some(r=>r.type==="reset"))return t.filter(r=>r.type==="reset").map(r=>r.item);const n=t.filter(r=>r.type==="add").map(r=>r.item);return e.reduce((r,s)=>{const i=t.filter(l=>l.id===s.id);if(i.length===0)return r.push(s),r;const a={...s};for(const l of i)if(l)switch(l.type){case"select":{a.selected=l.selected;break}case"position":{typeof l.position<"u"&&(a.position=l.position),typeof l.positionAbsolute<"u"&&(a.positionAbsolute=l.positionAbsolute),typeof l.dragging<"u"&&(a.dragging=l.dragging),a.expandParent&&wD(r,a);break}case"dimensions":{typeof l.dimensions<"u"&&(a.width=l.dimensions.width,a.height=l.dimensions.height),typeof l.updateStyle<"u"&&(a.style={...a.style||{},...l.dimensions}),typeof l.resizing=="boolean"&&(a.resizing=l.resizing),a.expandParent&&wD(r,a);break}case"remove":return r}return r.push(a),r},n)}function KW(t,e){return YW(t,e)}function U7e(t,e){return YW(t,e)}const Pc=(t,e)=>({id:t,type:"select",selected:e});function Eh(t,e){return t.reduce((n,r)=>{const s=e.includes(r.id);return!r.selected&&s?(r.selected=!0,n.push(Pc(r.id,!0))):r.selected&&!s&&(r.selected=!1,n.push(Pc(r.id,!1))),n},[])}const d5=(t,e)=>n=>{n.target===e.current&&t?.(n)},W7e=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,dragging:t.paneDragging}),ZW=b.memo(({isSelecting:t,selectionMode:e=Sp.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:s,onPaneClick:i,onPaneContextMenu:a,onPaneScroll:l,onPaneMouseEnter:c,onPaneMouseMove:d,onPaneMouseLeave:h,children:m})=>{const g=b.useRef(null),x=ps(),y=b.useRef(0),w=b.useRef(0),S=b.useRef(),{userSelectionActive:k,elementsSelectable:j,dragging:N}=hr(W7e,ks),T=()=>{x.setState({userSelectionActive:!1,userSelectionRect:null}),y.current=0,w.current=0},E=te=>{i?.(te),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},_=te=>{if(Array.isArray(n)&&n?.includes(2)){te.preventDefault();return}a?.(te)},A=l?te=>l(te):void 0,L=te=>{const{resetSelectedElements:z,domNode:Q}=x.getState();if(S.current=Q?.getBoundingClientRect(),!j||!t||te.button!==0||te.target!==g.current||!S.current)return;const{x:F,y:Y}=Hc(te,S.current);z(),x.setState({userSelectionRect:{width:0,height:0,startX:F,startY:Y,x:F,y:Y}}),r?.(te)},P=te=>{const{userSelectionRect:z,nodeInternals:Q,edges:F,transform:Y,onNodesChange:J,onEdgesChange:X,nodeOrigin:R,getNodes:ie}=x.getState();if(!t||!S.current||!z)return;x.setState({userSelectionActive:!0,nodesSelectionActive:!1});const G=Hc(te,S.current),I=z.startX??0,V=z.startY??0,ee={...z,x:G.xoe.id),re=W.map(oe=>oe.id);if(y.current!==re.length){y.current=re.length;const oe=Eh(ne,re);oe.length&&J?.(oe)}if(w.current!==se.length){w.current=se.length;const oe=Eh(F,se);oe.length&&X?.(oe)}x.setState({userSelectionRect:ee})},B=te=>{if(te.button!==0)return;const{userSelectionRect:z}=x.getState();!k&&z&&te.target===g.current&&E?.(te),x.setState({nodesSelectionActive:y.current>0}),T(),s?.(te)},$=te=>{k&&(x.setState({nodesSelectionActive:y.current>0}),s?.(te)),T()},U=j&&(t||k);return ae.createElement("div",{className:Bs(["react-flow__pane",{dragging:N,selection:t}]),onClick:U?void 0:d5(E,g),onContextMenu:d5(_,g),onWheel:d5(A,g),onMouseEnter:U?void 0:c,onMouseDown:U?L:void 0,onMouseMove:U?P:d,onMouseUp:U?B:void 0,onMouseLeave:U?$:h,ref:g,style:i7},m,ae.createElement(V7e,null))});ZW.displayName="Pane";function JW(t,e){const n=t.parentNode||t.parentId;if(!n)return!1;const r=e.get(n);return r?r.selected?!0:JW(r,e):!1}function SD(t,e,n){let r=t;do{if(r?.matches(e))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function G7e(t,e,n,r){return Array.from(t.values()).filter(s=>(s.selected||s.id===r)&&(!s.parentNode||s.parentId||!JW(s,t))&&(s.draggable||e&&typeof s.draggable>"u")).map(s=>({id:s.id,position:s.position||{x:0,y:0},positionAbsolute:s.positionAbsolute||{x:0,y:0},distance:{x:n.x-(s.positionAbsolute?.x??0),y:n.y-(s.positionAbsolute?.y??0)},delta:{x:0,y:0},extent:s.extent,parentNode:s.parentNode||s.parentId,parentId:s.parentNode||s.parentId,width:s.width,height:s.height,expandParent:s.expandParent}))}function X7e(t,e){return!e||e==="parent"?e:[e[0],[e[1][0]-(t.width||0),e[1][1]-(t.height||0)]]}function eG(t,e,n,r,s=[0,0],i){const a=X7e(t,t.extent||r);let l=a;const c=t.parentNode||t.parentId;if(t.extent==="parent"&&!t.expandParent)if(c&&t.width&&t.height){const m=n.get(c),{x:g,y:x}=td(m,s).positionAbsolute;l=m&&ka(g)&&ka(x)&&ka(m.width)&&ka(m.height)?[[g+t.width*s[0],x+t.height*s[1]],[g+m.width-t.width+t.width*s[0],x+m.height-t.height+t.height*s[1]]]:l}else i?.("005",Gl.error005()),l=a;else if(t.extent&&c&&t.extent!=="parent"){const m=n.get(c),{x:g,y:x}=td(m,s).positionAbsolute;l=[[t.extent[0][0]+g,t.extent[0][1]+x],[t.extent[1][0]+g,t.extent[1][1]+x]]}let d={x:0,y:0};if(c){const m=n.get(c);d=td(m,s).positionAbsolute}const h=l&&l!=="parent"?KN(e,l):e;return{position:{x:h.x-d.x,y:h.y-d.y},positionAbsolute:h}}function h5({nodeId:t,dragItems:e,nodeInternals:n}){const r=e.map(s=>({...n.get(s.id),position:s.position,positionAbsolute:s.positionAbsolute}));return[t?r.find(s=>s.id===t):r[0],r]}const kD=(t,e,n,r)=>{const s=e.querySelectorAll(t);if(!s||!s.length)return null;const i=Array.from(s),a=e.getBoundingClientRect(),l={x:a.width*r[0],y:a.height*r[1]};return i.map(c=>{const d=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),position:c.getAttribute("data-handlepos"),x:(d.left-a.left-l.x)/n,y:(d.top-a.top-l.y)/n,...YN(c)}})};function s0(t,e,n){return n===void 0?n:r=>{const s=e().nodeInternals.get(t);s&&n(r,{...s})}}function aj({id:t,store:e,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeInternals:l,onError:c}=e.getState(),d=l.get(t);if(!d){c?.("012",Gl.error012(t));return}e.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&a)&&(i({nodes:[d],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):s([t])}function Y7e(){const t=ps();return b.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:s,snapToGrid:i}=t.getState(),a=n.touches?n.touches[0].clientX:n.clientX,l=n.touches?n.touches[0].clientY:n.clientY,c={x:(a-r[0])/r[2],y:(l-r[1])/r[2]};return{xSnapped:i?s[0]*Math.round(c.x/s[0]):c.x,ySnapped:i?s[1]*Math.round(c.y/s[1]):c.y,...c}},[])}function f5(t){return(e,n,r)=>t?.(e,r)}function tG({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:i,selectNodesOnDrag:a}){const l=ps(),[c,d]=b.useState(!1),h=b.useRef([]),m=b.useRef({x:null,y:null}),g=b.useRef(0),x=b.useRef(null),y=b.useRef({x:0,y:0}),w=b.useRef(null),S=b.useRef(!1),k=b.useRef(!1),j=b.useRef(!1),N=Y7e();return b.useEffect(()=>{if(t?.current){const T=ma(t.current),E=({x:L,y:P})=>{const{nodeInternals:B,onNodeDrag:$,onSelectionDrag:U,updateNodePositions:te,nodeExtent:z,snapGrid:Q,snapToGrid:F,nodeOrigin:Y,onError:J}=l.getState();m.current={x:L,y:P};let X=!1,R={x:0,y:0,x2:0,y2:0};if(h.current.length>1&&z){const G=tw(h.current,Y);R=wp(G)}if(h.current=h.current.map(G=>{const I={x:L-G.distance.x,y:P-G.distance.y};F&&(I.x=Q[0]*Math.round(I.x/Q[0]),I.y=Q[1]*Math.round(I.y/Q[1]));const V=[[z[0][0],z[0][1]],[z[1][0],z[1][1]]];h.current.length>1&&z&&!G.extent&&(V[0][0]=G.positionAbsolute.x-R.x+z[0][0],V[1][0]=G.positionAbsolute.x+(G.width??0)-R.x2+z[1][0],V[0][1]=G.positionAbsolute.y-R.y+z[0][1],V[1][1]=G.positionAbsolute.y+(G.height??0)-R.y2+z[1][1]);const ee=eG(G,I,B,V,Y,J);return X=X||G.position.x!==ee.position.x||G.position.y!==ee.position.y,G.position=ee.position,G.positionAbsolute=ee.positionAbsolute,G}),!X)return;te(h.current,!0,!0),d(!0);const ie=s?$:f5(U);if(ie&&w.current){const[G,I]=h5({nodeId:s,dragItems:h.current,nodeInternals:B});ie(w.current,G,I)}},_=()=>{if(!x.current)return;const[L,P]=wW(y.current,x.current);if(L!==0||P!==0){const{transform:B,panBy:$}=l.getState();m.current.x=(m.current.x??0)-L/B[2],m.current.y=(m.current.y??0)-P/B[2],$({x:L,y:P})&&E(m.current)}g.current=requestAnimationFrame(_)},A=L=>{const{nodeInternals:P,multiSelectionActive:B,nodesDraggable:$,unselectNodesAndEdges:U,onNodeDragStart:te,onSelectionDragStart:z}=l.getState();k.current=!0;const Q=s?te:f5(z);(!a||!i)&&!B&&s&&(P.get(s)?.selected||U()),s&&i&&a&&aj({id:s,store:l,nodeRef:t});const F=N(L);if(m.current=F,h.current=G7e(P,$,F,s),Q&&h.current){const[Y,J]=h5({nodeId:s,dragItems:h.current,nodeInternals:P});Q(L.sourceEvent,Y,J)}};if(e)T.on(".drag",null);else{const L=R6e().on("start",P=>{const{domNode:B,nodeDragThreshold:$}=l.getState();$===0&&A(P),j.current=!1;const U=N(P);m.current=U,x.current=B?.getBoundingClientRect()||null,y.current=Hc(P.sourceEvent,x.current)}).on("drag",P=>{const B=N(P),{autoPanOnNodeDrag:$,nodeDragThreshold:U}=l.getState();if(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1&&(j.current=!0),!j.current){if(!S.current&&k.current&&$&&(S.current=!0,_()),!k.current){const te=B.xSnapped-(m?.current?.x??0),z=B.ySnapped-(m?.current?.y??0);Math.sqrt(te*te+z*z)>U&&A(P)}(m.current.x!==B.xSnapped||m.current.y!==B.ySnapped)&&h.current&&k.current&&(w.current=P.sourceEvent,y.current=Hc(P.sourceEvent,x.current),E(B))}}).on("end",P=>{if(!(!k.current||j.current)&&(d(!1),S.current=!1,k.current=!1,cancelAnimationFrame(g.current),h.current)){const{updateNodePositions:B,nodeInternals:$,onNodeDragStop:U,onSelectionDragStop:te}=l.getState(),z=s?U:f5(te);if(B(h.current,!1,!1),z){const[Q,F]=h5({nodeId:s,dragItems:h.current,nodeInternals:$});z(P.sourceEvent,Q,F)}}}).filter(P=>{const B=P.target;return!P.button&&(!n||!SD(B,`.${n}`,t))&&(!r||SD(B,r,t))});return T.call(L),()=>{T.on(".drag",null)}}}},[t,e,n,r,i,l,s,a,N]),c}function nG(){const t=ps();return b.useCallback(n=>{const{nodeInternals:r,nodeExtent:s,updateNodePositions:i,getNodes:a,snapToGrid:l,snapGrid:c,onError:d,nodesDraggable:h}=t.getState(),m=a().filter(j=>j.selected&&(j.draggable||h&&typeof j.draggable>"u")),g=l?c[0]:5,x=l?c[1]:5,y=n.isShiftPressed?4:1,w=n.x*g*y,S=n.y*x*y,k=m.map(j=>{if(j.positionAbsolute){const N={x:j.positionAbsolute.x+w,y:j.positionAbsolute.y+S};l&&(N.x=c[0]*Math.round(N.x/c[0]),N.y=c[1]*Math.round(N.y/c[1]));const{positionAbsolute:T,position:E}=eG(j,N,r,s,void 0,d);j.position=E,j.positionAbsolute=T}return j});i(k,!0,!1)},[])}const Qh={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var i0=t=>{const e=({id:n,type:r,data:s,xPos:i,yPos:a,xPosOrigin:l,yPosOrigin:c,selected:d,onClick:h,onMouseEnter:m,onMouseMove:g,onMouseLeave:x,onContextMenu:y,onDoubleClick:w,style:S,className:k,isDraggable:j,isSelectable:N,isConnectable:T,isFocusable:E,selectNodesOnDrag:_,sourcePosition:A,targetPosition:L,hidden:P,resizeObserver:B,dragHandle:$,zIndex:U,isParent:te,noDragClassName:z,noPanClassName:Q,initialized:F,disableKeyboardA11y:Y,ariaLabel:J,rfId:X,hasHandleBounds:R})=>{const ie=ps(),G=b.useRef(null),I=b.useRef(null),V=b.useRef(A),ee=b.useRef(L),ne=b.useRef(r),W=N||j||h||m||g||x,se=nG(),re=s0(n,ie.getState,m),oe=s0(n,ie.getState,g),Te=s0(n,ie.getState,x),We=s0(n,ie.getState,y),Ye=s0(n,ie.getState,w),Je=Ue=>{const{nodeDragThreshold:He}=ie.getState();if(N&&(!_||!j||He>0)&&aj({id:n,store:ie,nodeRef:G}),h){const Ot=ie.getState().nodeInternals.get(n);Ot&&h(Ue,{...Ot})}},Oe=Ue=>{if(!tj(Ue)&&!Y)if(jW.includes(Ue.key)&&N){const He=Ue.key==="Escape";aj({id:n,store:ie,unselect:He,nodeRef:G})}else j&&d&&Object.prototype.hasOwnProperty.call(Qh,Ue.key)&&(ie.setState({ariaLiveMessage:`Moved selected node ${Ue.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~a}`}),se({x:Qh[Ue.key].x,y:Qh[Ue.key].y,isShiftPressed:Ue.shiftKey}))};b.useEffect(()=>()=>{I.current&&(B?.unobserve(I.current),I.current=null)},[]),b.useEffect(()=>{if(G.current&&!P){const Ue=G.current;(!F||!R||I.current!==Ue)&&(I.current&&B?.unobserve(I.current),B?.observe(Ue),I.current=Ue)}},[P,F,R]),b.useEffect(()=>{const Ue=ne.current!==r,He=V.current!==A,Ot=ee.current!==L;G.current&&(Ue||He||Ot)&&(Ue&&(ne.current=r),He&&(V.current=A),Ot&&(ee.current=L),ie.getState().updateNodeDimensions([{id:n,nodeElement:G.current,forceUpdate:!0}]))},[n,r,A,L]);const Ve=tG({nodeRef:G,disabled:P||!j,noDragClassName:z,handleSelector:$,nodeId:n,isSelectable:N,selectNodesOnDrag:_});return P?null:ae.createElement("div",{className:Bs(["react-flow__node",`react-flow__node-${r}`,{[Q]:j},k,{selected:d,selectable:N,parent:te,dragging:Ve}]),ref:G,style:{zIndex:U,transform:`translate(${l}px,${c}px)`,pointerEvents:W?"all":"none",visibility:F?"visible":"hidden",...S},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:re,onMouseMove:oe,onMouseLeave:Te,onContextMenu:We,onClick:Je,onDoubleClick:Ye,onKeyDown:E?Oe:void 0,tabIndex:E?0:void 0,role:E?"button":void 0,"aria-describedby":Y?void 0:`${VW}-${X}`,"aria-label":J},ae.createElement(u7e,{value:n},ae.createElement(t,{id:n,data:s,type:r,xPos:i,yPos:a,selected:d,isConnectable:T,sourcePosition:A,targetPosition:L,dragging:Ve,dragHandle:$,zIndex:U})))};return e.displayName="NodeWrapper",b.memo(e)};const K7e=t=>{const e=t.getNodes().filter(n=>n.selected);return{...tw(e,t.nodeOrigin),transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`,userSelectionActive:t.userSelectionActive}};function Z7e({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const r=ps(),{width:s,height:i,x:a,y:l,transformString:c,userSelectionActive:d}=hr(K7e,ks),h=nG(),m=b.useRef(null);if(b.useEffect(()=>{n||m.current?.focus({preventScroll:!0})},[n]),tG({nodeRef:m}),d||!s||!i)return null;const g=t?y=>{const w=r.getState().getNodes().filter(S=>S.selected);t(y,w)}:void 0,x=y=>{Object.prototype.hasOwnProperty.call(Qh,y.key)&&h({x:Qh[y.key].x,y:Qh[y.key].y,isShiftPressed:y.shiftKey})};return ae.createElement("div",{className:Bs(["react-flow__nodesselection","react-flow__container",e]),style:{transform:c}},ae.createElement("div",{ref:m,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:n?void 0:-1,onKeyDown:n?void 0:x,style:{width:s,height:i,top:l,left:a}}))}var J7e=b.memo(Z7e);const eCe=t=>t.nodesSelectionActive,rG=({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,deleteKeyCode:l,onMove:c,onMoveStart:d,onMoveEnd:h,selectionKeyCode:m,selectionOnDrag:g,selectionMode:x,onSelectionStart:y,onSelectionEnd:w,multiSelectionKeyCode:S,panActivationKeyCode:k,zoomActivationKeyCode:j,elementsSelectable:N,zoomOnScroll:T,zoomOnPinch:E,panOnScroll:_,panOnScrollSpeed:A,panOnScrollMode:L,zoomOnDoubleClick:P,panOnDrag:B,defaultViewport:$,translateExtent:U,minZoom:te,maxZoom:z,preventScrolling:Q,onSelectionContextMenu:F,noWheelClassName:Y,noPanClassName:J,disableKeyboardA11y:X})=>{const R=hr(eCe),ie=kp(m),G=kp(k),I=G||B,V=G||_,ee=ie||g&&I!==!0;return B7e({deleteKeyCode:l,multiSelectionKeyCode:S}),ae.createElement(H7e,{onMove:c,onMoveStart:d,onMoveEnd:h,onPaneContextMenu:i,elementsSelectable:N,zoomOnScroll:T,zoomOnPinch:E,panOnScroll:V,panOnScrollSpeed:A,panOnScrollMode:L,zoomOnDoubleClick:P,panOnDrag:!ie&&I,defaultViewport:$,translateExtent:U,minZoom:te,maxZoom:z,zoomActivationKeyCode:j,preventScrolling:Q,noWheelClassName:Y,noPanClassName:J},ae.createElement(ZW,{onSelectionStart:y,onSelectionEnd:w,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:I,isSelecting:!!ee,selectionMode:x},t,R&&ae.createElement(J7e,{onSelectionContextMenu:F,noPanClassName:J,disableKeyboardA11y:X})))};rG.displayName="FlowRenderer";var tCe=b.memo(rG);function nCe(t){return hr(b.useCallback(n=>t?MW(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[t]))}function rCe(t){const e={input:i0(t.input||qW),default:i0(t.default||ij),output:i0(t.output||HW),group:i0(t.group||r7)},n={},r=Object.keys(t).filter(s=>!["input","default","output","group"].includes(s)).reduce((s,i)=>(s[i]=i0(t[i]||ij),s),n);return{...e,...r}}const sCe=({x:t,y:e,width:n,height:r,origin:s})=>!n||!r?{x:t,y:e}:s[0]<0||s[1]<0||s[0]>1||s[1]>1?{x:t,y:e}:{x:t-n*s[0],y:e-r*s[1]},iCe=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,updateNodeDimensions:t.updateNodeDimensions,onError:t.onError}),sG=t=>{const{nodesDraggable:e,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,updateNodeDimensions:i,onError:a}=hr(iCe,ks),l=nCe(t.onlyRenderVisibleElements),c=b.useRef(),d=b.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const h=new ResizeObserver(m=>{const g=m.map(x=>({id:x.target.getAttribute("data-id"),nodeElement:x.target,forceUpdate:!0}));i(g)});return c.current=h,h},[]);return b.useEffect(()=>()=>{c?.current?.disconnect()},[]),ae.createElement("div",{className:"react-flow__nodes",style:i7},l.map(h=>{let m=h.type||"default";t.nodeTypes[m]||(a?.("003",Gl.error003(m)),m="default");const g=t.nodeTypes[m]||t.nodeTypes.default,x=!!(h.draggable||e&&typeof h.draggable>"u"),y=!!(h.selectable||s&&typeof h.selectable>"u"),w=!!(h.connectable||n&&typeof h.connectable>"u"),S=!!(h.focusable||r&&typeof h.focusable>"u"),k=t.nodeExtent?KN(h.positionAbsolute,t.nodeExtent):h.positionAbsolute,j=k?.x??0,N=k?.y??0,T=sCe({x:j,y:N,width:h.width??0,height:h.height??0,origin:t.nodeOrigin});return ae.createElement(g,{key:h.id,id:h.id,className:h.className,style:h.style,type:m,data:h.data,sourcePosition:h.sourcePosition||wt.Bottom,targetPosition:h.targetPosition||wt.Top,hidden:h.hidden,xPos:j,yPos:N,xPosOrigin:T.x,yPosOrigin:T.y,selectNodesOnDrag:t.selectNodesOnDrag,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,selected:!!h.selected,isDraggable:x,isSelectable:y,isConnectable:w,isFocusable:S,resizeObserver:d,dragHandle:h.dragHandle,zIndex:h[Lr]?.z??0,isParent:!!h[Lr]?.isParent,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,initialized:!!h.width&&!!h.height,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,ariaLabel:h.ariaLabel,hasHandleBounds:!!h[Lr]?.handleBounds})}))};sG.displayName="NodeRenderer";var aCe=b.memo(sG);const oCe=(t,e,n)=>n===wt.Left?t-e:n===wt.Right?t+e:t,lCe=(t,e,n)=>n===wt.Top?t-e:n===wt.Bottom?t+e:t,OD="react-flow__edgeupdater",jD=({position:t,centerX:e,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:l})=>ae.createElement("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:Bs([OD,`${OD}-${l}`]),cx:oCe(e,r,t),cy:lCe(n,r,t),r,stroke:"transparent",fill:"transparent"}),cCe=()=>!0;var fh=t=>{const e=({id:n,className:r,type:s,data:i,onClick:a,onEdgeDoubleClick:l,selected:c,animated:d,label:h,labelStyle:m,labelShowBg:g,labelBgStyle:x,labelBgPadding:y,labelBgBorderRadius:w,style:S,source:k,target:j,sourceX:N,sourceY:T,targetX:E,targetY:_,sourcePosition:A,targetPosition:L,elementsSelectable:P,hidden:B,sourceHandleId:$,targetHandleId:U,onContextMenu:te,onMouseEnter:z,onMouseMove:Q,onMouseLeave:F,reconnectRadius:Y,onReconnect:J,onReconnectStart:X,onReconnectEnd:R,markerEnd:ie,markerStart:G,rfId:I,ariaLabel:V,isFocusable:ee,isReconnectable:ne,pathOptions:W,interactionWidth:se,disableKeyboardA11y:re})=>{const oe=b.useRef(null),[Te,We]=b.useState(!1),[Ye,Je]=b.useState(!1),Oe=ps(),Ve=b.useMemo(()=>`url('#${rj(G,I)}')`,[G,I]),Ue=b.useMemo(()=>`url('#${rj(ie,I)}')`,[ie,I]);if(B)return null;const He=Mt=>{const{edges:zn,addSelectedEdges:Fe,unselectNodesAndEdges:rt,multiSelectionActive:tn}=Oe.getState(),Rt=zn.find(ke=>ke.id===n);Rt&&(P&&(Oe.setState({nodesSelectionActive:!1}),Rt.selected&&tn?(rt({nodes:[],edges:[Rt]}),oe.current?.blur()):Fe([n])),a&&a(Mt,Rt))},Ot=r0(n,Oe.getState,l),xt=r0(n,Oe.getState,te),kn=r0(n,Oe.getState,z),It=r0(n,Oe.getState,Q),Yt=r0(n,Oe.getState,F),_t=(Mt,zn)=>{if(Mt.button!==0)return;const{edges:Fe,isValidConnection:rt}=Oe.getState(),tn=zn?j:k,Rt=(zn?U:$)||null,ke=zn?"target":"source",Pe=rt||cCe,it=zn,ot=Fe.find(pt=>pt.id===n);Je(!0),X?.(Mt,ot,ke);const nn=pt=>{Je(!1),R?.(pt,ot,ke)};IW({event:Mt,handleId:Rt,nodeId:tn,onConnect:pt=>J?.(ot,pt),isTarget:it,getState:Oe.getState,setState:Oe.setState,isValidConnection:Pe,edgeUpdaterType:ke,onReconnectEnd:nn})},mt=Mt=>_t(Mt,!0),Ne=Mt=>_t(Mt,!1),Ie=()=>We(!0),st=()=>We(!1),yt=!P&&!a,Pt=Mt=>{if(!re&&jW.includes(Mt.key)&&P){const{unselectNodesAndEdges:zn,addSelectedEdges:Fe,edges:rt}=Oe.getState();Mt.key==="Escape"?(oe.current?.blur(),zn({edges:[rt.find(Rt=>Rt.id===n)]})):Fe([n])}};return ae.createElement("g",{className:Bs(["react-flow__edge",`react-flow__edge-${s}`,r,{selected:c,animated:d,inactive:yt,updating:Te}]),onClick:He,onDoubleClick:Ot,onContextMenu:xt,onMouseEnter:kn,onMouseMove:It,onMouseLeave:Yt,onKeyDown:ee?Pt:void 0,tabIndex:ee?0:void 0,role:ee?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":V===null?void 0:V||`Edge from ${k} to ${j}`,"aria-describedby":ee?`${UW}-${I}`:void 0,ref:oe},!Ye&&ae.createElement(t,{id:n,source:k,target:j,selected:c,animated:d,label:h,labelStyle:m,labelShowBg:g,labelBgStyle:x,labelBgPadding:y,labelBgBorderRadius:w,data:i,style:S,sourceX:N,sourceY:T,targetX:E,targetY:_,sourcePosition:A,targetPosition:L,sourceHandleId:$,targetHandleId:U,markerStart:Ve,markerEnd:Ue,pathOptions:W,interactionWidth:se}),ne&&ae.createElement(ae.Fragment,null,(ne==="source"||ne===!0)&&ae.createElement(jD,{position:A,centerX:N,centerY:T,radius:Y,onMouseDown:mt,onMouseEnter:Ie,onMouseOut:st,type:"source"}),(ne==="target"||ne===!0)&&ae.createElement(jD,{position:L,centerX:E,centerY:_,radius:Y,onMouseDown:Ne,onMouseEnter:Ie,onMouseOut:st,type:"target"})))};return e.displayName="EdgeWrapper",b.memo(e)};function uCe(t){const e={default:fh(t.default||Ry),straight:fh(t.bezier||e7),step:fh(t.step||JN),smoothstep:fh(t.step||ew),simplebezier:fh(t.simplebezier||ZN)},n={},r=Object.keys(t).filter(s=>!["default","bezier"].includes(s)).reduce((s,i)=>(s[i]=fh(t[i]||Ry),s),n);return{...e,...r}}function ND(t,e,n=null){const r=(n?.x||0)+e.x,s=(n?.y||0)+e.y,i=n?.width||e.width,a=n?.height||e.height;switch(t){case wt.Top:return{x:r+i/2,y:s};case wt.Right:return{x:r+i,y:s+a/2};case wt.Bottom:return{x:r+i/2,y:s+a};case wt.Left:return{x:r,y:s+a/2}}}function CD(t,e){return t?t.length===1||!e?t[0]:e&&t.find(n=>n.id===e)||null:null}const dCe=(t,e,n,r,s,i)=>{const a=ND(n,t,e),l=ND(i,r,s);return{sourceX:a.x,sourceY:a.y,targetX:l.x,targetY:l.y}};function hCe({sourcePos:t,targetPos:e,sourceWidth:n,sourceHeight:r,targetWidth:s,targetHeight:i,width:a,height:l,transform:c}){const d={x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x+n,e.x+s),y2:Math.max(t.y+r,e.y+i)};d.x===d.x2&&(d.x2+=1),d.y===d.y2&&(d.y2+=1);const h=wp({x:(0-c[0])/c[2],y:(0-c[1])/c[2],width:a/c[2],height:l/c[2]}),m=Math.max(0,Math.min(h.x2,d.x2)-Math.max(h.x,d.x)),g=Math.max(0,Math.min(h.y2,d.y2)-Math.max(h.y,d.y));return Math.ceil(m*g)>0}function TD(t){const e=t?.[Lr]?.handleBounds||null,n=e&&t?.width&&t?.height&&typeof t?.positionAbsolute?.x<"u"&&typeof t?.positionAbsolute?.y<"u";return[{x:t?.positionAbsolute?.x||0,y:t?.positionAbsolute?.y||0,width:t?.width||0,height:t?.height||0},e,!!n]}const fCe=[{level:0,isMaxLevel:!0,edges:[]}];function mCe(t,e,n=!1){let r=-1;const s=t.reduce((a,l)=>{const c=ka(l.zIndex);let d=c?l.zIndex:0;if(n){const h=e.get(l.target),m=e.get(l.source),g=l.selected||h?.selected||m?.selected,x=Math.max(m?.[Lr]?.z||0,h?.[Lr]?.z||0,1e3);d=(c?l.zIndex:0)+(g?x:0)}return a[d]?a[d].push(l):a[d]=[l],r=d>r?d:r,a},{}),i=Object.entries(s).map(([a,l])=>{const c=+a;return{edges:l,level:c,isMaxLevel:c===r}});return i.length===0?fCe:i}function pCe(t,e,n){const r=hr(b.useCallback(s=>t?s.edges.filter(i=>{const a=e.get(i.source),l=e.get(i.target);return a?.width&&a?.height&&l?.width&&l?.height&&hCe({sourcePos:a.positionAbsolute||{x:0,y:0},targetPos:l.positionAbsolute||{x:0,y:0},sourceWidth:a.width,sourceHeight:a.height,targetWidth:l.width,targetHeight:l.height,width:s.width,height:s.height,transform:s.transform})}):s.edges,[t,e]));return mCe(r,e,n)}const gCe=({color:t="none",strokeWidth:e=1})=>ae.createElement("polyline",{style:{stroke:t,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),xCe=({color:t="none",strokeWidth:e=1})=>ae.createElement("polyline",{style:{stroke:t,fill:t,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),ED={[My.Arrow]:gCe,[My.ArrowClosed]:xCe};function vCe(t){const e=ps();return b.useMemo(()=>Object.prototype.hasOwnProperty.call(ED,t)?ED[t]:(e.getState().onError?.("009",Gl.error009(t)),null),[t])}const yCe=({id:t,type:e,color:n,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const c=vCe(e);return c?ae.createElement("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0"},ae.createElement(c,{color:n,strokeWidth:a})):null},bCe=({defaultColor:t,rfId:e})=>n=>{const r=[];return n.edges.reduce((s,i)=>([i.markerStart,i.markerEnd].forEach(a=>{if(a&&typeof a=="object"){const l=rj(a,e);r.includes(l)||(s.push({id:l,color:a.color||t,...a}),r.push(l))}}),s),[]).sort((s,i)=>s.id.localeCompare(i.id))},iG=({defaultColor:t,rfId:e})=>{const n=hr(b.useCallback(bCe({defaultColor:t,rfId:e}),[t,e]),(r,s)=>!(r.length!==s.length||r.some((i,a)=>i.id!==s[a].id)));return ae.createElement("defs",null,n.map(r=>ae.createElement(yCe,{id:r.id,key:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient})))};iG.displayName="MarkerDefinitions";var wCe=b.memo(iG);const SCe=t=>({nodesConnectable:t.nodesConnectable,edgesFocusable:t.edgesFocusable,edgesUpdatable:t.edgesUpdatable,elementsSelectable:t.elementsSelectable,width:t.width,height:t.height,connectionMode:t.connectionMode,nodeInternals:t.nodeInternals,onError:t.onError}),aG=({defaultMarkerColor:t,onlyRenderVisibleElements:e,elevateEdgesOnSelect:n,rfId:r,edgeTypes:s,noPanClassName:i,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:h,onEdgeDoubleClick:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:y,reconnectRadius:w,children:S,disableKeyboardA11y:k})=>{const{edgesFocusable:j,edgesUpdatable:N,elementsSelectable:T,width:E,height:_,connectionMode:A,nodeInternals:L,onError:P}=hr(SCe,ks),B=pCe(e,L,n);return E?ae.createElement(ae.Fragment,null,B.map(({level:$,edges:U,isMaxLevel:te})=>ae.createElement("svg",{key:$,style:{zIndex:$},width:E,height:_,className:"react-flow__edges react-flow__container"},te&&ae.createElement(wCe,{defaultColor:t,rfId:r}),ae.createElement("g",null,U.map(z=>{const[Q,F,Y]=TD(L.get(z.source)),[J,X,R]=TD(L.get(z.target));if(!Y||!R)return null;let ie=z.type||"default";s[ie]||(P?.("011",Gl.error011(ie)),ie="default");const G=s[ie]||s.default,I=A===pd.Strict?X.target:(X.target??[]).concat(X.source??[]),V=CD(F.source,z.sourceHandle),ee=CD(I,z.targetHandle),ne=V?.position||wt.Bottom,W=ee?.position||wt.Top,se=!!(z.focusable||j&&typeof z.focusable>"u"),re=z.reconnectable||z.updatable,oe=typeof g<"u"&&(re||N&&typeof re>"u");if(!V||!ee)return P?.("008",Gl.error008(V,z)),null;const{sourceX:Te,sourceY:We,targetX:Ye,targetY:Je}=dCe(Q,V,ne,J,ee,W);return ae.createElement(G,{key:z.id,id:z.id,className:Bs([z.className,i]),type:ie,data:z.data,selected:!!z.selected,animated:!!z.animated,hidden:!!z.hidden,label:z.label,labelStyle:z.labelStyle,labelShowBg:z.labelShowBg,labelBgStyle:z.labelBgStyle,labelBgPadding:z.labelBgPadding,labelBgBorderRadius:z.labelBgBorderRadius,style:z.style,source:z.source,target:z.target,sourceHandleId:z.sourceHandle,targetHandleId:z.targetHandle,markerEnd:z.markerEnd,markerStart:z.markerStart,sourceX:Te,sourceY:We,targetX:Ye,targetY:Je,sourcePosition:ne,targetPosition:W,elementsSelectable:T,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,onClick:h,onEdgeDoubleClick:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:y,reconnectRadius:w,rfId:r,ariaLabel:z.ariaLabel,isFocusable:se,isReconnectable:oe,pathOptions:"pathOptions"in z?z.pathOptions:void 0,interactionWidth:z.interactionWidth,disableKeyboardA11y:k})})))),S):null};aG.displayName="EdgeRenderer";var kCe=b.memo(aG);const OCe=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function jCe({children:t}){const e=hr(OCe);return ae.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:e}},t)}function NCe(t){const e=s7(),n=b.useRef(!1);b.useEffect(()=>{!n.current&&e.viewportInitialized&&t&&(setTimeout(()=>t(e),1),n.current=!0)},[t,e.viewportInitialized])}const CCe={[wt.Left]:wt.Right,[wt.Right]:wt.Left,[wt.Top]:wt.Bottom,[wt.Bottom]:wt.Top},oG=({nodeId:t,handleType:e,style:n,type:r=Lc.Bezier,CustomComponent:s,connectionStatus:i})=>{const{fromNode:a,handleId:l,toX:c,toY:d,connectionMode:h}=hr(b.useCallback(_=>({fromNode:_.nodeInternals.get(t),handleId:_.connectionHandleId,toX:(_.connectionPosition.x-_.transform[0])/_.transform[2],toY:(_.connectionPosition.y-_.transform[1])/_.transform[2],connectionMode:_.connectionMode}),[t]),ks),m=a?.[Lr]?.handleBounds;let g=m?.[e];if(h===pd.Loose&&(g=g||m?.[e==="source"?"target":"source"]),!a||!g)return null;const x=l?g.find(_=>_.id===l):g[0],y=x?x.x+x.width/2:(a.width??0)/2,w=x?x.y+x.height/2:a.height??0,S=(a.positionAbsolute?.x??0)+y,k=(a.positionAbsolute?.y??0)+w,j=x?.position,N=j?CCe[j]:null;if(!j||!N)return null;if(s)return ae.createElement(s,{connectionLineType:r,connectionLineStyle:n,fromNode:a,fromHandle:x,fromX:S,fromY:k,toX:c,toY:d,fromPosition:j,toPosition:N,connectionStatus:i});let T="";const E={sourceX:S,sourceY:k,sourcePosition:j,targetX:c,targetY:d,targetPosition:N};return r===Lc.Bezier?[T]=_W(E):r===Lc.Step?[T]=nj({...E,borderRadius:0}):r===Lc.SmoothStep?[T]=nj(E):r===Lc.SimpleBezier?[T]=EW(E):T=`M${S},${k} ${c},${d}`,ae.createElement("path",{d:T,fill:"none",className:"react-flow__connection-path",style:n})};oG.displayName="ConnectionLine";const TCe=t=>({nodeId:t.connectionNodeId,handleType:t.connectionHandleType,nodesConnectable:t.nodesConnectable,connectionStatus:t.connectionStatus,width:t.width,height:t.height});function ECe({containerStyle:t,style:e,type:n,component:r}){const{nodeId:s,handleType:i,nodesConnectable:a,width:l,height:c,connectionStatus:d}=hr(TCe,ks);return!(s&&i&&l&&a)?null:ae.createElement("svg",{style:t,width:l,height:c,className:"react-flow__edges react-flow__connectionline react-flow__container"},ae.createElement("g",{className:Bs(["react-flow__connection",d])},ae.createElement(oG,{nodeId:s,handleType:i,style:e,type:n,CustomComponent:r,connectionStatus:d})))}function _D(t,e){return b.useRef(null),ps(),b.useMemo(()=>e(t),[t])}const lG=({nodeTypes:t,edgeTypes:e,onMove:n,onMoveStart:r,onMoveEnd:s,onInit:i,onNodeClick:a,onEdgeClick:l,onNodeDoubleClick:c,onEdgeDoubleClick:d,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:g,onNodeContextMenu:x,onSelectionContextMenu:y,onSelectionStart:w,onSelectionEnd:S,connectionLineType:k,connectionLineStyle:j,connectionLineComponent:N,connectionLineContainerStyle:T,selectionKeyCode:E,selectionOnDrag:_,selectionMode:A,multiSelectionKeyCode:L,panActivationKeyCode:P,zoomActivationKeyCode:B,deleteKeyCode:$,onlyRenderVisibleElements:U,elementsSelectable:te,selectNodesOnDrag:z,defaultViewport:Q,translateExtent:F,minZoom:Y,maxZoom:J,preventScrolling:X,defaultMarkerColor:R,zoomOnScroll:ie,zoomOnPinch:G,panOnScroll:I,panOnScrollSpeed:V,panOnScrollMode:ee,zoomOnDoubleClick:ne,panOnDrag:W,onPaneClick:se,onPaneMouseEnter:re,onPaneMouseMove:oe,onPaneMouseLeave:Te,onPaneScroll:We,onPaneContextMenu:Ye,onEdgeContextMenu:Je,onEdgeMouseEnter:Oe,onEdgeMouseMove:Ve,onEdgeMouseLeave:Ue,onReconnect:He,onReconnectStart:Ot,onReconnectEnd:xt,reconnectRadius:kn,noDragClassName:It,noWheelClassName:Yt,noPanClassName:_t,elevateEdgesOnSelect:mt,disableKeyboardA11y:Ne,nodeOrigin:Ie,nodeExtent:st,rfId:yt})=>{const Pt=_D(t,rCe),Mt=_D(e,uCe);return NCe(i),ae.createElement(tCe,{onPaneClick:se,onPaneMouseEnter:re,onPaneMouseMove:oe,onPaneMouseLeave:Te,onPaneContextMenu:Ye,onPaneScroll:We,deleteKeyCode:$,selectionKeyCode:E,selectionOnDrag:_,selectionMode:A,onSelectionStart:w,onSelectionEnd:S,multiSelectionKeyCode:L,panActivationKeyCode:P,zoomActivationKeyCode:B,elementsSelectable:te,onMove:n,onMoveStart:r,onMoveEnd:s,zoomOnScroll:ie,zoomOnPinch:G,zoomOnDoubleClick:ne,panOnScroll:I,panOnScrollSpeed:V,panOnScrollMode:ee,panOnDrag:W,defaultViewport:Q,translateExtent:F,minZoom:Y,maxZoom:J,onSelectionContextMenu:y,preventScrolling:X,noDragClassName:It,noWheelClassName:Yt,noPanClassName:_t,disableKeyboardA11y:Ne},ae.createElement(jCe,null,ae.createElement(kCe,{edgeTypes:Mt,onEdgeClick:l,onEdgeDoubleClick:d,onlyRenderVisibleElements:U,onEdgeContextMenu:Je,onEdgeMouseEnter:Oe,onEdgeMouseMove:Ve,onEdgeMouseLeave:Ue,onReconnect:He,onReconnectStart:Ot,onReconnectEnd:xt,reconnectRadius:kn,defaultMarkerColor:R,noPanClassName:_t,elevateEdgesOnSelect:!!mt,disableKeyboardA11y:Ne,rfId:yt},ae.createElement(ECe,{style:j,type:k,component:N,containerStyle:T})),ae.createElement("div",{className:"react-flow__edgelabel-renderer"}),ae.createElement(aCe,{nodeTypes:Pt,onNodeClick:a,onNodeDoubleClick:c,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:g,onNodeContextMenu:x,selectNodesOnDrag:z,onlyRenderVisibleElements:U,noPanClassName:_t,noDragClassName:It,disableKeyboardA11y:Ne,nodeOrigin:Ie,nodeExtent:st,rfId:yt})))};lG.displayName="GraphView";var _Ce=b.memo(lG);const oj=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ec={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:oj,nodeExtent:oj,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:pd.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:s7e,isValidConnection:void 0},ACe=()=>VOe((t,e)=>({...Ec,setNodes:n=>{const{nodeInternals:r,nodeOrigin:s,elevateNodesOnSelect:i}=e();t({nodeInternals:u5(n,r,s,i)})},getNodes:()=>Array.from(e().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=e();t({edges:n.map(s=>({...r,...s}))})},setDefaultNodesAndEdges:(n,r)=>{const s=typeof n<"u",i=typeof r<"u",a=s?u5(n,new Map,e().nodeOrigin,e().elevateNodesOnSelect):new Map;t({nodeInternals:a,edges:i?r:[],hasDefaultNodes:s,hasDefaultEdges:i})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:s,fitViewOnInit:i,fitViewOnInitDone:a,fitViewOnInitOptions:l,domNode:c,nodeOrigin:d}=e(),h=c?.querySelector(".react-flow__viewport");if(!h)return;const m=window.getComputedStyle(h),{m22:g}=new window.DOMMatrixReadOnly(m.transform),x=n.reduce((w,S)=>{const k=s.get(S.id);if(k?.hidden)s.set(k.id,{...k,[Lr]:{...k[Lr],handleBounds:void 0}});else if(k){const j=YN(S.nodeElement);!!(j.width&&j.height&&(k.width!==j.width||k.height!==j.height||S.forceUpdate))&&(s.set(k.id,{...k,[Lr]:{...k[Lr],handleBounds:{source:kD(".source",S.nodeElement,g,d),target:kD(".target",S.nodeElement,g,d)}},...j}),w.push({id:k.id,type:"dimensions",dimensions:j}))}return w},[]);GW(s,d);const y=a||i&&!a&&XW(e,{initial:!0,...l});t({nodeInternals:new Map(s),fitViewOnInitDone:y}),x?.length>0&&r?.(x)},updateNodePositions:(n,r=!0,s=!1)=>{const{triggerNodeChanges:i}=e(),a=n.map(l=>{const c={id:l.id,type:"position",dragging:s};return r&&(c.positionAbsolute=l.positionAbsolute,c.position=l.position),c});i(a)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:s,hasDefaultNodes:i,nodeOrigin:a,getNodes:l,elevateNodesOnSelect:c}=e();if(n?.length){if(i){const d=KW(n,l()),h=u5(d,s,a,c);t({nodeInternals:h})}r?.(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:s,getNodes:i}=e();let a,l=null;r?a=n.map(c=>Pc(c,!0)):(a=Eh(i(),n),l=Eh(s,[])),Q1({changedNodes:a,changedEdges:l,get:e,set:t})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:s,getNodes:i}=e();let a,l=null;r?a=n.map(c=>Pc(c,!0)):(a=Eh(s,n),l=Eh(i(),[])),Q1({changedNodes:l,changedEdges:a,get:e,set:t})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:s,getNodes:i}=e(),a=n||i(),l=r||s,c=a.map(h=>(h.selected=!1,Pc(h.id,!1))),d=l.map(h=>Pc(h.id,!1));Q1({changedNodes:c,changedEdges:d,get:e,set:t})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:s}=e();r?.scaleExtent([n,s]),t({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:s}=e();r?.scaleExtent([s,n]),t({maxZoom:n})},setTranslateExtent:n=>{e().d3Zoom?.translateExtent(n),t({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=e(),i=r().filter(l=>l.selected).map(l=>Pc(l.id,!1)),a=n.filter(l=>l.selected).map(l=>Pc(l.id,!1));Q1({changedNodes:i,changedEdges:a,get:e,set:t})},setNodeExtent:n=>{const{nodeInternals:r}=e();r.forEach(s=>{s.positionAbsolute=KN(s.position,n)}),t({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:s,height:i,d3Zoom:a,d3Selection:l,translateExtent:c}=e();if(!a||!l||!n.x&&!n.y)return!1;const d=Fl.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),h=[[0,0],[s,i]],m=a?.constrain()(d,h,c);return a.transform(l,m),r[0]!==m.x||r[1]!==m.y||r[2]!==m.k},cancelConnection:()=>t({connectionNodeId:Ec.connectionNodeId,connectionHandleId:Ec.connectionHandleId,connectionHandleType:Ec.connectionHandleType,connectionStatus:Ec.connectionStatus,connectionStartHandle:Ec.connectionStartHandle,connectionEndHandle:Ec.connectionEndHandle}),reset:()=>t({...Ec})}),Object.is),cG=({children:t})=>{const e=b.useRef(null);return e.current||(e.current=ACe()),ae.createElement(KNe,{value:e.current},t)};cG.displayName="ReactFlowProvider";const uG=({children:t})=>b.useContext(Zb)?ae.createElement(ae.Fragment,null,t):ae.createElement(cG,null,t);uG.displayName="ReactFlowWrapper";const MCe={input:qW,default:ij,output:HW,group:r7},RCe={default:Ry,straight:e7,step:JN,smoothstep:ew,simplebezier:ZN},DCe=[0,0],PCe=[15,15],zCe={x:0,y:0,zoom:1},ICe={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},dG=b.forwardRef(({nodes:t,edges:e,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:i=MCe,edgeTypes:a=RCe,onNodeClick:l,onEdgeClick:c,onInit:d,onMove:h,onMoveStart:m,onMoveEnd:g,onConnect:x,onConnectStart:y,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:k,onNodeMouseEnter:j,onNodeMouseMove:N,onNodeMouseLeave:T,onNodeContextMenu:E,onNodeDoubleClick:_,onNodeDragStart:A,onNodeDrag:L,onNodeDragStop:P,onNodesDelete:B,onEdgesDelete:$,onSelectionChange:U,onSelectionDragStart:te,onSelectionDrag:z,onSelectionDragStop:Q,onSelectionContextMenu:F,onSelectionStart:Y,onSelectionEnd:J,connectionMode:X=pd.Strict,connectionLineType:R=Lc.Bezier,connectionLineStyle:ie,connectionLineComponent:G,connectionLineContainerStyle:I,deleteKeyCode:V="Backspace",selectionKeyCode:ee="Shift",selectionOnDrag:ne=!1,selectionMode:W=Sp.Full,panActivationKeyCode:se="Space",multiSelectionKeyCode:re=Ay()?"Meta":"Control",zoomActivationKeyCode:oe=Ay()?"Meta":"Control",snapToGrid:Te=!1,snapGrid:We=PCe,onlyRenderVisibleElements:Ye=!1,selectNodesOnDrag:Je=!0,nodesDraggable:Oe,nodesConnectable:Ve,nodesFocusable:Ue,nodeOrigin:He=DCe,edgesFocusable:Ot,edgesUpdatable:xt,elementsSelectable:kn,defaultViewport:It=zCe,minZoom:Yt=.5,maxZoom:_t=2,translateExtent:mt=oj,preventScrolling:Ne=!0,nodeExtent:Ie,defaultMarkerColor:st="#b1b1b7",zoomOnScroll:yt=!0,zoomOnPinch:Pt=!0,panOnScroll:Mt=!1,panOnScrollSpeed:zn=.5,panOnScrollMode:Fe=Wu.Free,zoomOnDoubleClick:rt=!0,panOnDrag:tn=!0,onPaneClick:Rt,onPaneMouseEnter:ke,onPaneMouseMove:Pe,onPaneMouseLeave:it,onPaneScroll:ot,onPaneContextMenu:nn,children:Kt,onEdgeContextMenu:pt,onEdgeDoubleClick:xr,onEdgeMouseEnter:Ur,onEdgeMouseMove:Wr,onEdgeMouseLeave:vr,onEdgeUpdate:In,onEdgeUpdateStart:cr,onEdgeUpdateEnd:nr,onReconnect:gs,onReconnectStart:xs,onReconnectEnd:js,reconnectRadius:ge=10,edgeUpdaterRadius:Le=10,onNodesChange:Ct,onEdgesChange:vn,noDragClassName:Fr="nodrag",noWheelClassName:Cr="nowheel",noPanClassName:Tr="nopan",fitView:Ns=!1,fitViewOptions:Qf,connectOnClick:lw=!0,attributionPosition:cw,proOptions:Eg,defaultEdgeOptions:mu,elevateNodesOnSelect:Vf=!0,elevateEdgesOnSelect:ec=!1,disableKeyboardA11y:Yo=!1,autoPanOnConnect:pu=!0,autoPanOnNodeDrag:tc=!0,connectionRadius:Gr=20,isValidConnection:_g,onError:Ag,style:Ko,id:Zo,nodeDragThreshold:uw,...Mg},Rg)=>{const Uf=Zo||"1";return ae.createElement("div",{...Mg,style:{...Ko,...ICe},ref:Rg,className:Bs(["react-flow",s]),"data-testid":"rf__wrapper",id:Zo},ae.createElement(uG,null,ae.createElement(_Ce,{onInit:d,onMove:h,onMoveStart:m,onMoveEnd:g,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:j,onNodeMouseMove:N,onNodeMouseLeave:T,onNodeContextMenu:E,onNodeDoubleClick:_,nodeTypes:i,edgeTypes:a,connectionLineType:R,connectionLineStyle:ie,connectionLineComponent:G,connectionLineContainerStyle:I,selectionKeyCode:ee,selectionOnDrag:ne,selectionMode:W,deleteKeyCode:V,multiSelectionKeyCode:re,panActivationKeyCode:se,zoomActivationKeyCode:oe,onlyRenderVisibleElements:Ye,selectNodesOnDrag:Je,defaultViewport:It,translateExtent:mt,minZoom:Yt,maxZoom:_t,preventScrolling:Ne,zoomOnScroll:yt,zoomOnPinch:Pt,zoomOnDoubleClick:rt,panOnScroll:Mt,panOnScrollSpeed:zn,panOnScrollMode:Fe,panOnDrag:tn,onPaneClick:Rt,onPaneMouseEnter:ke,onPaneMouseMove:Pe,onPaneMouseLeave:it,onPaneScroll:ot,onPaneContextMenu:nn,onSelectionContextMenu:F,onSelectionStart:Y,onSelectionEnd:J,onEdgeContextMenu:pt,onEdgeDoubleClick:xr,onEdgeMouseEnter:Ur,onEdgeMouseMove:Wr,onEdgeMouseLeave:vr,onReconnect:gs??In,onReconnectStart:xs??cr,onReconnectEnd:js??nr,reconnectRadius:ge??Le,defaultMarkerColor:st,noDragClassName:Fr,noWheelClassName:Cr,noPanClassName:Tr,elevateEdgesOnSelect:ec,rfId:Uf,disableKeyboardA11y:Yo,nodeOrigin:He,nodeExtent:Ie}),ae.createElement(C7e,{nodes:t,edges:e,defaultNodes:n,defaultEdges:r,onConnect:x,onConnectStart:y,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:k,nodesDraggable:Oe,nodesConnectable:Ve,nodesFocusable:Ue,edgesFocusable:Ot,edgesUpdatable:xt,elementsSelectable:kn,elevateNodesOnSelect:Vf,minZoom:Yt,maxZoom:_t,nodeExtent:Ie,onNodesChange:Ct,onEdgesChange:vn,snapToGrid:Te,snapGrid:We,connectionMode:X,translateExtent:mt,connectOnClick:lw,defaultEdgeOptions:mu,fitView:Ns,fitViewOptions:Qf,onNodesDelete:B,onEdgesDelete:$,onNodeDragStart:A,onNodeDrag:L,onNodeDragStop:P,onSelectionDrag:z,onSelectionDragStart:te,onSelectionDragStop:Q,noPanClassName:Tr,nodeOrigin:He,rfId:Uf,autoPanOnConnect:pu,autoPanOnNodeDrag:tc,onError:Ag,connectionRadius:Gr,isValidConnection:_g,nodeDragThreshold:uw}),ae.createElement(j7e,{onSelectionChange:U}),Kt,ae.createElement(JNe,{proOptions:Eg,position:cw}),ae.createElement(M7e,{rfId:Uf,disableKeyboardA11y:Yo})))});dG.displayName="ReactFlow";function hG(t){return e=>{const[n,r]=b.useState(e),s=b.useCallback(i=>r(a=>t(i,a)),[]);return[n,r,s]}}const LCe=hG(KW),BCe=hG(U7e),fG=({id:t,x:e,y:n,width:r,height:s,style:i,color:a,strokeColor:l,strokeWidth:c,className:d,borderRadius:h,shapeRendering:m,onClick:g,selected:x})=>{const{background:y,backgroundColor:w}=i||{},S=a||y||w;return ae.createElement("rect",{className:Bs(["react-flow__minimap-node",{selected:x},d]),x:e,y:n,rx:h,ry:h,width:r,height:s,fill:S,stroke:l,strokeWidth:c,shapeRendering:m,onClick:g?k=>g(k,t):void 0})};fG.displayName="MiniMapNode";var FCe=b.memo(fG);const qCe=t=>t.nodeOrigin,$Ce=t=>t.getNodes().filter(e=>!e.hidden&&e.width&&e.height),m5=t=>t instanceof Function?t:()=>t;function HCe({nodeStrokeColor:t="transparent",nodeColor:e="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s=2,nodeComponent:i=FCe,onClick:a}){const l=hr($Ce,ks),c=hr(qCe),d=m5(e),h=m5(t),m=m5(n),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return ae.createElement(ae.Fragment,null,l.map(x=>{const{x:y,y:w}=td(x,c).positionAbsolute;return ae.createElement(i,{key:x.id,x:y,y:w,width:x.width,height:x.height,style:x.style,selected:x.selected,className:m(x),color:d(x),borderRadius:r,strokeColor:h(x),strokeWidth:s,shapeRendering:g,onClick:a,id:x.id})}))}var QCe=b.memo(HCe);const VCe=200,UCe=150,WCe=t=>{const e=t.getNodes(),n={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:n,boundingRect:e.length>0?n7e(tw(e,t.nodeOrigin),n):n,rfId:t.rfId}},GCe="react-flow__minimap-desc";function mG({style:t,className:e,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a=2,nodeComponent:l,maskColor:c="rgb(240, 240, 240, 0.6)",maskStrokeColor:d="none",maskStrokeWidth:h=1,position:m="bottom-right",onClick:g,onNodeClick:x,pannable:y=!1,zoomable:w=!1,ariaLabel:S="React Flow mini map",inversePan:k=!1,zoomStep:j=10,offsetScale:N=5}){const T=ps(),E=b.useRef(null),{boundingRect:_,viewBB:A,rfId:L}=hr(WCe,ks),P=t?.width??VCe,B=t?.height??UCe,$=_.width/P,U=_.height/B,te=Math.max($,U),z=te*P,Q=te*B,F=N*te,Y=_.x-(z-_.width)/2-F,J=_.y-(Q-_.height)/2-F,X=z+F*2,R=Q+F*2,ie=`${GCe}-${L}`,G=b.useRef(0);G.current=te,b.useEffect(()=>{if(E.current){const ee=ma(E.current),ne=re=>{const{transform:oe,d3Selection:Te,d3Zoom:We}=T.getState();if(re.sourceEvent.type!=="wheel"||!Te||!We)return;const Ye=-re.sourceEvent.deltaY*(re.sourceEvent.deltaMode===1?.05:re.sourceEvent.deltaMode?1:.002)*j,Je=oe[2]*Math.pow(2,Ye);We.scaleTo(Te,Je)},W=re=>{const{transform:oe,d3Selection:Te,d3Zoom:We,translateExtent:Ye,width:Je,height:Oe}=T.getState();if(re.sourceEvent.type!=="mousemove"||!Te||!We)return;const Ve=G.current*Math.max(1,oe[2])*(k?-1:1),Ue={x:oe[0]-re.sourceEvent.movementX*Ve,y:oe[1]-re.sourceEvent.movementY*Ve},He=[[0,0],[Je,Oe]],Ot=Fl.translate(Ue.x,Ue.y).scale(oe[2]),xt=We.constrain()(Ot,He,Ye);We.transform(Te,xt)},se=yW().on("zoom",y?W:null).on("zoom.wheel",w?ne:null);return ee.call(se),()=>{ee.on("zoom",null)}}},[y,w,k,j]);const I=g?ee=>{const ne=Ha(ee);g(ee,{x:ne[0],y:ne[1]})}:void 0,V=x?(ee,ne)=>{const W=T.getState().nodeInternals.get(ne);x(ee,W)}:void 0;return ae.createElement(Jb,{position:m,style:t,className:Bs(["react-flow__minimap",e]),"data-testid":"rf__minimap"},ae.createElement("svg",{width:P,height:B,viewBox:`${Y} ${J} ${X} ${R}`,role:"img","aria-labelledby":ie,ref:E,onClick:I},S&&ae.createElement("title",{id:ie},S),ae.createElement(QCe,{onClick:V,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:l}),ae.createElement("path",{className:"react-flow__minimap-mask",d:`M${Y-F},${J-F}h${X+F*2}v${R+F*2}h${-X-F*2}z + M${A.x},${A.y}h${A.width}v${A.height}h${-A.width}z`,fill:c,fillRule:"evenodd",stroke:d,strokeWidth:h,pointerEvents:"none"})))}mG.displayName="MiniMap";var XCe=b.memo(mG);function YCe(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},ae.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function KCe(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},ae.createElement("path",{d:"M0 0h32v4.2H0z"}))}function ZCe(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},ae.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function JCe(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ae.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function e8e(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ae.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}const p0=({children:t,className:e,...n})=>ae.createElement("button",{type:"button",className:Bs(["react-flow__controls-button",e]),...n},t);p0.displayName="ControlButton";const t8e=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom}),pG=({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:l,onInteractiveChange:c,className:d,children:h,position:m="bottom-left"})=>{const g=ps(),[x,y]=b.useState(!1),{isInteractive:w,minZoomReached:S,maxZoomReached:k}=hr(t8e,ks),{zoomIn:j,zoomOut:N,fitView:T}=s7();if(b.useEffect(()=>{y(!0)},[]),!x)return null;const E=()=>{j(),i?.()},_=()=>{N(),a?.()},A=()=>{T(s),l?.()},L=()=>{g.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),c?.(!w)};return ae.createElement(Jb,{className:Bs(["react-flow__controls",d]),position:m,style:t,"data-testid":"rf__controls"},e&&ae.createElement(ae.Fragment,null,ae.createElement(p0,{onClick:E,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:k},ae.createElement(YCe,null)),ae.createElement(p0,{onClick:_,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:S},ae.createElement(KCe,null))),n&&ae.createElement(p0,{className:"react-flow__controls-fitview",onClick:A,title:"fit view","aria-label":"fit view"},ae.createElement(ZCe,null)),r&&ae.createElement(p0,{className:"react-flow__controls-interactive",onClick:L,title:"toggle interactivity","aria-label":"toggle interactivity"},w?ae.createElement(e8e,null):ae.createElement(JCe,null)),h)};pG.displayName="Controls";var n8e=b.memo(pG),Ca;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Ca||(Ca={}));function r8e({color:t,dimensions:e,lineWidth:n}){return ae.createElement("path",{stroke:t,strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})}function s8e({color:t,radius:e}){return ae.createElement("circle",{cx:e,cy:e,r:e,fill:t})}const i8e={[Ca.Dots]:"#91919a",[Ca.Lines]:"#eee",[Ca.Cross]:"#e2e2e2"},a8e={[Ca.Dots]:1,[Ca.Lines]:1,[Ca.Cross]:6},o8e=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function gG({id:t,variant:e=Ca.Dots,gap:n=20,size:r,lineWidth:s=1,offset:i=2,color:a,style:l,className:c}){const d=b.useRef(null),{transform:h,patternId:m}=hr(o8e,ks),g=a||i8e[e],x=r||a8e[e],y=e===Ca.Dots,w=e===Ca.Cross,S=Array.isArray(n)?n:[n,n],k=[S[0]*h[2]||1,S[1]*h[2]||1],j=x*h[2],N=w?[j,j]:k,T=y?[j/i,j/i]:[N[0]/i,N[1]/i];return ae.createElement("svg",{className:Bs(["react-flow__background",c]),style:{...l,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:d,"data-testid":"rf__background"},ae.createElement("pattern",{id:m+t,x:h[0]%k[0],y:h[1]%k[1],width:k[0],height:k[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`},y?ae.createElement(s8e,{color:g,radius:j/i}):ae.createElement(r8e,{dimensions:N,color:g,lineWidth:s})),ae.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${m+t})`}))}gG.displayName="Background";var l8e=b.memo(gG);function a7(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var p5,AD;function c8e(){if(AD)return p5;AD=1;var t=qz(),e=4;function n(r){return t(r,e)}return p5=n,p5}var g5,MD;function xG(){if(MD)return g5;MD=1;var t=FJ();function e(n){return typeof n=="function"?n:t}return g5=e,g5}var x5,RD;function vG(){if(RD)return x5;RD=1;var t=$z(),e=pj(),n=xG(),r=xd();function s(i,a){var l=r(i)?t:e;return l(i,n(a))}return x5=s,x5}var v5,DD;function yG(){return DD||(DD=1,v5=vG()),v5}var y5,PD;function u8e(){if(PD)return y5;PD=1;var t=pj();function e(n,r){var s=[];return t(n,function(i,a,l){r(i,a,l)&&s.push(i)}),s}return y5=e,y5}var b5,zD;function bG(){if(zD)return b5;zD=1;var t=qJ(),e=u8e(),n=gj(),r=xd();function s(i,a){var l=r(i)?t:e;return l(i,n(a,3))}return b5=s,b5}var w5,ID;function d8e(){if(ID)return w5;ID=1;var t=Object.prototype,e=t.hasOwnProperty;function n(r,s){return r!=null&&e.call(r,s)}return w5=n,w5}var S5,LD;function wG(){if(LD)return S5;LD=1;var t=d8e(),e=$J();function n(r,s){return r!=null&&e(r,s,t)}return S5=n,S5}var k5,BD;function h8e(){if(BD)return k5;BD=1;var t=Hz(),e=Qz(),n=Vz(),r=xd(),s=xj(),i=vj(),a=HJ(),l=yj(),c="[object Map]",d="[object Set]",h=Object.prototype,m=h.hasOwnProperty;function g(x){if(x==null)return!0;if(s(x)&&(r(x)||typeof x=="string"||typeof x.splice=="function"||i(x)||l(x)||n(x)))return!x.length;var y=e(x);if(y==c||y==d)return!x.size;if(a(x))return!t(x).length;for(var w in x)if(m.call(x,w))return!1;return!0}return k5=g,k5}var O5,FD;function SG(){if(FD)return O5;FD=1;function t(e){return e===void 0}return O5=t,O5}var j5,qD;function f8e(){if(qD)return j5;qD=1;function t(e,n,r,s){var i=-1,a=e==null?0:e.length;for(s&&a&&(r=e[++i]);++i1?x.setNode(y,m):x.setNode(y)}),this},s.prototype.setNode=function(h,m){return t.has(this._nodes,h)?(arguments.length>1&&(this._nodes[h]=m),this):(this._nodes[h]=arguments.length>1?m:this._defaultNodeLabelFn(h),this._isCompound&&(this._parent[h]=n,this._children[h]={},this._children[n][h]=!0),this._in[h]={},this._preds[h]={},this._out[h]={},this._sucs[h]={},++this._nodeCount,this)},s.prototype.node=function(h){return this._nodes[h]},s.prototype.hasNode=function(h){return t.has(this._nodes,h)},s.prototype.removeNode=function(h){var m=this;if(t.has(this._nodes,h)){var g=function(x){m.removeEdge(m._edgeObjs[x])};delete this._nodes[h],this._isCompound&&(this._removeFromParentsChildList(h),delete this._parent[h],t.each(this.children(h),function(x){m.setParent(x)}),delete this._children[h]),t.each(t.keys(this._in[h]),g),delete this._in[h],delete this._preds[h],t.each(t.keys(this._out[h]),g),delete this._out[h],delete this._sucs[h],--this._nodeCount}return this},s.prototype.setParent=function(h,m){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t.isUndefined(m))m=n;else{m+="";for(var g=m;!t.isUndefined(g);g=this.parent(g))if(g===h)throw new Error("Setting "+m+" as parent of "+h+" would create a cycle");this.setNode(m)}return this.setNode(h),this._removeFromParentsChildList(h),this._parent[h]=m,this._children[m][h]=!0,this},s.prototype._removeFromParentsChildList=function(h){delete this._children[this._parent[h]][h]},s.prototype.parent=function(h){if(this._isCompound){var m=this._parent[h];if(m!==n)return m}},s.prototype.children=function(h){if(t.isUndefined(h)&&(h=n),this._isCompound){var m=this._children[h];if(m)return t.keys(m)}else{if(h===n)return this.nodes();if(this.hasNode(h))return[]}},s.prototype.predecessors=function(h){var m=this._preds[h];if(m)return t.keys(m)},s.prototype.successors=function(h){var m=this._sucs[h];if(m)return t.keys(m)},s.prototype.neighbors=function(h){var m=this.predecessors(h);if(m)return t.union(m,this.successors(h))},s.prototype.isLeaf=function(h){var m;return this.isDirected()?m=this.successors(h):m=this.neighbors(h),m.length===0},s.prototype.filterNodes=function(h){var m=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});m.setGraph(this.graph());var g=this;t.each(this._nodes,function(w,S){h(S)&&m.setNode(S,w)}),t.each(this._edgeObjs,function(w){m.hasNode(w.v)&&m.hasNode(w.w)&&m.setEdge(w,g.edge(w))});var x={};function y(w){var S=g.parent(w);return S===void 0||m.hasNode(S)?(x[w]=S,S):S in x?x[S]:y(S)}return this._isCompound&&t.each(m.nodes(),function(w){m.setParent(w,y(w))}),m},s.prototype.setDefaultEdgeLabel=function(h){return t.isFunction(h)||(h=t.constant(h)),this._defaultEdgeLabelFn=h,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return t.values(this._edgeObjs)},s.prototype.setPath=function(h,m){var g=this,x=arguments;return t.reduce(h,function(y,w){return x.length>1?g.setEdge(y,w,m):g.setEdge(y,w),w}),this},s.prototype.setEdge=function(){var h,m,g,x,y=!1,w=arguments[0];typeof w=="object"&&w!==null&&"v"in w?(h=w.v,m=w.w,g=w.name,arguments.length===2&&(x=arguments[1],y=!0)):(h=w,m=arguments[1],g=arguments[3],arguments.length>2&&(x=arguments[2],y=!0)),h=""+h,m=""+m,t.isUndefined(g)||(g=""+g);var S=l(this._isDirected,h,m,g);if(t.has(this._edgeLabels,S))return y&&(this._edgeLabels[S]=x),this;if(!t.isUndefined(g)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(h),this.setNode(m),this._edgeLabels[S]=y?x:this._defaultEdgeLabelFn(h,m,g);var k=c(this._isDirected,h,m,g);return h=k.v,m=k.w,Object.freeze(k),this._edgeObjs[S]=k,i(this._preds[m],h),i(this._sucs[h],m),this._in[m][S]=k,this._out[h][S]=k,this._edgeCount++,this},s.prototype.edge=function(h,m,g){var x=arguments.length===1?d(this._isDirected,arguments[0]):l(this._isDirected,h,m,g);return this._edgeLabels[x]},s.prototype.hasEdge=function(h,m,g){var x=arguments.length===1?d(this._isDirected,arguments[0]):l(this._isDirected,h,m,g);return t.has(this._edgeLabels,x)},s.prototype.removeEdge=function(h,m,g){var x=arguments.length===1?d(this._isDirected,arguments[0]):l(this._isDirected,h,m,g),y=this._edgeObjs[x];return y&&(h=y.v,m=y.w,delete this._edgeLabels[x],delete this._edgeObjs[x],a(this._preds[m],h),a(this._sucs[h],m),delete this._in[m][x],delete this._out[h][x],this._edgeCount--),this},s.prototype.inEdges=function(h,m){var g=this._in[h];if(g){var x=t.values(g);return m?t.filter(x,function(y){return y.v===m}):x}},s.prototype.outEdges=function(h,m){var g=this._out[h];if(g){var x=t.values(g);return m?t.filter(x,function(y){return y.w===m}):x}},s.prototype.nodeEdges=function(h,m){var g=this.inEdges(h,m);if(g)return g.concat(this.outEdges(h,m))};function i(h,m){h[m]?h[m]++:h[m]=1}function a(h,m){--h[m]||delete h[m]}function l(h,m,g,x){var y=""+m,w=""+g;if(!h&&y>w){var S=y;y=w,w=S}return y+r+w+r+(t.isUndefined(x)?e:x)}function c(h,m,g,x){var y=""+m,w=""+g;if(!h&&y>w){var S=y;y=w,w=S}var k={v:y,w};return x&&(k.name=x),k}function d(h,m){return l(h,m.v,m.w,m.name)}return L5}var B5,tP;function S8e(){return tP||(tP=1,B5="2.1.8"),B5}var F5,nP;function k8e(){return nP||(nP=1,F5={Graph:o7(),version:S8e()}),F5}var q5,rP;function O8e(){if(rP)return q5;rP=1;var t=za(),e=o7();q5={write:n,read:i};function n(a){var l={options:{directed:a.isDirected(),multigraph:a.isMultigraph(),compound:a.isCompound()},nodes:r(a),edges:s(a)};return t.isUndefined(a.graph())||(l.value=t.clone(a.graph())),l}function r(a){return t.map(a.nodes(),function(l){var c=a.node(l),d=a.parent(l),h={v:l};return t.isUndefined(c)||(h.value=c),t.isUndefined(d)||(h.parent=d),h})}function s(a){return t.map(a.edges(),function(l){var c=a.edge(l),d={v:l.v,w:l.w};return t.isUndefined(l.name)||(d.name=l.name),t.isUndefined(c)||(d.value=c),d})}function i(a){var l=new e(a.options).setGraph(a.value);return t.each(a.nodes,function(c){l.setNode(c.v,c.value),c.parent&&l.setParent(c.v,c.parent)}),t.each(a.edges,function(c){l.setEdge({v:c.v,w:c.w,name:c.name},c.value)}),l}return q5}var $5,sP;function j8e(){if(sP)return $5;sP=1;var t=za();$5=e;function e(n){var r={},s=[],i;function a(l){t.has(r,l)||(r[l]=!0,i.push(l),t.each(n.successors(l),a),t.each(n.predecessors(l),a))}return t.each(n.nodes(),function(l){i=[],a(l),i.length&&s.push(i)}),s}return $5}var H5,iP;function NG(){if(iP)return H5;iP=1;var t=za();H5=e;function e(){this._arr=[],this._keyIndices={}}return e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map(function(n){return n.key})},e.prototype.has=function(n){return t.has(this._keyIndices,n)},e.prototype.priority=function(n){var r=this._keyIndices[n];if(r!==void 0)return this._arr[r].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(n,r){var s=this._keyIndices;if(n=String(n),!t.has(s,n)){var i=this._arr,a=i.length;return s[n]=a,i.push({key:n,priority:r}),this._decrease(a),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key},e.prototype.decrease=function(n,r){var s=this._keyIndices[n];if(r>this._arr[s].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[s].priority+" New: "+r);this._arr[s].priority=r,this._decrease(s)},e.prototype._heapify=function(n){var r=this._arr,s=2*n,i=s+1,a=n;s>1,!(r[i].priority0&&(m=h.removeMin(),g=d[m],g.distance!==Number.POSITIVE_INFINITY);)c(m).forEach(x);return d}return Q5}var V5,oP;function N8e(){if(oP)return V5;oP=1;var t=CG(),e=za();V5=n;function n(r,s,i){return e.transform(r.nodes(),function(a,l){a[l]=t(r,l,s,i)},{})}return V5}var U5,lP;function TG(){if(lP)return U5;lP=1;var t=za();U5=e;function e(n){var r=0,s=[],i={},a=[];function l(c){var d=i[c]={onStack:!0,lowlink:r,index:r++};if(s.push(c),n.successors(c).forEach(function(g){t.has(i,g)?i[g].onStack&&(d.lowlink=Math.min(d.lowlink,i[g].index)):(l(g),d.lowlink=Math.min(d.lowlink,i[g].lowlink))}),d.lowlink===d.index){var h=[],m;do m=s.pop(),i[m].onStack=!1,h.push(m);while(c!==m);a.push(h)}}return n.nodes().forEach(function(c){t.has(i,c)||l(c)}),a}return U5}var W5,cP;function C8e(){if(cP)return W5;cP=1;var t=za(),e=TG();W5=n;function n(r){return t.filter(e(r),function(s){return s.length>1||s.length===1&&r.hasEdge(s[0],s[0])})}return W5}var G5,uP;function T8e(){if(uP)return G5;uP=1;var t=za();G5=n;var e=t.constant(1);function n(s,i,a){return r(s,i||e,a||function(l){return s.outEdges(l)})}function r(s,i,a){var l={},c=s.nodes();return c.forEach(function(d){l[d]={},l[d][d]={distance:0},c.forEach(function(h){d!==h&&(l[d][h]={distance:Number.POSITIVE_INFINITY})}),a(d).forEach(function(h){var m=h.v===d?h.w:h.v,g=i(h);l[d][m]={distance:g,predecessor:d}})}),c.forEach(function(d){var h=l[d];c.forEach(function(m){var g=l[m];c.forEach(function(x){var y=g[d],w=h[x],S=g[x],k=y.distance+w.distance;k0;){if(d=c.removeMin(),t.has(l,d))a.setEdge(d,l[d]);else{if(m)throw new Error("Input graph is not connected: "+s);m=!0}s.nodeEdges(d).forEach(h)}return a}return e3}var t3,xP;function R8e(){return xP||(xP=1,t3={components:j8e(),dijkstra:CG(),dijkstraAll:N8e(),findCycles:C8e(),floydWarshall:T8e(),isAcyclic:E8e(),postorder:_8e(),preorder:A8e(),prim:M8e(),tarjan:TG(),topsort:EG()}),t3}var n3,vP;function D8e(){if(vP)return n3;vP=1;var t=k8e();return n3={Graph:t.Graph,json:O8e(),alg:R8e(),version:t.version},n3}var r3,yP;function Ja(){if(yP)return r3;yP=1;var t;if(typeof a7=="function")try{t=D8e()}catch{}return t||(t=window.graphlib),r3=t,r3}var s3,bP;function P8e(){if(bP)return s3;bP=1;var t=qz(),e=1,n=4;function r(s){return t(s,e|n)}return s3=r,s3}var i3,wP;function z8e(){if(wP)return i3;wP=1;var t=wj(),e=Yz(),n=Xz(),r=Ly(),s=Object.prototype,i=s.hasOwnProperty,a=t(function(l,c){l=Object(l);var d=-1,h=c.length,m=h>2?c[2]:void 0;for(m&&n(c[0],c[1],m)&&(h=1);++d1?i[l-1]:void 0,d=l>2?i[2]:void 0;for(c=r.length>3&&typeof c=="function"?(l--,c):void 0,d&&e(i[0],i[1],d)&&(c=l<3?void 0:c,l=1),s=Object(s);++a0;--S)if(w=h[S].dequeue(),w){g=g.concat(a(d,h,m,w,!0));break}}}return g}function a(d,h,m,g,x){var y=x?[]:void 0;return t.forEach(d.inEdges(g.v),function(w){var S=d.edge(w),k=d.node(w.v);x&&y.push({v:w.v,w:w.w}),k.out-=S,c(h,m,k)}),t.forEach(d.outEdges(g.v),function(w){var S=d.edge(w),k=w.w,j=d.node(k);j.in-=S,c(h,m,j)}),d.removeNode(g.v),y}function l(d,h){var m=new e,g=0,x=0;t.forEach(d.nodes(),function(S){m.setNode(S,{v:S,in:0,out:0})}),t.forEach(d.edges(),function(S){var k=m.edge(S.v,S.w)||0,j=h(S),N=k+j;m.setEdge(S.v,S.w,N),x=Math.max(x,m.node(S.v).out+=j),g=Math.max(g,m.node(S.w).in+=j)});var y=t.range(x+g+3).map(function(){return new n}),w=g+1;return t.forEach(m.nodes(),function(S){c(y,w,m.node(S))}),{graph:m,buckets:y,zeroIdx:w}}function c(d,h,m){m.out?m.in?d[m.out-m.in+h].enqueue(m):d[d.length-1].enqueue(m):d[0].enqueue(m)}return k3}var O3,FP;function Z8e(){if(FP)return O3;FP=1;var t=Nr(),e=K8e();O3={run:n,undo:s};function n(i){var a=i.graph().acyclicer==="greedy"?e(i,l(i)):r(i);t.forEach(a,function(c){var d=i.edge(c);i.removeEdge(c),d.forwardName=c.name,d.reversed=!0,i.setEdge(c.w,c.v,d,t.uniqueId("rev"))});function l(c){return function(d){return c.edge(d).weight}}}function r(i){var a=[],l={},c={};function d(h){t.has(c,h)||(c[h]=!0,l[h]=!0,t.forEach(i.outEdges(h),function(m){t.has(l,m.w)?a.push(m):d(m.w)}),delete l[h])}return t.forEach(i.nodes(),d),a}function s(i){t.forEach(i.edges(),function(a){var l=i.edge(a);if(l.reversed){i.removeEdge(a);var c=l.forwardName;delete l.reversed,delete l.forwardName,i.setEdge(a.w,a.v,l,c)}})}return O3}var j3,qP;function ji(){if(qP)return j3;qP=1;var t=Nr(),e=Ja().Graph;j3={addDummyNode:n,simplify:r,asNonCompoundGraph:s,successorWeights:i,predecessorWeights:a,intersectRect:l,buildLayerMatrix:c,normalizeRanks:d,removeEmptyRanks:h,addBorderNode:m,maxRank:g,partition:x,time:y,notime:w};function n(S,k,j,N){var T;do T=t.uniqueId(N);while(S.hasNode(T));return j.dummy=k,S.setNode(T,j),T}function r(S){var k=new e().setGraph(S.graph());return t.forEach(S.nodes(),function(j){k.setNode(j,S.node(j))}),t.forEach(S.edges(),function(j){var N=k.edge(j.v,j.w)||{weight:0,minlen:1},T=S.edge(j);k.setEdge(j.v,j.w,{weight:N.weight+T.weight,minlen:Math.max(N.minlen,T.minlen)})}),k}function s(S){var k=new e({multigraph:S.isMultigraph()}).setGraph(S.graph());return t.forEach(S.nodes(),function(j){S.children(j).length||k.setNode(j,S.node(j))}),t.forEach(S.edges(),function(j){k.setEdge(j,S.edge(j))}),k}function i(S){var k=t.map(S.nodes(),function(j){var N={};return t.forEach(S.outEdges(j),function(T){N[T.w]=(N[T.w]||0)+S.edge(T).weight}),N});return t.zipObject(S.nodes(),k)}function a(S){var k=t.map(S.nodes(),function(j){var N={};return t.forEach(S.inEdges(j),function(T){N[T.v]=(N[T.v]||0)+S.edge(T).weight}),N});return t.zipObject(S.nodes(),k)}function l(S,k){var j=S.x,N=S.y,T=k.x-j,E=k.y-N,_=S.width/2,A=S.height/2;if(!T&&!E)throw new Error("Not possible to find intersection inside of the rectangle");var L,P;return Math.abs(E)*_>Math.abs(T)*A?(E<0&&(A=-A),L=A*T/E,P=A):(T<0&&(_=-_),L=_,P=_*E/T),{x:j+L,y:N+P}}function c(S){var k=t.map(t.range(g(S)+1),function(){return[]});return t.forEach(S.nodes(),function(j){var N=S.node(j),T=N.rank;t.isUndefined(T)||(k[T][N.order]=j)}),k}function d(S){var k=t.min(t.map(S.nodes(),function(j){return S.node(j).rank}));t.forEach(S.nodes(),function(j){var N=S.node(j);t.has(N,"rank")&&(N.rank-=k)})}function h(S){var k=t.min(t.map(S.nodes(),function(E){return S.node(E).rank})),j=[];t.forEach(S.nodes(),function(E){var _=S.node(E).rank-k;j[_]||(j[_]=[]),j[_].push(E)});var N=0,T=S.graph().nodeRankFactor;t.forEach(j,function(E,_){t.isUndefined(E)&&_%T!==0?--N:N&&t.forEach(E,function(A){S.node(A).rank+=N})})}function m(S,k,j,N){var T={width:0,height:0};return arguments.length>=4&&(T.rank=j,T.order=N),n(S,"border",T,k)}function g(S){return t.max(t.map(S.nodes(),function(k){var j=S.node(k).rank;if(!t.isUndefined(j))return j}))}function x(S,k){var j={lhs:[],rhs:[]};return t.forEach(S,function(N){k(N)?j.lhs.push(N):j.rhs.push(N)}),j}function y(S,k){var j=t.now();try{return k()}finally{console.log(S+" time: "+(t.now()-j)+"ms")}}function w(S,k){return k()}return j3}var N3,$P;function J8e(){if($P)return N3;$P=1;var t=Nr(),e=ji();N3={run:n,undo:s};function n(i){i.graph().dummyChains=[],t.forEach(i.edges(),function(a){r(i,a)})}function r(i,a){var l=a.v,c=i.node(l).rank,d=a.w,h=i.node(d).rank,m=a.name,g=i.edge(a),x=g.labelRank;if(h!==c+1){i.removeEdge(a);var y,w,S;for(S=0,++c;cP.lim&&(B=P,$=!0);var U=t.filter(T.edges(),function(te){return $===j(N,N.node(te.v),B)&&$!==j(N,N.node(te.w),B)});return t.minBy(U,function(te){return n(T,te)})}function w(N,T,E,_){var A=E.v,L=E.w;N.removeEdge(A,L),N.setEdge(_.v,_.w,{}),m(N),c(N,T),S(N,T)}function S(N,T){var E=t.find(N.nodes(),function(A){return!T.node(A).parent}),_=s(N,E);_=_.slice(1),t.forEach(_,function(A){var L=N.node(A).parent,P=T.edge(A,L),B=!1;P||(P=T.edge(L,A),B=!0),T.node(A).rank=T.node(L).rank+(B?P.minlen:-P.minlen)})}function k(N,T,E){return N.hasEdge(T,E)}function j(N,T,E){return E.low<=T.lim&&T.lim<=E.lim}return E3}var _3,UP;function tTe(){if(UP)return _3;UP=1;var t=Dy(),e=t.longestPath,n=RG(),r=eTe();_3=s;function s(c){switch(c.graph().ranker){case"network-simplex":l(c);break;case"tight-tree":a(c);break;case"longest-path":i(c);break;default:l(c)}}var i=e;function a(c){e(c),n(c)}function l(c){r(c)}return _3}var A3,WP;function nTe(){if(WP)return A3;WP=1;var t=Nr();A3=e;function e(s){var i=r(s);t.forEach(s.graph().dummyChains,function(a){for(var l=s.node(a),c=l.edgeObj,d=n(s,i,c.v,c.w),h=d.path,m=d.lca,g=0,x=h[g],y=!0;a!==c.w;){if(l=s.node(a),y){for(;(x=h[g])!==m&&s.node(x).maxRankh||m>i[g].lim));for(x=g,g=l;(g=s.parent(g))!==x;)d.push(g);return{path:c.concat(d.reverse()),lca:x}}function r(s){var i={},a=0;function l(c){var d=a;t.forEach(s.children(c),l),i[c]={low:d,lim:a++}}return t.forEach(s.children(),l),i}return A3}var M3,GP;function rTe(){if(GP)return M3;GP=1;var t=Nr(),e=ji();M3={run:n,cleanup:a};function n(l){var c=e.addDummyNode(l,"root",{},"_root"),d=s(l),h=t.max(t.values(d))-1,m=2*h+1;l.graph().nestingRoot=c,t.forEach(l.edges(),function(x){l.edge(x).minlen*=m});var g=i(l)+1;t.forEach(l.children(),function(x){r(l,c,m,g,h,d,x)}),l.graph().nodeRankFactor=m}function r(l,c,d,h,m,g,x){var y=l.children(x);if(!y.length){x!==c&&l.setEdge(c,x,{weight:0,minlen:d});return}var w=e.addBorderNode(l,"_bt"),S=e.addBorderNode(l,"_bb"),k=l.node(x);l.setParent(w,x),k.borderTop=w,l.setParent(S,x),k.borderBottom=S,t.forEach(y,function(j){r(l,c,d,h,m,g,j);var N=l.node(j),T=N.borderTop?N.borderTop:j,E=N.borderBottom?N.borderBottom:j,_=N.borderTop?h:2*h,A=T!==E?1:m-g[x]+1;l.setEdge(w,T,{weight:_,minlen:A,nestingEdge:!0}),l.setEdge(E,S,{weight:_,minlen:A,nestingEdge:!0})}),l.parent(x)||l.setEdge(c,w,{weight:0,minlen:m+g[x]})}function s(l){var c={};function d(h,m){var g=l.children(h);g&&g.length&&t.forEach(g,function(x){d(x,m+1)}),c[h]=m}return t.forEach(l.children(),function(h){d(h,1)}),c}function i(l){return t.reduce(l.edges(),function(c,d){return c+l.edge(d).weight},0)}function a(l){var c=l.graph();l.removeNode(c.nestingRoot),delete c.nestingRoot,t.forEach(l.edges(),function(d){var h=l.edge(d);h.nestingEdge&&l.removeEdge(d)})}return M3}var R3,XP;function sTe(){if(XP)return R3;XP=1;var t=Nr(),e=ji();R3=n;function n(s){function i(a){var l=s.children(a),c=s.node(a);if(l.length&&t.forEach(l,i),t.has(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(var d=c.minRank,h=c.maxRank+1;d0;)x%2&&(y+=h[x+1]),x=x-1>>1,h[x]+=g.weight;m+=g.weight*y})),m}return z3}var I3,JP;function lTe(){if(JP)return I3;JP=1;var t=Nr();I3=e;function e(n,r){return t.map(r,function(s){var i=n.inEdges(s);if(i.length){var a=t.reduce(i,function(l,c){var d=n.edge(c),h=n.node(c.v);return{sum:l.sum+d.weight*h.order,weight:l.weight+d.weight}},{sum:0,weight:0});return{v:s,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:s}})}return I3}var L3,ez;function cTe(){if(ez)return L3;ez=1;var t=Nr();L3=e;function e(s,i){var a={};t.forEach(s,function(c,d){var h=a[c.v]={indegree:0,in:[],out:[],vs:[c.v],i:d};t.isUndefined(c.barycenter)||(h.barycenter=c.barycenter,h.weight=c.weight)}),t.forEach(i.edges(),function(c){var d=a[c.v],h=a[c.w];!t.isUndefined(d)&&!t.isUndefined(h)&&(h.indegree++,d.out.push(a[c.w]))});var l=t.filter(a,function(c){return!c.indegree});return n(l)}function n(s){var i=[];function a(d){return function(h){h.merged||(t.isUndefined(h.barycenter)||t.isUndefined(d.barycenter)||h.barycenter>=d.barycenter)&&r(d,h)}}function l(d){return function(h){h.in.push(d),--h.indegree===0&&s.push(h)}}for(;s.length;){var c=s.pop();i.push(c),t.forEach(c.in.reverse(),a(c)),t.forEach(c.out,l(c))}return t.map(t.filter(i,function(d){return!d.merged}),function(d){return t.pick(d,["vs","i","barycenter","weight"])})}function r(s,i){var a=0,l=0;s.weight&&(a+=s.barycenter*s.weight,l+=s.weight),i.weight&&(a+=i.barycenter*i.weight,l+=i.weight),s.vs=i.vs.concat(s.vs),s.barycenter=a/l,s.weight=l,s.i=Math.min(i.i,s.i),i.merged=!0}return L3}var B3,tz;function uTe(){if(tz)return B3;tz=1;var t=Nr(),e=ji();B3=n;function n(i,a){var l=e.partition(i,function(w){return t.has(w,"barycenter")}),c=l.lhs,d=t.sortBy(l.rhs,function(w){return-w.i}),h=[],m=0,g=0,x=0;c.sort(s(!!a)),x=r(h,d,x),t.forEach(c,function(w){x+=w.vs.length,h.push(w.vs),m+=w.barycenter*w.weight,g+=w.weight,x=r(h,d,x)});var y={vs:t.flatten(h,!0)};return g&&(y.barycenter=m/g,y.weight=g),y}function r(i,a,l){for(var c;a.length&&(c=t.last(a)).i<=l;)a.pop(),i.push(c.vs),l++;return l}function s(i){return function(a,l){return a.barycenterl.barycenter?1:i?l.i-a.i:a.i-l.i}}return B3}var F3,nz;function dTe(){if(nz)return F3;nz=1;var t=Nr(),e=lTe(),n=cTe(),r=uTe();F3=s;function s(l,c,d,h){var m=l.children(c),g=l.node(c),x=g?g.borderLeft:void 0,y=g?g.borderRight:void 0,w={};x&&(m=t.filter(m,function(E){return E!==x&&E!==y}));var S=e(l,m);t.forEach(S,function(E){if(l.children(E.v).length){var _=s(l,E.v,d,h);w[E.v]=_,t.has(_,"barycenter")&&a(E,_)}});var k=n(S,d);i(k,w);var j=r(k,h);if(x&&(j.vs=t.flatten([x,j.vs,y],!0),l.predecessors(x).length)){var N=l.node(l.predecessors(x)[0]),T=l.node(l.predecessors(y)[0]);t.has(j,"barycenter")||(j.barycenter=0,j.weight=0),j.barycenter=(j.barycenter*j.weight+N.order+T.order)/(j.weight+2),j.weight+=2}return j}function i(l,c){t.forEach(l,function(d){d.vs=t.flatten(d.vs.map(function(h){return c[h]?c[h].vs:h}),!0)})}function a(l,c){t.isUndefined(l.barycenter)?(l.barycenter=c.barycenter,l.weight=c.weight):(l.barycenter=(l.barycenter*l.weight+c.barycenter*c.weight)/(l.weight+c.weight),l.weight+=c.weight)}return F3}var q3,rz;function hTe(){if(rz)return q3;rz=1;var t=Nr(),e=Ja().Graph;q3=n;function n(s,i,a){var l=r(s),c=new e({compound:!0}).setGraph({root:l}).setDefaultNodeLabel(function(d){return s.node(d)});return t.forEach(s.nodes(),function(d){var h=s.node(d),m=s.parent(d);(h.rank===i||h.minRank<=i&&i<=h.maxRank)&&(c.setNode(d),c.setParent(d,m||l),t.forEach(s[a](d),function(g){var x=g.v===d?g.w:g.v,y=c.edge(x,d),w=t.isUndefined(y)?0:y.weight;c.setEdge(x,d,{weight:s.edge(g).weight+w})}),t.has(h,"minRank")&&c.setNode(d,{borderLeft:h.borderLeft[i],borderRight:h.borderRight[i]}))}),c}function r(s){for(var i;s.hasNode(i=t.uniqueId("_root")););return i}return q3}var $3,sz;function fTe(){if(sz)return $3;sz=1;var t=Nr();$3=e;function e(n,r,s){var i={},a;t.forEach(s,function(l){for(var c=n.parent(l),d,h;c;){if(d=n.parent(c),d?(h=i[d],i[d]=c):(h=a,a=c),h&&h!==c){r.setEdge(h,c);return}c=d}})}return $3}var H3,iz;function mTe(){if(iz)return H3;iz=1;var t=Nr(),e=aTe(),n=oTe(),r=dTe(),s=hTe(),i=fTe(),a=Ja().Graph,l=ji();H3=c;function c(g){var x=l.maxRank(g),y=d(g,t.range(1,x+1),"inEdges"),w=d(g,t.range(x-1,-1,-1),"outEdges"),S=e(g);m(g,S);for(var k=Number.POSITIVE_INFINITY,j,N=0,T=0;T<4;++N,++T){h(N%2?y:w,N%4>=2),S=l.buildLayerMatrix(g);var E=n(g,S);EB)&&a(N,te,$)})})}function E(_,A){var L=-1,P,B=0;return t.forEach(A,function($,U){if(k.node($).dummy==="border"){var te=k.predecessors($);te.length&&(P=k.node(te[0]).order,T(A,B,U,L,P),B=U,L=P)}T(A,B,A.length,P,_.length)}),A}return t.reduce(j,E),N}function i(k,j){if(k.node(j).dummy)return t.find(k.predecessors(j),function(N){return k.node(N).dummy})}function a(k,j,N){if(j>N){var T=j;j=N,N=T}var E=k[j];E||(k[j]=E={}),E[N]=!0}function l(k,j,N){if(j>N){var T=j;j=N,N=T}return t.has(k[j],N)}function c(k,j,N,T){var E={},_={},A={};return t.forEach(j,function(L){t.forEach(L,function(P,B){E[P]=P,_[P]=P,A[P]=B})}),t.forEach(j,function(L){var P=-1;t.forEach(L,function(B){var $=T(B);if($.length){$=t.sortBy($,function(F){return A[F]});for(var U=($.length-1)/2,te=Math.floor(U),z=Math.ceil(U);te<=z;++te){var Q=$[te];_[B]===B&&Po.jsxs("div",{className:"px-4 py-2 shadow-md rounded-lg bg-gradient-to-br from-blue-500 to-blue-600 border-2 border-blue-700 min-w-[120px]",children:[o.jsx(ru,{type:"target",position:wt.Top}),o.jsx("div",{className:"font-semibold text-white text-sm truncate max-w-[200px]",title:t.content,children:t.label}),o.jsx(ru,{type:"source",position:wt.Bottom})]}));DG.displayName="EntityNode";const PG=b.memo(({data:t})=>o.jsxs("div",{className:"px-3 py-2 shadow-md rounded-md bg-gradient-to-br from-green-500 to-green-600 border-2 border-green-700 min-w-[100px]",children:[o.jsx(ru,{type:"target",position:wt.Top}),o.jsx("div",{className:"font-medium text-white text-xs truncate max-w-[150px]",title:t.content,children:t.label}),o.jsx(ru,{type:"source",position:wt.Bottom})]}));PG.displayName="ParagraphNode";const jTe={entity:DG,paragraph:PG};function NTe(t,e){const n=new hz.graphlib.Graph;n.setDefaultEdgeLabel(()=>({})),n.setGraph({rankdir:"TB",ranksep:100,nodesep:80});const r=[],s=[];return t.forEach(i=>{n.setNode(i.id,{width:150,height:50})}),e.forEach(i=>{n.setEdge(i.source,i.target)}),hz.layout(n),t.forEach(i=>{const a=n.node(i.id);r.push({id:i.id,type:i.type,position:{x:a.x-75,y:a.y-25},data:{label:i.content.slice(0,20)+(i.content.length>20?"...":""),content:i.content}})}),e.forEach((i,a)=>{const l={id:`edge-${a}`,source:i.source,target:i.target,animated:t.length<=200&&i.weight>5,style:{strokeWidth:Math.min(i.weight/2,5),opacity:.6}};i.weight>10&&t.length<100&&(l.label=`${i.weight.toFixed(0)}`),s.push(l)}),{nodes:r,edges:s}}function CTe(){const t=Zi(),[e,n]=b.useState(!1),[r,s]=b.useState(null),[i,a]=b.useState(""),[l,c]=b.useState("all"),[d,h]=b.useState(50),[m,g]=b.useState("50"),[x,y]=b.useState(!1),[w,S]=b.useState(!0),[k,j]=b.useState(!1),[N,T]=b.useState(!1),[E,_,A]=LCe([]),[L,P,B]=BCe([]),[$,U]=b.useState(0),[te,z]=b.useState(null),[Q,F]=b.useState(null),{toast:Y}=as(),J=b.useCallback(ne=>ne.type==="entity"?"#6366f1":ne.type==="paragraph"?"#10b981":"#6b7280",[]),X=b.useCallback(async(ne=!1)=>{try{if(!ne&&d>200){T(!0);return}n(!0);const[W,se]=await Promise.all([STe(d,l),kTe()]);if(s(se),W.nodes.length===0){Y({title:"提示",description:"知识库为空,请先导入知识数据"}),_([]),P([]);return}const{nodes:re,edges:oe}=NTe(W.nodes,W.edges);_(re),P(oe),U(re.length),se&&se.total_nodes>d&&Y({title:"提示",description:`知识图谱包含 ${se.total_nodes} 个节点,当前显示 ${re.length} 个`}),Y({title:"加载成功",description:`已加载 ${re.length} 个节点,${oe.length} 条边`})}catch(W){console.error("加载知识图谱失败:",W),Y({title:"加载失败",description:W instanceof Error?W.message:"未知错误",variant:"destructive"})}finally{n(!1)}},[d,l,Y]),R=b.useCallback(async()=>{if(!i.trim()){Y({title:"提示",description:"请输入搜索关键词"});return}try{const ne=await OTe(i);if(ne.length===0){Y({title:"未找到",description:"没有找到匹配的节点"});return}const W=new Set(ne.map(se=>se.id));_(se=>se.map(re=>({...re,style:{...re.style,opacity:W.has(re.id)?1:.3,filter:W.has(re.id)?"brightness(1.2)":"brightness(0.8)"}}))),Y({title:"搜索完成",description:`找到 ${ne.length} 个匹配节点`})}catch(ne){console.error("搜索失败:",ne),Y({title:"搜索失败",description:ne instanceof Error?ne.message:"未知错误",variant:"destructive"})}},[i,Y]),ie=b.useCallback(()=>{_(ne=>ne.map(W=>({...W,style:{...W.style,opacity:1,filter:"brightness(1)"}})))},[]),G=b.useCallback(()=>{S(!1),j(!0),X()},[X]),I=b.useCallback(()=>{T(!1),setTimeout(()=>{X(!0)},0)},[X]),V=b.useCallback((ne,W)=>{E.find(re=>re.id===W.id)&&z({id:W.id,type:W.type,content:W.data.content})},[E]);b.useEffect(()=>{w||k&&X()},[d,l,w,k]);const ee=b.useCallback((ne,W)=>{const se=E.find(Te=>Te.id===W.source),re=E.find(Te=>Te.id===W.target),oe=L.find(Te=>Te.id===W.id);se&&re&&oe&&F({source:{id:se.id,type:se.type,content:se.data.content},target:{id:re.id,type:re.type,content:re.data.content},edge:{source:W.source,target:W.target,weight:parseFloat(W.label||"0")}})},[E,L]);return o.jsxs("div",{className:"h-full flex flex-col",children:[o.jsxs("div",{className:"flex-shrink-0 p-4 border-b bg-background",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦知识库图谱"}),o.jsx("p",{className:"text-muted-foreground mt-1",children:"可视化知识实体与关系网络"})]}),r&&o.jsxs("div",{className:"flex gap-2 flex-wrap",children:[o.jsxs(Xn,{variant:"outline",className:"gap-1",children:[o.jsx(ek,{className:"h-3 w-3"}),"节点: ",r.total_nodes]}),o.jsxs(Xn,{variant:"outline",className:"gap-1",children:[o.jsx(SI,{className:"h-3 w-3"}),"边: ",r.total_edges]}),o.jsxs(Xn,{variant:"outline",className:"gap-1",children:[o.jsx(Oa,{className:"h-3 w-3"}),"实体: ",r.entity_nodes]}),o.jsxs(Xn,{variant:"outline",className:"gap-1",children:[o.jsx(zl,{className:"h-3 w-3"}),"段落: ",r.paragraph_nodes]})]})]}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 mt-4",children:[o.jsxs("div",{className:"flex-1 flex gap-2",children:[o.jsx(ze,{placeholder:"搜索节点内容...",value:i,onChange:ne=>a(ne.target.value),onKeyDown:ne=>ne.key==="Enter"&&R(),className:"flex-1"}),o.jsx(de,{onClick:R,size:"sm",children:o.jsx(Ni,{className:"h-4 w-4"})}),o.jsx(de,{onClick:ie,variant:"outline",size:"sm",children:"重置"})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(Vt,{value:l,onValueChange:ne=>c(ne),children:[o.jsx($t,{className:"w-[120px]",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部节点"}),o.jsx(De,{value:"entity",children:"仅实体"}),o.jsx(De,{value:"paragraph",children:"仅段落"})]})]}),o.jsxs(Vt,{value:d===1e4?"all":x?"custom":d.toString(),onValueChange:ne=>{ne==="custom"?(y(!0),g(d.toString())):ne==="all"?(y(!1),h(1e4)):(y(!1),h(Number(ne)))},children:[o.jsx($t,{className:"w-[120px]",children:o.jsx(Ut,{})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"50",children:"50 节点"}),o.jsx(De,{value:"100",children:"100 节点"}),o.jsx(De,{value:"200",children:"200 节点"}),o.jsx(De,{value:"500",children:"500 节点"}),o.jsx(De,{value:"1000",children:"1000 节点"}),o.jsx(De,{value:"all",children:"全部 (最多10000)"}),o.jsx(De,{value:"custom",children:"自定义..."})]})]}),x&&o.jsx(ze,{type:"number",min:"50",value:m,onChange:ne=>g(ne.target.value),onBlur:()=>{const ne=parseInt(m);!isNaN(ne)&&ne>=50?h(ne):(g("50"),h(50))},onKeyDown:ne=>{if(ne.key==="Enter"){const W=parseInt(m);!isNaN(W)&&W>=50?h(W):(g("50"),h(50))}},placeholder:"最少50个",className:"w-[120px]"}),o.jsx(de,{onClick:()=>X(),variant:"outline",size:"sm",disabled:e,children:o.jsx(Ps,{className:xe("h-4 w-4",e&&"animate-spin")})})]})]})]}),o.jsx("div",{className:"flex-1 relative",children:e?o.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:o.jsxs("div",{className:"text-center",children:[o.jsx(Ps,{className:"h-8 w-8 animate-spin mx-auto mb-2 text-muted-foreground"}),o.jsx("p",{className:"text-muted-foreground",children:"加载知识图谱中..."})]})}):E.length===0?o.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:o.jsxs("div",{className:"text-center",children:[o.jsx(ek,{className:"h-12 w-12 mx-auto mb-4 text-muted-foreground"}),o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"知识库为空"}),o.jsx("p",{className:"text-muted-foreground",children:"请先导入知识数据"})]})}):o.jsxs(dG,{nodes:E,edges:L,onNodesChange:A,onEdgesChange:B,onNodeClick:V,onEdgeClick:ee,nodeTypes:jTe,fitView:!0,minZoom:.05,maxZoom:1.5,defaultViewport:{x:0,y:0,zoom:.5},elevateNodesOnSelect:$<=500,nodesDraggable:$<=1e3,attributionPosition:"bottom-left",children:[o.jsx(l8e,{variant:Ca.Dots,gap:12,size:1}),o.jsx(n8e,{}),$<=500&&o.jsx(XCe,{nodeColor:J,nodeBorderRadius:8,pannable:!0,zoomable:!0}),o.jsxs(Jb,{position:"top-right",className:"bg-background/95 backdrop-blur-sm rounded-lg border p-3 shadow-lg",children:[o.jsx("div",{className:"text-sm font-semibold mb-2",children:"图例"}),o.jsxs("div",{className:"space-y-2 text-xs",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-blue-500 to-blue-600 border-2 border-blue-700"}),o.jsx("span",{children:"实体节点"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-green-500 to-green-600 border-2 border-green-700"}),o.jsx("span",{children:"段落节点"})]}),$>200&&o.jsxs("div",{className:"mt-2 pt-2 border-t text-yellow-600 dark:text-yellow-500",children:[o.jsx("div",{className:"font-semibold",children:"性能模式"}),o.jsx("div",{children:"已禁用动画"}),$>500&&o.jsx("div",{children:"已禁用缩略图"})]})]})]})]})}),o.jsx(Dr,{open:!!te,onOpenChange:ne=>!ne&&z(null),children:o.jsxs(Sr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsx(kr,{children:o.jsx(Or,{children:"节点详情"})}),te&&o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"grid grid-cols-2 gap-4",children:o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"类型"}),o.jsx("div",{className:"mt-1",children:o.jsx(Xn,{variant:te.type==="entity"?"default":"secondary",children:te.type==="entity"?"🏷️ 实体":"📄 段落"})})]})}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"ID"}),o.jsx("code",{className:"mt-1 block p-2 bg-muted rounded text-xs break-all",children:te.id})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"内容"}),o.jsx(gn,{className:"mt-1 h-40 p-3 bg-muted rounded",children:o.jsx("p",{className:"text-sm whitespace-pre-wrap",children:te.content})})]})]})]})}),o.jsx(Dr,{open:!!Q,onOpenChange:ne=>!ne&&F(null),children:o.jsxs(Sr,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[o.jsx(kr,{children:o.jsx(Or,{children:"边详情"})}),Q&&o.jsx(gn,{className:"flex-1 pr-4",children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("div",{className:"flex-1 min-w-0 p-3 bg-blue-50 dark:bg-blue-950 rounded border-2 border-blue-200 dark:border-blue-800",children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"源节点"}),o.jsx("div",{className:"font-medium text-sm mb-2 truncate",children:Q.source.content}),o.jsxs("code",{className:"text-xs text-muted-foreground truncate block",children:[Q.source.id.slice(0,40),"..."]})]}),o.jsx("div",{className:"text-2xl text-muted-foreground flex-shrink-0",children:"→"}),o.jsxs("div",{className:"flex-1 min-w-0 p-3 bg-green-50 dark:bg-green-950 rounded border-2 border-green-200 dark:border-green-800",children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"目标节点"}),o.jsx("div",{className:"font-medium text-sm mb-2 truncate",children:Q.target.content}),o.jsxs("code",{className:"text-xs text-muted-foreground truncate block",children:[Q.target.id.slice(0,40),"..."]})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"权重"}),o.jsx("div",{className:"mt-1",children:o.jsx(Xn,{variant:"outline",className:"text-base font-mono",children:Q.edge.weight.toFixed(4)})})]})]})})]})}),o.jsx(Dn,{open:w,onOpenChange:S,children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"加载知识图谱"}),o.jsxs(_n,{children:["知识图谱的动态展示会消耗较多系统资源。",o.jsx("br",{}),"确定要加载知识图谱吗?"]})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{onClick:()=>t({to:"/"}),children:"取消 (返回首页)"}),o.jsx(An,{onClick:G,children:"确认加载"})]})]})}),o.jsx(Dn,{open:N,onOpenChange:T,children:o.jsxs(Nn,{children:[o.jsxs(Cn,{children:[o.jsx(En,{children:"⚠️ 节点数量较多"}),o.jsx(_n,{asChild:!0,children:o.jsxs("div",{children:[o.jsxs("p",{children:["您正在尝试加载 ",o.jsx("strong",{className:"text-orange-600",children:d>=1e4?"全部 (最多10000个)":d})," 个节点。"]}),o.jsx("p",{className:"mt-4",children:"节点数量过多可能导致:"}),o.jsxs("ul",{className:"list-disc list-inside mt-2 space-y-1",children:[o.jsx("li",{children:"页面加载时间较长"}),o.jsx("li",{children:"浏览器卡顿或崩溃"}),o.jsx("li",{children:"系统资源占用过高"})]}),o.jsx("p",{className:"mt-4",children:"建议先选择较少的节点数量 (50-200 个)。"})]})})]}),o.jsxs(Tn,{children:[o.jsx(Mn,{onClick:()=>{T(!1),d>200&&(h(50),y(!1))},children:"取消"}),o.jsx(An,{onClick:I,className:"bg-orange-600 hover:bg-orange-700",children:"我了解风险,继续加载"})]})]})})]})}function mh(t,e,n){let r=n.initialDeps??[],s;function i(){var a,l,c,d;let h;n.key&&((a=n.debug)!=null&&a.call(n))&&(h=Date.now());const m=t();if(!(m.length!==r.length||m.some((y,w)=>r[w]!==y)))return s;r=m;let x;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(x=Date.now()),s=e(...m),n.key&&((c=n.debug)!=null&&c.call(n))){const y=Math.round((Date.now()-h)*100)/100,w=Math.round((Date.now()-x)*100)/100,S=w/16,k=(j,N)=>{for(j=String(j);j.length{r=a},i}function oz(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const cTe=(t,e)=>Math.abs(t-e)<1.01,uTe=(t,e,n)=>{let r;return function(...s){t.clearTimeout(r),r=t.setTimeout(()=>e.apply(this,s),n)}},lz=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},dTe=t=>t,hTe=t=>{const e=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),r=[];for(let s=e;s<=n;s++)r.push(s);return r},fTe=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;const s=a=>{const{width:l,height:c}=a;e({width:Math.round(l),height:Math.round(c)})};if(s(lz(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(a=>{const l=()=>{const c=a[0];if(c?.borderBoxSize){const d=c.borderBoxSize[0];if(d){s({width:d.inlineSize,height:d.blockSize});return}}s(lz(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},cz={passive:!0},uz=typeof window>"u"?!0:"onscrollend"in window,mTe=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;let s=0;const i=t.options.useScrollendEvent&&uz?()=>{}:uTe(r,()=>{e(s,!1)},t.options.isScrollingResetDelay),a=h=>()=>{const{horizontal:m,isRtl:g}=t.options;s=m?n.scrollLeft*(g&&-1||1):n.scrollTop,i(),e(s,h)},l=a(!0),c=a(!1);c(),n.addEventListener("scroll",l,cz);const d=t.options.useScrollendEvent&&uz;return d&&n.addEventListener("scrollend",c,cz),()=>{n.removeEventListener("scroll",l),d&&n.removeEventListener("scrollend",c)}},pTe=(t,e,n)=>{if(e?.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},gTe=(t,{adjustments:e=0,behavior:n},r)=>{var s,i;const a=t+e;(i=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[r.options.horizontal?"left":"top"]:a,behavior:n})};class xTe{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 n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const a=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),n=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=n=>{Object.entries(n).forEach(([r,s])=>{typeof s>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:dTe,rangeExtractor:hTe,onChange:()=>{},measureElement:pTe,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,...n}},this.notify=n=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,n)},this.maybeNotify=mh(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(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()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=(n,r)=>{const s=new Map,i=new Map;for(let a=r-1;a>=0;a--){const l=n[a];if(s.has(l.lane))continue;const c=i.get(l.lane);if(c==null||l.end>c.end?i.set(l.lane,l):l.enda.end===l.end?a.index-l.index:a.end-l.end)[0]:void 0},this.getMeasurementOptions=mh(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,s,i,a)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a}),{key:!1}),this.getMeasurements=mh(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a},l)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const c=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const d=this.measurementsCache.slice(0,c);for(let h=c;hthis.options.debug}),this.calculateRange=mh(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,i)=>this.range=n.length>0&&r>0?vTe({measurements:n,outerSize:r,scrollOffset:s,lanes:i}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=mh(()=>{let n=null,r=null;const s=this.calculateRange();return s&&(n=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,s,i,a)=>i===null||a===null?[]:n({startIndex:i,endIndex:a,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,s=n.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const s=this.indexFromElement(n),i=this.measurementsCache[s];if(!i)return;const a=i.key,l=this.elementsCache.get(a);l!==n&&(l&&this.observer.unobserve(l),this.observer.observe(n),this.elementsCache.set(a,n)),n.isConnected&&this.resizeItem(s,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const s=this.measurementsCache[n];if(!s)return;const i=this.itemSizeCache.get(s.key)??s.size,a=r-i;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,a,this):s.start{if(!n){this.elementsCache.forEach((r,s)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(s))});return}this._measureElement(n,void 0)},this.getVirtualItems=mh(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const s=[];for(let i=0,a=n.length;ithis.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return oz(r[_G(0,r.length-1,s=>oz(r[s]).start,n)])},this.getOffsetForAlignment=(n,r,s=0)=>{const i=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=n>=a+i?"end":"start"),r==="center"?n+=(s-i)/2:r==="end"&&(n-=i);const l=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.measurementsCache[n];if(!s)return;const i=this.getSize(),a=this.getScrollOffset();if(r==="auto")if(s.end>=a+i-this.options.scrollPaddingEnd)r="end";else if(s.start<=a+this.options.scrollPaddingStart)r="start";else return[a,r];const l=r==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,r,s.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{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(n,r),{adjustments:void 0,behavior:s})},this.scrollToIndex=(n,{align:r="auto",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1));let i=0;const a=10,l=d=>{if(!this.targetWindow)return;const h=this.getOffsetForIndex(n,d);if(!h){console.warn("Failed to get offset for index:",n);return}const[m,g]=h;this._scrollToOffset(m,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const x=this.getScrollOffset(),y=this.getOffsetForIndex(n,g);if(!y){console.warn("Failed to get offset for index:",n);return}cTe(y[0],x)||c(g)})},c=d=>{this.targetWindow&&(i++,il(d)):console.warn(`Failed to scroll to index ${n} after ${a} attempts.`))};l(r)},this.scrollBy=(n,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((n=r[r.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&i.some(l=>l===null);){const l=r[a];i[l.lane]===null&&(i[l.lane]=l.end),a--}s=Math.max(...i.filter(l=>l!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:s})=>{this.options.scrollToFn(n,{behavior:s,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const _G=(t,e,n,r)=>{for(;t<=e;){const s=(t+e)/2|0,i=n(s);if(ir)e=s-1;else return s}return t>0?t-1:0};function vTe({measurements:t,outerSize:e,scrollOffset:n,lanes:r}){const s=t.length-1,i=c=>t[c].start;if(t.length<=r)return{startIndex:0,endIndex:s};let a=_G(0,s,i,n),l=a;if(r===1)for(;l1){const c=Array(r).fill(0);for(;lh=0&&d.some(h=>h>=n);){const h=t[a];d[h.lane]=h.start,a--}a=Math.max(0,a-a%r),l=Math.min(s,l+(r-1-l%r))}return{startIndex:a,endIndex:l}}const dz=typeof document<"u"?b.useLayoutEffect:b.useEffect;function yTe(t){const e=b.useReducer(()=>({}),{})[1],n={...t,onChange:(s,i)=>{var a;i?pa.flushSync(e):e(),(a=t.onChange)==null||a.call(t,s,i)}},[r]=b.useState(()=>new xTe(n));return r.setOptions(n),dz(()=>r._didMount(),[]),dz(()=>r._willUpdate()),r}function bTe(t){return yTe({observeElementRect:fTe,observeElementOffset:mTe,scrollToFn:gTe,...t})}function wTe(t,e,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:t,timeZoneName:n}).format(e).split(/\s/g).slice(2).join(" ")}const STe={},f0={};function Gu(t,e){try{const r=(STe[t]||=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"longOffset"}).format)(e).split("GMT")[1];return r in f0?f0[r]:hz(r,r.split(":"))}catch{if(t in f0)return f0[t];const n=t?.match(kTe);return n?hz(t,n.slice(1)):NaN}}const kTe=/([+-]\d\d):?(\d\d)?/;function hz(t,e){const n=+(e[0]||0),r=+(e[1]||0),s=+(e[2]||0)/60;return f0[t]=n*60+r>0?n*60+r+s:n*60-r-s}class Ao extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Gu(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)),MG(this),nj(this)):this.setTime(Date.now())}static tz(e,...n){return n.length?new Ao(...n,e):new Ao(Date.now(),e)}withTimeZone(e){return new Ao(+this,e)}getTimezoneOffset(){const e=-Gu(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),nj(this),+this}[Symbol.for("constructDateFrom")](e){return new Ao(+new Date(e),this.timeZone)}}const fz=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!fz.test(t))return;const e=t.replace(fz,"$1UTC");Ao.prototype[e]&&(t.startsWith("get")?Ao.prototype[t]=function(){return this.internal[e]()}:(Ao.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),OTe(this),+this},Ao.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),nj(this),+this}))});function nj(t){t.internal.setTime(+t),t.internal.setUTCSeconds(t.internal.getUTCSeconds()-Math.round(-Gu(t.timeZone,t)*60))}function OTe(t){Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),MG(t)}function MG(t){const e=Gu(t.timeZone,t),n=e>0?Math.floor(e):Math.ceil(e),r=new Date(+t);r.setUTCHours(r.getUTCHours()-1);const s=-new Date(+t).getTimezoneOffset(),i=-new Date(+r).getTimezoneOffset(),a=s-i,l=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();a&&l&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+a);const c=s-n;c&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+c);const d=new Date(+t);d.setUTCSeconds(0);const h=s>0?d.getSeconds():(d.getSeconds()-60)%60,m=Math.round(-(Gu(t.timeZone,t)*60))%60;(m||h)&&(t.internal.setUTCSeconds(t.internal.getUTCSeconds()+m),Date.prototype.setUTCSeconds.call(t,Date.prototype.getUTCSeconds.call(t)+m+h));const g=Gu(t.timeZone,t),x=g>0?Math.floor(g):Math.ceil(g),w=-new Date(+t).getTimezoneOffset()-x,S=x!==n,k=w-c;if(S&&k){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+k);const j=Gu(t.timeZone,t),N=j>0?Math.floor(j):Math.ceil(j),T=x-N;T&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+T),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+T))}}class Ls extends Ao{static tz(e,...n){return n.length?new Ls(...n,e):new Ls(Date.now(),e)}toISOString(){const[e,n,r]=this.tzComponents(),s=`${e}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+s}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,n,r,s]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${r} ${n} ${s}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[n,r,s]=this.tzComponents();return`${e} GMT${n}${r}${s} (${wTe(this.timeZone,this)})`}toLocaleString(e,n){return Date.prototype.toLocaleString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(e,n){return Date.prototype.toLocaleDateString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(e,n){return Date.prototype.toLocaleTimeString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),n=e>0?"-":"+",r=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),s=String(Math.abs(e)%60).padStart(2,"0");return[n,r,s]}withTimeZone(e){return new Ls(+this,e)}[Symbol.for("constructDateFrom")](e){return new Ls(+new Date(e),this.timeZone)}}const AG=6048e5,jTe=864e5,mz=Symbol.for("constructDateFrom");function is(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&mz in t?t[mz](e):t instanceof Date?new t.constructor(e):new Date(e)}function tr(t,e){return is(e||t,t)}function RG(t,e,n){const r=tr(t,n?.in);return isNaN(e)?is(t,NaN):(e&&r.setDate(r.getDate()+e),r)}function DG(t,e,n){const r=tr(t,n?.in);if(isNaN(e))return is(t,NaN);if(!e)return r;const s=r.getDate(),i=is(t,r.getTime());i.setMonth(r.getMonth()+e+1,0);const a=i.getDate();return s>=a?i:(r.setFullYear(i.getFullYear(),i.getMonth(),s),r)}let NTe={};function xg(){return NTe}function su(t,e){const n=xg(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=tr(t,e?.in),i=s.getDay(),a=(i=i.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function pz(t){const e=tr(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function Od(t,...e){const n=is.bind(null,t||e.find(r=>typeof r=="object"));return e.map(n)}function Sp(t,e){const n=tr(t,e?.in);return n.setHours(0,0,0,0),n}function zG(t,e,n){const[r,s]=Od(n?.in,t,e),i=Sp(r),a=Sp(s),l=+i-pz(i),c=+a-pz(a);return Math.round((l-c)/jTe)}function CTe(t,e){const n=PG(t,e),r=is(t,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),wp(r)}function TTe(t,e,n){return RG(t,e*7,n)}function ETe(t,e,n){return DG(t,e*12,n)}function _Te(t,e){let n,r=e?.in;return t.forEach(s=>{!r&&typeof s=="object"&&(r=is.bind(null,s));const i=tr(s,r);(!n||n{!r&&typeof s=="object"&&(r=is.bind(null,s));const i=tr(s,r);(!n||n>i||isNaN(+i))&&(n=i)}),is(r,n||NaN)}function ATe(t,e,n){const[r,s]=Od(n?.in,t,e);return+Sp(r)==+Sp(s)}function IG(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function RTe(t){return!(!IG(t)&&typeof t!="number"||isNaN(+tr(t)))}function DTe(t,e,n){const[r,s]=Od(n?.in,t,e),i=r.getFullYear()-s.getFullYear(),a=r.getMonth()-s.getMonth();return i*12+a}function PTe(t,e){const n=tr(t,e?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function LG(t,e){const[n,r]=Od(t,e.start,e.end);return{start:n,end:r}}function zTe(t,e){const{start:n,end:r}=LG(e?.in,t);let s=+n>+r;const i=s?+n:+r,a=s?r:n;a.setHours(0,0,0,0),a.setDate(1);let l=1;const c=[];for(;+a<=i;)c.push(is(n,a)),a.setMonth(a.getMonth()+l);return s?c.reverse():c}function ITe(t,e){const n=tr(t,e?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function LTe(t,e){const n=tr(t,e?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function BG(t,e){const n=tr(t,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function BTe(t,e){const{start:n,end:r}=LG(e?.in,t);let s=+n>+r;const i=s?+n:+r,a=s?r:n;a.setHours(0,0,0,0),a.setMonth(0,1);let l=1;const c=[];for(;+a<=i;)c.push(is(n,a)),a.setFullYear(a.getFullYear()+l);return s?c.reverse():c}function FG(t,e){const n=xg(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=tr(t,e?.in),i=s.getDay(),a=(i{let r;const s=qTe[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Vh(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const HTe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},QTe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},VTe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},UTe={date:Vh({formats:HTe,defaultWidth:"full"}),time:Vh({formats:QTe,defaultWidth:"full"}),dateTime:Vh({formats:VTe,defaultWidth:"full"})},WTe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},GTe=(t,e,n,r)=>WTe[t];function ko(t){return(e,n)=>{const r=n?.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=n?.width?String(n.width):a;s=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=n?.width?String(n.width):t.defaultWidth;s=t.values[l]||t.values[a]}const i=t.argumentCallback?t.argumentCallback(e):e;return s[i]}}const XTe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},YTe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},KTe={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"]},ZTe={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"]},JTe={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"}},e9e={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"}},t9e=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},n9e={ordinalNumber:t9e,era:ko({values:XTe,defaultWidth:"wide"}),quarter:ko({values:YTe,defaultWidth:"wide",argumentCallback:t=>t-1}),month:ko({values:KTe,defaultWidth:"wide"}),day:ko({values:ZTe,defaultWidth:"wide"}),dayPeriod:ko({values:JTe,defaultWidth:"wide",formattingValues:e9e,defaultFormattingWidth:"wide"})};function Oo(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(s);if(!i)return null;const a=i[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?s9e(l,m=>m.test(a)):r9e(l,m=>m.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const h=e.slice(a.length);return{value:d,rest:h}}}function r9e(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function s9e(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const s=r[0],i=e.match(t.parsePattern);if(!i)return null;let a=t.valueCallback?t.valueCallback(i[0]):i[0];a=n.valueCallback?n.valueCallback(a):a;const l=e.slice(s.length);return{value:a,rest:l}}}const i9e=/^(\d+)(th|st|nd|rd)?/i,a9e=/\d+/i,o9e={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},l9e={any:[/^b/i,/^(a|c)/i]},c9e={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},u9e={any:[/1/i,/2/i,/3/i,/4/i]},d9e={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},h9e={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]},f9e={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},m9e={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]},p9e={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},g9e={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}},x9e={ordinalNumber:qG({matchPattern:i9e,parsePattern:a9e,valueCallback:t=>parseInt(t,10)}),era:Oo({matchPatterns:o9e,defaultMatchWidth:"wide",parsePatterns:l9e,defaultParseWidth:"any"}),quarter:Oo({matchPatterns:c9e,defaultMatchWidth:"wide",parsePatterns:u9e,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Oo({matchPatterns:d9e,defaultMatchWidth:"wide",parsePatterns:h9e,defaultParseWidth:"any"}),day:Oo({matchPatterns:f9e,defaultMatchWidth:"wide",parsePatterns:m9e,defaultParseWidth:"any"}),dayPeriod:Oo({matchPatterns:p9e,defaultMatchWidth:"any",parsePatterns:g9e,defaultParseWidth:"any"})},i7={code:"en-US",formatDistance:$Te,formatLong:UTe,formatRelative:GTe,localize:n9e,match:x9e,options:{weekStartsOn:0,firstWeekContainsDate:1}};function v9e(t,e){const n=tr(t,e?.in);return zG(n,BG(n))+1}function $G(t,e){const n=tr(t,e?.in),r=+wp(n)-+CTe(n);return Math.round(r/AG)+1}function HG(t,e){const n=tr(t,e?.in),r=n.getFullYear(),s=xg(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=is(e?.in||t,0);a.setFullYear(r+1,0,i),a.setHours(0,0,0,0);const l=su(a,e),c=is(e?.in||t,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const d=su(c,e);return+n>=+l?r+1:+n>=+d?r:r-1}function y9e(t,e){const n=xg(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=HG(t,e),i=is(e?.in||t,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),su(i,e)}function QG(t,e){const n=tr(t,e?.in),r=+su(n,e)-+y9e(n,e);return Math.round(r/AG)+1}function Wn(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const Ec={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return Wn(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):Wn(n+1,2)},d(t,e){return Wn(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return Wn(t.getHours()%12||12,e.length)},H(t,e){return Wn(t.getHours(),e.length)},m(t,e){return Wn(t.getMinutes(),e.length)},s(t,e){return Wn(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return Wn(s,e.length)}},ph={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},gz={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return Ec.y(t,e)},Y:function(t,e,n,r){const s=HG(t,r),i=s>0?s:1-s;if(e==="YY"){const a=i%100;return Wn(a,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):Wn(i,e.length)},R:function(t,e){const n=PG(t);return Wn(n,e.length)},u:function(t,e){const n=t.getFullYear();return Wn(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return Wn(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return Wn(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return Ec.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return Wn(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const s=QG(t,r);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):Wn(s,e.length)},I:function(t,e,n){const r=$G(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):Wn(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Ec.d(t,e)},D:function(t,e,n){const r=v9e(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Wn(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return Wn(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return Wn(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),s=r===0?7:r;switch(e){case"i":return String(s);case"ii":return Wn(s,e.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const s=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let s;switch(r===12?s=ph.noon:r===0?s=ph.midnight:s=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let s;switch(r>=17?s=ph.evening:r>=12?s=ph.afternoon:r>=4?s=ph.morning:s=ph.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Ec.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Ec.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Wn(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):Wn(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Ec.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Ec.s(t,e)},S:function(t,e){return Ec.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return vz(r);case"XXXX":case"XX":return Bu(r);case"XXXXX":case"XXX":default:return Bu(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return vz(r);case"xxxx":case"xx":return Bu(r);case"xxxxx":case"xxx":default:return Bu(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+xz(r,":");case"OOOO":default:return"GMT"+Bu(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+xz(r,":");case"zzzz":default:return"GMT"+Bu(r,":")}},t:function(t,e,n){const r=Math.trunc(+t/1e3);return Wn(r,e.length)},T:function(t,e,n){return Wn(+t,e.length)}};function xz(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=Math.trunc(r/60),i=r%60;return i===0?n+String(s):n+String(s)+e+Wn(i,2)}function vz(t,e){return t%60===0?(t>0?"-":"+")+Wn(Math.abs(t)/60,2):Bu(t,e)}function Bu(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=Wn(Math.trunc(r/60),2),i=Wn(r%60,2);return n+s+e+i}const yz=(t,e)=>{switch(t){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"})}},VG=(t,e)=>{switch(t){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"})}},b9e=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return yz(t,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}}",yz(r,e)).replace("{{time}}",VG(s,e))},w9e={p:VG,P:b9e},S9e=/^D+$/,k9e=/^Y+$/,O9e=["D","DD","YY","YYYY"];function j9e(t){return S9e.test(t)}function N9e(t){return k9e.test(t)}function C9e(t,e,n){const r=T9e(t,e,n);if(console.warn(r),O9e.includes(t))throw new RangeError(r)}function T9e(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const E9e=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_9e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,M9e=/^'([^]*?)'?$/,A9e=/''/g,R9e=/[a-zA-Z]/;function Cv(t,e,n){const r=xg(),s=n?.locale??r.locale??i7,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,l=tr(t,n?.in);if(!RTe(l))throw new RangeError("Invalid time value");let c=e.match(_9e).map(h=>{const m=h[0];if(m==="p"||m==="P"){const g=w9e[m];return g(h,s.formatLong)}return h}).join("").match(E9e).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const m=h[0];if(m==="'")return{isToken:!1,value:D9e(h)};if(gz[m])return{isToken:!0,value:h};if(m.match(R9e))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:h}});s.localize.preprocessor&&(c=s.localize.preprocessor(l,c));const d={firstWeekContainsDate:i,weekStartsOn:a,locale:s};return c.map(h=>{if(!h.isToken)return h.value;const m=h.value;(!n?.useAdditionalWeekYearTokens&&N9e(m)||!n?.useAdditionalDayOfYearTokens&&j9e(m))&&C9e(m,e,String(t));const g=gz[m[0]];return g(l,m,s.localize,d)}).join("")}function D9e(t){const e=t.match(M9e);return e?e[1].replace(A9e,"'"):t}function P9e(t,e){const n=tr(t,e?.in),r=n.getFullYear(),s=n.getMonth(),i=is(n,0);return i.setFullYear(r,s+1,0),i.setHours(0,0,0,0),i.getDate()}function z9e(t,e){return tr(t,e?.in).getMonth()}function I9e(t,e){return tr(t,e?.in).getFullYear()}function L9e(t,e){return+tr(t)>+tr(e)}function B9e(t,e){return+tr(t)<+tr(e)}function F9e(t,e,n){const[r,s]=Od(n?.in,t,e);return+su(r,n)==+su(s,n)}function q9e(t,e,n){const[r,s]=Od(n?.in,t,e);return r.getFullYear()===s.getFullYear()&&r.getMonth()===s.getMonth()}function $9e(t,e,n){const[r,s]=Od(n?.in,t,e);return r.getFullYear()===s.getFullYear()}function H9e(t,e,n){const r=tr(t,n?.in),s=r.getFullYear(),i=r.getDate(),a=is(t,0);a.setFullYear(s,e,15),a.setHours(0,0,0,0);const l=P9e(a);return r.setMonth(e,Math.min(i,l)),r}function Q9e(t,e,n){const r=tr(t,n?.in);return isNaN(+r)?is(t,NaN):(r.setFullYear(e),r)}const bz=5,V9e=4;function U9e(t,e){const n=e.startOfMonth(t),r=n.getDay()>0?n.getDay():7,s=e.addDays(t,-r+1),i=e.addDays(s,bz*7-1);return e.getMonth(t)===e.getMonth(i)?bz:V9e}function UG(t,e){const n=e.startOfMonth(t),r=n.getDay();return r===1?n:r===0?e.addDays(n,-6):e.addDays(n,-1*(r-1))}function W9e(t,e){const n=UG(t,e),r=U9e(t,e);return e.addDays(n,r*7-1)}class Ki{constructor(e,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?Ls.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 Ls(r,s,i,this.options.timeZone):new Date(r,s,i),this.addDays=(r,s)=>this.overrides?.addDays?this.overrides.addDays(r,s):RG(r,s),this.addMonths=(r,s)=>this.overrides?.addMonths?this.overrides.addMonths(r,s):DG(r,s),this.addWeeks=(r,s)=>this.overrides?.addWeeks?this.overrides.addWeeks(r,s):TTe(r,s),this.addYears=(r,s)=>this.overrides?.addYears?this.overrides.addYears(r,s):ETe(r,s),this.differenceInCalendarDays=(r,s)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,s):zG(r,s),this.differenceInCalendarMonths=(r,s)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,s):DTe(r,s),this.eachMonthOfInterval=r=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):zTe(r),this.eachYearOfInterval=r=>{const s=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(r):BTe(r),i=new Set(s.map(l=>this.getYear(l)));if(i.size===s.length)return s;const a=[];return i.forEach(l=>{a.push(new Date(l,0,1))}),a},this.endOfBroadcastWeek=r=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):W9e(r,this),this.endOfISOWeek=r=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(r):FTe(r),this.endOfMonth=r=>this.overrides?.endOfMonth?this.overrides.endOfMonth(r):PTe(r),this.endOfWeek=(r,s)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(r,s):FG(r,this.options),this.endOfYear=r=>this.overrides?.endOfYear?this.overrides.endOfYear(r):LTe(r),this.format=(r,s,i)=>{const a=this.overrides?.format?this.overrides.format(r,s,this.options):Cv(r,s,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(a):a},this.getISOWeek=r=>this.overrides?.getISOWeek?this.overrides.getISOWeek(r):$G(r),this.getMonth=(r,s)=>this.overrides?.getMonth?this.overrides.getMonth(r,this.options):z9e(r,this.options),this.getYear=(r,s)=>this.overrides?.getYear?this.overrides.getYear(r,this.options):I9e(r,this.options),this.getWeek=(r,s)=>this.overrides?.getWeek?this.overrides.getWeek(r,this.options):QG(r,this.options),this.isAfter=(r,s)=>this.overrides?.isAfter?this.overrides.isAfter(r,s):L9e(r,s),this.isBefore=(r,s)=>this.overrides?.isBefore?this.overrides.isBefore(r,s):B9e(r,s),this.isDate=r=>this.overrides?.isDate?this.overrides.isDate(r):IG(r),this.isSameDay=(r,s)=>this.overrides?.isSameDay?this.overrides.isSameDay(r,s):ATe(r,s),this.isSameMonth=(r,s)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(r,s):q9e(r,s),this.isSameYear=(r,s)=>this.overrides?.isSameYear?this.overrides.isSameYear(r,s):$9e(r,s),this.max=r=>this.overrides?.max?this.overrides.max(r):_Te(r),this.min=r=>this.overrides?.min?this.overrides.min(r):MTe(r),this.setMonth=(r,s)=>this.overrides?.setMonth?this.overrides.setMonth(r,s):H9e(r,s),this.setYear=(r,s)=>this.overrides?.setYear?this.overrides.setYear(r,s):Q9e(r,s),this.startOfBroadcastWeek=(r,s)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):UG(r,this),this.startOfDay=r=>this.overrides?.startOfDay?this.overrides.startOfDay(r):Sp(r),this.startOfISOWeek=r=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(r):wp(r),this.startOfMonth=r=>this.overrides?.startOfMonth?this.overrides.startOfMonth(r):ITe(r),this.startOfWeek=(r,s)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(r,this.options):su(r,this.options),this.startOfYear=r=>this.overrides?.startOfYear?this.overrides.startOfYear(r):BG(r),this.options={locale:i7,...e},this.overrides=n}getDigitMap(){const{numerals:e="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:e}),r={};for(let s=0;s<10;s++)r[s.toString()]=n.format(s);return r}replaceDigits(e){const n=this.getDigitMap();return e.replace(/\d/g,r=>n[r]||r)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){const e=this.options.locale?.code;return e&&Ki.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:n,timeZone:r,numerals:s}=this.options,i=n?.code;if(i&&Ki.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:r,numberingSystem:s}).format(e)}catch{}const a=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(e,a)}}Ki.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 Go=new Ki;class WG{constructor(e,n,r=Go){this.date=e,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(e,n)),this.dateLib=r}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class G9e{constructor(e,n){this.date=e,this.weeks=n}}class X9e{constructor(e,n){this.days=n,this.weekNumber=e}}function Y9e(t){return ae.createElement("button",{...t})}function K9e(t){return ae.createElement("span",{...t})}function Z9e(t){const{size:e=24,orientation:n="left",className:r}=t;return ae.createElement("svg",{className:r,width:e,height:e,viewBox:"0 0 24 24"},n==="up"&&ae.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&ae.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&ae.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&ae.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function J9e(t){const{day:e,modifiers:n,...r}=t;return ae.createElement("td",{...r})}function eEe(t){const{day:e,modifiers:n,...r}=t,s=ae.useRef(null);return ae.useEffect(()=>{n.focused&&s.current?.focus()},[n.focused]),ae.createElement("button",{ref:s,...r})}var jt;(function(t){t.Root="root",t.Chevron="chevron",t.Day="day",t.DayButton="day_button",t.CaptionLabel="caption_label",t.Dropdowns="dropdowns",t.Dropdown="dropdown",t.DropdownRoot="dropdown_root",t.Footer="footer",t.MonthGrid="month_grid",t.MonthCaption="month_caption",t.MonthsDropdown="months_dropdown",t.Month="month",t.Months="months",t.Nav="nav",t.NextMonthButton="button_next",t.PreviousMonthButton="button_previous",t.Week="week",t.Weeks="weeks",t.Weekday="weekday",t.Weekdays="weekdays",t.WeekNumber="week_number",t.WeekNumberHeader="week_number_header",t.YearsDropdown="years_dropdown"})(jt||(jt={}));var Mr;(function(t){t.disabled="disabled",t.hidden="hidden",t.outside="outside",t.focused="focused",t.today="today"})(Mr||(Mr={}));var Ua;(function(t){t.range_end="range_end",t.range_middle="range_middle",t.range_start="range_start",t.selected="selected"})(Ua||(Ua={}));var Hi;(function(t){t.weeks_before_enter="weeks_before_enter",t.weeks_before_exit="weeks_before_exit",t.weeks_after_enter="weeks_after_enter",t.weeks_after_exit="weeks_after_exit",t.caption_after_enter="caption_after_enter",t.caption_after_exit="caption_after_exit",t.caption_before_enter="caption_before_enter",t.caption_before_exit="caption_before_exit"})(Hi||(Hi={}));function tEe(t){const{options:e,className:n,components:r,classNames:s,...i}=t,a=[s[jt.Dropdown],n].join(" "),l=e?.find(({value:c})=>c===i.value);return ae.createElement("span",{"data-disabled":i.disabled,className:s[jt.DropdownRoot]},ae.createElement(r.Select,{className:a,...i},e?.map(({value:c,label:d,disabled:h})=>ae.createElement(r.Option,{key:c,value:c,disabled:h},d))),ae.createElement("span",{className:s[jt.CaptionLabel],"aria-hidden":!0},l?.label,ae.createElement(r.Chevron,{orientation:"down",size:18,className:s[jt.Chevron]})))}function nEe(t){return ae.createElement("div",{...t})}function rEe(t){return ae.createElement("div",{...t})}function sEe(t){const{calendarMonth:e,displayIndex:n,...r}=t;return ae.createElement("div",{...r},t.children)}function iEe(t){const{calendarMonth:e,displayIndex:n,...r}=t;return ae.createElement("div",{...r})}function aEe(t){return ae.createElement("table",{...t})}function oEe(t){return ae.createElement("div",{...t})}const GG=b.createContext(void 0);function vg(){const t=b.useContext(GG);if(t===void 0)throw new Error("useDayPicker() must be used within a custom component.");return t}function lEe(t){const{components:e}=vg();return ae.createElement(e.Dropdown,{...t})}function cEe(t){const{onPreviousClick:e,onNextClick:n,previousMonth:r,nextMonth:s,...i}=t,{components:a,classNames:l,labels:{labelPrevious:c,labelNext:d}}=vg(),h=b.useCallback(g=>{s&&n?.(g)},[s,n]),m=b.useCallback(g=>{r&&e?.(g)},[r,e]);return ae.createElement("nav",{...i},ae.createElement(a.PreviousMonthButton,{type:"button",className:l[jt.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:m},ae.createElement(a.Chevron,{disabled:r?void 0:!0,className:l[jt.Chevron],orientation:"left"})),ae.createElement(a.NextMonthButton,{type:"button",className:l[jt.NextMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":d(s),onClick:h},ae.createElement(a.Chevron,{disabled:s?void 0:!0,orientation:"right",className:l[jt.Chevron]})))}function uEe(t){const{components:e}=vg();return ae.createElement(e.Button,{...t})}function dEe(t){return ae.createElement("option",{...t})}function hEe(t){const{components:e}=vg();return ae.createElement(e.Button,{...t})}function fEe(t){const{rootRef:e,...n}=t;return ae.createElement("div",{...n,ref:e})}function mEe(t){return ae.createElement("select",{...t})}function pEe(t){const{week:e,...n}=t;return ae.createElement("tr",{...n})}function gEe(t){return ae.createElement("th",{...t})}function xEe(t){return ae.createElement("thead",{"aria-hidden":!0},ae.createElement("tr",{...t}))}function vEe(t){const{week:e,...n}=t;return ae.createElement("th",{...n})}function yEe(t){return ae.createElement("th",{...t})}function bEe(t){return ae.createElement("tbody",{...t})}function wEe(t){const{components:e}=vg();return ae.createElement(e.Dropdown,{...t})}const SEe=Object.freeze(Object.defineProperty({__proto__:null,Button:Y9e,CaptionLabel:K9e,Chevron:Z9e,Day:J9e,DayButton:eEe,Dropdown:tEe,DropdownNav:nEe,Footer:rEe,Month:sEe,MonthCaption:iEe,MonthGrid:aEe,Months:oEe,MonthsDropdown:lEe,Nav:cEe,NextMonthButton:uEe,Option:dEe,PreviousMonthButton:hEe,Root:fEe,Select:mEe,Week:pEe,WeekNumber:vEe,WeekNumberHeader:yEe,Weekday:gEe,Weekdays:xEe,Weeks:bEe,YearsDropdown:wEe},Symbol.toStringTag,{value:"Module"}));function Rl(t,e,n=!1,r=Go){let{from:s,to:i}=t;const{differenceInCalendarDays:a,isSameDay:l}=r;return s&&i?(a(i,s)<0&&([s,i]=[i,s]),a(e,s)>=(n?1:0)&&a(i,e)>=(n?1:0)):!n&&i?l(i,e):!n&&s?l(s,e):!1}function XG(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function a7(t){return!!(t&&typeof t=="object"&&"from"in t)}function YG(t){return!!(t&&typeof t=="object"&&"after"in t)}function KG(t){return!!(t&&typeof t=="object"&&"before"in t)}function ZG(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function JG(t,e){return Array.isArray(t)&&t.every(e.isDate)}function Dl(t,e,n=Go){const r=Array.isArray(e)?e:[e],{isSameDay:s,differenceInCalendarDays:i,isAfter:a}=n;return r.some(l=>{if(typeof l=="boolean")return l;if(n.isDate(l))return s(t,l);if(JG(l,n))return l.includes(t);if(a7(l))return Rl(l,t,!1,n);if(ZG(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(t.getDay()):l.dayOfWeek===t.getDay();if(XG(l)){const c=i(l.before,t),d=i(l.after,t),h=c>0,m=d<0;return a(l.before,l.after)?m&&h:h||m}return YG(l)?i(t,l.after)>0:KG(l)?i(l.before,t)>0:typeof l=="function"?l(t):!1})}function kEe(t,e,n,r,s){const{disabled:i,hidden:a,modifiers:l,showOutsideDays:c,broadcastCalendar:d,today:h}=e,{isSameDay:m,isSameMonth:g,startOfMonth:x,isBefore:y,endOfMonth:w,isAfter:S}=s,k=n&&x(n),j=r&&w(r),N={[Mr.focused]:[],[Mr.outside]:[],[Mr.disabled]:[],[Mr.hidden]:[],[Mr.today]:[]},T={};for(const E of t){const{date:_,displayMonth:M}=E,I=!!(M&&!g(_,M)),P=!!(k&&y(_,k)),L=!!(j&&S(_,j)),H=!!(i&&Dl(_,i,s)),U=!!(a&&Dl(_,a,s))||P||L||!d&&!c&&I||d&&c===!1&&I,ee=m(_,h??s.today());I&&N.outside.push(E),H&&N.disabled.push(E),U&&N.hidden.push(E),ee&&N.today.push(E),l&&Object.keys(l).forEach(z=>{const Q=l?.[z];Q&&Dl(_,Q,s)&&(T[z]?T[z].push(E):T[z]=[E])})}return E=>{const _={[Mr.focused]:!1,[Mr.disabled]:!1,[Mr.hidden]:!1,[Mr.outside]:!1,[Mr.today]:!1},M={};for(const I in N){const P=N[I];_[I]=P.some(L=>L===E)}for(const I in T)M[I]=T[I].some(P=>P===E);return{..._,...M}}}function OEe(t,e,n={}){return Object.entries(t).filter(([,s])=>s===!0).reduce((s,[i])=>(n[i]?s.push(n[i]):e[Mr[i]]?s.push(e[Mr[i]]):e[Ua[i]]&&s.push(e[Ua[i]]),s),[e[jt.Day]])}function jEe(t){return{...SEe,...t}}function NEe(t){const e={"data-mode":t.mode??void 0,"data-required":"required"in t?t.required:void 0,"data-multiple-months":t.numberOfMonths&&t.numberOfMonths>1||void 0,"data-week-numbers":t.showWeekNumber||void 0,"data-broadcast-calendar":t.broadcastCalendar||void 0,"data-nav-layout":t.navLayout||void 0};return Object.entries(t).forEach(([n,r])=>{n.startsWith("data-")&&(e[n]=r)}),e}function o7(){const t={};for(const e in jt)t[jt[e]]=`rdp-${jt[e]}`;for(const e in Mr)t[Mr[e]]=`rdp-${Mr[e]}`;for(const e in Ua)t[Ua[e]]=`rdp-${Ua[e]}`;for(const e in Hi)t[Hi[e]]=`rdp-${Hi[e]}`;return t}function eX(t,e,n){return(n??new Ki(e)).formatMonthYear(t)}const CEe=eX;function TEe(t,e,n){return(n??new Ki(e)).format(t,"d")}function EEe(t,e=Go){return e.format(t,"LLLL")}function _Ee(t,e,n){return(n??new Ki(e)).format(t,"cccccc")}function MEe(t,e=Go){return t<10?e.formatNumber(`0${t.toLocaleString()}`):e.formatNumber(`${t.toLocaleString()}`)}function AEe(){return""}function tX(t,e=Go){return e.format(t,"yyyy")}const REe=tX,DEe=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:eX,formatDay:TEe,formatMonthCaption:CEe,formatMonthDropdown:EEe,formatWeekNumber:MEe,formatWeekNumberHeader:AEe,formatWeekdayName:_Ee,formatYearCaption:REe,formatYearDropdown:tX},Symbol.toStringTag,{value:"Module"}));function PEe(t){return t?.formatMonthCaption&&!t.formatCaption&&(t.formatCaption=t.formatMonthCaption),t?.formatYearCaption&&!t.formatYearDropdown&&(t.formatYearDropdown=t.formatYearCaption),{...DEe,...t}}function zEe(t,e,n,r,s){const{startOfMonth:i,startOfYear:a,endOfYear:l,eachMonthOfInterval:c,getMonth:d}=s;return c({start:a(t),end:l(t)}).map(g=>{const x=r.formatMonthDropdown(g,s),y=d(g),w=e&&gi(n)||!1;return{value:y,label:x,disabled:w}})}function IEe(t,e={},n={}){let r={...e?.[jt.Day]};return Object.entries(t).filter(([,s])=>s===!0).forEach(([s])=>{r={...r,...n?.[s]}}),r}function LEe(t,e,n){const r=t.today(),s=e?t.startOfISOWeek(r):t.startOfWeek(r),i=[];for(let a=0;a<7;a++){const l=t.addDays(s,a);i.push(l)}return i}function BEe(t,e,n,r,s=!1){if(!t||!e)return;const{startOfYear:i,endOfYear:a,eachYearOfInterval:l,getYear:c}=r,d=i(t),h=a(e),m=l({start:d,end:h});return s&&m.reverse(),m.map(g=>{const x=n.formatYearDropdown(g,r);return{value:c(g),label:x,disabled:!1}})}function nX(t,e,n,r){let s=(r??new Ki(n)).format(t,"PPPP");return e.today&&(s=`Today, ${s}`),e.selected&&(s=`${s}, selected`),s}const FEe=nX;function rX(t,e,n){return(n??new Ki(e)).formatMonthYear(t)}const qEe=rX;function $Ee(t,e,n,r){let s=(r??new Ki(n)).format(t,"PPPP");return e?.today&&(s=`Today, ${s}`),s}function HEe(t){return"Choose the Month"}function QEe(){return""}function VEe(t){return"Go to the Next Month"}function UEe(t){return"Go to the Previous Month"}function WEe(t,e,n){return(n??new Ki(e)).format(t,"cccc")}function GEe(t,e){return`Week ${t}`}function XEe(t){return"Week Number"}function YEe(t){return"Choose the Year"}const KEe=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:qEe,labelDay:FEe,labelDayButton:nX,labelGrid:rX,labelGridcell:$Ee,labelMonthDropdown:HEe,labelNav:QEe,labelNext:VEe,labelPrevious:UEe,labelWeekNumber:GEe,labelWeekNumberHeader:XEe,labelWeekday:WEe,labelYearDropdown:YEe},Symbol.toStringTag,{value:"Module"})),yg=t=>t instanceof HTMLElement?t:null,Q3=t=>[...t.querySelectorAll("[data-animated-month]")??[]],ZEe=t=>yg(t.querySelector("[data-animated-month]")),V3=t=>yg(t.querySelector("[data-animated-caption]")),U3=t=>yg(t.querySelector("[data-animated-weeks]")),JEe=t=>yg(t.querySelector("[data-animated-nav]")),e_e=t=>yg(t.querySelector("[data-animated-weekdays]"));function t_e(t,e,{classNames:n,months:r,focused:s,dateLib:i}){const a=b.useRef(null),l=b.useRef(r),c=b.useRef(!1);b.useLayoutEffect(()=>{const d=l.current;if(l.current=r,!e||!t.current||!(t.current instanceof HTMLElement)||r.length===0||d.length===0||r.length!==d.length)return;const h=i.isSameMonth(r[0].date,d[0].date),m=i.isAfter(r[0].date,d[0].date),g=m?n[Hi.caption_after_enter]:n[Hi.caption_before_enter],x=m?n[Hi.weeks_after_enter]:n[Hi.weeks_before_enter],y=a.current,w=t.current.cloneNode(!0);if(w instanceof HTMLElement?(Q3(w).forEach(N=>{if(!(N instanceof HTMLElement))return;const T=ZEe(N);T&&N.contains(T)&&N.removeChild(T);const E=V3(N);E&&E.classList.remove(g);const _=U3(N);_&&_.classList.remove(x)}),a.current=w):a.current=null,c.current||h||s)return;const S=y instanceof HTMLElement?Q3(y):[],k=Q3(t.current);if(k?.every(j=>j instanceof HTMLElement)&&S&&S.every(j=>j instanceof HTMLElement)){c.current=!0,t.current.style.isolation="isolate";const j=JEe(t.current);j&&(j.style.zIndex="1"),k.forEach((N,T)=>{const E=S[T];if(!E)return;N.style.position="relative",N.style.overflow="hidden";const _=V3(N);_&&_.classList.add(g);const M=U3(N);M&&M.classList.add(x);const I=()=>{c.current=!1,t.current&&(t.current.style.isolation=""),j&&(j.style.zIndex=""),_&&_.classList.remove(g),M&&M.classList.remove(x),N.style.position="",N.style.overflow="",N.contains(E)&&N.removeChild(E)};E.style.pointerEvents="none",E.style.position="absolute",E.style.overflow="hidden",E.setAttribute("aria-hidden","true");const P=e_e(E);P&&(P.style.opacity="0");const L=V3(E);L&&(L.classList.add(m?n[Hi.caption_before_exit]:n[Hi.caption_after_exit]),L.addEventListener("animationend",I));const H=U3(E);H&&H.classList.add(m?n[Hi.weeks_before_exit]:n[Hi.weeks_after_exit]),N.insertBefore(E,N.firstChild)})}})}function n_e(t,e,n,r){const s=t[0],i=t[t.length-1],{ISOWeek:a,fixedWeeks:l,broadcastCalendar:c}=n??{},{addDays:d,differenceInCalendarDays:h,differenceInCalendarMonths:m,endOfBroadcastWeek:g,endOfISOWeek:x,endOfMonth:y,endOfWeek:w,isAfter:S,startOfBroadcastWeek:k,startOfISOWeek:j,startOfWeek:N}=r,T=c?k(s,r):a?j(s):N(s),E=c?g(i):a?x(y(i)):w(y(i)),_=h(E,T),M=m(i,s)+1,I=[];for(let H=0;H<=_;H++){const U=d(T,H);if(e&&S(U,e))break;I.push(U)}const L=(c?35:42)*M;if(l&&I.length{const s=r.weeks.reduce((i,a)=>i.concat(a.days.slice()),e.slice());return n.concat(s.slice())},e.slice())}function s_e(t,e,n,r){const{numberOfMonths:s=1}=n,i=[];for(let a=0;ae)break;i.push(l)}return i}function wz(t,e,n,r){const{month:s,defaultMonth:i,today:a=r.today(),numberOfMonths:l=1}=t;let c=s||i||a;const{differenceInCalendarMonths:d,addMonths:h,startOfMonth:m}=r;if(n&&d(n,c){const k=n.broadcastCalendar?m(S,r):n.ISOWeek?g(S):x(S),j=n.broadcastCalendar?i(S):n.ISOWeek?a(l(S)):c(l(S)),N=e.filter(M=>M>=k&&M<=j),T=n.broadcastCalendar?35:42;if(n.fixedWeeks&&N.length{const P=T-N.length;return I>j&&I<=s(j,P)});N.push(...M)}const E=N.reduce((M,I)=>{const P=n.ISOWeek?d(I):h(I),L=M.find(U=>U.weekNumber===P),H=new WG(I,S,r);return L?L.days.push(H):M.push(new X9e(P,[H])),M},[]),_=new G9e(S,E);return w.push(_),w},[]);return n.reverseMonths?y.reverse():y}function a_e(t,e){let{startMonth:n,endMonth:r}=t;const{startOfYear:s,startOfDay:i,startOfMonth:a,endOfMonth:l,addYears:c,endOfYear:d,newDate:h,today:m}=e,{fromYear:g,toYear:x,fromMonth:y,toMonth:w}=t;!n&&y&&(n=y),!n&&g&&(n=e.newDate(g,0,1)),!r&&w&&(r=w),!r&&x&&(r=h(x,11,31));const S=t.captionLayout==="dropdown"||t.captionLayout==="dropdown-years";return n?n=a(n):g?n=h(g,0,1):!n&&S&&(n=s(c(t.today??m(),-100))),r?r=l(r):x?r=h(x,11,31):!r&&S&&(r=d(t.today??m())),[n&&i(n),r&&i(r)]}function o_e(t,e,n,r){if(n.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i=1}=n,{startOfMonth:a,addMonths:l,differenceInCalendarMonths:c}=r,d=s?i:1,h=a(t);if(!e)return l(h,d);if(!(c(e,t)n.concat(r.weeks.slice()),e.slice())}function Yb(t,e){const[n,r]=b.useState(t);return[e===void 0?n:e,r]}function u_e(t,e){const[n,r]=a_e(t,e),{startOfMonth:s,endOfMonth:i}=e,a=wz(t,n,r,e),[l,c]=Yb(a,t.month?a:void 0);b.useEffect(()=>{const _=wz(t,n,r,e);c(_)},[t.timeZone]);const d=s_e(l,r,t,e),h=n_e(d,t.endMonth?i(t.endMonth):void 0,t,e),m=i_e(d,h,t,e),g=c_e(m),x=r_e(m),y=l_e(l,n,t,e),w=o_e(l,r,t,e),{disableNavigation:S,onMonthChange:k}=t,j=_=>g.some(M=>M.days.some(I=>I.isEqualTo(_))),N=_=>{if(S)return;let M=s(_);n&&Ms(r)&&(M=s(r)),c(M),k?.(M)};return{months:m,weeks:g,days:x,navStart:n,navEnd:r,previousMonth:y,nextMonth:w,goToMonth:N,goToDay:_=>{j(_)||N(_.date)}}}var xo;(function(t){t[t.Today=0]="Today",t[t.Selected=1]="Selected",t[t.LastFocused=2]="LastFocused",t[t.FocusedModifier=3]="FocusedModifier"})(xo||(xo={}));function Sz(t){return!t[Mr.disabled]&&!t[Mr.hidden]&&!t[Mr.outside]}function d_e(t,e,n,r){let s,i=-1;for(const a of t){const l=e(a);Sz(l)&&(l[Mr.focused]&&iSz(e(a)))),s}function h_e(t,e,n,r,s,i,a){const{ISOWeek:l,broadcastCalendar:c}=i,{addDays:d,addMonths:h,addWeeks:m,addYears:g,endOfBroadcastWeek:x,endOfISOWeek:y,endOfWeek:w,max:S,min:k,startOfBroadcastWeek:j,startOfISOWeek:N,startOfWeek:T}=a;let _={day:d,week:m,month:h,year:g,startOfWeek:M=>c?j(M,a):l?N(M):T(M),endOfWeek:M=>c?x(M):l?y(M):w(M)}[t](n,e==="after"?1:-1);return e==="before"&&r?_=S([r,_]):e==="after"&&s&&(_=k([s,_])),_}function sX(t,e,n,r,s,i,a,l=0){if(l>365)return;const c=h_e(t,e,n.date,r,s,i,a),d=!!(i.disabled&&Dl(c,i.disabled,a)),h=!!(i.hidden&&Dl(c,i.hidden,a)),m=c,g=new WG(c,m,a);return!d&&!h?g:sX(t,e,g,r,s,i,a,l+1)}function f_e(t,e,n,r,s){const{autoFocus:i}=t,[a,l]=b.useState(),c=d_e(e.days,n,r||(()=>!1),a),[d,h]=b.useState(i?c:void 0);return{isFocusTarget:w=>!!c?.isEqualTo(w),setFocused:h,focused:d,blur:()=>{l(d),h(void 0)},moveFocus:(w,S)=>{if(!d)return;const k=sX(w,S,d,e.navStart,e.navEnd,t,s);k&&(t.disableNavigation&&!e.days.some(N=>N.isEqualTo(k))||(e.goToDay(k),h(k)))}}}function m_e(t,e){const{selected:n,required:r,onSelect:s}=t,[i,a]=Yb(n,s?n:void 0),l=s?n:i,{isSameDay:c}=e,d=x=>l?.some(y=>c(y,x))??!1,{min:h,max:m}=t;return{selected:l,select:(x,y,w)=>{let S=[...l??[]];if(d(x)){if(l?.length===h||r&&l?.length===1)return;S=l?.filter(k=>!c(k,x))}else l?.length===m?S=[x]:S=[...S,x];return s||a(S),s?.(S,x,y,w),S},isSelected:d}}function p_e(t,e,n=0,r=0,s=!1,i=Go){const{from:a,to:l}=e||{},{isSameDay:c,isAfter:d,isBefore:h}=i;let m;if(!a&&!l)m={from:t,to:n>0?void 0:t};else if(a&&!l)c(a,t)?n===0?m={from:a,to:t}:s?m={from:a,to:void 0}:m=void 0:h(t,a)?m={from:t,to:a}:m={from:a,to:t};else if(a&&l)if(c(a,t)&&c(l,t))s?m={from:a,to:l}:m=void 0;else if(c(a,t))m={from:a,to:n>0?void 0:t};else if(c(l,t))m={from:t,to:n>0?void 0:t};else if(h(t,a))m={from:t,to:l};else if(d(t,a))m={from:a,to:t};else if(d(t,l))m={from:a,to:t};else throw new Error("Invalid range");if(m?.from&&m?.to){const g=i.differenceInCalendarDays(m.to,m.from);r>0&&g>r?m={from:t,to:void 0}:n>1&&gtypeof l!="function").some(l=>typeof l=="boolean"?l:n.isDate(l)?Rl(t,l,!1,n):JG(l,n)?l.some(c=>Rl(t,c,!1,n)):a7(l)?l.from&&l.to?kz(t,{from:l.from,to:l.to},n):!1:ZG(l)?g_e(t,l.dayOfWeek,n):XG(l)?n.isAfter(l.before,l.after)?kz(t,{from:n.addDays(l.after,1),to:n.addDays(l.before,-1)},n):Dl(t.from,l,n)||Dl(t.to,l,n):YG(l)||KG(l)?Dl(t.from,l,n)||Dl(t.to,l,n):!1))return!0;const a=r.filter(l=>typeof l=="function");if(a.length){let l=t.from;const c=n.differenceInCalendarDays(t.to,t.from);for(let d=0;d<=c;d++){if(a.some(h=>h(l)))return!0;l=n.addDays(l,1)}}return!1}function v_e(t,e){const{disabled:n,excludeDisabled:r,selected:s,required:i,onSelect:a}=t,[l,c]=Yb(s,a?s:void 0),d=a?s:l;return{selected:d,select:(g,x,y)=>{const{min:w,max:S}=t,k=g?p_e(g,d,w,S,i,e):void 0;return r&&n&&k?.from&&k.to&&x_e({from:k.from,to:k.to},n,e)&&(k.from=g,k.to=void 0),a||c(k),a?.(k,g,x,y),k},isSelected:g=>d&&Rl(d,g,!1,e)}}function y_e(t,e){const{selected:n,required:r,onSelect:s}=t,[i,a]=Yb(n,s?n:void 0),l=s?n:i,{isSameDay:c}=e;return{selected:l,select:(m,g,x)=>{let y=m;return!r&&l&&l&&c(m,l)&&(y=void 0),s||a(y),s?.(y,m,g,x),y},isSelected:m=>l?c(l,m):!1}}function b_e(t,e){const n=y_e(t,e),r=m_e(t,e),s=v_e(t,e);switch(t.mode){case"single":return n;case"multiple":return r;case"range":return s;default:return}}function w_e(t){let e=t;e.timeZone&&(e={...t},e.today&&(e.today=new Ls(e.today,e.timeZone)),e.month&&(e.month=new Ls(e.month,e.timeZone)),e.defaultMonth&&(e.defaultMonth=new Ls(e.defaultMonth,e.timeZone)),e.startMonth&&(e.startMonth=new Ls(e.startMonth,e.timeZone)),e.endMonth&&(e.endMonth=new Ls(e.endMonth,e.timeZone)),e.mode==="single"&&e.selected?e.selected=new Ls(e.selected,e.timeZone):e.mode==="multiple"&&e.selected?e.selected=e.selected?.map(Pe=>new Ls(Pe,e.timeZone)):e.mode==="range"&&e.selected&&(e.selected={from:e.selected.from?new Ls(e.selected.from,e.timeZone):void 0,to:e.selected.to?new Ls(e.selected.to,e.timeZone):void 0}));const{components:n,formatters:r,labels:s,dateLib:i,locale:a,classNames:l}=b.useMemo(()=>{const Pe={...i7,...e.locale};return{dateLib:new Ki({locale:Pe,weekStartsOn:e.broadcastCalendar?1:e.weekStartsOn,firstWeekContainsDate:e.firstWeekContainsDate,useAdditionalWeekYearTokens:e.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:e.useAdditionalDayOfYearTokens,timeZone:e.timeZone,numerals:e.numerals},e.dateLib),components:jEe(e.components),formatters:PEe(e.formatters),labels:{...KEe,...e.labels},locale:Pe,classNames:{...o7(),...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:c,mode:d,navLayout:h,numberOfMonths:m=1,onDayBlur:g,onDayClick:x,onDayFocus:y,onDayKeyDown:w,onDayMouseEnter:S,onDayMouseLeave:k,onNextClick:j,onPrevClick:N,showWeekNumber:T,styles:E}=e,{formatCaption:_,formatDay:M,formatMonthDropdown:I,formatWeekNumber:P,formatWeekNumberHeader:L,formatWeekdayName:H,formatYearDropdown:U}=r,ee=u_e(e,i),{days:z,months:Q,navStart:B,navEnd:X,previousMonth:J,nextMonth:G,goToMonth:R}=ee,ie=kEe(z,e,B,X,i),{isSelected:W,select:q,selected:V}=b_e(e,i)??{},{blur:te,focused:ne,isFocusTarget:K,moveFocus:se,setFocused:re}=f_e(e,ee,ie,W??(()=>!1),i),{labelDayButton:oe,labelGridcell:Te,labelGrid:We,labelMonthDropdown:Ye,labelNav:Je,labelPrevious:Oe,labelNext:Ve,labelWeekday:Ue,labelWeekNumber:He,labelWeekNumberHeader:Ot,labelYearDropdown:xt}=s,kn=b.useMemo(()=>LEe(i,e.ISOWeek),[i,e.ISOWeek]),It=d!==void 0||x!==void 0,Yt=b.useCallback(()=>{J&&(R(J),N?.(J))},[J,R,N]),_t=b.useCallback(()=>{G&&(R(G),j?.(G))},[R,G,j]),mt=b.useCallback((Pe,it)=>ot=>{ot.preventDefault(),ot.stopPropagation(),re(Pe),q?.(Pe.date,it,ot),x?.(Pe.date,it,ot)},[q,x,re]),Ne=b.useCallback((Pe,it)=>ot=>{re(Pe),y?.(Pe.date,it,ot)},[y,re]),Ie=b.useCallback((Pe,it)=>ot=>{te(),g?.(Pe.date,it,ot)},[te,g]),st=b.useCallback((Pe,it)=>ot=>{const nn={ArrowLeft:[ot.shiftKey?"month":"day",e.dir==="rtl"?"after":"before"],ArrowRight:[ot.shiftKey?"month":"day",e.dir==="rtl"?"before":"after"],ArrowDown:[ot.shiftKey?"year":"week","after"],ArrowUp:[ot.shiftKey?"year":"week","before"],PageUp:[ot.shiftKey?"year":"month","before"],PageDown:[ot.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(nn[ot.key]){ot.preventDefault(),ot.stopPropagation();const[Kt,pt]=nn[ot.key];se(Kt,pt)}w?.(Pe.date,it,ot)},[se,w,e.dir]),yt=b.useCallback((Pe,it)=>ot=>{S?.(Pe.date,it,ot)},[S]),Pt=b.useCallback((Pe,it)=>ot=>{k?.(Pe.date,it,ot)},[k]),At=b.useCallback(Pe=>it=>{const ot=Number(it.target.value),nn=i.setMonth(i.startOfMonth(Pe),ot);R(nn)},[i,R]),zn=b.useCallback(Pe=>it=>{const ot=Number(it.target.value),nn=i.setYear(i.startOfMonth(Pe),ot);R(nn)},[i,R]),{className:Fe,style:rt}=b.useMemo(()=>({className:[l[jt.Root],e.className].filter(Boolean).join(" "),style:{...E?.[jt.Root],...e.style}}),[l,e.className,e.style,E]),tn=NEe(e),Rt=b.useRef(null);t_e(Rt,!!e.animate,{classNames:l,months:Q,focused:ne,dateLib:i});const ke={dayPickerProps:e,selected:V,select:q,isSelected:W,months:Q,nextMonth:G,previousMonth:J,goToMonth:R,getModifiers:ie,components:n,classNames:l,styles:E,labels:s,formatters:r};return ae.createElement(GG.Provider,{value:ke},ae.createElement(n.Root,{rootRef:e.animate?Rt:void 0,className:Fe,style:rt,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"],...tn},ae.createElement(n.Months,{className:l[jt.Months],style:E?.[jt.Months]},!e.hideNavigation&&!h&&ae.createElement(n.Nav,{"data-animated-nav":e.animate?"true":void 0,className:l[jt.Nav],style:E?.[jt.Nav],"aria-label":Je(),onPreviousClick:Yt,onNextClick:_t,previousMonth:J,nextMonth:G}),Q.map((Pe,it)=>ae.createElement(n.Month,{"data-animated-month":e.animate?"true":void 0,className:l[jt.Month],style:E?.[jt.Month],key:it,displayIndex:it,calendarMonth:Pe},h==="around"&&!e.hideNavigation&&it===0&&ae.createElement(n.PreviousMonthButton,{type:"button",className:l[jt.PreviousMonthButton],tabIndex:J?void 0:-1,"aria-disabled":J?void 0:!0,"aria-label":Oe(J),onClick:Yt,"data-animated-button":e.animate?"true":void 0},ae.createElement(n.Chevron,{disabled:J?void 0:!0,className:l[jt.Chevron],orientation:e.dir==="rtl"?"right":"left"})),ae.createElement(n.MonthCaption,{"data-animated-caption":e.animate?"true":void 0,className:l[jt.MonthCaption],style:E?.[jt.MonthCaption],calendarMonth:Pe,displayIndex:it},c?.startsWith("dropdown")?ae.createElement(n.DropdownNav,{className:l[jt.Dropdowns],style:E?.[jt.Dropdowns]},(()=>{const ot=c==="dropdown"||c==="dropdown-months"?ae.createElement(n.MonthsDropdown,{key:"month",className:l[jt.MonthsDropdown],"aria-label":Ye(),classNames:l,components:n,disabled:!!e.disableNavigation,onChange:At(Pe.date),options:zEe(Pe.date,B,X,r,i),style:E?.[jt.Dropdown],value:i.getMonth(Pe.date)}):ae.createElement("span",{key:"month"},I(Pe.date,i)),nn=c==="dropdown"||c==="dropdown-years"?ae.createElement(n.YearsDropdown,{key:"year",className:l[jt.YearsDropdown],"aria-label":xt(i.options),classNames:l,components:n,disabled:!!e.disableNavigation,onChange:zn(Pe.date),options:BEe(B,X,r,i,!!e.reverseYears),style:E?.[jt.Dropdown],value:i.getYear(Pe.date)}):ae.createElement("span",{key:"year"},U(Pe.date,i));return i.getMonthYearOrder()==="year-first"?[nn,ot]:[ot,nn]})(),ae.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"}},_(Pe.date,i.options,i))):ae.createElement(n.CaptionLabel,{className:l[jt.CaptionLabel],role:"status","aria-live":"polite"},_(Pe.date,i.options,i))),h==="around"&&!e.hideNavigation&&it===m-1&&ae.createElement(n.NextMonthButton,{type:"button",className:l[jt.NextMonthButton],tabIndex:G?void 0:-1,"aria-disabled":G?void 0:!0,"aria-label":Ve(G),onClick:_t,"data-animated-button":e.animate?"true":void 0},ae.createElement(n.Chevron,{disabled:G?void 0:!0,className:l[jt.Chevron],orientation:e.dir==="rtl"?"left":"right"})),it===m-1&&h==="after"&&!e.hideNavigation&&ae.createElement(n.Nav,{"data-animated-nav":e.animate?"true":void 0,className:l[jt.Nav],style:E?.[jt.Nav],"aria-label":Je(),onPreviousClick:Yt,onNextClick:_t,previousMonth:J,nextMonth:G}),ae.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":d==="multiple"||d==="range","aria-label":We(Pe.date,i.options,i)||void 0,className:l[jt.MonthGrid],style:E?.[jt.MonthGrid]},!e.hideWeekdays&&ae.createElement(n.Weekdays,{"data-animated-weekdays":e.animate?"true":void 0,className:l[jt.Weekdays],style:E?.[jt.Weekdays]},T&&ae.createElement(n.WeekNumberHeader,{"aria-label":Ot(i.options),className:l[jt.WeekNumberHeader],style:E?.[jt.WeekNumberHeader],scope:"col"},L()),kn.map(ot=>ae.createElement(n.Weekday,{"aria-label":Ue(ot,i.options,i),className:l[jt.Weekday],key:String(ot),style:E?.[jt.Weekday],scope:"col"},H(ot,i.options,i)))),ae.createElement(n.Weeks,{"data-animated-weeks":e.animate?"true":void 0,className:l[jt.Weeks],style:E?.[jt.Weeks]},Pe.weeks.map(ot=>ae.createElement(n.Week,{className:l[jt.Week],key:ot.weekNumber,style:E?.[jt.Week],week:ot},T&&ae.createElement(n.WeekNumber,{week:ot,style:E?.[jt.WeekNumber],"aria-label":He(ot.weekNumber,{locale:a}),className:l[jt.WeekNumber],scope:"row",role:"rowheader"},P(ot.weekNumber,i)),ot.days.map(nn=>{const{date:Kt}=nn,pt=ie(nn);if(pt[Mr.focused]=!pt.hidden&&!!ne?.isEqualTo(nn),pt[Ua.selected]=W?.(Kt)||pt.selected,a7(V)){const{from:vr,to:In}=V;pt[Ua.range_start]=!!(vr&&In&&i.isSameDay(Kt,vr)),pt[Ua.range_end]=!!(vr&&In&&i.isSameDay(Kt,In)),pt[Ua.range_middle]=Rl(V,Kt,!0,i)}const xr=IEe(pt,E,e.modifiersStyles),Ur=OEe(pt,l,e.modifiersClassNames),Wr=!It&&!pt.hidden?Te(Kt,pt,i.options,i):void 0;return ae.createElement(n.Day,{key:`${i.format(Kt,"yyyy-MM-dd")}_${i.format(nn.displayMonth,"yyyy-MM")}`,day:nn,modifiers:pt,className:Ur.join(" "),style:xr,role:"gridcell","aria-selected":pt.selected||void 0,"aria-label":Wr,"data-day":i.format(Kt,"yyyy-MM-dd"),"data-month":nn.outside?i.format(Kt,"yyyy-MM"):void 0,"data-selected":pt.selected||void 0,"data-disabled":pt.disabled||void 0,"data-hidden":pt.hidden||void 0,"data-outside":nn.outside||void 0,"data-focused":pt.focused||void 0,"data-today":pt.today||void 0},!pt.hidden&&It?ae.createElement(n.DayButton,{className:l[jt.DayButton],style:E?.[jt.DayButton],type:"button",day:nn,modifiers:pt,disabled:pt.disabled||void 0,tabIndex:K(nn)?0:-1,"aria-label":oe(Kt,pt,i.options,i),onClick:mt(nn,pt),onBlur:Ie(nn,pt),onFocus:Ne(nn,pt),onKeyDown:st(nn,pt),onMouseEnter:yt(nn,pt),onMouseLeave:Pt(nn,pt)},M(Kt,i.options,i)):!pt.hidden&&M(nn.date,i.options,i))})))))))),e.footer&&ae.createElement(n.Footer,{className:l[jt.Footer],style:E?.[jt.Footer],role:"status","aria-live":"polite"},e.footer)))}function Oz({className:t,classNames:e,showOutsideDays:n=!0,captionLayout:r="label",buttonVariant:s="ghost",formatters:i,components:a,...l}){const c=o7();return o.jsx(w_e,{showOutsideDays:n,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`,t),captionLayout:r,formatters:{formatMonthDropdown:d=>d.toLocaleString("default",{month:"short"}),...i},classNames:{root:ve("w-fit",c.root),months:ve("relative flex flex-col gap-4 md:flex-row",c.months),month:ve("flex w-full flex-col gap-4",c.month),nav:ve("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",c.nav),button_previous:ve(D0({variant:s}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_previous),button_next:ve(D0({variant:s}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_next),month_caption:ve("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",c.month_caption),dropdowns:ve("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",c.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",c.dropdown_root),dropdown:ve("bg-popover absolute inset-0 opacity-0",c.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",c.caption_label),table:"w-full border-collapse",weekdays:ve("flex",c.weekdays),weekday:ve("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",c.weekday),week:ve("mt-2 flex w-full",c.week),week_number_header:ve("w-[--cell-size] select-none",c.week_number_header),week_number:ve("text-muted-foreground select-none text-[0.8rem]",c.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",c.day),range_start:ve("bg-accent rounded-l-md",c.range_start),range_middle:ve("rounded-none",c.range_middle),range_end:ve("bg-accent rounded-r-md",c.range_end),today:ve("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",c.today),outside:ve("text-muted-foreground aria-selected:text-muted-foreground",c.outside),disabled:ve("text-muted-foreground opacity-50",c.disabled),hidden:ve("invisible",c.hidden),...e},components:{Root:({className:d,rootRef:h,...m})=>o.jsx("div",{"data-slot":"calendar",ref:h,className:ve(d),...m}),Chevron:({className:d,orientation:h,...m})=>h==="left"?o.jsx(vd,{className:ve("size-4",d),...m}):h==="right"?o.jsx(yd,{className:ve("size-4",d),...m}):o.jsx(nd,{className:ve("size-4",d),...m}),DayButton:S_e,WeekNumber:({children:d,...h})=>o.jsx("td",{...h,children:o.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:d})}),...a},...l})}function S_e({className:t,day:e,modifiers:n,...r}){const s=o7(),i=b.useRef(null);return b.useEffect(()=>{n.focused&&i.current?.focus()},[n.focused]),o.jsx(he,{ref:i,variant:"ghost",size:"icon","data-day":e.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.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,t),...r})}class k_e{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:",n=window.location.host;return`${e}//${n}/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=n=>{try{if(n.data==="pong")return;const r=JSON.parse(n.data);this.notifyLog(r)}catch(r){console.error("解析日志消息失败:",r)}},this.ws.onerror=n=>{console.error("❌ WebSocket 错误:",n),this.isConnected=!1,this.notifyConnection(!1)},this.ws.onclose=()=>{this.isConnected=!1,this.notifyConnection(!1),this.stopHeartbeat(),this.attemptReconnect()}}catch(n){console.error("创建 WebSocket 连接失败:",n),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(n=>{try{n(e)}catch(r){console.error("连接状态回调执行失败:",r)}})}getAllLogs(){return[...this.logCache]}clearLogs(){this.logCache=[]}getConnectionStatus(){return this.isConnected}}const Oh=new k_e;typeof window<"u"&&Oh.connect();const O_e={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}} 年"}},j_e=(t,e,n)=>{let r;const s=O_e[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",String(e)),n?.addSuffix?n.comparison&&n.comparison>0?r+"内":r+"前":r},N_e={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},C_e={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},T_e={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},E_e={date:Vh({formats:N_e,defaultWidth:"full"}),time:Vh({formats:C_e,defaultWidth:"full"}),dateTime:Vh({formats:T_e,defaultWidth:"full"})};function jz(t,e,n){const r="eeee p";return F9e(t,e,n)?r:t.getTime()>e.getTime()?"'下个'"+r:"'上个'"+r}const __e={lastWeek:jz,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:jz,other:"PP p"},M_e=(t,e,n,r)=>{const s=__e[t];return typeof s=="function"?s(e,n,r):s},A_e={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},R_e={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},D_e={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},P_e={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},z_e={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:"夜间"}},I_e={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:"夜间"}},L_e=(t,e)=>{const n=Number(t);switch(e?.unit){case"date":return n.toString()+"日";case"hour":return n.toString()+"时";case"minute":return n.toString()+"分";case"second":return n.toString()+"秒";default:return"第 "+n.toString()}},B_e={ordinalNumber:L_e,era:ko({values:A_e,defaultWidth:"wide"}),quarter:ko({values:R_e,defaultWidth:"wide",argumentCallback:t=>t-1}),month:ko({values:D_e,defaultWidth:"wide"}),day:ko({values:P_e,defaultWidth:"wide"}),dayPeriod:ko({values:z_e,defaultWidth:"wide",formattingValues:I_e,defaultFormattingWidth:"wide"})},F_e=/^(第\s*)?\d+(日|时|分|秒)?/i,q_e=/\d+/i,$_e={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},H_e={any:[/^(前)/i,/^(公元)/i]},Q_e={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},V_e={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},U_e={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},W_e={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]},G_e={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},X_e={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},Y_e={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},K_e={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},Z_e={ordinalNumber:qG({matchPattern:F_e,parsePattern:q_e,valueCallback:t=>parseInt(t,10)}),era:Oo({matchPatterns:$_e,defaultMatchWidth:"wide",parsePatterns:H_e,defaultParseWidth:"any"}),quarter:Oo({matchPatterns:Q_e,defaultMatchWidth:"wide",parsePatterns:V_e,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Oo({matchPatterns:U_e,defaultMatchWidth:"wide",parsePatterns:W_e,defaultParseWidth:"any"}),day:Oo({matchPatterns:G_e,defaultMatchWidth:"wide",parsePatterns:X_e,defaultParseWidth:"any"}),dayPeriod:Oo({matchPatterns:Y_e,defaultMatchWidth:"any",parsePatterns:K_e,defaultParseWidth:"any"})},Q1={code:"zh-CN",formatDistance:j_e,formatLong:E_e,formatRelative:M_e,localize:B_e,match:Z_e,options:{weekStartsOn:1,firstWeekContainsDate:4}},V1={xs:{label:"小",rowHeight:28,class:"text-[10px] sm:text-xs"},sm:{label:"中",rowHeight:36,class:"text-xs sm:text-sm"},base:{label:"大",rowHeight:44,class:"text-sm sm:text-base"}};function J_e(){const[t,e]=b.useState([]),[n,r]=b.useState(""),[s,i]=b.useState("all"),[a,l]=b.useState("all"),[c,d]=b.useState(void 0),[h,m]=b.useState(void 0),[g,x]=b.useState(!0),[y,w]=b.useState(!1),[S,k]=b.useState("xs"),[j,N]=b.useState(4),T=b.useRef(null);b.useEffect(()=>{const B=Oh.getAllLogs();e(B);const X=Oh.onLog(()=>{e(Oh.getAllLogs())}),J=Oh.onConnectionChange(G=>{w(G)});return()=>{X(),J()}},[]);const E=b.useMemo(()=>{const B=new Set(t.map(X=>X.module));return Array.from(B).sort()},[t]),_=B=>{switch(B){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=B=>{switch(B){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"}},I=()=>{window.location.reload()},P=()=>{Oh.clearLogs(),e([])},L=()=>{const B=ee.map(R=>`${R.timestamp} [${R.level.padEnd(8)}] [${R.module}] ${R.message}`).join(` -`),X=new Blob([B],{type:"text/plain;charset=utf-8"}),J=URL.createObjectURL(X),G=document.createElement("a");G.href=J,G.download=`logs-${Cv(new Date,"yyyy-MM-dd-HHmmss")}.txt`,G.click(),URL.revokeObjectURL(J)},H=()=>{x(!g)},U=()=>{d(void 0),m(void 0)},ee=b.useMemo(()=>t.filter(B=>{const X=n===""||B.message.toLowerCase().includes(n.toLowerCase())||B.module.toLowerCase().includes(n.toLowerCase()),J=s==="all"||B.level===s,G=a==="all"||B.module===a;let R=!0;if(c||h){const ie=new Date(B.timestamp);if(c){const W=new Date(c);W.setHours(0,0,0,0),R=R&&ie>=W}if(h){const W=new Date(h);W.setHours(23,59,59,999),R=R&&ie<=W}}return X&&J&&G&&R}),[t,n,s,a,c,h]),z=V1[S].rowHeight+j,Q=bTe({count:ee.length,getScrollElement:()=>T.current,estimateSize:()=>z,overscan:15});return b.useEffect(()=>{g&&ee.length>0&&Q.scrollToIndex(ee.length-1,{align:"end",behavior:"auto"})},[ee.length,g,Q]),o.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[o.jsxs("div",{className:"flex-shrink-0 space-y-4 p-3 sm:p-4 lg:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-xl sm:text-2xl lg:text-3xl font-bold",children:"日志查看器"}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:"实时查看和分析麦麦运行日志"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:ve("h-2.5 w-2.5 sm:h-3 sm:w-3 rounded-full",y?"bg-green-500 animate-pulse":"bg-red-500")}),o.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground",children:y?"已连接":"未连接"})]})]}),o.jsx(qt,{className:"p-3 sm:p-4",children:o.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[o.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:gap-4",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(Ni,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(ze,{placeholder:"搜索日志...",value:n,onChange:B=>r(B.target.value),className:"pl-9 h-9 text-sm"})]}),o.jsxs(Vt,{value:s,onValueChange:i,children:[o.jsxs($t,{className:"w-full sm:w-[140px] lg:w-[180px] h-9 text-sm",children:[o.jsx(Z3,{className:"h-4 w-4 mr-2"}),o.jsx(Ut,{placeholder:"级别"})]}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部级别"}),o.jsx(De,{value:"DEBUG",children:"DEBUG"}),o.jsx(De,{value:"INFO",children:"INFO"}),o.jsx(De,{value:"WARNING",children:"WARNING"}),o.jsx(De,{value:"ERROR",children:"ERROR"}),o.jsx(De,{value:"CRITICAL",children:"CRITICAL"})]})]}),o.jsxs(Vt,{value:a,onValueChange:l,children:[o.jsxs($t,{className:"w-full sm:w-[160px] lg:w-[200px] h-9 text-sm",children:[o.jsx(Z3,{className:"h-4 w-4 mr-2"}),o.jsx(Ut,{placeholder:"模块"})]}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部模块"}),E.map(B=>o.jsx(De,{value:B,children:B},B))]})]})]}),o.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-4",children:[o.jsxs(Po,{children:[o.jsx(zo,{asChild:!0,children:o.jsxs(he,{variant:"outline",size:"sm",className:ve("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!c&&"text-muted-foreground"),children:[o.jsx(p9,{className:"mr-2 h-4 w-4"}),o.jsx("span",{className:"text-xs sm:text-sm",children:c?Cv(c,"PPP",{locale:Q1}):"开始日期"})]})}),o.jsx(Xa,{className:"w-auto p-0",align:"start",children:o.jsx(Oz,{mode:"single",selected:c,onSelect:d,initialFocus:!0,locale:Q1})})]}),o.jsxs(Po,{children:[o.jsx(zo,{asChild:!0,children:o.jsxs(he,{variant:"outline",size:"sm",className:ve("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!h&&"text-muted-foreground"),children:[o.jsx(p9,{className:"mr-2 h-4 w-4"}),o.jsx("span",{className:"text-xs sm:text-sm",children:h?Cv(h,"PPP",{locale:Q1}):"结束日期"})]})}),o.jsx(Xa,{className:"w-auto p-0",align:"start",children:o.jsx(Oz,{mode:"single",selected:h,onSelect:m,initialFocus:!0,locale:Q1})})]}),(c||h)&&o.jsxs(he,{variant:"outline",size:"sm",onClick:U,className:"w-full sm:w-auto h-9",children:[o.jsx(Tp,{className:"h-4 w-4 sm:mr-2"}),o.jsx("span",{className:"hidden sm:inline text-sm",children:"清除时间筛选"}),o.jsx("span",{className:"sm:hidden text-sm",children:"清除"})]})]}),o.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center",children:[o.jsxs("div",{className:"flex gap-2 flex-wrap",children:[o.jsxs(he,{variant:g?"default":"outline",size:"sm",onClick:H,className:"flex-1 sm:flex-none h-9",children:[g?o.jsx(Fee,{className:"h-4 w-4"}):o.jsx(qee,{className:"h-4 w-4"}),o.jsx("span",{className:"ml-2 text-sm",children:g?"自动滚动":"已暂停"})]}),o.jsxs(he,{variant:"outline",size:"sm",onClick:I,className:"flex-1 sm:flex-none h-9",children:[o.jsx(Qs,{className:"h-4 w-4"}),o.jsx("span",{className:"ml-2 text-sm",children:"刷新"})]}),o.jsxs(he,{variant:"outline",size:"sm",onClick:P,className:"flex-1 sm:flex-none h-9",children:[o.jsx(Sn,{className:"h-4 w-4"}),o.jsx("span",{className:"ml-2 text-sm",children:"清空"})]}),o.jsxs(he,{variant:"outline",size:"sm",onClick:L,className:"flex-1 sm:flex-none h-9",children:[o.jsx(Ku,{className:"h-4 w-4"}),o.jsx("span",{className:"ml-2 text-sm",children:"导出"})]})]}),o.jsx("div",{className:"flex-1 hidden sm:block"}),o.jsxs("div",{className:"text-xs sm:text-sm text-muted-foreground flex items-center justify-center sm:justify-end",children:[o.jsxs("span",{className:"font-mono",children:[ee.length," / ",t.length]}),o.jsx("span",{className:"ml-1",children:"条日志"})]})]}),o.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-6 pt-2 border-t border-border/50",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o.jsx($ee,{className:"h-4 w-4"}),o.jsx("span",{children:"字号"})]}),o.jsx("div",{className:"flex gap-1",children:Object.keys(V1).map(B=>o.jsx(he,{variant:S===B?"default":"outline",size:"sm",onClick:()=>k(B),className:"h-7 px-3 text-xs",children:V1[B].label},B))})]}),o.jsxs("div",{className:"flex items-center gap-3 flex-1 max-w-xs",children:[o.jsx("span",{className:"text-sm text-muted-foreground whitespace-nowrap",children:"行距"}),o.jsx(Ip,{value:[j],onValueChange:([B])=>N(B),min:0,max:12,step:2,className:"flex-1"}),o.jsxs("span",{className:"text-xs text-muted-foreground w-8",children:[j,"px"]})]})]})]})})]}),o.jsx("div",{className:"flex-1 min-h-0 px-3 sm:px-4 lg:px-6 pb-3 sm:pb-4 lg:pb-6",children:o.jsx(qt,{className:"bg-black dark:bg-gray-950 border-gray-800 dark:border-gray-900 h-full",children:o.jsx(wn,{viewportRef:T,className:"h-full",children:o.jsx("div",{className:ve("p-2 sm:p-3 font-mono relative",V1[S].class),style:{height:`${Q.getTotalSize()}px`},children:ee.length===0?o.jsx("div",{className:"text-gray-500 dark:text-gray-600 text-center py-8 text-sm",children:"暂无日志数据"}):Q.getVirtualItems().map(B=>{const X=ee[B.index];return o.jsxs("div",{"data-index":B.index,ref:Q.measureElement,className:ve("absolute top-0 left-0 w-full px-2 sm:px-3 rounded hover:bg-white/5 transition-colors group",M(X.level)),style:{transform:`translateY(${B.start}px)`,paddingTop:`${j/2}px`,paddingBottom:`${j/2}px`},children:[o.jsxs("div",{className:"flex flex-col gap-0.5 sm:hidden",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-gray-500 dark:text-gray-600",children:X.timestamp}),o.jsxs("span",{className:ve("font-semibold",_(X.level)),children:["[",X.level,"]"]})]}),o.jsx("div",{className:"text-cyan-400 dark:text-cyan-500 truncate",children:X.module}),o.jsx("div",{className:"text-gray-300 dark:text-gray-400 whitespace-pre-wrap break-words",children:X.message})]}),o.jsxs("div",{className:"hidden sm:flex gap-2 items-start",children:[o.jsx("span",{className:"text-gray-500 dark:text-gray-600 flex-shrink-0 w-[130px] lg:w-[160px]",children:X.timestamp}),o.jsxs("span",{className:ve("flex-shrink-0 w-[65px] lg:w-[75px] font-semibold",_(X.level)),children:["[",X.level,"]"]}),o.jsx("span",{className:"text-cyan-400 dark:text-cyan-500 flex-shrink-0 w-[100px] lg:w-[130px] truncate",children:X.module}),o.jsx("span",{className:"text-gray-300 dark:text-gray-400 flex-1 whitespace-pre-wrap break-words",children:X.message})]})]},B.key)})})})})})]})}const eMe="Mai-with-u",tMe="plugin-repo",nMe="main",rMe="plugin_details.json";async function sMe(){try{const t=await St("/api/webui/plugins/fetch-raw",{method:"POST",headers:Dt(),body:JSON.stringify({owner:eMe,repo:tMe,branch:nMe,file_path:rMe})});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const e=await t.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(t){throw console.error("Failed to fetch plugin list:",t),t}}async function iMe(){try{const t=await St("/api/webui/plugins/git-status");if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.json()}catch(t){return console.error("Failed to check Git status:",t),{installed:!1,error:"无法检测 Git 安装状态"}}}async function aMe(){try{const t=await St("/api/webui/plugins/version");if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.json()}catch(t){return console.error("Failed to get Maimai version:",t),{version:"0.0.0",version_major:0,version_minor:0,version_patch:0}}}function oMe(t,e,n){const r=t.split(".").map(l=>parseInt(l)||0),s=r[0]||0,i=r[1]||0,a=r[2]||0;if(n.version_majorparseInt(m)||0),c=l[0]||0,d=l[1]||0,h=l[2]||0;if(n.version_major>c||n.version_major===c&&n.version_minor>d||n.version_major===c&&n.version_minor===d&&n.version_patch>h)return!1}return!0}function lMe(t,e){const n=window.location.protocol==="https:"?"wss:":"ws:",r=window.location.host,s=new WebSocket(`${n}//${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 a=JSON.parse(i.data);t(a)}catch(a){console.error("Failed to parse progress data:",a)}},s.onerror=i=>{console.error("Plugin progress WebSocket error:",i),e?.(i)},s.onclose=()=>{console.log("Plugin progress WebSocket disconnected")},s}async function U1(){try{const t=await St("/api/webui/plugins/installed",{headers:Dt()});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const e=await t.json();if(!e.success)throw new Error(e.message||"获取已安装插件列表失败");return e.plugins||[]}catch(t){return console.error("Failed to get installed plugins:",t),[]}}function W1(t,e){return e.some(n=>n.id===t)}function G1(t,e){const n=e.find(r=>r.id===t);if(n)return n.manifest?.version||n.version}async function cMe(t,e,n="main"){const r=await St("/api/webui/plugins/install",{method:"POST",headers:Dt(),body:JSON.stringify({plugin_id:t,repository_url:e,branch:n})});if(!r.ok){const s=await r.json();throw new Error(s.detail||"安装失败")}return await r.json()}async function uMe(t){const e=await St("/api/webui/plugins/uninstall",{method:"POST",headers:Dt(),body:JSON.stringify({plugin_id:t})});if(!e.ok){const n=await e.json();throw new Error(n.detail||"卸载失败")}return await e.json()}async function dMe(t,e,n="main"){const r=await St("/api/webui/plugins/update",{method:"POST",headers:Dt(),body:JSON.stringify({plugin_id:t,repository_url:e,branch:n})});if(!r.ok){const s=await r.json();throw new Error(s.detail||"更新失败")}return await r.json()}const bg="https://maibot-plugin-stats.maibot-webui.workers.dev";async function iX(t){try{const e=await fetch(`${bg}/stats/${t}`);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(t,e){try{const n=e||l7(),r=await fetch(`${bg}/stats/like`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:t,user_id:n})}),s=await r.json();return r.status===429?{success:!1,error:"操作过于频繁,请稍后再试"}:r.ok?{success:!0,...s}:{success:!1,error:s.error||"点赞失败"}}catch(n){return console.error("Error liking plugin:",n),{success:!1,error:"网络错误"}}}async function fMe(t,e){try{const n=e||l7(),r=await fetch(`${bg}/stats/dislike`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:t,user_id:n})}),s=await r.json();return r.status===429?{success:!1,error:"操作过于频繁,请稍后再试"}:r.ok?{success:!0,...s}:{success:!1,error:s.error||"点踩失败"}}catch(n){return console.error("Error disliking plugin:",n),{success:!1,error:"网络错误"}}}async function mMe(t,e,n,r){if(e<1||e>5)return{success:!1,error:"评分必须在 1-5 之间"};try{const s=r||l7(),i=await fetch(`${bg}/stats/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:t,rating:e,comment:n,user_id:s})}),a=await i.json();return i.status===429?{success:!1,error:"每天最多评分 3 次"}:i.ok?{success:!0,...a}:{success:!1,error:a.error||"评分失败"}}catch(s){return console.error("Error rating plugin:",s),{success:!1,error:"网络错误"}}}async function pMe(t){try{const e=await fetch(`${bg}/stats/download`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:t})}),n=await e.json();return e.status===429?(console.warn("Download recording rate limited"),{success:!0}):e.ok?{success:!0,...n}:(console.error("Failed to record download:",n.error),{success:!1,error:n.error})}catch(e){return console.error("Error recording download:",e),{success:!1,error:"网络错误"}}}function gMe(){const t=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,t.deviceMemory||0].join("|");let n=0;for(let r=0;r{i(!0);const k=await iX(t);k&&r(k),i(!1)};b.useEffect(()=>{x()},[t]);const y=async()=>{const k=await hMe(t);k.success?(g({title:"已点赞",description:"感谢你的支持!"}),x()):g({title:"点赞失败",description:k.error||"未知错误",variant:"destructive"})},w=async()=>{const k=await fMe(t);k.success?(g({title:"已反馈",description:"感谢你的反馈!"}),x()):g({title:"操作失败",description:k.error||"未知错误",variant:"destructive"})},S=async()=>{if(a===0){g({title:"请选择评分",description:"至少选择 1 颗星",variant:"destructive"});return}const k=await mMe(t,a,c||void 0);k.success?(g({title:"评分成功",description:"感谢你的评价!"}),m(!1),l(0),d(""),x()):g({title:"评分失败",description:k.error||"未知错误",variant:"destructive"})};return s?o.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Ku,{className:"h-4 w-4"}),o.jsx("span",{children:"-"})]}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(_c,{className:"h-4 w-4"}),o.jsx("span",{children:"-"})]})]}):n?e?o.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[o.jsxs("div",{className:"flex items-center gap-1",title:`下载量: ${n.downloads.toLocaleString()}`,children:[o.jsx(Ku,{className:"h-4 w-4"}),o.jsx("span",{children:n.downloads.toLocaleString()})]}),o.jsxs("div",{className:"flex items-center gap-1",title:`评分: ${n.rating.toFixed(1)} (${n.rating_count} 条评价)`,children:[o.jsx(_c,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),o.jsx("span",{children:n.rating.toFixed(1)})]}),o.jsxs("div",{className:"flex items-center gap-1",title:`点赞数: ${n.likes}`,children:[o.jsx(f4,{className:"h-4 w-4"}),o.jsx("span",{children:n.likes})]})]}):o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[o.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[o.jsx(Ku,{className:"h-5 w-5 text-muted-foreground mb-1"}),o.jsx("span",{className:"text-2xl font-bold",children:n.downloads.toLocaleString()}),o.jsx("span",{className:"text-xs text-muted-foreground",children:"下载量"})]}),o.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[o.jsx(_c,{className:"h-5 w-5 text-yellow-400 mb-1 fill-yellow-400"}),o.jsx("span",{className:"text-2xl font-bold",children:n.rating.toFixed(1)}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:[n.rating_count," 条评价"]})]}),o.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[o.jsx(f4,{className:"h-5 w-5 text-green-500 mb-1"}),o.jsx("span",{className:"text-2xl font-bold",children:n.likes}),o.jsx("span",{className:"text-xs text-muted-foreground",children:"点赞"})]}),o.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[o.jsx(g9,{className:"h-5 w-5 text-red-500 mb-1"}),o.jsx("span",{className:"text-2xl font-bold",children:n.dislikes}),o.jsx("span",{className:"text-xs text-muted-foreground",children:"点踩"})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(he,{variant:"outline",size:"sm",onClick:y,children:[o.jsx(f4,{className:"h-4 w-4 mr-1"}),"点赞"]}),o.jsxs(he,{variant:"outline",size:"sm",onClick:w,children:[o.jsx(g9,{className:"h-4 w-4 mr-1"}),"点踩"]}),o.jsxs(Dr,{open:h,onOpenChange:m,children:[o.jsx(Sf,{asChild:!0,children:o.jsxs(he,{variant:"default",size:"sm",children:[o.jsx(_c,{className:"h-4 w-4 mr-1"}),"评分"]})}),o.jsxs(Sr,{children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"为插件评分"}),o.jsx(ss,{children:"分享你的使用体验,帮助其他用户"})]}),o.jsxs("div",{className:"space-y-4 py-4",children:[o.jsxs("div",{className:"flex flex-col items-center gap-2",children:[o.jsx("div",{className:"flex gap-2",children:[1,2,3,4,5].map(k=>o.jsx("button",{onClick:()=>l(k),className:"focus:outline-none",children:o.jsx(_c,{className:`h-8 w-8 transition-colors ${k<=a?"fill-yellow-400 text-yellow-400":"text-muted-foreground hover:text-yellow-300"}`})},k))}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:[a===0&&"点击星星进行评分",a===1&&"很差",a===2&&"一般",a===3&&"还行",a===4&&"不错",a===5&&"非常好"]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium mb-2 block",children:"评论(可选)"}),o.jsx(Ar,{value:c,onChange:k=>d(k.target.value),placeholder:"分享你的使用体验...",rows:4,maxLength:500}),o.jsxs("div",{className:"text-xs text-muted-foreground mt-1 text-right",children:[c.length," / 500"]})]})]}),o.jsxs(bs,{children:[o.jsx(he,{variant:"outline",onClick:()=>m(!1),children:"取消"}),o.jsx(he,{onClick:S,disabled:a===0,children:"提交评分"})]})]})]})]}),n.recent_ratings&&n.recent_ratings.length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"text-sm font-semibold",children:"最近评价"}),o.jsx("div",{className:"space-y-3",children:n.recent_ratings.map((k,j)=>o.jsxs("div",{className:"p-3 rounded-lg border bg-muted/50",children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("div",{className:"flex gap-1",children:[1,2,3,4,5].map(N=>o.jsx(_c,{className:`h-3 w-3 ${N<=k.rating?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},N))}),o.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(k.created_at).toLocaleDateString()})]}),k.comment&&o.jsx("p",{className:"text-sm text-muted-foreground",children:k.comment})]},j))})]})]}):null}const Nz={"Group Management":"群组管理","Entertainment & Interaction":"娱乐互动","Utility Tools":"实用工具","Content Generation":"内容生成",Multimedia:"多媒体","External Integration":"外部集成","Data Analysis & Insights":"数据分析与洞察",Other:"其他"};function vMe(){const t=Zi(),[e,n]=b.useState(null),[r,s]=b.useState(""),[i,a]=b.useState("all"),[l,c]=b.useState("all"),[d,h]=b.useState(!0),[m,g]=b.useState([]),[x,y]=b.useState(!0),[w,S]=b.useState(null),[k,j]=b.useState(null),[N,T]=b.useState(null),[E,_]=b.useState(null),[,M]=b.useState([]),[I,P]=b.useState({}),{toast:L}=fs(),H=async R=>{const ie=R.map(async V=>{try{const te=await iX(V.id);return{id:V.id,stats:te}}catch(te){return console.warn(`Failed to load stats for ${V.id}:`,te),{id:V.id,stats:null}}}),W=await Promise.all(ie),q={};W.forEach(({id:V,stats:te})=>{te&&(q[V]=te)}),P(q)};b.useEffect(()=>{let R=null,ie=!1;return(async()=>{if(R=lMe(q=>{ie||(T(q),q.stage==="success"?setTimeout(()=>{ie||T(null)},2e3):q.stage==="error"&&(y(!1),S(q.error||"加载失败")))},q=>{console.error("WebSocket error:",q),ie||L({title:"WebSocket 连接失败",description:"无法实时显示加载进度",variant:"destructive"})}),await new Promise(q=>{if(!R){q();return}const V=()=>{R&&R.readyState===WebSocket.OPEN?(console.log("WebSocket connected, starting to load plugins"),q()):R&&R.readyState===WebSocket.CLOSED?(console.warn("WebSocket closed before loading plugins"),q()):setTimeout(V,100)};V()}),!ie){const q=await iMe();j(q),q.installed||L({title:"Git 未安装",description:q.error||"请先安装 Git 才能使用插件安装功能",variant:"destructive"})}if(!ie){const q=await aMe();_(q)}if(!ie)try{y(!0),S(null);const q=await sMe();if(!ie){const V=await U1();M(V);const te=q.map(ne=>{const K=W1(ne.id,V),se=G1(ne.id,V);return{...ne,installed:K,installed_version:se}});for(const ne of V)!te.some(se=>se.id===ne.id)&&ne.manifest&&te.push({id:ne.id,manifest:{manifest_version:ne.manifest.manifest_version||1,name:ne.manifest.name,version:ne.manifest.version,description:ne.manifest.description||"",author:ne.manifest.author,license:ne.manifest.license||"Unknown",host_application:ne.manifest.host_application,homepage_url:ne.manifest.homepage_url,repository_url:ne.manifest.repository_url,keywords:ne.manifest.keywords||[],categories:ne.manifest.categories||[],default_locale:ne.manifest.default_locale||"zh-CN",locales_path:ne.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!0,installed_version:ne.manifest.version,published_at:new Date().toISOString(),updated_at:new Date().toISOString()});g(te),H(te)}}catch(q){if(!ie){const V=q instanceof Error?q.message:"加载插件列表失败";S(V),L({title:"加载失败",description:V,variant:"destructive"})}}finally{ie||y(!1)}})(),()=>{ie=!0,R&&R.close()}},[L]);const U=R=>{if(!R.installed&&E&&!ee(R))return o.jsxs(Xn,{variant:"destructive",className:"gap-1",children:[o.jsx(Vc,{className:"h-3 w-3"}),"不兼容"]});if(R.installed){const ie=R.installed_version?.trim(),W=R.manifest.version?.trim();if(ie!==W){const q=ie?.split(".").map(Number)||[0,0,0],V=W?.split(".").map(Number)||[0,0,0];for(let te=0;te<3;te++){if((V[te]||0)>(q[te]||0))return o.jsxs(Xn,{variant:"outline",className:"gap-1 text-orange-600 border-orange-600",children:[o.jsx(Vc,{className:"h-3 w-3"}),"可更新"]});if((V[te]||0)<(q[te]||0))break}}return o.jsxs(Xn,{variant:"default",className:"gap-1",children:[o.jsx(Qc,{className:"h-3 w-3"}),"已安装"]})}return null},ee=R=>!E||!R.manifest?.host_application?!0:oMe(R.manifest.host_application.min_version,R.manifest.host_application.max_version,E),z=R=>{if(!R.installed||!R.installed_version||!R.manifest?.version)return!1;const ie=R.installed_version.trim(),W=R.manifest.version.trim();if(ie===W)return!1;const q=ie.split(".").map(Number),V=W.split(".").map(Number);for(let te=0;te<3;te++){if((V[te]||0)>(q[te]||0))return!0;if((V[te]||0)<(q[te]||0))return!1}return!1},Q=m.filter(R=>{if(!R.manifest)return console.warn("[过滤] 跳过无 manifest 的插件:",R.id),!1;const ie=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(te=>te.toLowerCase().includes(r.toLowerCase())),W=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i);let q=!0;l==="installed"?q=R.installed===!0:l==="updates"&&(q=R.installed===!0&&z(R));const V=!d||!E||ee(R);return ie&&W&&q&&V}),B=()=>{n(null)},X=async R=>{if(!k?.installed){L({title:"无法安装",description:"Git 未安装",variant:"destructive"});return}if(E&&!ee(R)){L({title:"无法安装",description:"插件与当前麦麦版本不兼容",variant:"destructive"});return}try{await cMe(R.id,R.manifest.repository_url||"","main"),pMe(R.id).catch(W=>{console.warn("Failed to record download:",W)}),L({title:"安装成功",description:`${R.manifest.name} 已成功安装`});const ie=await U1();M(ie),g(W=>W.map(q=>{if(q.id===R.id){const V=W1(q.id,ie),te=G1(q.id,ie);return{...q,installed:V,installed_version:te}}return q}))}catch(ie){L({title:"安装失败",description:ie instanceof Error?ie.message:"未知错误",variant:"destructive"})}},J=async R=>{try{await uMe(R.id),L({title:"卸载成功",description:`${R.manifest.name} 已成功卸载`});const ie=await U1();M(ie),g(W=>W.map(q=>{if(q.id===R.id){const V=W1(q.id,ie),te=G1(q.id,ie);return{...q,installed:V,installed_version:te}}return q}))}catch(ie){L({title:"卸载失败",description:ie instanceof Error?ie.message:"未知错误",variant:"destructive"})}},G=async R=>{if(!k?.installed){L({title:"无法更新",description:"Git 未安装",variant:"destructive"});return}try{const ie=await dMe(R.id,R.manifest.repository_url||"","main");L({title:"更新成功",description:`${R.manifest.name} 已从 ${ie.old_version} 更新到 ${ie.new_version}`});const W=await U1();M(W),g(q=>q.map(V=>{if(V.id===R.id){const te=W1(V.id,W),ne=G1(V.id,W);return{...V,installed:te,installed_version:ne}}return V}))}catch(ie){L({title:"更新失败",description:ie instanceof Error?ie.message:"未知错误",variant:"destructive"})}};return o.jsx(wn,{className:"h-full",children:o.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件市场"}),o.jsx("p",{className:"text-muted-foreground mt-2",children:"浏览和管理麦麦的插件"})]}),o.jsxs(he,{onClick:()=>t({to:"/plugin-mirrors"}),children:[o.jsx(Hee,{className:"h-4 w-4 mr-2"}),"配置镜像源"]})]}),k&&!k.installed&&o.jsxs(qt,{className:"border-orange-600 bg-orange-50 dark:bg-orange-950/20",children:[o.jsx(Fn,{children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Wa,{className:"h-5 w-5 text-orange-600"}),o.jsxs("div",{children:[o.jsx(qn,{className:"text-lg text-orange-900 dark:text-orange-100",children:"Git 未安装"}),o.jsx(ts,{className:"text-orange-800 dark:text-orange-200",children:k.error||"请先安装 Git 才能使用插件安装功能"})]})]})}),o.jsx(Gn,{children:o.jsxs("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:["您可以从 ",o.jsx("a",{href:"https://git-scm.com/downloads",target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"git-scm.com"})," 下载并安装 Git。 安装完成后,请重启麦麦应用。"]})})]}),o.jsx(qt,{className:"p-4",children:o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(Ni,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(ze,{placeholder:"搜索插件...",value:r,onChange:R=>s(R.target.value),className:"pl-9"})]}),o.jsxs(Vt,{value:i,onValueChange:a,children:[o.jsx($t,{className:"w-full sm:w-[200px]",children:o.jsx(Ut,{placeholder:"选择分类"})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部分类"}),o.jsx(De,{value:"Group Management",children:"群组管理"}),o.jsx(De,{value:"Entertainment & Interaction",children:"娱乐互动"}),o.jsx(De,{value:"Utility Tools",children:"实用工具"}),o.jsx(De,{value:"Content Generation",children:"内容生成"}),o.jsx(De,{value:"Multimedia",children:"多媒体"}),o.jsx(De,{value:"External Integration",children:"外部集成"}),o.jsx(De,{value:"Data Analysis & Insights",children:"数据分析与洞察"}),o.jsx(De,{value:"Other",children:"其他"})]})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Oi,{id:"compatible-only",checked:d,onCheckedChange:R=>h(R===!0)}),o.jsx("label",{htmlFor:"compatible-only",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:"只显示兼容当前版本的插件"})]})]})}),o.jsx(ja,{value:l,onValueChange:c,className:"w-full",children:o.jsxs(Wi,{className:"grid w-full grid-cols-3",children:[o.jsxs(Lt,{value:"all",children:["全部插件 (",m.filter(R=>{if(!R.manifest)return!1;const ie=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(V=>V.toLowerCase().includes(r.toLowerCase())),W=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i),q=!d||!E||ee(R);return ie&&W&&q}).length,")"]}),o.jsxs(Lt,{value:"installed",children:["已安装 (",m.filter(R=>{if(!R.manifest)return!1;const ie=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(V=>V.toLowerCase().includes(r.toLowerCase())),W=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i),q=!d||!E||ee(R);return R.installed&&ie&&W&&q}).length,")"]}),o.jsxs(Lt,{value:"updates",children:["可更新 (",m.filter(R=>{if(!R.manifest)return!1;const ie=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(V=>V.toLowerCase().includes(r.toLowerCase())),W=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i),q=!d||!E||ee(R);return R.installed&&z(R)&&ie&&W&&q}).length,")"]})]})}),N&&N.stage==="loading"&&o.jsx(qt,{className:"p-4",children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Uc,{className:"h-4 w-4 animate-spin"}),o.jsxs("span",{className:"text-sm font-medium",children:[N.operation==="fetch"&&"加载插件列表",N.operation==="install"&&`安装插件${N.plugin_id?`: ${N.plugin_id}`:""}`,N.operation==="uninstall"&&`卸载插件${N.plugin_id?`: ${N.plugin_id}`:""}`,N.operation==="update"&&`更新插件${N.plugin_id?`: ${N.plugin_id}`:""}`]})]}),o.jsxs("span",{className:"text-sm font-medium",children:[N.progress,"%"]})]}),o.jsx(zp,{value:N.progress,className:"h-2"}),o.jsx("div",{className:"text-xs text-muted-foreground",children:N.message}),N.operation==="fetch"&&N.total_plugins>0&&o.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["已加载 ",N.loaded_plugins," / ",N.total_plugins," 个插件"]})]})}),N&&N.stage==="error"&&N.error&&o.jsx(qt,{className:"border-destructive bg-destructive/10",children:o.jsx(Fn,{children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Wa,{className:"h-5 w-5 text-destructive"}),o.jsxs("div",{children:[o.jsx(qn,{className:"text-lg text-destructive",children:"加载失败"}),o.jsx(ts,{className:"text-destructive/80",children:N.error})]})]})})}),x?o.jsxs("div",{className:"flex items-center justify-center py-12",children:[o.jsx(Uc,{className:"h-8 w-8 animate-spin text-muted-foreground"}),o.jsx("span",{className:"ml-3 text-muted-foreground",children:"加载插件列表中..."})]}):w?o.jsx(qt,{className:"p-6",children:o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[o.jsx(Wa,{className:"h-12 w-12 text-destructive mb-4"}),o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),o.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:w}),o.jsx(he,{onClick:()=>window.location.reload(),children:"重新加载"})]})}):Q.length===0?o.jsx(qt,{className:"p-6",children:o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[o.jsx(Ni,{className:"h-12 w-12 text-muted-foreground mb-4"}),o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"未找到插件"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:r||i!=="all"?"尝试调整搜索条件或筛选器":"暂无可用插件"})]})}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:Q.map(R=>o.jsxs(qt,{className:"flex flex-col hover:shadow-lg transition-shadow h-full",children:[o.jsxs(Fn,{children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsx(qn,{className:"text-xl",children:R.manifest?.name||R.id}),o.jsxs("div",{className:"flex flex-col gap-1",children:[R.manifest?.categories&&R.manifest.categories[0]&&o.jsx(Xn,{variant:"secondary",className:"text-xs whitespace-nowrap",children:Nz[R.manifest.categories[0]]||R.manifest.categories[0]}),U(R)]})]}),o.jsx(ts,{className:"line-clamp-2",children:R.manifest?.description||"无描述"})]}),o.jsx(Gn,{className:"flex-1",children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Ku,{className:"h-4 w-4"}),o.jsx("span",{children:(I[R.id]?.downloads??R.downloads??0).toLocaleString()})]}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(_c,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),o.jsx("span",{children:(I[R.id]?.rating??R.rating??0).toFixed(1)})]})]}),o.jsxs("div",{className:"flex flex-wrap gap-2",children:[R.manifest?.keywords&&R.manifest.keywords.slice(0,3).map(ie=>o.jsx(Xn,{variant:"outline",className:"text-xs",children:ie},ie)),R.manifest?.keywords&&R.manifest.keywords.length>3&&o.jsxs(Xn,{variant:"outline",className:"text-xs",children:["+",R.manifest.keywords.length-3]})]}),o.jsxs("div",{className:"text-xs text-muted-foreground pt-2 border-t space-y-1",children:[o.jsxs("div",{children:["v",R.manifest?.version||"unknown"," · ",R.manifest?.author?.name||"Unknown"]}),R.manifest?.host_application&&o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{children:"支持:"}),o.jsxs("span",{className:"font-medium",children:[R.manifest.host_application.min_version,R.manifest.host_application.max_version?` - ${R.manifest.host_application.max_version}`:" - 最新版本"]})]})]})]})}),o.jsx(nL,{className:"pt-4",children:o.jsxs("div",{className:"flex items-center justify-end gap-2 w-full",children:[o.jsx(he,{variant:"outline",size:"sm",onClick:()=>n(R),children:"查看详情"}),R.installed?z(R)?o.jsxs(he,{size:"sm",disabled:!k?.installed,title:k?.installed?void 0:"Git 未安装",onClick:()=>G(R),children:[o.jsx(Qs,{className:"h-4 w-4 mr-1"}),"更新"]}):o.jsxs(he,{variant:"destructive",size:"sm",disabled:!k?.installed,title:k?.installed?void 0:"Git 未安装",onClick:()=>J(R),children:[o.jsx(Sn,{className:"h-4 w-4 mr-1"}),"卸载"]}):o.jsxs(he,{size:"sm",disabled:!k?.installed||N?.operation==="install"||E!==null&&!ee(R),title:k?.installed?E!==null&&!ee(R)?`不兼容当前版本 (需要 ${R.manifest?.host_application?.min_version||"未知"}${R.manifest?.host_application?.max_version?` - ${R.manifest.host_application.max_version}`:"+"},当前 ${E?.version})`:void 0:"Git 未安装",onClick:()=>X(R),children:[o.jsx(Ku,{className:"h-4 w-4 mr-1"}),N?.operation==="install"&&N?.plugin_id===R.id?"安装中...":"安装"]})]})})]},R.id))}),o.jsx(Dr,{open:e!==null,onOpenChange:B,children:e&&e.manifest&&o.jsxs(Sr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsx(kr,{children:o.jsxs("div",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"space-y-2 flex-1",children:[o.jsx(Or,{className:"text-2xl",children:e.manifest.name}),o.jsxs(ss,{children:["作者: ",e.manifest.author?.name||"Unknown",e.manifest.author?.url&&o.jsx("a",{href:e.manifest.author.url,target:"_blank",rel:"noopener noreferrer",className:"ml-2 text-primary hover:underline",children:o.jsx(Mh,{className:"h-3 w-3 inline"})})]})]}),o.jsxs("div",{className:"flex flex-col gap-2",children:[e.manifest.categories&&e.manifest.categories[0]&&o.jsx(Xn,{variant:"secondary",children:Nz[e.manifest.categories[0]]||e.manifest.categories[0]}),U(e)]})]})}),o.jsxs("div",{className:"space-y-6",children:[o.jsx(xMe,{pluginId:e.id}),o.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:"版本"}),o.jsxs("p",{className:"text-sm text-muted-foreground",children:["v",e.manifest?.version||"unknown"]}),e.installed&&e.installed_version&&o.jsxs("p",{className:"text-xs text-muted-foreground",children:["已安装: v",e.installed_version]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:"下载量"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:(I[e.id]?.downloads??e.downloads??0).toLocaleString()})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:"评分"}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(_c,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:[(I[e.id]?.rating??e.rating??0).toFixed(1)," (",I[e.id]?.rating_count??e.review_count??0,")"]})]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:"许可证"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e.manifest.license||"Unknown"})]}),o.jsxs("div",{className:"col-span-2",children:[o.jsx("p",{className:"text-sm font-medium",children:"支持版本"}),o.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}`:" - 最新版本"]})]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium mb-2",children:"关键词"}),o.jsx("div",{className:"flex flex-wrap gap-2",children:e.manifest.keywords&&e.manifest.keywords.map(R=>o.jsx(Xn,{variant:"outline",children:R},R))})]}),e.detailed_description&&o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium mb-2",children:"详细说明"}),o.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:e.detailed_description})]}),!e.detailed_description&&o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium mb-2",children:"说明"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e.manifest.description||"无描述"})]}),o.jsxs("div",{className:"space-y-2",children:[e.manifest.homepage_url&&o.jsxs("div",{className:"text-sm",children:[o.jsx("span",{className:"font-medium",children:"主页: "}),o.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&&o.jsxs("div",{className:"text-sm",children:[o.jsx("span",{className:"font-medium",children:"仓库: "}),o.jsx("a",{href:e.manifest.repository_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:e.manifest.repository_url})]})]})]}),o.jsxs(bs,{children:[e.manifest.homepage_url&&o.jsxs(he,{onClick:()=>window.open(e.manifest.homepage_url,"_blank"),children:[o.jsx(Mh,{className:"h-4 w-4 mr-2"}),"访问主页"]}),e.manifest.repository_url&&o.jsxs(he,{variant:"outline",onClick:()=>window.open(e.manifest.repository_url,"_blank"),children:[o.jsx(Mh,{className:"h-4 w-4 mr-2"}),"查看仓库"]})]})]})})]})})}function yMe(){return o.jsx(wn,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件配置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理和配置已安装的插件"})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(he,{variant:"outline",size:"sm",children:[o.jsx(Qs,{className:"h-4 w-4 mr-2"}),"刷新"]}),o.jsxs(he,{size:"sm",children:[o.jsx(Xu,{className:"h-4 w-4 mr-2"}),"全局设置"]})]})]}),o.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[o.jsxs(qt,{children:[o.jsxs(Fn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(qn,{className:"text-sm font-medium",children:"已安装插件"}),o.jsx(Uh,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Gn,{children:[o.jsx("div",{className:"text-2xl font-bold",children:"0"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"正在加载..."})]})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(qn,{className:"text-sm font-medium",children:"已启用"}),o.jsx(Qc,{className:"h-4 w-4 text-green-600"})]}),o.jsxs(Gn,{children:[o.jsx("div",{className:"text-2xl font-bold",children:"0"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"运行中的插件"})]})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(qn,{className:"text-sm font-medium",children:"已禁用"}),o.jsx(Vc,{className:"h-4 w-4 text-orange-600"})]}),o.jsxs(Gn,{children:[o.jsx("div",{className:"text-2xl font-bold",children:"0"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"未激活的插件"})]})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(qn,{className:"text-sm font-medium",children:"可更新"}),o.jsx(Qs,{className:"h-4 w-4 text-blue-600"})]}),o.jsxs(Gn,{children:[o.jsx("div",{className:"text-2xl font-bold",children:"0"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"有新版本可用"})]})]})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{children:[o.jsx(qn,{children:"已安装的插件"}),o.jsx(ts,{children:"查看和管理已安装插件的配置"})]}),o.jsx(Gn,{children:o.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[o.jsx(Uh,{className:"h-16 w-16 text-muted-foreground/50"}),o.jsxs("div",{className:"text-center space-y-2",children:[o.jsx("p",{className:"text-lg font-medium text-muted-foreground",children:"插件配置功能开发中"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"即将支持插件的启用/禁用、参数配置等功能"})]}),o.jsx("div",{className:"flex gap-2",children:o.jsx(he,{variant:"outline",asChild:!0,children:o.jsxs("a",{href:"/plugins",children:[o.jsx(Mh,{className:"h-4 w-4 mr-2"}),"前往插件市场"]})})})]})})]}),o.jsx(qt,{className:"border-blue-200 bg-blue-50 dark:bg-blue-950/20 dark:border-blue-900",children:o.jsx(Gn,{className:"pt-6",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(Vc,{className:"h-5 w-5 text-blue-600 mt-0.5 flex-shrink-0"}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-sm font-medium text-blue-900 dark:text-blue-100",children:"开发进行中"}),o.jsxs("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:["插件配置功能正在积极开发中。目前您可以通过",o.jsx("strong",{children:"插件市场"}),"安装和卸载插件,完整的配置管理功能即将推出。"]})]})]})})})]})})}function bMe(){const t=Zi(),{toast:e}=fs(),[n,r]=b.useState([]),[s,i]=b.useState(!0),[a,l]=b.useState(null),[c,d]=b.useState(null),[h,m]=b.useState(!1),[g,x]=b.useState(!1),[y,w]=b.useState({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),S=b.useCallback(async()=>{try{i(!0),l(null);const M=localStorage.getItem("access-token"),I=await fetch("/api/webui/plugins/mirrors",{headers:{Authorization:`Bearer ${M}`}});if(!I.ok)throw new Error("获取镜像源列表失败");const P=await I.json();r(P.mirrors||[])}catch(M){const I=M instanceof Error?M.message:"加载镜像源失败";l(I),e({title:"加载失败",description:I,variant:"destructive"})}finally{i(!1)}},[e]);b.useEffect(()=>{S()},[S]);const k=async()=>{try{const M=localStorage.getItem("access-token"),I=await fetch("/api/webui/plugins/mirrors",{method:"POST",headers:{Authorization:`Bearer ${M}`,"Content-Type":"application/json"},body:JSON.stringify(y)});if(!I.ok){const P=await I.json();throw new Error(P.detail||"添加镜像源失败")}e({title:"添加成功",description:"镜像源已添加"}),m(!1),w({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),S()}catch(M){e({title:"添加失败",description:M instanceof Error?M.message:"未知错误",variant:"destructive"})}},j=async()=>{if(c)try{const M=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${c.id}`,{method:"PUT",headers:{Authorization:`Bearer ${M}`,"Content-Type":"application/json"},body:JSON.stringify({name:y.name,raw_prefix:y.raw_prefix,clone_prefix:y.clone_prefix,enabled:y.enabled,priority:y.priority})})).ok)throw new Error("更新镜像源失败");e({title:"更新成功",description:"镜像源已更新"}),x(!1),d(null),S()}catch(M){e({title:"更新失败",description:M instanceof Error?M.message:"未知错误",variant:"destructive"})}},N=async M=>{if(confirm("确定要删除这个镜像源吗?"))try{const I=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${M}`,{method:"DELETE",headers:{Authorization:`Bearer ${I}`}})).ok)throw new Error("删除镜像源失败");e({title:"删除成功",description:"镜像源已删除"}),S()}catch(I){e({title:"删除失败",description:I instanceof Error?I.message:"未知错误",variant:"destructive"})}},T=async M=>{try{const I=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${M.id}`,{method:"PUT",headers:{Authorization:`Bearer ${I}`,"Content-Type":"application/json"},body:JSON.stringify({enabled:!M.enabled})})).ok)throw new Error("更新状态失败");S()}catch(I){e({title:"更新失败",description:I instanceof Error?I.message:"未知错误",variant:"destructive"})}},E=M=>{d(M),w({id:M.id,name:M.name,raw_prefix:M.raw_prefix,clone_prefix:M.clone_prefix,enabled:M.enabled,priority:M.priority}),x(!0)},_=async(M,I)=>{const P=I==="up"?M.priority-1:M.priority+1;if(!(P<1))try{const L=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${M.id}`,{method:"PUT",headers:{Authorization:`Bearer ${L}`,"Content-Type":"application/json"},body:JSON.stringify({priority:P})})).ok)throw new Error("更新优先级失败");S()}catch(L){e({title:"更新失败",description:L instanceof Error?L.message:"未知错误",variant:"destructive"})}};return o.jsx(wn,{className:"h-full",children:o.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(he,{variant:"ghost",size:"icon",onClick:()=>t({to:"/plugins"}),children:o.jsx(pI,{className:"h-5 w-5"})}),o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"镜像源配置"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理 Git 克隆和文件下载的镜像源"})]})]}),o.jsxs(he,{onClick:()=>m(!0),children:[o.jsx(zs,{className:"h-4 w-4 mr-2"}),"添加镜像源"]})]}),s?o.jsx(qt,{className:"p-6",children:o.jsx("div",{className:"flex items-center justify-center py-8",children:o.jsx(Uc,{className:"h-8 w-8 animate-spin text-primary"})})}):a?o.jsx(qt,{className:"p-6",children:o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[o.jsx(Wa,{className:"h-12 w-12 text-destructive mb-4"}),o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),o.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:a}),o.jsx(he,{onClick:S,children:"重新加载"})]})}):o.jsxs(qt,{children:[o.jsx("div",{className:"hidden md:block",children:o.jsxs(Tf,{children:[o.jsx(Ef,{children:o.jsxs(Ps,{children:[o.jsx(pn,{children:"状态"}),o.jsx(pn,{children:"名称"}),o.jsx(pn,{children:"ID"}),o.jsx(pn,{children:"优先级"}),o.jsx(pn,{className:"text-right",children:"操作"})]})}),o.jsx(_f,{children:n.map(M=>o.jsxs(Ps,{children:[o.jsx(Gt,{children:o.jsx(Bt,{checked:M.enabled,onCheckedChange:()=>T(M)})}),o.jsx(Gt,{children:o.jsxs("div",{children:[o.jsx("div",{className:"font-medium",children:M.name}),o.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Raw: ",M.raw_prefix]})]})}),o.jsx(Gt,{children:o.jsx(Xn,{variant:"outline",children:M.id})}),o.jsx(Gt,{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"font-mono",children:M.priority}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(he,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>_(M,"up"),disabled:M.priority===1,children:o.jsx(A0,{className:"h-3 w-3"})}),o.jsx(he,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>_(M,"down"),children:o.jsx(nd,{className:"h-3 w-3"})})]})]})}),o.jsx(Gt,{className:"text-right",children:o.jsxs("div",{className:"flex items-center justify-end gap-2",children:[o.jsx(he,{variant:"ghost",size:"icon",onClick:()=>E(M),children:o.jsx(Yu,{className:"h-4 w-4"})}),o.jsx(he,{variant:"ghost",size:"icon",onClick:()=>N(M.id),children:o.jsx(Sn,{className:"h-4 w-4 text-destructive"})})]})})]},M.id))})]})}),o.jsx("div",{className:"md:hidden p-4 space-y-4",children:n.map(M=>o.jsx(qt,{className:"p-4",children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-start justify-between",children:[o.jsxs("div",{className:"flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h3",{className:"font-semibold",children:M.name}),M.enabled&&o.jsx(Xn,{variant:"default",className:"text-xs",children:"启用"})]}),o.jsx(Xn,{variant:"outline",className:"mt-1 text-xs",children:M.id})]}),o.jsx(Bt,{checked:M.enabled,onCheckedChange:()=>T(M)})]}),o.jsxs("div",{className:"text-sm space-y-1",children:[o.jsxs("div",{className:"text-muted-foreground",children:[o.jsx("span",{className:"font-medium",children:"Raw: "}),o.jsx("span",{className:"break-all",children:M.raw_prefix})]}),o.jsxs("div",{className:"text-muted-foreground",children:[o.jsx("span",{className:"font-medium",children:"优先级: "}),o.jsx("span",{className:"font-mono",children:M.priority})]})]}),o.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t",children:[o.jsxs(he,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>E(M),children:[o.jsx(Yu,{className:"h-4 w-4 mr-1"}),"编辑"]}),o.jsx(he,{variant:"outline",size:"sm",onClick:()=>_(M,"up"),disabled:M.priority===1,children:o.jsx(A0,{className:"h-4 w-4"})}),o.jsx(he,{variant:"outline",size:"sm",onClick:()=>_(M,"down"),children:o.jsx(nd,{className:"h-4 w-4"})}),o.jsx(he,{variant:"destructive",size:"sm",onClick:()=>N(M.id),children:o.jsx(Sn,{className:"h-4 w-4"})})]})]})},M.id))})]}),o.jsx(Dr,{open:h,onOpenChange:m,children:o.jsxs(Sr,{className:"max-w-lg",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"添加镜像源"}),o.jsx(ss,{children:"添加新的 Git 镜像源配置"})]}),o.jsxs("div",{className:"space-y-4 py-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{htmlFor:"add-id",children:"镜像源 ID *"}),o.jsx(ze,{id:"add-id",placeholder:"例如: my-mirror",value:y.id,onChange:M=>w({...y,id:M.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{htmlFor:"add-name",children:"名称 *"}),o.jsx(ze,{id:"add-name",placeholder:"例如: 我的镜像源",value:y.name,onChange:M=>w({...y,name:M.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{htmlFor:"add-raw",children:"Raw 文件前缀 *"}),o.jsx(ze,{id:"add-raw",placeholder:"https://example.com/raw",value:y.raw_prefix,onChange:M=>w({...y,raw_prefix:M.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{htmlFor:"add-clone",children:"克隆前缀 *"}),o.jsx(ze,{id:"add-clone",placeholder:"https://example.com/clone",value:y.clone_prefix,onChange:M=>w({...y,clone_prefix:M.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{htmlFor:"add-priority",children:"优先级"}),o.jsx(ze,{id:"add-priority",type:"number",min:"1",value:y.priority,onChange:M=>w({...y,priority:parseInt(M.target.value)||1})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"add-enabled",checked:y.enabled,onCheckedChange:M=>w({...y,enabled:M})}),o.jsx(de,{htmlFor:"add-enabled",children:"启用此镜像源"})]})]}),o.jsxs(bs,{children:[o.jsx(he,{variant:"outline",onClick:()=>m(!1),children:"取消"}),o.jsx(he,{onClick:k,children:"添加"})]})]})}),o.jsx(Dr,{open:g,onOpenChange:x,children:o.jsxs(Sr,{className:"max-w-lg",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"编辑镜像源"}),o.jsx(ss,{children:"修改镜像源配置"})]}),o.jsxs("div",{className:"space-y-4 py-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{children:"镜像源 ID"}),o.jsx(ze,{value:y.id,disabled:!0})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{htmlFor:"edit-name",children:"名称 *"}),o.jsx(ze,{id:"edit-name",value:y.name,onChange:M=>w({...y,name:M.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{htmlFor:"edit-raw",children:"Raw 文件前缀 *"}),o.jsx(ze,{id:"edit-raw",value:y.raw_prefix,onChange:M=>w({...y,raw_prefix:M.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{htmlFor:"edit-clone",children:"克隆前缀 *"}),o.jsx(ze,{id:"edit-clone",value:y.clone_prefix,onChange:M=>w({...y,clone_prefix:M.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(de,{htmlFor:"edit-priority",children:"优先级"}),o.jsx(ze,{id:"edit-priority",type:"number",min:"1",value:y.priority,onChange:M=>w({...y,priority:parseInt(M.target.value)||1})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"edit-enabled",checked:y.enabled,onCheckedChange:M=>w({...y,enabled:M})}),o.jsx(de,{htmlFor:"edit-enabled",children:"启用此镜像源"})]})]}),o.jsxs(bs,{children:[o.jsx(he,{variant:"outline",onClick:()=>x(!1),children:"取消"}),o.jsx(he,{onClick:j,children:"保存"})]})]})})]})})}const wMe=wf("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"}}),aX=b.forwardRef(({className:t,size:e,abbrTitle:n,children:r,...s},i)=>o.jsx("kbd",{className:ve(wMe({size:e,className:t})),ref:i,...s,children:n?o.jsx("abbr",{title:n,children:r}):r}));aX.displayName="Kbd";const SMe=[{icon:M0,title:"首页",description:"查看仪表板概览",path:"/",category:"概览"},{icon:Pl,title:"麦麦主程序配置",description:"配置麦麦的核心设置",path:"/config/bot",category:"配置"},{icon:xI,title:"麦麦模型提供商配置",description:"配置模型提供商",path:"/config/modelProvider",category:"配置"},{icon:vI,title:"麦麦模型配置",description:"配置模型参数",path:"/config/model",category:"配置"},{icon:Nj,title:"表情包管理",description:"管理麦麦的表情包",path:"/resource/emoji",category:"资源"},{icon:Cp,title:"表达方式管理",description:"管理麦麦的表达方式",path:"/resource/expression",category:"资源"},{icon:yI,title:"人物信息管理",description:"管理人物信息",path:"/resource/person",category:"资源"},{icon:Qee,title:"统计信息",description:"查看使用统计",path:"/statistics",category:"监控"},{icon:Uh,title:"插件市场",description:"浏览和安装插件",path:"/plugins",category:"扩展"},{icon:_v,title:"日志查看器",description:"查看系统日志",path:"/logs",category:"监控"},{icon:Xu,title:"系统设置",description:"配置系统参数",path:"/settings",category:"系统"}];function kMe({open:t,onOpenChange:e}){const[n,r]=b.useState(""),[s,i]=b.useState(0),a=Zi(),l=SMe.filter(h=>h.title.toLowerCase().includes(n.toLowerCase())||h.description.toLowerCase().includes(n.toLowerCase())||h.category.toLowerCase().includes(n.toLowerCase()));b.useEffect(()=>{t&&(r(""),i(0))},[t]);const c=b.useCallback(h=>{a({to:h}),e(!1)},[a,e]),d=b.useCallback(h=>{h.key==="ArrowDown"?(h.preventDefault(),i(m=>(m+1)%l.length)):h.key==="ArrowUp"?(h.preventDefault(),i(m=>(m-1+l.length)%l.length)):h.key==="Enter"&&l[s]&&(h.preventDefault(),c(l[s].path))},[l,s,c]);return o.jsx(Dr,{open:t,onOpenChange:e,children:o.jsxs(Sr,{className:"max-w-2xl p-0 gap-0",children:[o.jsxs(kr,{className:"px-4 pt-4 pb-0",children:[o.jsx(Or,{className:"sr-only",children:"搜索"}),o.jsxs("div",{className:"relative",children:[o.jsx(Ni,{className:"absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground"}),o.jsx(ze,{value:n,onChange:h=>{r(h.target.value),i(0)},onKeyDown:d,placeholder:"搜索页面...",className:"h-12 pl-11 text-base border-0 focus-visible:ring-0 shadow-none",autoFocus:!0})]})]}),o.jsx("div",{className:"border-t",children:o.jsx(wn,{className:"h-[400px]",children:l.length>0?o.jsx("div",{className:"p-2",children:l.map((h,m)=>{const g=h.icon;return o.jsxs("button",{onClick:()=>c(h.path),onMouseEnter:()=>i(m),className:ve("w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-left transition-colors",m===s?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:[o.jsx(g,{className:"h-5 w-5 flex-shrink-0"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"font-medium text-sm",children:h.title}),o.jsx("div",{className:"text-xs text-muted-foreground truncate",children:h.description})]}),o.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1 bg-muted rounded",children:h.category})]},h.path)})}):o.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[o.jsx(Ni,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:n?"未找到匹配的页面":"输入关键词开始搜索"})]})})}),o.jsx("div",{className:"border-t px-4 py-3 flex items-center justify-between text-xs text-muted-foreground",children:o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↑"}),o.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↓"}),"导航"]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Enter"}),"选择"]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Esc"}),"关闭"]})]})})]})})}function OMe(t){const e=jMe(t),n=b.forwardRef((r,s)=>{const{children:i,...a}=r,l=b.Children.toArray(i),c=l.find(CMe);if(c){const d=c.props.children,h=l.map(m=>m===c?b.Children.count(d)>1?b.Children.only(null):b.isValidElement(d)?d.props.children:null:m);return o.jsx(e,{...a,ref:s,children:b.isValidElement(d)?b.cloneElement(d,void 0,h):null})}return o.jsx(e,{...a,ref:s,children:i})});return n.displayName=`${t}.Slot`,n}function jMe(t){const e=b.forwardRef((n,r)=>{const{children:s,...i}=n;if(b.isValidElement(s)){const a=EMe(s),l=TMe(i,s.props);return s.type!==b.Fragment&&(l.ref=r?Hc(r,a):a),b.cloneElement(s,l)}return b.Children.count(s)>1?b.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var NMe=Symbol("radix.slottable");function CMe(t){return b.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===NMe}function TMe(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...l)=>{const c=i(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function EMe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var rj=["Enter"," "],_Me=["ArrowDown","PageUp","Home"],oX=["ArrowUp","PageDown","End"],MMe=[..._Me,...oX],AMe={ltr:[...rj,"ArrowRight"],rtl:[...rj,"ArrowLeft"]},RMe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},wg="Menu",[kp,DMe,PMe]=Dy(wg),[jd,lX]=Ra(wg,[PMe,gf,Gy]),Sg=gf(),cX=Gy(),[uX,fu]=jd(wg),[zMe,kg]=jd(wg),dX=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:s,onOpenChange:i,modal:a=!0}=t,l=Sg(e),[c,d]=b.useState(null),h=b.useRef(!1),m=qs(i),g=Np(s);return b.useEffect(()=>{const x=()=>{h.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>h.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),o.jsx(By,{...l,children:o.jsx(uX,{scope:e,open:n,onOpenChange:m,content:c,onContentChange:d,children:o.jsx(zMe,{scope:e,onClose:b.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:h,dir:g,modal:a,children:r})})})};dX.displayName=wg;var IMe="MenuAnchor",c7=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=Sg(n);return o.jsx(Fy,{...s,...r,ref:e})});c7.displayName=IMe;var u7="MenuPortal",[LMe,hX]=jd(u7,{forceMount:void 0}),fX=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:s}=t,i=fu(u7,e);return o.jsx(LMe,{scope:e,forceMount:n,children:o.jsx(si,{present:n||i.open,children:o.jsx(Ly,{asChild:!0,container:s,children:r})})})};fX.displayName=u7;var Ta="MenuContent",[BMe,d7]=jd(Ta),mX=b.forwardRef((t,e)=>{const n=hX(Ta,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=fu(Ta,t.__scopeMenu),a=kg(Ta,t.__scopeMenu);return o.jsx(kp.Provider,{scope:t.__scopeMenu,children:o.jsx(si,{present:r||i.open,children:o.jsx(kp.Slot,{scope:t.__scopeMenu,children:a.modal?o.jsx(FMe,{...s,ref:e}):o.jsx(qMe,{...s,ref:e})})})})}),FMe=b.forwardRef((t,e)=>{const n=fu(Ta,t.__scopeMenu),r=b.useRef(null),s=Yn(e,r);return b.useEffect(()=>{const i=r.current;if(i)return iI(i)},[]),o.jsx(h7,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:nt(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),qMe=b.forwardRef((t,e)=>{const n=fu(Ta,t.__scopeMenu);return o.jsx(h7,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),$Me=OMe("MenuContent.ScrollLock"),h7=b.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:g,onDismiss:x,disableOutsideScroll:y,...w}=t,S=fu(Ta,n),k=kg(Ta,n),j=Sg(n),N=cX(n),T=DMe(n),[E,_]=b.useState(null),M=b.useRef(null),I=Yn(e,M,S.onContentChange),P=b.useRef(0),L=b.useRef(""),H=b.useRef(0),U=b.useRef(null),ee=b.useRef("right"),z=b.useRef(0),Q=y?aI:b.Fragment,B=y?{as:$Me,allowPinchZoom:!0}:void 0,X=G=>{const R=L.current+G,ie=T().filter(K=>!K.disabled),W=document.activeElement,q=ie.find(K=>K.ref.current===W)?.textValue,V=ie.map(K=>K.textValue),te=eAe(V,R,q),ne=ie.find(K=>K.textValue===te)?.ref.current;(function K(se){L.current=se,window.clearTimeout(P.current),se!==""&&(P.current=window.setTimeout(()=>K(""),1e3))})(R),ne&&setTimeout(()=>ne.focus())};b.useEffect(()=>()=>window.clearTimeout(P.current),[]),oI();const J=b.useCallback(G=>ee.current===U.current?.side&&nAe(G,U.current?.area),[]);return o.jsx(BMe,{scope:n,searchRef:L,onItemEnter:b.useCallback(G=>{J(G)&&G.preventDefault()},[J]),onItemLeave:b.useCallback(G=>{J(G)||(M.current?.focus(),_(null))},[J]),onTriggerLeave:b.useCallback(G=>{J(G)&&G.preventDefault()},[J]),pointerGraceTimerRef:H,onPointerGraceIntentChange:b.useCallback(G=>{U.current=G},[]),children:o.jsx(Q,{...B,children:o.jsx(lI,{asChild:!0,trapped:s,onMountAutoFocus:nt(i,G=>{G.preventDefault(),M.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:o.jsx(kj,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:g,onDismiss:x,children:o.jsx(lL,{asChild:!0,...N,dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:_,onEntryFocus:nt(c,G=>{k.isUsingKeyboardRef.current||G.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(Oj,{role:"menu","aria-orientation":"vertical","data-state":MX(S.open),"data-radix-menu-content":"",dir:k.dir,...j,...w,ref:I,style:{outline:"none",...w.style},onKeyDown:nt(w.onKeyDown,G=>{const ie=G.target.closest("[data-radix-menu-content]")===G.currentTarget,W=G.ctrlKey||G.altKey||G.metaKey,q=G.key.length===1;ie&&(G.key==="Tab"&&G.preventDefault(),!W&&q&&X(G.key));const V=M.current;if(G.target!==V||!MMe.includes(G.key))return;G.preventDefault();const ne=T().filter(K=>!K.disabled).map(K=>K.ref.current);oX.includes(G.key)&&ne.reverse(),ZMe(ne)}),onBlur:nt(t.onBlur,G=>{G.currentTarget.contains(G.target)||(window.clearTimeout(P.current),L.current="")}),onPointerMove:nt(t.onPointerMove,Op(G=>{const R=G.target,ie=z.current!==G.clientX;if(G.currentTarget.contains(R)&&ie){const W=G.clientX>z.current?"right":"left";ee.current=W,z.current=G.clientX}}))})})})})})})});mX.displayName=Ta;var HMe="MenuGroup",f7=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return o.jsx(gn.div,{role:"group",...r,ref:e})});f7.displayName=HMe;var QMe="MenuLabel",pX=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return o.jsx(gn.div,{...r,ref:e})});pX.displayName=QMe;var _y="MenuItem",Cz="menu.itemSelect",Kb=b.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...s}=t,i=b.useRef(null),a=kg(_y,t.__scopeMenu),l=d7(_y,t.__scopeMenu),c=Yn(e,i),d=b.useRef(!1),h=()=>{const m=i.current;if(!n&&m){const g=new CustomEvent(Cz,{bubbles:!0,cancelable:!0});m.addEventListener(Cz,x=>r?.(x),{once:!0}),uI(m,g),g.defaultPrevented?d.current=!1:a.onClose()}};return o.jsx(gX,{...s,ref:c,disabled:n,onClick:nt(t.onClick,h),onPointerDown:m=>{t.onPointerDown?.(m),d.current=!0},onPointerUp:nt(t.onPointerUp,m=>{d.current||m.currentTarget?.click()}),onKeyDown:nt(t.onKeyDown,m=>{const g=l.searchRef.current!=="";n||g&&m.key===" "||rj.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});Kb.displayName=_y;var gX=b.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=t,a=d7(_y,n),l=cX(n),c=b.useRef(null),d=Yn(e,c),[h,m]=b.useState(!1),[g,x]=b.useState("");return b.useEffect(()=>{const y=c.current;y&&x((y.textContent??"").trim())},[i.children]),o.jsx(kp.ItemSlot,{scope:n,disabled:r,textValue:s??g,children:o.jsx(cL,{asChild:!0,...l,focusable:!r,children:o.jsx(gn.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:d,onPointerMove:nt(t.onPointerMove,Op(y=>{r?a.onItemLeave(y):(a.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:nt(t.onPointerLeave,Op(y=>a.onItemLeave(y))),onFocus:nt(t.onFocus,()=>m(!0)),onBlur:nt(t.onBlur,()=>m(!1))})})})}),VMe="MenuCheckboxItem",xX=b.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...s}=t;return o.jsx(SX,{scope:t.__scopeMenu,checked:n,children:o.jsx(Kb,{role:"menuitemcheckbox","aria-checked":My(n)?"mixed":n,...s,ref:e,"data-state":g7(n),onSelect:nt(s.onSelect,()=>r?.(My(n)?!0:!n),{checkForDefaultPrevented:!1})})})});xX.displayName=VMe;var vX="MenuRadioGroup",[UMe,WMe]=jd(vX,{value:void 0,onValueChange:()=>{}}),yX=b.forwardRef((t,e)=>{const{value:n,onValueChange:r,...s}=t,i=qs(r);return o.jsx(UMe,{scope:t.__scopeMenu,value:n,onValueChange:i,children:o.jsx(f7,{...s,ref:e})})});yX.displayName=vX;var bX="MenuRadioItem",wX=b.forwardRef((t,e)=>{const{value:n,...r}=t,s=WMe(bX,t.__scopeMenu),i=n===s.value;return o.jsx(SX,{scope:t.__scopeMenu,checked:i,children:o.jsx(Kb,{role:"menuitemradio","aria-checked":i,...r,ref:e,"data-state":g7(i),onSelect:nt(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});wX.displayName=bX;var m7="MenuItemIndicator",[SX,GMe]=jd(m7,{checked:!1}),kX=b.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...s}=t,i=GMe(m7,n);return o.jsx(si,{present:r||My(i.checked)||i.checked===!0,children:o.jsx(gn.span,{...s,ref:e,"data-state":g7(i.checked)})})});kX.displayName=m7;var XMe="MenuSeparator",OX=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return o.jsx(gn.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});OX.displayName=XMe;var YMe="MenuArrow",jX=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=Sg(n);return o.jsx(jj,{...s,...r,ref:e})});jX.displayName=YMe;var p7="MenuSub",[KMe,NX]=jd(p7),CX=t=>{const{__scopeMenu:e,children:n,open:r=!1,onOpenChange:s}=t,i=fu(p7,e),a=Sg(e),[l,c]=b.useState(null),[d,h]=b.useState(null),m=qs(s);return b.useEffect(()=>(i.open===!1&&m(!1),()=>m(!1)),[i.open,m]),o.jsx(By,{...a,children:o.jsx(uX,{scope:e,open:r,onOpenChange:m,content:d,onContentChange:h,children:o.jsx(KMe,{scope:e,contentId:Ui(),triggerId:Ui(),trigger:l,onTriggerChange:c,children:n})})})};CX.displayName=p7;var m0="MenuSubTrigger",TX=b.forwardRef((t,e)=>{const n=fu(m0,t.__scopeMenu),r=kg(m0,t.__scopeMenu),s=NX(m0,t.__scopeMenu),i=d7(m0,t.__scopeMenu),a=b.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=i,d={__scopeMenu:t.__scopeMenu},h=b.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return b.useEffect(()=>h,[h]),b.useEffect(()=>{const m=l.current;return()=>{window.clearTimeout(m),c(null)}},[l,c]),o.jsx(c7,{asChild:!0,...d,children:o.jsx(gX,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":MX(n.open),...t,ref:Hc(e,s.onTriggerChange),onClick:m=>{t.onClick?.(m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:nt(t.onPointerMove,Op(m=>{i.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:nt(t.onPointerLeave,Op(m=>{h();const g=n.content?.getBoundingClientRect();if(g){const x=n.content?.dataset.side,y=x==="right",w=y?-5:5,S=g[y?"left":"right"],k=g[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:m.clientX+w,y:m.clientY},{x:S,y:g.top},{x:k,y:g.top},{x:k,y:g.bottom},{x:S,y:g.bottom}],side:x}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(m),m.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:nt(t.onKeyDown,m=>{const g=i.searchRef.current!=="";t.disabled||g&&m.key===" "||AMe[r.dir].includes(m.key)&&(n.onOpenChange(!0),n.content?.focus(),m.preventDefault())})})})});TX.displayName=m0;var EX="MenuSubContent",_X=b.forwardRef((t,e)=>{const n=hX(Ta,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=fu(Ta,t.__scopeMenu),a=kg(Ta,t.__scopeMenu),l=NX(EX,t.__scopeMenu),c=b.useRef(null),d=Yn(e,c);return o.jsx(kp.Provider,{scope:t.__scopeMenu,children:o.jsx(si,{present:r||i.open,children:o.jsx(kp.Slot,{scope:t.__scopeMenu,children:o.jsx(h7,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:d,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{a.isUsingKeyboardRef.current&&c.current?.focus(),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:nt(t.onFocusOutside,h=>{h.target!==l.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:nt(t.onEscapeKeyDown,h=>{a.onClose(),h.preventDefault()}),onKeyDown:nt(t.onKeyDown,h=>{const m=h.currentTarget.contains(h.target),g=RMe[a.dir].includes(h.key);m&&g&&(i.onOpenChange(!1),l.trigger?.focus(),h.preventDefault())})})})})})});_X.displayName=EX;function MX(t){return t?"open":"closed"}function My(t){return t==="indeterminate"}function g7(t){return My(t)?"indeterminate":t?"checked":"unchecked"}function ZMe(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function JMe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function eAe(t,e,n){const s=e.length>1&&Array.from(e).every(d=>d===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let a=JMe(t,Math.max(i,0));s.length===1&&(a=a.filter(d=>d!==n));const c=a.find(d=>d.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function tAe(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;ir!=g>r&&n<(m-d)*(r-h)/(g-h)+d&&(s=!s)}return s}function nAe(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return tAe(n,e)}function Op(t){return e=>e.pointerType==="mouse"?t(e):void 0}var rAe=dX,sAe=c7,iAe=fX,aAe=mX,oAe=f7,lAe=pX,cAe=Kb,uAe=xX,dAe=yX,hAe=wX,fAe=kX,mAe=OX,pAe=jX,gAe=CX,xAe=TX,vAe=_X,x7="ContextMenu",[yAe]=Ra(x7,[lX]),Gs=lX(),[bAe,AX]=yAe(x7),RX=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:s,modal:i=!0}=t,[a,l]=b.useState(!1),c=Gs(e),d=qs(r),h=b.useCallback(m=>{l(m),d(m)},[d]);return o.jsx(bAe,{scope:e,open:a,onOpenChange:h,modal:i,children:o.jsx(rAe,{...c,dir:s,open:a,onOpenChange:h,modal:i,children:n})})};RX.displayName=x7;var DX="ContextMenuTrigger",PX=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=t,i=AX(DX,n),a=Gs(n),l=b.useRef({x:0,y:0}),c=b.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...l.current})}),d=b.useRef(0),h=b.useCallback(()=>window.clearTimeout(d.current),[]),m=g=>{l.current={x:g.clientX,y:g.clientY},i.onOpenChange(!0)};return b.useEffect(()=>h,[h]),b.useEffect(()=>void(r&&h()),[r,h]),o.jsxs(o.Fragment,{children:[o.jsx(sAe,{...a,virtualRef:c}),o.jsx(gn.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:nt(t.onContextMenu,g=>{h(),m(g),g.preventDefault()}),onPointerDown:r?t.onPointerDown:nt(t.onPointerDown,X1(g=>{h(),d.current=window.setTimeout(()=>m(g),700)})),onPointerMove:r?t.onPointerMove:nt(t.onPointerMove,X1(h)),onPointerCancel:r?t.onPointerCancel:nt(t.onPointerCancel,X1(h)),onPointerUp:r?t.onPointerUp:nt(t.onPointerUp,X1(h))})]})});PX.displayName=DX;var wAe="ContextMenuPortal",zX=t=>{const{__scopeContextMenu:e,...n}=t,r=Gs(e);return o.jsx(iAe,{...r,...n})};zX.displayName=wAe;var IX="ContextMenuContent",LX=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=AX(IX,n),i=Gs(n),a=b.useRef(!1);return o.jsx(aAe,{...i,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:l=>{t.onCloseAutoFocus?.(l),!l.defaultPrevented&&a.current&&l.preventDefault(),a.current=!1},onInteractOutside:l=>{t.onInteractOutside?.(l),!l.defaultPrevented&&!s.modal&&(a.current=!0)},style:{...t.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)"}})});LX.displayName=IX;var SAe="ContextMenuGroup",kAe=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Gs(n);return o.jsx(oAe,{...s,...r,ref:e})});kAe.displayName=SAe;var OAe="ContextMenuLabel",BX=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Gs(n);return o.jsx(lAe,{...s,...r,ref:e})});BX.displayName=OAe;var jAe="ContextMenuItem",FX=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Gs(n);return o.jsx(cAe,{...s,...r,ref:e})});FX.displayName=jAe;var NAe="ContextMenuCheckboxItem",qX=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Gs(n);return o.jsx(uAe,{...s,...r,ref:e})});qX.displayName=NAe;var CAe="ContextMenuRadioGroup",TAe=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Gs(n);return o.jsx(dAe,{...s,...r,ref:e})});TAe.displayName=CAe;var EAe="ContextMenuRadioItem",$X=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Gs(n);return o.jsx(hAe,{...s,...r,ref:e})});$X.displayName=EAe;var _Ae="ContextMenuItemIndicator",HX=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Gs(n);return o.jsx(fAe,{...s,...r,ref:e})});HX.displayName=_Ae;var MAe="ContextMenuSeparator",QX=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Gs(n);return o.jsx(mAe,{...s,...r,ref:e})});QX.displayName=MAe;var AAe="ContextMenuArrow",RAe=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Gs(n);return o.jsx(pAe,{...s,...r,ref:e})});RAe.displayName=AAe;var VX="ContextMenuSub",UX=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:s,defaultOpen:i}=t,a=Gs(e),[l,c]=Gl({prop:s,defaultProp:i??!1,onChange:r,caller:VX});return o.jsx(gAe,{...a,open:l,onOpenChange:c,children:n})};UX.displayName=VX;var DAe="ContextMenuSubTrigger",WX=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Gs(n);return o.jsx(xAe,{...s,...r,ref:e})});WX.displayName=DAe;var PAe="ContextMenuSubContent",GX=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Gs(n);return o.jsx(vAe,{...s,...r,ref:e,style:{...t.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)"}})});GX.displayName=PAe;function X1(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var zAe=RX,IAe=PX,LAe=zX,XX=LX,YX=BX,KX=FX,ZX=qX,JX=$X,eY=HX,tY=QX,BAe=UX,nY=WX,rY=GX;const FAe=zAe,qAe=IAe,$Ae=BAe,sY=b.forwardRef(({className:t,inset:e,children:n,...r},s)=>o.jsxs(nY,{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",t),...r,children:[n,o.jsx(yd,{className:"ml-auto h-4 w-4"})]}));sY.displayName=nY.displayName;const iY=b.forwardRef(({className:t,...e},n)=>o.jsx(rY,{ref:n,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]",t),...e}));iY.displayName=rY.displayName;const aY=b.forwardRef(({className:t,...e},n)=>o.jsx(LAe,{children:o.jsx(XX,{ref:n,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]",t),...e})}));aY.displayName=XX.displayName;const qa=b.forwardRef(({className:t,inset:e,...n},r)=>o.jsx(KX,{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",t),...n}));qa.displayName=KX.displayName;const HAe=b.forwardRef(({className:t,children:e,checked:n,...r},s)=>o.jsxs(ZX,{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",t),checked:n,...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(eY,{children:o.jsx(Ro,{className:"h-4 w-4"})})}),e]}));HAe.displayName=ZX.displayName;const QAe=b.forwardRef(({className:t,children:e,...n},r)=>o.jsxs(JX,{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",t),...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(eY,{children:o.jsx(Vee,{className:"h-2 w-2 fill-current"})})}),e]}));QAe.displayName=JX.displayName;const VAe=b.forwardRef(({className:t,inset:e,...n},r)=>o.jsx(YX,{ref:r,className:ve("px-2 py-1.5 text-sm font-semibold text-foreground",e&&"pl-8",t),...n}));VAe.displayName=YX.displayName;const p0=b.forwardRef(({className:t,...e},n)=>o.jsx(tY,{ref:n,className:ve("-mx-1 my-1 h-px bg-border",t),...e}));p0.displayName=tY.displayName;const jh=({className:t,...e})=>o.jsx("span",{className:ve("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});jh.displayName="ContextMenuShortcut";var UAe=Symbol("radix.slottable");function WAe(t){const e=({children:n})=>o.jsx(o.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=UAe,e}var[Zb]=Ra("Tooltip",[gf]),Jb=gf(),oY="TooltipProvider",GAe=700,sj="tooltip.open",[XAe,v7]=Zb(oY),lY=t=>{const{__scopeTooltip:e,delayDuration:n=GAe,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,a=b.useRef(!0),l=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),o.jsx(XAe,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:b.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:i})};lY.displayName=oY;var jp="Tooltip",[YAe,Og]=Zb(jp),cY=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:a,delayDuration:l}=t,c=v7(jp,t.__scopeTooltip),d=Jb(e),[h,m]=b.useState(null),g=Ui(),x=b.useRef(0),y=a??c.disableHoverableContent,w=l??c.delayDuration,S=b.useRef(!1),[k,j]=Gl({prop:r,defaultProp:s??!1,onChange:M=>{M?(c.onOpen(),document.dispatchEvent(new CustomEvent(sj))):c.onClose(),i?.(M)},caller:jp}),N=b.useMemo(()=>k?S.current?"delayed-open":"instant-open":"closed",[k]),T=b.useCallback(()=>{window.clearTimeout(x.current),x.current=0,S.current=!1,j(!0)},[j]),E=b.useCallback(()=>{window.clearTimeout(x.current),x.current=0,j(!1)},[j]),_=b.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{S.current=!0,j(!0),x.current=0},w)},[w,j]);return b.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),o.jsx(By,{...d,children:o.jsx(YAe,{scope:e,contentId:g,open:k,stateAttribute:N,trigger:h,onTriggerChange:m,onTriggerEnter:b.useCallback(()=>{c.isOpenDelayedRef.current?_():T()},[c.isOpenDelayedRef,_,T]),onTriggerLeave:b.useCallback(()=>{y?E():(window.clearTimeout(x.current),x.current=0)},[E,y]),onOpen:T,onClose:E,disableHoverableContent:y,children:n})})};cY.displayName=jp;var ij="TooltipTrigger",uY=b.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=Og(ij,n),i=v7(ij,n),a=Jb(n),l=b.useRef(null),c=Yn(e,l,s.onTriggerChange),d=b.useRef(!1),h=b.useRef(!1),m=b.useCallback(()=>d.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),o.jsx(Fy,{asChild:!0,...a,children:o.jsx(gn.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:nt(t.onPointerMove,g=>{g.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),h.current=!0)}),onPointerLeave:nt(t.onPointerLeave,()=>{s.onTriggerLeave(),h.current=!1}),onPointerDown:nt(t.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:nt(t.onFocus,()=>{d.current||s.onOpen()}),onBlur:nt(t.onBlur,s.onClose),onClick:nt(t.onClick,s.onClose)})})});uY.displayName=ij;var y7="TooltipPortal",[KAe,ZAe]=Zb(y7,{forceMount:void 0}),dY=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=Og(y7,e);return o.jsx(KAe,{scope:e,forceMount:n,children:o.jsx(si,{present:n||i.open,children:o.jsx(Ly,{asChild:!0,container:s,children:r})})})};dY.displayName=y7;var pf="TooltipContent",hY=b.forwardRef((t,e)=>{const n=ZAe(pf,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,a=Og(pf,t.__scopeTooltip);return o.jsx(si,{present:r||a.open,children:a.disableHoverableContent?o.jsx(fY,{side:s,...i,ref:e}):o.jsx(JAe,{side:s,...i,ref:e})})}),JAe=b.forwardRef((t,e)=>{const n=Og(pf,t.__scopeTooltip),r=v7(pf,t.__scopeTooltip),s=b.useRef(null),i=Yn(e,s),[a,l]=b.useState(null),{trigger:c,onClose:d}=n,h=s.current,{onPointerInTransitChange:m}=r,g=b.useCallback(()=>{l(null),m(!1)},[m]),x=b.useCallback((y,w)=>{const S=y.currentTarget,k={x:y.clientX,y:y.clientY},j=sRe(k,S.getBoundingClientRect()),N=iRe(k,j),T=aRe(w.getBoundingClientRect()),E=lRe([...N,...T]);l(E),m(!0)},[m]);return b.useEffect(()=>()=>g(),[g]),b.useEffect(()=>{if(c&&h){const y=S=>x(S,h),w=S=>x(S,c);return c.addEventListener("pointerleave",y),h.addEventListener("pointerleave",w),()=>{c.removeEventListener("pointerleave",y),h.removeEventListener("pointerleave",w)}}},[c,h,x,g]),b.useEffect(()=>{if(a){const y=w=>{const S=w.target,k={x:w.clientX,y:w.clientY},j=c?.contains(S)||h?.contains(S),N=!oRe(k,a);j?g():N&&(g(),d())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,h,a,d,g]),o.jsx(fY,{...t,ref:i})}),[eRe,tRe]=Zb(jp,{isInside:!1}),nRe=WAe("TooltipContent"),fY=b.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:a,...l}=t,c=Og(pf,n),d=Jb(n),{onClose:h}=c;return b.useEffect(()=>(document.addEventListener(sj,h),()=>document.removeEventListener(sj,h)),[h]),b.useEffect(()=>{if(c.trigger){const m=g=>{g.target?.contains(c.trigger)&&h()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[c.trigger,h]),o.jsx(kj,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:m=>m.preventDefault(),onDismiss:h,children:o.jsxs(Oj,{"data-state":c.stateAttribute,...d,...l,ref:e,style:{...l.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:[o.jsx(nRe,{children:r}),o.jsx(eRe,{scope:n,isInside:!0,children:o.jsx(vee,{id:c.contentId,role:"tooltip",children:s||r})})]})})});hY.displayName=pf;var mY="TooltipArrow",rRe=b.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=Jb(n);return tRe(mY,n).isInside?null:o.jsx(jj,{...s,...r,ref:e})});rRe.displayName=mY;function sRe(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function iRe(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function aRe(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}function oRe(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;ir!=g>r&&n<(m-d)*(r-h)/(g-h)+d&&(s=!s)}return s}function lRe(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),cRe(e)}function cRe(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const i=e[e.length-1],a=e[e.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var uRe=lY,dRe=cY,hRe=uY,fRe=dY,pY=hY;const mRe=uRe,pRe=dRe,gRe=hRe,gY=b.forwardRef(({className:t,sideOffset:e=4,...n},r)=>o.jsx(fRe,{children:o.jsx(pY,{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]",t),...n})}));gY.displayName=pY.displayName;function xRe({children:t}){Vse();const[e,n]=b.useState(!0),[r,s]=b.useState(!1),[i,a]=b.useState(!1),{theme:l,setTheme:c}=qj(),d=tJ(),h=Zi();b.useEffect(()=>{const w=S=>{(S.metaKey||S.ctrlKey)&&S.key==="k"&&(S.preventDefault(),a(!0))};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[]);const m=[{title:"概览",items:[{icon:M0,label:"首页",path:"/"}]},{title:"麦麦配置编辑",items:[{icon:Pl,label:"麦麦主程序配置",path:"/config/bot"},{icon:xI,label:"AI模型厂商配置",path:"/config/modelProvider",tourId:"sidebar-model-provider"},{icon:vI,label:"模型管理与分配",path:"/config/model",tourId:"sidebar-model-management"},{icon:x9,label:"麦麦适配器配置",path:"/config/adapter"}]},{title:"麦麦资源管理",items:[{icon:Nj,label:"表情包管理",path:"/resource/emoji"},{icon:Cp,label:"表达方式管理",path:"/resource/expression"},{icon:yI,label:"人物信息管理",path:"/resource/person"},{icon:gI,label:"知识库图谱可视化",path:"/resource/knowledge-graph"}]},{title:"扩展与监控",items:[{icon:Uh,label:"插件市场",path:"/plugins"},{icon:x9,label:"插件配置",path:"/plugin-config"},{icon:_v,label:"日志查看器",path:"/logs"}]},{title:"系统",items:[{icon:Xu,label:"系统设置",path:"/settings"}]}],x=l==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":l,y=()=>{localStorage.removeItem("access-token"),h({to:"/auth"})};return o.jsx(mRe,{delayDuration:300,children:o.jsxs("div",{className:"flex h-screen overflow-hidden",children:[o.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:[o.jsx("div",{className:"flex h-16 items-center border-b px-4",children:o.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:[o.jsxs("div",{className:ve("flex items-baseline gap-2",!e&&"lg:hidden"),children:[o.jsx("span",{className:"font-bold text-xl text-primary-gradient whitespace-nowrap",children:"MaiBot WebUI"}),o.jsx("span",{className:"text-xs text-primary/60 whitespace-nowrap",children:wse()})]}),!e&&o.jsx("span",{className:"hidden lg:block font-bold text-primary-gradient text-2xl",children:"M"})]})}),o.jsx(wn,{className:ve("flex-1 overflow-x-hidden",!e&&"lg:w-16"),children:o.jsx("nav",{className:ve("p-4",!e&&"lg:p-2 lg:w-16"),children:o.jsx("ul",{className:ve("space-y-6",!e&&"lg:space-y-3 lg:w-full"),children:m.map((w,S)=>o.jsxs("li",{children:[o.jsx("div",{className:ve("px-3 h-[1.25rem]","mb-2",!e&&"lg:mb-1 lg:invisible"),children:o.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/60 whitespace-nowrap",children:w.title})}),!e&&S>0&&o.jsx("div",{className:"hidden lg:block mb-2 border-t border-border"}),o.jsx("ul",{className:"space-y-1",children:w.items.map(k=>{const j=d({to:k.path}),N=k.icon,T=o.jsxs(o.Fragment,{children:[j&&o.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"}),o.jsxs("div",{className:ve("flex items-center transition-all duration-300",e?"gap-3":"gap-3 lg:gap-0"),children:[o.jsx(N,{className:ve("h-5 w-5 flex-shrink-0",j&&"text-primary"),strokeWidth:2,fill:"none"}),o.jsx("span",{className:ve("text-sm font-medium whitespace-nowrap transition-all duration-300",j&&"font-semibold",e?"opacity-100 max-w-[200px]":"opacity-100 max-w-[200px] lg:opacity-0 lg:max-w-0 lg:overflow-hidden"),children:k.label})]})]});return o.jsx("li",{className:"relative",children:o.jsxs(pRe,{children:[o.jsx(gRe,{asChild:!0,children:o.jsx(nJ,{to:k.path,"data-tour":k.tourId,className:ve("relative flex items-center rounded-lg py-2 transition-all duration-300","hover:bg-accent hover:text-accent-foreground",j?"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:T})}),!e&&o.jsx(gY,{side:"right",className:"hidden lg:block",children:o.jsx("p",{children:k.label})})]})},k.path)})})]},w.title))})})})]}),r&&o.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>s(!1)}),o.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[o.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:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("button",{onClick:()=>s(!r),className:"rounded-lg p-2 hover:bg-accent lg:hidden",children:o.jsx(Uee,{className:"h-5 w-5"})}),o.jsx("button",{onClick:()=>n(!e),className:"hidden rounded-lg p-2 hover:bg-accent lg:block",title:e?"收起侧边栏":"展开侧边栏",children:o.jsx(vd,{className:ve("h-5 w-5 transition-transform",!e&&"rotate-180")})})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("button",{onClick:()=>a(!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:[o.jsx(Ni,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),o.jsx("span",{className:"text-sm text-muted-foreground",children:"搜索..."}),o.jsxs(aX,{size:"sm",className:"absolute right-2 top-1/2 -translate-y-1/2",children:[o.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]}),o.jsx(kMe,{open:i,onOpenChange:a}),o.jsxs(he,{variant:"ghost",size:"sm",onClick:()=>window.open("https://docs.mai-mai.org","_blank"),className:"gap-2",title:"查看麦麦文档",children:[o.jsx(Wee,{className:"h-4 w-4"}),o.jsx("span",{className:"hidden sm:inline",children:"麦麦文档"})]}),o.jsx("button",{onClick:w=>{ase(x==="dark"?"light":"dark",c,w)},className:"rounded-lg p-2 hover:bg-accent",title:x==="dark"?"切换到浅色模式":"切换到深色模式",children:x==="dark"?o.jsx(Y3,{className:"h-5 w-5"}):o.jsx(K3,{className:"h-5 w-5"})}),o.jsx("div",{className:"h-6 w-px bg-border"}),o.jsxs(he,{variant:"ghost",size:"sm",onClick:y,className:"gap-2",title:"登出系统",children:[o.jsx(v9,{className:"h-4 w-4"}),o.jsx("span",{className:"hidden sm:inline",children:"登出"})]})]})]}),o.jsxs(FAe,{children:[o.jsx(qAe,{asChild:!0,children:o.jsx("main",{className:"flex-1 overflow-hidden bg-background",children:t})}),o.jsxs(aY,{className:"w-64",children:[o.jsxs(qa,{onClick:()=>h({to:"/"}),children:[o.jsx(M0,{className:"mr-2 h-4 w-4"}),"首页"]}),o.jsxs(qa,{onClick:()=>h({to:"/settings"}),children:[o.jsx(Xu,{className:"mr-2 h-4 w-4"}),"系统设置"]}),o.jsxs(qa,{onClick:()=>h({to:"/logs"}),children:[o.jsx(_v,{className:"mr-2 h-4 w-4"}),"日志查看器"]}),o.jsx(p0,{}),o.jsxs($Ae,{children:[o.jsxs(sY,{children:[o.jsx(hI,{className:"mr-2 h-4 w-4"}),"切换主题"]}),o.jsxs(iY,{className:"w-48",children:[o.jsxs(qa,{onClick:()=>c("light"),disabled:l==="light",children:[o.jsx(Y3,{className:"mr-2 h-4 w-4"}),"浅色",l==="light"&&o.jsx(jh,{children:"✓"})]}),o.jsxs(qa,{onClick:()=>c("dark"),disabled:l==="dark",children:[o.jsx(K3,{className:"mr-2 h-4 w-4"}),"深色",l==="dark"&&o.jsx(jh,{children:"✓"})]}),o.jsxs(qa,{onClick:()=>c("system"),disabled:l==="system",children:[o.jsx(Xu,{className:"mr-2 h-4 w-4"}),"跟随系统",l==="system"&&o.jsx(jh,{children:"✓"})]})]})]}),o.jsx(p0,{}),o.jsxs(qa,{onClick:()=>window.location.reload(),children:[o.jsx(Gee,{className:"mr-2 h-4 w-4"}),"刷新页面",o.jsx(jh,{children:"⌘R"})]}),o.jsxs(qa,{onClick:()=>a(!0),children:[o.jsx(Ni,{className:"mr-2 h-4 w-4"}),"搜索",o.jsx(jh,{children:"⌘K"})]}),o.jsx(p0,{}),o.jsxs(qa,{onClick:()=>window.open("https://docs.mai-mai.org","_blank"),children:[o.jsx(Mh,{className:"mr-2 h-4 w-4"}),"麦麦文档"]}),o.jsx(p0,{}),o.jsxs(qa,{onClick:y,className:"text-destructive focus:text-destructive",children:[o.jsx(v9,{className:"mr-2 h-4 w-4"}),"登出系统"]})]})]})]})]})})}var ew="Collapsible",[vRe]=Ra(ew),[yRe,b7]=vRe(ew),xY=b.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:a,...l}=t,[c,d]=Gl({prop:r,defaultProp:s??!1,onChange:a,caller:ew});return o.jsx(yRe,{scope:n,disabled:i,contentId:Ui(),open:c,onOpenToggle:b.useCallback(()=>d(h=>!h),[d]),children:o.jsx(gn.div,{"data-state":S7(c),"data-disabled":i?"":void 0,...l,ref:e})})});xY.displayName=ew;var vY="CollapsibleTrigger",yY=b.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=b7(vY,n);return o.jsx(gn.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":S7(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:nt(t.onClick,s.onOpenToggle)})});yY.displayName=vY;var w7="CollapsibleContent",bY=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=b7(w7,t.__scopeCollapsible);return o.jsx(si,{present:n||s.open,children:({present:i})=>o.jsx(bRe,{...r,ref:e,present:i})})});bY.displayName=w7;var bRe=b.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=t,a=b7(w7,n),[l,c]=b.useState(r),d=b.useRef(null),h=Yn(e,d),m=b.useRef(0),g=m.current,x=b.useRef(0),y=x.current,w=a.open||l,S=b.useRef(w),k=b.useRef(void 0);return b.useEffect(()=>{const j=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(j)},[]),gj(()=>{const j=d.current;if(j){k.current=k.current||{transitionDuration:j.style.transitionDuration,animationName:j.style.animationName},j.style.transitionDuration="0s",j.style.animationName="none";const N=j.getBoundingClientRect();m.current=N.height,x.current=N.width,S.current||(j.style.transitionDuration=k.current.transitionDuration,j.style.animationName=k.current.animationName),c(r)}},[a.open,r]),o.jsx(gn.div,{"data-state":S7(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!w,...i,ref:h,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...t.style},children:w&&s})});function S7(t){return t?"open":"closed"}var wRe=xY;const Tz=wRe,Ez=yY,_z=bY;function SRe(t){const e=t.split(` -`).slice(1),n=[];for(const r of e){const s=r.trim();if(!s.startsWith("at "))continue;const i=s.match(/at\s+(?:(.+?)\s+\()?(.+?):(\d+):(\d+)\)?$/);i?n.push({functionName:i[1]||"",fileName:i[2],lineNumber:i[3],columnNumber:i[4],raw:s}):n.push({functionName:"",fileName:"",lineNumber:"",columnNumber:"",raw:s})}return n}function kRe({error:t,errorInfo:e}){const[n,r]=b.useState(!0),[s,i]=b.useState(!1),[a,l]=b.useState(!1),c=t.stack?SRe(t.stack):[],d=async()=>{const h=` + color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,n?.key)}return(d=n?.onChange)==null||d.call(n,s),s}return i.updateDeps=a=>{r=a},i}function fz(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const TTe=(t,e)=>Math.abs(t-e)<1.01,ETe=(t,e,n)=>{let r;return function(...s){t.clearTimeout(r),r=t.setTimeout(()=>e.apply(this,s),n)}},mz=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},_Te=t=>t,ATe=t=>{const e=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),r=[];for(let s=e;s<=n;s++)r.push(s);return r},MTe=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;const s=a=>{const{width:l,height:c}=a;e({width:Math.round(l),height:Math.round(c)})};if(s(mz(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(a=>{const l=()=>{const c=a[0];if(c?.borderBoxSize){const d=c.borderBoxSize[0];if(d){s({width:d.inlineSize,height:d.blockSize});return}}s(mz(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},pz={passive:!0},gz=typeof window>"u"?!0:"onscrollend"in window,RTe=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;let s=0;const i=t.options.useScrollendEvent&&gz?()=>{}:ETe(r,()=>{e(s,!1)},t.options.isScrollingResetDelay),a=h=>()=>{const{horizontal:m,isRtl:g}=t.options;s=m?n.scrollLeft*(g&&-1||1):n.scrollTop,i(),e(s,h)},l=a(!0),c=a(!1);c(),n.addEventListener("scroll",l,pz);const d=t.options.useScrollendEvent&&gz;return d&&n.addEventListener("scrollend",c,pz),()=>{n.removeEventListener("scroll",l),d&&n.removeEventListener("scrollend",c)}},DTe=(t,e,n)=>{if(e?.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},PTe=(t,{adjustments:e=0,behavior:n},r)=>{var s,i;const a=t+e;(i=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[r.options.horizontal?"left":"top"]:a,behavior:n})};class zTe{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 n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const a=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),n=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=n=>{Object.entries(n).forEach(([r,s])=>{typeof s>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:_Te,rangeExtractor:ATe,onChange:()=>{},measureElement:DTe,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,...n}},this.notify=n=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,n)},this.maybeNotify=mh(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(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()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=(n,r)=>{const s=new Map,i=new Map;for(let a=r-1;a>=0;a--){const l=n[a];if(s.has(l.lane))continue;const c=i.get(l.lane);if(c==null||l.end>c.end?i.set(l.lane,l):l.enda.end===l.end?a.index-l.index:a.end-l.end)[0]:void 0},this.getMeasurementOptions=mh(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,s,i,a)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a}),{key:!1}),this.getMeasurements=mh(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a},l)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const c=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const d=this.measurementsCache.slice(0,c);for(let h=c;hthis.options.debug}),this.calculateRange=mh(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,i)=>this.range=n.length>0&&r>0?ITe({measurements:n,outerSize:r,scrollOffset:s,lanes:i}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=mh(()=>{let n=null,r=null;const s=this.calculateRange();return s&&(n=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,s,i,a)=>i===null||a===null?[]:n({startIndex:i,endIndex:a,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,s=n.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const s=this.indexFromElement(n),i=this.measurementsCache[s];if(!i)return;const a=i.key,l=this.elementsCache.get(a);l!==n&&(l&&this.observer.unobserve(l),this.observer.observe(n),this.elementsCache.set(a,n)),n.isConnected&&this.resizeItem(s,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const s=this.measurementsCache[n];if(!s)return;const i=this.itemSizeCache.get(s.key)??s.size,a=r-i;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,a,this):s.start{if(!n){this.elementsCache.forEach((r,s)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(s))});return}this._measureElement(n,void 0)},this.getVirtualItems=mh(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const s=[];for(let i=0,a=n.length;ithis.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return fz(r[zG(0,r.length-1,s=>fz(r[s]).start,n)])},this.getOffsetForAlignment=(n,r,s=0)=>{const i=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=n>=a+i?"end":"start"),r==="center"?n+=(s-i)/2:r==="end"&&(n-=i);const l=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.measurementsCache[n];if(!s)return;const i=this.getSize(),a=this.getScrollOffset();if(r==="auto")if(s.end>=a+i-this.options.scrollPaddingEnd)r="end";else if(s.start<=a+this.options.scrollPaddingStart)r="start";else return[a,r];const l=r==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,r,s.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{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(n,r),{adjustments:void 0,behavior:s})},this.scrollToIndex=(n,{align:r="auto",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1));let i=0;const a=10,l=d=>{if(!this.targetWindow)return;const h=this.getOffsetForIndex(n,d);if(!h){console.warn("Failed to get offset for index:",n);return}const[m,g]=h;this._scrollToOffset(m,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const x=this.getScrollOffset(),y=this.getOffsetForIndex(n,g);if(!y){console.warn("Failed to get offset for index:",n);return}TTe(y[0],x)||c(g)})},c=d=>{this.targetWindow&&(i++,il(d)):console.warn(`Failed to scroll to index ${n} after ${a} attempts.`))};l(r)},this.scrollBy=(n,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((n=r[r.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&i.some(l=>l===null);){const l=r[a];i[l.lane]===null&&(i[l.lane]=l.end),a--}s=Math.max(...i.filter(l=>l!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:s})=>{this.options.scrollToFn(n,{behavior:s,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const zG=(t,e,n,r)=>{for(;t<=e;){const s=(t+e)/2|0,i=n(s);if(ir)e=s-1;else return s}return t>0?t-1:0};function ITe({measurements:t,outerSize:e,scrollOffset:n,lanes:r}){const s=t.length-1,i=c=>t[c].start;if(t.length<=r)return{startIndex:0,endIndex:s};let a=zG(0,s,i,n),l=a;if(r===1)for(;l1){const c=Array(r).fill(0);for(;lh=0&&d.some(h=>h>=n);){const h=t[a];d[h.lane]=h.start,a--}a=Math.max(0,a-a%r),l=Math.min(s,l+(r-1-l%r))}return{startIndex:a,endIndex:l}}const xz=typeof document<"u"?b.useLayoutEffect:b.useEffect;function LTe(t){const e=b.useReducer(()=>({}),{})[1],n={...t,onChange:(s,i)=>{var a;i?pa.flushSync(e):e(),(a=t.onChange)==null||a.call(t,s,i)}},[r]=b.useState(()=>new zTe(n));return r.setOptions(n),xz(()=>r._didMount(),[]),xz(()=>r._willUpdate()),r}function BTe(t){return LTe({observeElementRect:MTe,observeElementOffset:RTe,scrollToFn:PTe,...t})}function FTe(t,e,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:t,timeZoneName:n}).format(e).split(/\s/g).slice(2).join(" ")}const qTe={},g0={};function Gu(t,e){try{const r=(qTe[t]||=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"longOffset"}).format)(e).split("GMT")[1];return r in g0?g0[r]:vz(r,r.split(":"))}catch{if(t in g0)return g0[t];const n=t?.match($Te);return n?vz(t,n.slice(1)):NaN}}const $Te=/([+-]\d\d):?(\d\d)?/;function vz(t,e){const n=+(e[0]||0),r=+(e[1]||0),s=+(e[2]||0)/60;return g0[t]=n*60+r>0?n*60+r+s:n*60-r-s}class Mo extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Gu(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)),IG(this),lj(this)):this.setTime(Date.now())}static tz(e,...n){return n.length?new Mo(...n,e):new Mo(Date.now(),e)}withTimeZone(e){return new Mo(+this,e)}getTimezoneOffset(){const e=-Gu(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),lj(this),+this}[Symbol.for("constructDateFrom")](e){return new Mo(+new Date(e),this.timeZone)}}const yz=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!yz.test(t))return;const e=t.replace(yz,"$1UTC");Mo.prototype[e]&&(t.startsWith("get")?Mo.prototype[t]=function(){return this.internal[e]()}:(Mo.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),HTe(this),+this},Mo.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),lj(this),+this}))});function lj(t){t.internal.setTime(+t),t.internal.setUTCSeconds(t.internal.getUTCSeconds()-Math.round(-Gu(t.timeZone,t)*60))}function HTe(t){Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),IG(t)}function IG(t){const e=Gu(t.timeZone,t),n=e>0?Math.floor(e):Math.ceil(e),r=new Date(+t);r.setUTCHours(r.getUTCHours()-1);const s=-new Date(+t).getTimezoneOffset(),i=-new Date(+r).getTimezoneOffset(),a=s-i,l=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();a&&l&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+a);const c=s-n;c&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+c);const d=new Date(+t);d.setUTCSeconds(0);const h=s>0?d.getSeconds():(d.getSeconds()-60)%60,m=Math.round(-(Gu(t.timeZone,t)*60))%60;(m||h)&&(t.internal.setUTCSeconds(t.internal.getUTCSeconds()+m),Date.prototype.setUTCSeconds.call(t,Date.prototype.getUTCSeconds.call(t)+m+h));const g=Gu(t.timeZone,t),x=g>0?Math.floor(g):Math.ceil(g),w=-new Date(+t).getTimezoneOffset()-x,S=x!==n,k=w-c;if(S&&k){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+k);const j=Gu(t.timeZone,t),N=j>0?Math.floor(j):Math.ceil(j),T=x-N;T&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+T),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+T))}}class Fs extends Mo{static tz(e,...n){return n.length?new Fs(...n,e):new Fs(Date.now(),e)}toISOString(){const[e,n,r]=this.tzComponents(),s=`${e}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+s}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,n,r,s]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${r} ${n} ${s}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[n,r,s]=this.tzComponents();return`${e} GMT${n}${r}${s} (${FTe(this.timeZone,this)})`}toLocaleString(e,n){return Date.prototype.toLocaleString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(e,n){return Date.prototype.toLocaleDateString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(e,n){return Date.prototype.toLocaleTimeString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),n=e>0?"-":"+",r=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),s=String(Math.abs(e)%60).padStart(2,"0");return[n,r,s]}withTimeZone(e){return new Fs(+this,e)}[Symbol.for("constructDateFrom")](e){return new Fs(+new Date(e),this.timeZone)}}const LG=6048e5,QTe=864e5,bz=Symbol.for("constructDateFrom");function is(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&bz in t?t[bz](e):t instanceof Date?new t.constructor(e):new Date(e)}function tr(t,e){return is(e||t,t)}function BG(t,e,n){const r=tr(t,n?.in);return isNaN(e)?is(t,NaN):(e&&r.setDate(r.getDate()+e),r)}function FG(t,e,n){const r=tr(t,n?.in);if(isNaN(e))return is(t,NaN);if(!e)return r;const s=r.getDate(),i=is(t,r.getTime());i.setMonth(r.getMonth()+e+1,0);const a=i.getDate();return s>=a?i:(r.setFullYear(i.getFullYear(),i.getMonth(),s),r)}let VTe={};function yg(){return VTe}function su(t,e){const n=yg(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=tr(t,e?.in),i=s.getDay(),a=(i=i.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function wz(t){const e=tr(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function Od(t,...e){const n=is.bind(null,t||e.find(r=>typeof r=="object"));return e.map(n)}function jp(t,e){const n=tr(t,e?.in);return n.setHours(0,0,0,0),n}function $G(t,e,n){const[r,s]=Od(n?.in,t,e),i=jp(r),a=jp(s),l=+i-wz(i),c=+a-wz(a);return Math.round((l-c)/QTe)}function UTe(t,e){const n=qG(t,e),r=is(t,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Op(r)}function WTe(t,e,n){return BG(t,e*7,n)}function GTe(t,e,n){return FG(t,e*12,n)}function XTe(t,e){let n,r=e?.in;return t.forEach(s=>{!r&&typeof s=="object"&&(r=is.bind(null,s));const i=tr(s,r);(!n||n{!r&&typeof s=="object"&&(r=is.bind(null,s));const i=tr(s,r);(!n||n>i||isNaN(+i))&&(n=i)}),is(r,n||NaN)}function KTe(t,e,n){const[r,s]=Od(n?.in,t,e);return+jp(r)==+jp(s)}function HG(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function ZTe(t){return!(!HG(t)&&typeof t!="number"||isNaN(+tr(t)))}function JTe(t,e,n){const[r,s]=Od(n?.in,t,e),i=r.getFullYear()-s.getFullYear(),a=r.getMonth()-s.getMonth();return i*12+a}function e9e(t,e){const n=tr(t,e?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function QG(t,e){const[n,r]=Od(t,e.start,e.end);return{start:n,end:r}}function t9e(t,e){const{start:n,end:r}=QG(e?.in,t);let s=+n>+r;const i=s?+n:+r,a=s?r:n;a.setHours(0,0,0,0),a.setDate(1);let l=1;const c=[];for(;+a<=i;)c.push(is(n,a)),a.setMonth(a.getMonth()+l);return s?c.reverse():c}function n9e(t,e){const n=tr(t,e?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function r9e(t,e){const n=tr(t,e?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function VG(t,e){const n=tr(t,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function s9e(t,e){const{start:n,end:r}=QG(e?.in,t);let s=+n>+r;const i=s?+n:+r,a=s?r:n;a.setHours(0,0,0,0),a.setMonth(0,1);let l=1;const c=[];for(;+a<=i;)c.push(is(n,a)),a.setFullYear(a.getFullYear()+l);return s?c.reverse():c}function UG(t,e){const n=yg(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=tr(t,e?.in),i=s.getDay(),a=(i{let r;const s=a9e[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Vh(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const l9e={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},c9e={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},u9e={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},d9e={date:Vh({formats:l9e,defaultWidth:"full"}),time:Vh({formats:c9e,defaultWidth:"full"}),dateTime:Vh({formats:u9e,defaultWidth:"full"})},h9e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},f9e=(t,e,n,r)=>h9e[t];function ko(t){return(e,n)=>{const r=n?.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=n?.width?String(n.width):a;s=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=n?.width?String(n.width):t.defaultWidth;s=t.values[l]||t.values[a]}const i=t.argumentCallback?t.argumentCallback(e):e;return s[i]}}const m9e={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},p9e={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},g9e={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"]},x9e={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"]},v9e={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"}},y9e={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"}},b9e=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},w9e={ordinalNumber:b9e,era:ko({values:m9e,defaultWidth:"wide"}),quarter:ko({values:p9e,defaultWidth:"wide",argumentCallback:t=>t-1}),month:ko({values:g9e,defaultWidth:"wide"}),day:ko({values:x9e,defaultWidth:"wide"}),dayPeriod:ko({values:v9e,defaultWidth:"wide",formattingValues:y9e,defaultFormattingWidth:"wide"})};function Oo(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(s);if(!i)return null;const a=i[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?k9e(l,m=>m.test(a)):S9e(l,m=>m.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const h=e.slice(a.length);return{value:d,rest:h}}}function S9e(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function k9e(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const s=r[0],i=e.match(t.parsePattern);if(!i)return null;let a=t.valueCallback?t.valueCallback(i[0]):i[0];a=n.valueCallback?n.valueCallback(a):a;const l=e.slice(s.length);return{value:a,rest:l}}}const O9e=/^(\d+)(th|st|nd|rd)?/i,j9e=/\d+/i,N9e={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},C9e={any:[/^b/i,/^(a|c)/i]},T9e={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},E9e={any:[/1/i,/2/i,/3/i,/4/i]},_9e={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},A9e={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]},M9e={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},R9e={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]},D9e={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},P9e={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}},z9e={ordinalNumber:WG({matchPattern:O9e,parsePattern:j9e,valueCallback:t=>parseInt(t,10)}),era:Oo({matchPatterns:N9e,defaultMatchWidth:"wide",parsePatterns:C9e,defaultParseWidth:"any"}),quarter:Oo({matchPatterns:T9e,defaultMatchWidth:"wide",parsePatterns:E9e,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Oo({matchPatterns:_9e,defaultMatchWidth:"wide",parsePatterns:A9e,defaultParseWidth:"any"}),day:Oo({matchPatterns:M9e,defaultMatchWidth:"wide",parsePatterns:R9e,defaultParseWidth:"any"}),dayPeriod:Oo({matchPatterns:D9e,defaultMatchWidth:"any",parsePatterns:P9e,defaultParseWidth:"any"})},c7={code:"en-US",formatDistance:o9e,formatLong:d9e,formatRelative:f9e,localize:w9e,match:z9e,options:{weekStartsOn:0,firstWeekContainsDate:1}};function I9e(t,e){const n=tr(t,e?.in);return $G(n,VG(n))+1}function GG(t,e){const n=tr(t,e?.in),r=+Op(n)-+UTe(n);return Math.round(r/LG)+1}function XG(t,e){const n=tr(t,e?.in),r=n.getFullYear(),s=yg(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=is(e?.in||t,0);a.setFullYear(r+1,0,i),a.setHours(0,0,0,0);const l=su(a,e),c=is(e?.in||t,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const d=su(c,e);return+n>=+l?r+1:+n>=+d?r:r-1}function L9e(t,e){const n=yg(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=XG(t,e),i=is(e?.in||t,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),su(i,e)}function YG(t,e){const n=tr(t,e?.in),r=+su(n,e)-+L9e(n,e);return Math.round(r/LG)+1}function Wn(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const _c={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return Wn(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):Wn(n+1,2)},d(t,e){return Wn(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return Wn(t.getHours()%12||12,e.length)},H(t,e){return Wn(t.getHours(),e.length)},m(t,e){return Wn(t.getMinutes(),e.length)},s(t,e){return Wn(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return Wn(s,e.length)}},ph={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Sz={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return _c.y(t,e)},Y:function(t,e,n,r){const s=XG(t,r),i=s>0?s:1-s;if(e==="YY"){const a=i%100;return Wn(a,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):Wn(i,e.length)},R:function(t,e){const n=qG(t);return Wn(n,e.length)},u:function(t,e){const n=t.getFullYear();return Wn(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return Wn(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return Wn(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return _c.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return Wn(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const s=YG(t,r);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):Wn(s,e.length)},I:function(t,e,n){const r=GG(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):Wn(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):_c.d(t,e)},D:function(t,e,n){const r=I9e(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Wn(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return Wn(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return Wn(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),s=r===0?7:r;switch(e){case"i":return String(s);case"ii":return Wn(s,e.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const s=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let s;switch(r===12?s=ph.noon:r===0?s=ph.midnight:s=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let s;switch(r>=17?s=ph.evening:r>=12?s=ph.afternoon:r>=4?s=ph.morning:s=ph.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return _c.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):_c.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Wn(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):Wn(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):_c.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):_c.s(t,e)},S:function(t,e){return _c.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return Oz(r);case"XXXX":case"XX":return Bu(r);case"XXXXX":case"XXX":default:return Bu(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return Oz(r);case"xxxx":case"xx":return Bu(r);case"xxxxx":case"xxx":default:return Bu(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+kz(r,":");case"OOOO":default:return"GMT"+Bu(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+kz(r,":");case"zzzz":default:return"GMT"+Bu(r,":")}},t:function(t,e,n){const r=Math.trunc(+t/1e3);return Wn(r,e.length)},T:function(t,e,n){return Wn(+t,e.length)}};function kz(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=Math.trunc(r/60),i=r%60;return i===0?n+String(s):n+String(s)+e+Wn(i,2)}function Oz(t,e){return t%60===0?(t>0?"-":"+")+Wn(Math.abs(t)/60,2):Bu(t,e)}function Bu(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=Wn(Math.trunc(r/60),2),i=Wn(r%60,2);return n+s+e+i}const jz=(t,e)=>{switch(t){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"})}},KG=(t,e)=>{switch(t){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"})}},B9e=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return jz(t,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}}",jz(r,e)).replace("{{time}}",KG(s,e))},F9e={p:KG,P:B9e},q9e=/^D+$/,$9e=/^Y+$/,H9e=["D","DD","YY","YYYY"];function Q9e(t){return q9e.test(t)}function V9e(t){return $9e.test(t)}function U9e(t,e,n){const r=W9e(t,e,n);if(console.warn(r),H9e.includes(t))throw new RangeError(r)}function W9e(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const G9e=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,X9e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Y9e=/^'([^]*?)'?$/,K9e=/''/g,Z9e=/[a-zA-Z]/;function Ev(t,e,n){const r=yg(),s=n?.locale??r.locale??c7,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,l=tr(t,n?.in);if(!ZTe(l))throw new RangeError("Invalid time value");let c=e.match(X9e).map(h=>{const m=h[0];if(m==="p"||m==="P"){const g=F9e[m];return g(h,s.formatLong)}return h}).join("").match(G9e).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const m=h[0];if(m==="'")return{isToken:!1,value:J9e(h)};if(Sz[m])return{isToken:!0,value:h};if(m.match(Z9e))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:h}});s.localize.preprocessor&&(c=s.localize.preprocessor(l,c));const d={firstWeekContainsDate:i,weekStartsOn:a,locale:s};return c.map(h=>{if(!h.isToken)return h.value;const m=h.value;(!n?.useAdditionalWeekYearTokens&&V9e(m)||!n?.useAdditionalDayOfYearTokens&&Q9e(m))&&U9e(m,e,String(t));const g=Sz[m[0]];return g(l,m,s.localize,d)}).join("")}function J9e(t){const e=t.match(Y9e);return e?e[1].replace(K9e,"'"):t}function eEe(t,e){const n=tr(t,e?.in),r=n.getFullYear(),s=n.getMonth(),i=is(n,0);return i.setFullYear(r,s+1,0),i.setHours(0,0,0,0),i.getDate()}function tEe(t,e){return tr(t,e?.in).getMonth()}function nEe(t,e){return tr(t,e?.in).getFullYear()}function rEe(t,e){return+tr(t)>+tr(e)}function sEe(t,e){return+tr(t)<+tr(e)}function iEe(t,e,n){const[r,s]=Od(n?.in,t,e);return+su(r,n)==+su(s,n)}function aEe(t,e,n){const[r,s]=Od(n?.in,t,e);return r.getFullYear()===s.getFullYear()&&r.getMonth()===s.getMonth()}function oEe(t,e,n){const[r,s]=Od(n?.in,t,e);return r.getFullYear()===s.getFullYear()}function lEe(t,e,n){const r=tr(t,n?.in),s=r.getFullYear(),i=r.getDate(),a=is(t,0);a.setFullYear(s,e,15),a.setHours(0,0,0,0);const l=eEe(a);return r.setMonth(e,Math.min(i,l)),r}function cEe(t,e,n){const r=tr(t,n?.in);return isNaN(+r)?is(t,NaN):(r.setFullYear(e),r)}const Nz=5,uEe=4;function dEe(t,e){const n=e.startOfMonth(t),r=n.getDay()>0?n.getDay():7,s=e.addDays(t,-r+1),i=e.addDays(s,Nz*7-1);return e.getMonth(t)===e.getMonth(i)?Nz:uEe}function ZG(t,e){const n=e.startOfMonth(t),r=n.getDay();return r===1?n:r===0?e.addDays(n,-6):e.addDays(n,-1*(r-1))}function hEe(t,e){const n=ZG(t,e),r=dEe(t,e);return e.addDays(n,r*7-1)}class Ki{constructor(e,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?Fs.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 Fs(r,s,i,this.options.timeZone):new Date(r,s,i),this.addDays=(r,s)=>this.overrides?.addDays?this.overrides.addDays(r,s):BG(r,s),this.addMonths=(r,s)=>this.overrides?.addMonths?this.overrides.addMonths(r,s):FG(r,s),this.addWeeks=(r,s)=>this.overrides?.addWeeks?this.overrides.addWeeks(r,s):WTe(r,s),this.addYears=(r,s)=>this.overrides?.addYears?this.overrides.addYears(r,s):GTe(r,s),this.differenceInCalendarDays=(r,s)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,s):$G(r,s),this.differenceInCalendarMonths=(r,s)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,s):JTe(r,s),this.eachMonthOfInterval=r=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):t9e(r),this.eachYearOfInterval=r=>{const s=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(r):s9e(r),i=new Set(s.map(l=>this.getYear(l)));if(i.size===s.length)return s;const a=[];return i.forEach(l=>{a.push(new Date(l,0,1))}),a},this.endOfBroadcastWeek=r=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):hEe(r,this),this.endOfISOWeek=r=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(r):i9e(r),this.endOfMonth=r=>this.overrides?.endOfMonth?this.overrides.endOfMonth(r):e9e(r),this.endOfWeek=(r,s)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(r,s):UG(r,this.options),this.endOfYear=r=>this.overrides?.endOfYear?this.overrides.endOfYear(r):r9e(r),this.format=(r,s,i)=>{const a=this.overrides?.format?this.overrides.format(r,s,this.options):Ev(r,s,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(a):a},this.getISOWeek=r=>this.overrides?.getISOWeek?this.overrides.getISOWeek(r):GG(r),this.getMonth=(r,s)=>this.overrides?.getMonth?this.overrides.getMonth(r,this.options):tEe(r,this.options),this.getYear=(r,s)=>this.overrides?.getYear?this.overrides.getYear(r,this.options):nEe(r,this.options),this.getWeek=(r,s)=>this.overrides?.getWeek?this.overrides.getWeek(r,this.options):YG(r,this.options),this.isAfter=(r,s)=>this.overrides?.isAfter?this.overrides.isAfter(r,s):rEe(r,s),this.isBefore=(r,s)=>this.overrides?.isBefore?this.overrides.isBefore(r,s):sEe(r,s),this.isDate=r=>this.overrides?.isDate?this.overrides.isDate(r):HG(r),this.isSameDay=(r,s)=>this.overrides?.isSameDay?this.overrides.isSameDay(r,s):KTe(r,s),this.isSameMonth=(r,s)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(r,s):aEe(r,s),this.isSameYear=(r,s)=>this.overrides?.isSameYear?this.overrides.isSameYear(r,s):oEe(r,s),this.max=r=>this.overrides?.max?this.overrides.max(r):XTe(r),this.min=r=>this.overrides?.min?this.overrides.min(r):YTe(r),this.setMonth=(r,s)=>this.overrides?.setMonth?this.overrides.setMonth(r,s):lEe(r,s),this.setYear=(r,s)=>this.overrides?.setYear?this.overrides.setYear(r,s):cEe(r,s),this.startOfBroadcastWeek=(r,s)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):ZG(r,this),this.startOfDay=r=>this.overrides?.startOfDay?this.overrides.startOfDay(r):jp(r),this.startOfISOWeek=r=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(r):Op(r),this.startOfMonth=r=>this.overrides?.startOfMonth?this.overrides.startOfMonth(r):n9e(r),this.startOfWeek=(r,s)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(r,this.options):su(r,this.options),this.startOfYear=r=>this.overrides?.startOfYear?this.overrides.startOfYear(r):VG(r),this.options={locale:c7,...e},this.overrides=n}getDigitMap(){const{numerals:e="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:e}),r={};for(let s=0;s<10;s++)r[s.toString()]=n.format(s);return r}replaceDigits(e){const n=this.getDigitMap();return e.replace(/\d/g,r=>n[r]||r)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){const e=this.options.locale?.code;return e&&Ki.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:n,timeZone:r,numerals:s}=this.options,i=n?.code;if(i&&Ki.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:r,numberingSystem:s}).format(e)}catch{}const a=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(e,a)}}Ki.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 Xo=new Ki;class JG{constructor(e,n,r=Xo){this.date=e,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(e,n)),this.dateLib=r}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class fEe{constructor(e,n){this.date=e,this.weeks=n}}class mEe{constructor(e,n){this.days=n,this.weekNumber=e}}function pEe(t){return ae.createElement("button",{...t})}function gEe(t){return ae.createElement("span",{...t})}function xEe(t){const{size:e=24,orientation:n="left",className:r}=t;return ae.createElement("svg",{className:r,width:e,height:e,viewBox:"0 0 24 24"},n==="up"&&ae.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&ae.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&ae.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&ae.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function vEe(t){const{day:e,modifiers:n,...r}=t;return ae.createElement("td",{...r})}function yEe(t){const{day:e,modifiers:n,...r}=t,s=ae.useRef(null);return ae.useEffect(()=>{n.focused&&s.current?.focus()},[n.focused]),ae.createElement("button",{ref:s,...r})}var jt;(function(t){t.Root="root",t.Chevron="chevron",t.Day="day",t.DayButton="day_button",t.CaptionLabel="caption_label",t.Dropdowns="dropdowns",t.Dropdown="dropdown",t.DropdownRoot="dropdown_root",t.Footer="footer",t.MonthGrid="month_grid",t.MonthCaption="month_caption",t.MonthsDropdown="months_dropdown",t.Month="month",t.Months="months",t.Nav="nav",t.NextMonthButton="button_next",t.PreviousMonthButton="button_previous",t.Week="week",t.Weeks="weeks",t.Weekday="weekday",t.Weekdays="weekdays",t.WeekNumber="week_number",t.WeekNumberHeader="week_number_header",t.YearsDropdown="years_dropdown"})(jt||(jt={}));var Ar;(function(t){t.disabled="disabled",t.hidden="hidden",t.outside="outside",t.focused="focused",t.today="today"})(Ar||(Ar={}));var Ua;(function(t){t.range_end="range_end",t.range_middle="range_middle",t.range_start="range_start",t.selected="selected"})(Ua||(Ua={}));var Hi;(function(t){t.weeks_before_enter="weeks_before_enter",t.weeks_before_exit="weeks_before_exit",t.weeks_after_enter="weeks_after_enter",t.weeks_after_exit="weeks_after_exit",t.caption_after_enter="caption_after_enter",t.caption_after_exit="caption_after_exit",t.caption_before_enter="caption_before_enter",t.caption_before_exit="caption_before_exit"})(Hi||(Hi={}));function bEe(t){const{options:e,className:n,components:r,classNames:s,...i}=t,a=[s[jt.Dropdown],n].join(" "),l=e?.find(({value:c})=>c===i.value);return ae.createElement("span",{"data-disabled":i.disabled,className:s[jt.DropdownRoot]},ae.createElement(r.Select,{className:a,...i},e?.map(({value:c,label:d,disabled:h})=>ae.createElement(r.Option,{key:c,value:c,disabled:h},d))),ae.createElement("span",{className:s[jt.CaptionLabel],"aria-hidden":!0},l?.label,ae.createElement(r.Chevron,{orientation:"down",size:18,className:s[jt.Chevron]})))}function wEe(t){return ae.createElement("div",{...t})}function SEe(t){return ae.createElement("div",{...t})}function kEe(t){const{calendarMonth:e,displayIndex:n,...r}=t;return ae.createElement("div",{...r},t.children)}function OEe(t){const{calendarMonth:e,displayIndex:n,...r}=t;return ae.createElement("div",{...r})}function jEe(t){return ae.createElement("table",{...t})}function NEe(t){return ae.createElement("div",{...t})}const eX=b.createContext(void 0);function bg(){const t=b.useContext(eX);if(t===void 0)throw new Error("useDayPicker() must be used within a custom component.");return t}function CEe(t){const{components:e}=bg();return ae.createElement(e.Dropdown,{...t})}function TEe(t){const{onPreviousClick:e,onNextClick:n,previousMonth:r,nextMonth:s,...i}=t,{components:a,classNames:l,labels:{labelPrevious:c,labelNext:d}}=bg(),h=b.useCallback(g=>{s&&n?.(g)},[s,n]),m=b.useCallback(g=>{r&&e?.(g)},[r,e]);return ae.createElement("nav",{...i},ae.createElement(a.PreviousMonthButton,{type:"button",className:l[jt.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:m},ae.createElement(a.Chevron,{disabled:r?void 0:!0,className:l[jt.Chevron],orientation:"left"})),ae.createElement(a.NextMonthButton,{type:"button",className:l[jt.NextMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":d(s),onClick:h},ae.createElement(a.Chevron,{disabled:s?void 0:!0,orientation:"right",className:l[jt.Chevron]})))}function EEe(t){const{components:e}=bg();return ae.createElement(e.Button,{...t})}function _Ee(t){return ae.createElement("option",{...t})}function AEe(t){const{components:e}=bg();return ae.createElement(e.Button,{...t})}function MEe(t){const{rootRef:e,...n}=t;return ae.createElement("div",{...n,ref:e})}function REe(t){return ae.createElement("select",{...t})}function DEe(t){const{week:e,...n}=t;return ae.createElement("tr",{...n})}function PEe(t){return ae.createElement("th",{...t})}function zEe(t){return ae.createElement("thead",{"aria-hidden":!0},ae.createElement("tr",{...t}))}function IEe(t){const{week:e,...n}=t;return ae.createElement("th",{...n})}function LEe(t){return ae.createElement("th",{...t})}function BEe(t){return ae.createElement("tbody",{...t})}function FEe(t){const{components:e}=bg();return ae.createElement(e.Dropdown,{...t})}const qEe=Object.freeze(Object.defineProperty({__proto__:null,Button:pEe,CaptionLabel:gEe,Chevron:xEe,Day:vEe,DayButton:yEe,Dropdown:bEe,DropdownNav:wEe,Footer:SEe,Month:kEe,MonthCaption:OEe,MonthGrid:jEe,Months:NEe,MonthsDropdown:CEe,Nav:TEe,NextMonthButton:EEe,Option:_Ee,PreviousMonthButton:AEe,Root:MEe,Select:REe,Week:DEe,WeekNumber:IEe,WeekNumberHeader:LEe,Weekday:PEe,Weekdays:zEe,Weeks:BEe,YearsDropdown:FEe},Symbol.toStringTag,{value:"Module"}));function Dl(t,e,n=!1,r=Xo){let{from:s,to:i}=t;const{differenceInCalendarDays:a,isSameDay:l}=r;return s&&i?(a(i,s)<0&&([s,i]=[i,s]),a(e,s)>=(n?1:0)&&a(i,e)>=(n?1:0)):!n&&i?l(i,e):!n&&s?l(s,e):!1}function tX(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function u7(t){return!!(t&&typeof t=="object"&&"from"in t)}function nX(t){return!!(t&&typeof t=="object"&&"after"in t)}function rX(t){return!!(t&&typeof t=="object"&&"before"in t)}function sX(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function iX(t,e){return Array.isArray(t)&&t.every(e.isDate)}function Pl(t,e,n=Xo){const r=Array.isArray(e)?e:[e],{isSameDay:s,differenceInCalendarDays:i,isAfter:a}=n;return r.some(l=>{if(typeof l=="boolean")return l;if(n.isDate(l))return s(t,l);if(iX(l,n))return l.includes(t);if(u7(l))return Dl(l,t,!1,n);if(sX(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(t.getDay()):l.dayOfWeek===t.getDay();if(tX(l)){const c=i(l.before,t),d=i(l.after,t),h=c>0,m=d<0;return a(l.before,l.after)?m&&h:h||m}return nX(l)?i(t,l.after)>0:rX(l)?i(l.before,t)>0:typeof l=="function"?l(t):!1})}function $Ee(t,e,n,r,s){const{disabled:i,hidden:a,modifiers:l,showOutsideDays:c,broadcastCalendar:d,today:h}=e,{isSameDay:m,isSameMonth:g,startOfMonth:x,isBefore:y,endOfMonth:w,isAfter:S}=s,k=n&&x(n),j=r&&w(r),N={[Ar.focused]:[],[Ar.outside]:[],[Ar.disabled]:[],[Ar.hidden]:[],[Ar.today]:[]},T={};for(const E of t){const{date:_,displayMonth:A}=E,L=!!(A&&!g(_,A)),P=!!(k&&y(_,k)),B=!!(j&&S(_,j)),$=!!(i&&Pl(_,i,s)),U=!!(a&&Pl(_,a,s))||P||B||!d&&!c&&L||d&&c===!1&&L,te=m(_,h??s.today());L&&N.outside.push(E),$&&N.disabled.push(E),U&&N.hidden.push(E),te&&N.today.push(E),l&&Object.keys(l).forEach(z=>{const Q=l?.[z];Q&&Pl(_,Q,s)&&(T[z]?T[z].push(E):T[z]=[E])})}return E=>{const _={[Ar.focused]:!1,[Ar.disabled]:!1,[Ar.hidden]:!1,[Ar.outside]:!1,[Ar.today]:!1},A={};for(const L in N){const P=N[L];_[L]=P.some(B=>B===E)}for(const L in T)A[L]=T[L].some(P=>P===E);return{..._,...A}}}function HEe(t,e,n={}){return Object.entries(t).filter(([,s])=>s===!0).reduce((s,[i])=>(n[i]?s.push(n[i]):e[Ar[i]]?s.push(e[Ar[i]]):e[Ua[i]]&&s.push(e[Ua[i]]),s),[e[jt.Day]])}function QEe(t){return{...qEe,...t}}function VEe(t){const e={"data-mode":t.mode??void 0,"data-required":"required"in t?t.required:void 0,"data-multiple-months":t.numberOfMonths&&t.numberOfMonths>1||void 0,"data-week-numbers":t.showWeekNumber||void 0,"data-broadcast-calendar":t.broadcastCalendar||void 0,"data-nav-layout":t.navLayout||void 0};return Object.entries(t).forEach(([n,r])=>{n.startsWith("data-")&&(e[n]=r)}),e}function d7(){const t={};for(const e in jt)t[jt[e]]=`rdp-${jt[e]}`;for(const e in Ar)t[Ar[e]]=`rdp-${Ar[e]}`;for(const e in Ua)t[Ua[e]]=`rdp-${Ua[e]}`;for(const e in Hi)t[Hi[e]]=`rdp-${Hi[e]}`;return t}function aX(t,e,n){return(n??new Ki(e)).formatMonthYear(t)}const UEe=aX;function WEe(t,e,n){return(n??new Ki(e)).format(t,"d")}function GEe(t,e=Xo){return e.format(t,"LLLL")}function XEe(t,e,n){return(n??new Ki(e)).format(t,"cccccc")}function YEe(t,e=Xo){return t<10?e.formatNumber(`0${t.toLocaleString()}`):e.formatNumber(`${t.toLocaleString()}`)}function KEe(){return""}function oX(t,e=Xo){return e.format(t,"yyyy")}const ZEe=oX,JEe=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:aX,formatDay:WEe,formatMonthCaption:UEe,formatMonthDropdown:GEe,formatWeekNumber:YEe,formatWeekNumberHeader:KEe,formatWeekdayName:XEe,formatYearCaption:ZEe,formatYearDropdown:oX},Symbol.toStringTag,{value:"Module"}));function e_e(t){return t?.formatMonthCaption&&!t.formatCaption&&(t.formatCaption=t.formatMonthCaption),t?.formatYearCaption&&!t.formatYearDropdown&&(t.formatYearDropdown=t.formatYearCaption),{...JEe,...t}}function t_e(t,e,n,r,s){const{startOfMonth:i,startOfYear:a,endOfYear:l,eachMonthOfInterval:c,getMonth:d}=s;return c({start:a(t),end:l(t)}).map(g=>{const x=r.formatMonthDropdown(g,s),y=d(g),w=e&&gi(n)||!1;return{value:y,label:x,disabled:w}})}function n_e(t,e={},n={}){let r={...e?.[jt.Day]};return Object.entries(t).filter(([,s])=>s===!0).forEach(([s])=>{r={...r,...n?.[s]}}),r}function r_e(t,e,n){const r=t.today(),s=e?t.startOfISOWeek(r):t.startOfWeek(r),i=[];for(let a=0;a<7;a++){const l=t.addDays(s,a);i.push(l)}return i}function s_e(t,e,n,r,s=!1){if(!t||!e)return;const{startOfYear:i,endOfYear:a,eachYearOfInterval:l,getYear:c}=r,d=i(t),h=a(e),m=l({start:d,end:h});return s&&m.reverse(),m.map(g=>{const x=n.formatYearDropdown(g,r);return{value:c(g),label:x,disabled:!1}})}function lX(t,e,n,r){let s=(r??new Ki(n)).format(t,"PPPP");return e.today&&(s=`Today, ${s}`),e.selected&&(s=`${s}, selected`),s}const i_e=lX;function cX(t,e,n){return(n??new Ki(e)).formatMonthYear(t)}const a_e=cX;function o_e(t,e,n,r){let s=(r??new Ki(n)).format(t,"PPPP");return e?.today&&(s=`Today, ${s}`),s}function l_e(t){return"Choose the Month"}function c_e(){return""}function u_e(t){return"Go to the Next Month"}function d_e(t){return"Go to the Previous Month"}function h_e(t,e,n){return(n??new Ki(e)).format(t,"cccc")}function f_e(t,e){return`Week ${t}`}function m_e(t){return"Week Number"}function p_e(t){return"Choose the Year"}const g_e=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:a_e,labelDay:i_e,labelDayButton:lX,labelGrid:cX,labelGridcell:o_e,labelMonthDropdown:l_e,labelNav:c_e,labelNext:u_e,labelPrevious:d_e,labelWeekNumber:f_e,labelWeekNumberHeader:m_e,labelWeekday:h_e,labelYearDropdown:p_e},Symbol.toStringTag,{value:"Module"})),wg=t=>t instanceof HTMLElement?t:null,Y3=t=>[...t.querySelectorAll("[data-animated-month]")??[]],x_e=t=>wg(t.querySelector("[data-animated-month]")),K3=t=>wg(t.querySelector("[data-animated-caption]")),Z3=t=>wg(t.querySelector("[data-animated-weeks]")),v_e=t=>wg(t.querySelector("[data-animated-nav]")),y_e=t=>wg(t.querySelector("[data-animated-weekdays]"));function b_e(t,e,{classNames:n,months:r,focused:s,dateLib:i}){const a=b.useRef(null),l=b.useRef(r),c=b.useRef(!1);b.useLayoutEffect(()=>{const d=l.current;if(l.current=r,!e||!t.current||!(t.current instanceof HTMLElement)||r.length===0||d.length===0||r.length!==d.length)return;const h=i.isSameMonth(r[0].date,d[0].date),m=i.isAfter(r[0].date,d[0].date),g=m?n[Hi.caption_after_enter]:n[Hi.caption_before_enter],x=m?n[Hi.weeks_after_enter]:n[Hi.weeks_before_enter],y=a.current,w=t.current.cloneNode(!0);if(w instanceof HTMLElement?(Y3(w).forEach(N=>{if(!(N instanceof HTMLElement))return;const T=x_e(N);T&&N.contains(T)&&N.removeChild(T);const E=K3(N);E&&E.classList.remove(g);const _=Z3(N);_&&_.classList.remove(x)}),a.current=w):a.current=null,c.current||h||s)return;const S=y instanceof HTMLElement?Y3(y):[],k=Y3(t.current);if(k?.every(j=>j instanceof HTMLElement)&&S&&S.every(j=>j instanceof HTMLElement)){c.current=!0,t.current.style.isolation="isolate";const j=v_e(t.current);j&&(j.style.zIndex="1"),k.forEach((N,T)=>{const E=S[T];if(!E)return;N.style.position="relative",N.style.overflow="hidden";const _=K3(N);_&&_.classList.add(g);const A=Z3(N);A&&A.classList.add(x);const L=()=>{c.current=!1,t.current&&(t.current.style.isolation=""),j&&(j.style.zIndex=""),_&&_.classList.remove(g),A&&A.classList.remove(x),N.style.position="",N.style.overflow="",N.contains(E)&&N.removeChild(E)};E.style.pointerEvents="none",E.style.position="absolute",E.style.overflow="hidden",E.setAttribute("aria-hidden","true");const P=y_e(E);P&&(P.style.opacity="0");const B=K3(E);B&&(B.classList.add(m?n[Hi.caption_before_exit]:n[Hi.caption_after_exit]),B.addEventListener("animationend",L));const $=Z3(E);$&&$.classList.add(m?n[Hi.weeks_before_exit]:n[Hi.weeks_after_exit]),N.insertBefore(E,N.firstChild)})}})}function w_e(t,e,n,r){const s=t[0],i=t[t.length-1],{ISOWeek:a,fixedWeeks:l,broadcastCalendar:c}=n??{},{addDays:d,differenceInCalendarDays:h,differenceInCalendarMonths:m,endOfBroadcastWeek:g,endOfISOWeek:x,endOfMonth:y,endOfWeek:w,isAfter:S,startOfBroadcastWeek:k,startOfISOWeek:j,startOfWeek:N}=r,T=c?k(s,r):a?j(s):N(s),E=c?g(i):a?x(y(i)):w(y(i)),_=h(E,T),A=m(i,s)+1,L=[];for(let $=0;$<=_;$++){const U=d(T,$);if(e&&S(U,e))break;L.push(U)}const B=(c?35:42)*A;if(l&&L.length{const s=r.weeks.reduce((i,a)=>i.concat(a.days.slice()),e.slice());return n.concat(s.slice())},e.slice())}function k_e(t,e,n,r){const{numberOfMonths:s=1}=n,i=[];for(let a=0;ae)break;i.push(l)}return i}function Cz(t,e,n,r){const{month:s,defaultMonth:i,today:a=r.today(),numberOfMonths:l=1}=t;let c=s||i||a;const{differenceInCalendarMonths:d,addMonths:h,startOfMonth:m}=r;if(n&&d(n,c){const k=n.broadcastCalendar?m(S,r):n.ISOWeek?g(S):x(S),j=n.broadcastCalendar?i(S):n.ISOWeek?a(l(S)):c(l(S)),N=e.filter(A=>A>=k&&A<=j),T=n.broadcastCalendar?35:42;if(n.fixedWeeks&&N.length{const P=T-N.length;return L>j&&L<=s(j,P)});N.push(...A)}const E=N.reduce((A,L)=>{const P=n.ISOWeek?d(L):h(L),B=A.find(U=>U.weekNumber===P),$=new JG(L,S,r);return B?B.days.push($):A.push(new mEe(P,[$])),A},[]),_=new fEe(S,E);return w.push(_),w},[]);return n.reverseMonths?y.reverse():y}function j_e(t,e){let{startMonth:n,endMonth:r}=t;const{startOfYear:s,startOfDay:i,startOfMonth:a,endOfMonth:l,addYears:c,endOfYear:d,newDate:h,today:m}=e,{fromYear:g,toYear:x,fromMonth:y,toMonth:w}=t;!n&&y&&(n=y),!n&&g&&(n=e.newDate(g,0,1)),!r&&w&&(r=w),!r&&x&&(r=h(x,11,31));const S=t.captionLayout==="dropdown"||t.captionLayout==="dropdown-years";return n?n=a(n):g?n=h(g,0,1):!n&&S&&(n=s(c(t.today??m(),-100))),r?r=l(r):x?r=h(x,11,31):!r&&S&&(r=d(t.today??m())),[n&&i(n),r&&i(r)]}function N_e(t,e,n,r){if(n.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i=1}=n,{startOfMonth:a,addMonths:l,differenceInCalendarMonths:c}=r,d=s?i:1,h=a(t);if(!e)return l(h,d);if(!(c(e,t)n.concat(r.weeks.slice()),e.slice())}function nw(t,e){const[n,r]=b.useState(t);return[e===void 0?n:e,r]}function E_e(t,e){const[n,r]=j_e(t,e),{startOfMonth:s,endOfMonth:i}=e,a=Cz(t,n,r,e),[l,c]=nw(a,t.month?a:void 0);b.useEffect(()=>{const _=Cz(t,n,r,e);c(_)},[t.timeZone]);const d=k_e(l,r,t,e),h=w_e(d,t.endMonth?i(t.endMonth):void 0,t,e),m=O_e(d,h,t,e),g=T_e(m),x=S_e(m),y=C_e(l,n,t,e),w=N_e(l,r,t,e),{disableNavigation:S,onMonthChange:k}=t,j=_=>g.some(A=>A.days.some(L=>L.isEqualTo(_))),N=_=>{if(S)return;let A=s(_);n&&As(r)&&(A=s(r)),c(A),k?.(A)};return{months:m,weeks:g,days:x,navStart:n,navEnd:r,previousMonth:y,nextMonth:w,goToMonth:N,goToDay:_=>{j(_)||N(_.date)}}}var xo;(function(t){t[t.Today=0]="Today",t[t.Selected=1]="Selected",t[t.LastFocused=2]="LastFocused",t[t.FocusedModifier=3]="FocusedModifier"})(xo||(xo={}));function Tz(t){return!t[Ar.disabled]&&!t[Ar.hidden]&&!t[Ar.outside]}function __e(t,e,n,r){let s,i=-1;for(const a of t){const l=e(a);Tz(l)&&(l[Ar.focused]&&iTz(e(a)))),s}function A_e(t,e,n,r,s,i,a){const{ISOWeek:l,broadcastCalendar:c}=i,{addDays:d,addMonths:h,addWeeks:m,addYears:g,endOfBroadcastWeek:x,endOfISOWeek:y,endOfWeek:w,max:S,min:k,startOfBroadcastWeek:j,startOfISOWeek:N,startOfWeek:T}=a;let _={day:d,week:m,month:h,year:g,startOfWeek:A=>c?j(A,a):l?N(A):T(A),endOfWeek:A=>c?x(A):l?y(A):w(A)}[t](n,e==="after"?1:-1);return e==="before"&&r?_=S([r,_]):e==="after"&&s&&(_=k([s,_])),_}function uX(t,e,n,r,s,i,a,l=0){if(l>365)return;const c=A_e(t,e,n.date,r,s,i,a),d=!!(i.disabled&&Pl(c,i.disabled,a)),h=!!(i.hidden&&Pl(c,i.hidden,a)),m=c,g=new JG(c,m,a);return!d&&!h?g:uX(t,e,g,r,s,i,a,l+1)}function M_e(t,e,n,r,s){const{autoFocus:i}=t,[a,l]=b.useState(),c=__e(e.days,n,r||(()=>!1),a),[d,h]=b.useState(i?c:void 0);return{isFocusTarget:w=>!!c?.isEqualTo(w),setFocused:h,focused:d,blur:()=>{l(d),h(void 0)},moveFocus:(w,S)=>{if(!d)return;const k=uX(w,S,d,e.navStart,e.navEnd,t,s);k&&(t.disableNavigation&&!e.days.some(N=>N.isEqualTo(k))||(e.goToDay(k),h(k)))}}}function R_e(t,e){const{selected:n,required:r,onSelect:s}=t,[i,a]=nw(n,s?n:void 0),l=s?n:i,{isSameDay:c}=e,d=x=>l?.some(y=>c(y,x))??!1,{min:h,max:m}=t;return{selected:l,select:(x,y,w)=>{let S=[...l??[]];if(d(x)){if(l?.length===h||r&&l?.length===1)return;S=l?.filter(k=>!c(k,x))}else l?.length===m?S=[x]:S=[...S,x];return s||a(S),s?.(S,x,y,w),S},isSelected:d}}function D_e(t,e,n=0,r=0,s=!1,i=Xo){const{from:a,to:l}=e||{},{isSameDay:c,isAfter:d,isBefore:h}=i;let m;if(!a&&!l)m={from:t,to:n>0?void 0:t};else if(a&&!l)c(a,t)?n===0?m={from:a,to:t}:s?m={from:a,to:void 0}:m=void 0:h(t,a)?m={from:t,to:a}:m={from:a,to:t};else if(a&&l)if(c(a,t)&&c(l,t))s?m={from:a,to:l}:m=void 0;else if(c(a,t))m={from:a,to:n>0?void 0:t};else if(c(l,t))m={from:t,to:n>0?void 0:t};else if(h(t,a))m={from:t,to:l};else if(d(t,a))m={from:a,to:t};else if(d(t,l))m={from:a,to:t};else throw new Error("Invalid range");if(m?.from&&m?.to){const g=i.differenceInCalendarDays(m.to,m.from);r>0&&g>r?m={from:t,to:void 0}:n>1&&gtypeof l!="function").some(l=>typeof l=="boolean"?l:n.isDate(l)?Dl(t,l,!1,n):iX(l,n)?l.some(c=>Dl(t,c,!1,n)):u7(l)?l.from&&l.to?Ez(t,{from:l.from,to:l.to},n):!1:sX(l)?P_e(t,l.dayOfWeek,n):tX(l)?n.isAfter(l.before,l.after)?Ez(t,{from:n.addDays(l.after,1),to:n.addDays(l.before,-1)},n):Pl(t.from,l,n)||Pl(t.to,l,n):nX(l)||rX(l)?Pl(t.from,l,n)||Pl(t.to,l,n):!1))return!0;const a=r.filter(l=>typeof l=="function");if(a.length){let l=t.from;const c=n.differenceInCalendarDays(t.to,t.from);for(let d=0;d<=c;d++){if(a.some(h=>h(l)))return!0;l=n.addDays(l,1)}}return!1}function I_e(t,e){const{disabled:n,excludeDisabled:r,selected:s,required:i,onSelect:a}=t,[l,c]=nw(s,a?s:void 0),d=a?s:l;return{selected:d,select:(g,x,y)=>{const{min:w,max:S}=t,k=g?D_e(g,d,w,S,i,e):void 0;return r&&n&&k?.from&&k.to&&z_e({from:k.from,to:k.to},n,e)&&(k.from=g,k.to=void 0),a||c(k),a?.(k,g,x,y),k},isSelected:g=>d&&Dl(d,g,!1,e)}}function L_e(t,e){const{selected:n,required:r,onSelect:s}=t,[i,a]=nw(n,s?n:void 0),l=s?n:i,{isSameDay:c}=e;return{selected:l,select:(m,g,x)=>{let y=m;return!r&&l&&l&&c(m,l)&&(y=void 0),s||a(y),s?.(y,m,g,x),y},isSelected:m=>l?c(l,m):!1}}function B_e(t,e){const n=L_e(t,e),r=R_e(t,e),s=I_e(t,e);switch(t.mode){case"single":return n;case"multiple":return r;case"range":return s;default:return}}function F_e(t){let e=t;e.timeZone&&(e={...t},e.today&&(e.today=new Fs(e.today,e.timeZone)),e.month&&(e.month=new Fs(e.month,e.timeZone)),e.defaultMonth&&(e.defaultMonth=new Fs(e.defaultMonth,e.timeZone)),e.startMonth&&(e.startMonth=new Fs(e.startMonth,e.timeZone)),e.endMonth&&(e.endMonth=new Fs(e.endMonth,e.timeZone)),e.mode==="single"&&e.selected?e.selected=new Fs(e.selected,e.timeZone):e.mode==="multiple"&&e.selected?e.selected=e.selected?.map(Pe=>new Fs(Pe,e.timeZone)):e.mode==="range"&&e.selected&&(e.selected={from:e.selected.from?new Fs(e.selected.from,e.timeZone):void 0,to:e.selected.to?new Fs(e.selected.to,e.timeZone):void 0}));const{components:n,formatters:r,labels:s,dateLib:i,locale:a,classNames:l}=b.useMemo(()=>{const Pe={...c7,...e.locale};return{dateLib:new Ki({locale:Pe,weekStartsOn:e.broadcastCalendar?1:e.weekStartsOn,firstWeekContainsDate:e.firstWeekContainsDate,useAdditionalWeekYearTokens:e.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:e.useAdditionalDayOfYearTokens,timeZone:e.timeZone,numerals:e.numerals},e.dateLib),components:QEe(e.components),formatters:e_e(e.formatters),labels:{...g_e,...e.labels},locale:Pe,classNames:{...d7(),...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:c,mode:d,navLayout:h,numberOfMonths:m=1,onDayBlur:g,onDayClick:x,onDayFocus:y,onDayKeyDown:w,onDayMouseEnter:S,onDayMouseLeave:k,onNextClick:j,onPrevClick:N,showWeekNumber:T,styles:E}=e,{formatCaption:_,formatDay:A,formatMonthDropdown:L,formatWeekNumber:P,formatWeekNumberHeader:B,formatWeekdayName:$,formatYearDropdown:U}=r,te=E_e(e,i),{days:z,months:Q,navStart:F,navEnd:Y,previousMonth:J,nextMonth:X,goToMonth:R}=te,ie=$Ee(z,e,F,Y,i),{isSelected:G,select:I,selected:V}=B_e(e,i)??{},{blur:ee,focused:ne,isFocusTarget:W,moveFocus:se,setFocused:re}=M_e(e,te,ie,G??(()=>!1),i),{labelDayButton:oe,labelGridcell:Te,labelGrid:We,labelMonthDropdown:Ye,labelNav:Je,labelPrevious:Oe,labelNext:Ve,labelWeekday:Ue,labelWeekNumber:He,labelWeekNumberHeader:Ot,labelYearDropdown:xt}=s,kn=b.useMemo(()=>r_e(i,e.ISOWeek),[i,e.ISOWeek]),It=d!==void 0||x!==void 0,Yt=b.useCallback(()=>{J&&(R(J),N?.(J))},[J,R,N]),_t=b.useCallback(()=>{X&&(R(X),j?.(X))},[R,X,j]),mt=b.useCallback((Pe,it)=>ot=>{ot.preventDefault(),ot.stopPropagation(),re(Pe),I?.(Pe.date,it,ot),x?.(Pe.date,it,ot)},[I,x,re]),Ne=b.useCallback((Pe,it)=>ot=>{re(Pe),y?.(Pe.date,it,ot)},[y,re]),Ie=b.useCallback((Pe,it)=>ot=>{ee(),g?.(Pe.date,it,ot)},[ee,g]),st=b.useCallback((Pe,it)=>ot=>{const nn={ArrowLeft:[ot.shiftKey?"month":"day",e.dir==="rtl"?"after":"before"],ArrowRight:[ot.shiftKey?"month":"day",e.dir==="rtl"?"before":"after"],ArrowDown:[ot.shiftKey?"year":"week","after"],ArrowUp:[ot.shiftKey?"year":"week","before"],PageUp:[ot.shiftKey?"year":"month","before"],PageDown:[ot.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(nn[ot.key]){ot.preventDefault(),ot.stopPropagation();const[Kt,pt]=nn[ot.key];se(Kt,pt)}w?.(Pe.date,it,ot)},[se,w,e.dir]),yt=b.useCallback((Pe,it)=>ot=>{S?.(Pe.date,it,ot)},[S]),Pt=b.useCallback((Pe,it)=>ot=>{k?.(Pe.date,it,ot)},[k]),Mt=b.useCallback(Pe=>it=>{const ot=Number(it.target.value),nn=i.setMonth(i.startOfMonth(Pe),ot);R(nn)},[i,R]),zn=b.useCallback(Pe=>it=>{const ot=Number(it.target.value),nn=i.setYear(i.startOfMonth(Pe),ot);R(nn)},[i,R]),{className:Fe,style:rt}=b.useMemo(()=>({className:[l[jt.Root],e.className].filter(Boolean).join(" "),style:{...E?.[jt.Root],...e.style}}),[l,e.className,e.style,E]),tn=VEe(e),Rt=b.useRef(null);b_e(Rt,!!e.animate,{classNames:l,months:Q,focused:ne,dateLib:i});const ke={dayPickerProps:e,selected:V,select:I,isSelected:G,months:Q,nextMonth:X,previousMonth:J,goToMonth:R,getModifiers:ie,components:n,classNames:l,styles:E,labels:s,formatters:r};return ae.createElement(eX.Provider,{value:ke},ae.createElement(n.Root,{rootRef:e.animate?Rt:void 0,className:Fe,style:rt,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"],...tn},ae.createElement(n.Months,{className:l[jt.Months],style:E?.[jt.Months]},!e.hideNavigation&&!h&&ae.createElement(n.Nav,{"data-animated-nav":e.animate?"true":void 0,className:l[jt.Nav],style:E?.[jt.Nav],"aria-label":Je(),onPreviousClick:Yt,onNextClick:_t,previousMonth:J,nextMonth:X}),Q.map((Pe,it)=>ae.createElement(n.Month,{"data-animated-month":e.animate?"true":void 0,className:l[jt.Month],style:E?.[jt.Month],key:it,displayIndex:it,calendarMonth:Pe},h==="around"&&!e.hideNavigation&&it===0&&ae.createElement(n.PreviousMonthButton,{type:"button",className:l[jt.PreviousMonthButton],tabIndex:J?void 0:-1,"aria-disabled":J?void 0:!0,"aria-label":Oe(J),onClick:Yt,"data-animated-button":e.animate?"true":void 0},ae.createElement(n.Chevron,{disabled:J?void 0:!0,className:l[jt.Chevron],orientation:e.dir==="rtl"?"right":"left"})),ae.createElement(n.MonthCaption,{"data-animated-caption":e.animate?"true":void 0,className:l[jt.MonthCaption],style:E?.[jt.MonthCaption],calendarMonth:Pe,displayIndex:it},c?.startsWith("dropdown")?ae.createElement(n.DropdownNav,{className:l[jt.Dropdowns],style:E?.[jt.Dropdowns]},(()=>{const ot=c==="dropdown"||c==="dropdown-months"?ae.createElement(n.MonthsDropdown,{key:"month",className:l[jt.MonthsDropdown],"aria-label":Ye(),classNames:l,components:n,disabled:!!e.disableNavigation,onChange:Mt(Pe.date),options:t_e(Pe.date,F,Y,r,i),style:E?.[jt.Dropdown],value:i.getMonth(Pe.date)}):ae.createElement("span",{key:"month"},L(Pe.date,i)),nn=c==="dropdown"||c==="dropdown-years"?ae.createElement(n.YearsDropdown,{key:"year",className:l[jt.YearsDropdown],"aria-label":xt(i.options),classNames:l,components:n,disabled:!!e.disableNavigation,onChange:zn(Pe.date),options:s_e(F,Y,r,i,!!e.reverseYears),style:E?.[jt.Dropdown],value:i.getYear(Pe.date)}):ae.createElement("span",{key:"year"},U(Pe.date,i));return i.getMonthYearOrder()==="year-first"?[nn,ot]:[ot,nn]})(),ae.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"}},_(Pe.date,i.options,i))):ae.createElement(n.CaptionLabel,{className:l[jt.CaptionLabel],role:"status","aria-live":"polite"},_(Pe.date,i.options,i))),h==="around"&&!e.hideNavigation&&it===m-1&&ae.createElement(n.NextMonthButton,{type:"button",className:l[jt.NextMonthButton],tabIndex:X?void 0:-1,"aria-disabled":X?void 0:!0,"aria-label":Ve(X),onClick:_t,"data-animated-button":e.animate?"true":void 0},ae.createElement(n.Chevron,{disabled:X?void 0:!0,className:l[jt.Chevron],orientation:e.dir==="rtl"?"left":"right"})),it===m-1&&h==="after"&&!e.hideNavigation&&ae.createElement(n.Nav,{"data-animated-nav":e.animate?"true":void 0,className:l[jt.Nav],style:E?.[jt.Nav],"aria-label":Je(),onPreviousClick:Yt,onNextClick:_t,previousMonth:J,nextMonth:X}),ae.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":d==="multiple"||d==="range","aria-label":We(Pe.date,i.options,i)||void 0,className:l[jt.MonthGrid],style:E?.[jt.MonthGrid]},!e.hideWeekdays&&ae.createElement(n.Weekdays,{"data-animated-weekdays":e.animate?"true":void 0,className:l[jt.Weekdays],style:E?.[jt.Weekdays]},T&&ae.createElement(n.WeekNumberHeader,{"aria-label":Ot(i.options),className:l[jt.WeekNumberHeader],style:E?.[jt.WeekNumberHeader],scope:"col"},B()),kn.map(ot=>ae.createElement(n.Weekday,{"aria-label":Ue(ot,i.options,i),className:l[jt.Weekday],key:String(ot),style:E?.[jt.Weekday],scope:"col"},$(ot,i.options,i)))),ae.createElement(n.Weeks,{"data-animated-weeks":e.animate?"true":void 0,className:l[jt.Weeks],style:E?.[jt.Weeks]},Pe.weeks.map(ot=>ae.createElement(n.Week,{className:l[jt.Week],key:ot.weekNumber,style:E?.[jt.Week],week:ot},T&&ae.createElement(n.WeekNumber,{week:ot,style:E?.[jt.WeekNumber],"aria-label":He(ot.weekNumber,{locale:a}),className:l[jt.WeekNumber],scope:"row",role:"rowheader"},P(ot.weekNumber,i)),ot.days.map(nn=>{const{date:Kt}=nn,pt=ie(nn);if(pt[Ar.focused]=!pt.hidden&&!!ne?.isEqualTo(nn),pt[Ua.selected]=G?.(Kt)||pt.selected,u7(V)){const{from:vr,to:In}=V;pt[Ua.range_start]=!!(vr&&In&&i.isSameDay(Kt,vr)),pt[Ua.range_end]=!!(vr&&In&&i.isSameDay(Kt,In)),pt[Ua.range_middle]=Dl(V,Kt,!0,i)}const xr=n_e(pt,E,e.modifiersStyles),Ur=HEe(pt,l,e.modifiersClassNames),Wr=!It&&!pt.hidden?Te(Kt,pt,i.options,i):void 0;return ae.createElement(n.Day,{key:`${i.format(Kt,"yyyy-MM-dd")}_${i.format(nn.displayMonth,"yyyy-MM")}`,day:nn,modifiers:pt,className:Ur.join(" "),style:xr,role:"gridcell","aria-selected":pt.selected||void 0,"aria-label":Wr,"data-day":i.format(Kt,"yyyy-MM-dd"),"data-month":nn.outside?i.format(Kt,"yyyy-MM"):void 0,"data-selected":pt.selected||void 0,"data-disabled":pt.disabled||void 0,"data-hidden":pt.hidden||void 0,"data-outside":nn.outside||void 0,"data-focused":pt.focused||void 0,"data-today":pt.today||void 0},!pt.hidden&&It?ae.createElement(n.DayButton,{className:l[jt.DayButton],style:E?.[jt.DayButton],type:"button",day:nn,modifiers:pt,disabled:pt.disabled||void 0,tabIndex:W(nn)?0:-1,"aria-label":oe(Kt,pt,i.options,i),onClick:mt(nn,pt),onBlur:Ie(nn,pt),onFocus:Ne(nn,pt),onKeyDown:st(nn,pt),onMouseEnter:yt(nn,pt),onMouseLeave:Pt(nn,pt)},A(Kt,i.options,i)):!pt.hidden&&A(nn.date,i.options,i))})))))))),e.footer&&ae.createElement(n.Footer,{className:l[jt.Footer],style:E?.[jt.Footer],role:"status","aria-live":"polite"},e.footer)))}function _z({className:t,classNames:e,showOutsideDays:n=!0,captionLayout:r="label",buttonVariant:s="ghost",formatters:i,components:a,...l}){const c=d7();return o.jsx(F_e,{showOutsideDays:n,className:xe("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`,t),captionLayout:r,formatters:{formatMonthDropdown:d=>d.toLocaleString("default",{month:"short"}),...i},classNames:{root:xe("w-fit",c.root),months:xe("relative flex flex-col gap-4 md:flex-row",c.months),month:xe("flex w-full flex-col gap-4",c.month),nav:xe("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",c.nav),button_previous:xe(I0({variant:s}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_previous),button_next:xe(I0({variant:s}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_next),month_caption:xe("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",c.month_caption),dropdowns:xe("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",c.dropdowns),dropdown_root:xe("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",c.dropdown_root),dropdown:xe("bg-popover absolute inset-0 opacity-0",c.dropdown),caption_label:xe("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",c.caption_label),table:"w-full border-collapse",weekdays:xe("flex",c.weekdays),weekday:xe("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",c.weekday),week:xe("mt-2 flex w-full",c.week),week_number_header:xe("w-[--cell-size] select-none",c.week_number_header),week_number:xe("text-muted-foreground select-none text-[0.8rem]",c.week_number),day:xe("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",c.day),range_start:xe("bg-accent rounded-l-md",c.range_start),range_middle:xe("rounded-none",c.range_middle),range_end:xe("bg-accent rounded-r-md",c.range_end),today:xe("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",c.today),outside:xe("text-muted-foreground aria-selected:text-muted-foreground",c.outside),disabled:xe("text-muted-foreground opacity-50",c.disabled),hidden:xe("invisible",c.hidden),...e},components:{Root:({className:d,rootRef:h,...m})=>o.jsx("div",{"data-slot":"calendar",ref:h,className:xe(d),...m}),Chevron:({className:d,orientation:h,...m})=>h==="left"?o.jsx(vd,{className:xe("size-4",d),...m}):h==="right"?o.jsx(yd,{className:xe("size-4",d),...m}):o.jsx(nd,{className:xe("size-4",d),...m}),DayButton:q_e,WeekNumber:({children:d,...h})=>o.jsx("td",{...h,children:o.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:d})}),...a},...l})}function q_e({className:t,day:e,modifiers:n,...r}){const s=d7(),i=b.useRef(null);return b.useEffect(()=>{n.focused&&i.current?.focus()},[n.focused]),o.jsx(de,{ref:i,variant:"ghost",size:"icon","data-day":e.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:xe("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,t),...r})}class $_e{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:",n=window.location.host;return`${e}//${n}/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=n=>{try{if(n.data==="pong")return;const r=JSON.parse(n.data);this.notifyLog(r)}catch(r){console.error("解析日志消息失败:",r)}},this.ws.onerror=n=>{console.error("❌ WebSocket 错误:",n),this.isConnected=!1,this.notifyConnection(!1)},this.ws.onclose=()=>{this.isConnected=!1,this.notifyConnection(!1),this.stopHeartbeat(),this.attemptReconnect()}}catch(n){console.error("创建 WebSocket 连接失败:",n),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(n=>{try{n(e)}catch(r){console.error("连接状态回调执行失败:",r)}})}getAllLogs(){return[...this.logCache]}clearLogs(){this.logCache=[]}getConnectionStatus(){return this.isConnected}}const Oh=new $_e;typeof window<"u"&&Oh.connect();const H_e={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}} 年"}},Q_e=(t,e,n)=>{let r;const s=H_e[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",String(e)),n?.addSuffix?n.comparison&&n.comparison>0?r+"内":r+"前":r},V_e={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},U_e={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},W_e={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},G_e={date:Vh({formats:V_e,defaultWidth:"full"}),time:Vh({formats:U_e,defaultWidth:"full"}),dateTime:Vh({formats:W_e,defaultWidth:"full"})};function Az(t,e,n){const r="eeee p";return iEe(t,e,n)?r:t.getTime()>e.getTime()?"'下个'"+r:"'上个'"+r}const X_e={lastWeek:Az,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:Az,other:"PP p"},Y_e=(t,e,n,r)=>{const s=X_e[t];return typeof s=="function"?s(e,n,r):s},K_e={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},Z_e={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},J_e={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},eAe={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},tAe={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:"夜间"}},nAe={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:"夜间"}},rAe=(t,e)=>{const n=Number(t);switch(e?.unit){case"date":return n.toString()+"日";case"hour":return n.toString()+"时";case"minute":return n.toString()+"分";case"second":return n.toString()+"秒";default:return"第 "+n.toString()}},sAe={ordinalNumber:rAe,era:ko({values:K_e,defaultWidth:"wide"}),quarter:ko({values:Z_e,defaultWidth:"wide",argumentCallback:t=>t-1}),month:ko({values:J_e,defaultWidth:"wide"}),day:ko({values:eAe,defaultWidth:"wide"}),dayPeriod:ko({values:tAe,defaultWidth:"wide",formattingValues:nAe,defaultFormattingWidth:"wide"})},iAe=/^(第\s*)?\d+(日|时|分|秒)?/i,aAe=/\d+/i,oAe={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},lAe={any:[/^(前)/i,/^(公元)/i]},cAe={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},uAe={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},dAe={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},hAe={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]},fAe={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},mAe={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},pAe={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},gAe={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},xAe={ordinalNumber:WG({matchPattern:iAe,parsePattern:aAe,valueCallback:t=>parseInt(t,10)}),era:Oo({matchPatterns:oAe,defaultMatchWidth:"wide",parsePatterns:lAe,defaultParseWidth:"any"}),quarter:Oo({matchPatterns:cAe,defaultMatchWidth:"wide",parsePatterns:uAe,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Oo({matchPatterns:dAe,defaultMatchWidth:"wide",parsePatterns:hAe,defaultParseWidth:"any"}),day:Oo({matchPatterns:fAe,defaultMatchWidth:"wide",parsePatterns:mAe,defaultParseWidth:"any"}),dayPeriod:Oo({matchPatterns:pAe,defaultMatchWidth:"any",parsePatterns:gAe,defaultParseWidth:"any"})},U1={code:"zh-CN",formatDistance:Q_e,formatLong:G_e,formatRelative:Y_e,localize:sAe,match:xAe,options:{weekStartsOn:1,firstWeekContainsDate:4}},W1={xs:{label:"小",rowHeight:28,class:"text-[10px] sm:text-xs"},sm:{label:"中",rowHeight:36,class:"text-xs sm:text-sm"},base:{label:"大",rowHeight:44,class:"text-sm sm:text-base"}};function vAe(){const[t,e]=b.useState([]),[n,r]=b.useState(""),[s,i]=b.useState("all"),[a,l]=b.useState("all"),[c,d]=b.useState(void 0),[h,m]=b.useState(void 0),[g,x]=b.useState(!0),[y,w]=b.useState(!1),[S,k]=b.useState("xs"),[j,N]=b.useState(4),T=b.useRef(null);b.useEffect(()=>{const F=Oh.getAllLogs();e(F);const Y=Oh.onLog(()=>{e(Oh.getAllLogs())}),J=Oh.onConnectionChange(X=>{w(X)});return()=>{Y(),J()}},[]);const E=b.useMemo(()=>{const F=new Set(t.map(Y=>Y.module));return Array.from(F).sort()},[t]),_=F=>{switch(F){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"}},A=F=>{switch(F){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"}},L=()=>{window.location.reload()},P=()=>{Oh.clearLogs(),e([])},B=()=>{const F=te.map(R=>`${R.timestamp} [${R.level.padEnd(8)}] [${R.module}] ${R.message}`).join(` +`),Y=new Blob([F],{type:"text/plain;charset=utf-8"}),J=URL.createObjectURL(Y),X=document.createElement("a");X.href=J,X.download=`logs-${Ev(new Date,"yyyy-MM-dd-HHmmss")}.txt`,X.click(),URL.revokeObjectURL(J)},$=()=>{x(!g)},U=()=>{d(void 0),m(void 0)},te=b.useMemo(()=>t.filter(F=>{const Y=n===""||F.message.toLowerCase().includes(n.toLowerCase())||F.module.toLowerCase().includes(n.toLowerCase()),J=s==="all"||F.level===s,X=a==="all"||F.module===a;let R=!0;if(c||h){const ie=new Date(F.timestamp);if(c){const G=new Date(c);G.setHours(0,0,0,0),R=R&&ie>=G}if(h){const G=new Date(h);G.setHours(23,59,59,999),R=R&&ie<=G}}return Y&&J&&X&&R}),[t,n,s,a,c,h]),z=W1[S].rowHeight+j,Q=BTe({count:te.length,getScrollElement:()=>T.current,estimateSize:()=>z,overscan:15});return b.useEffect(()=>{g&&te.length>0&&Q.scrollToIndex(te.length-1,{align:"end",behavior:"auto"})},[te.length,g,Q]),o.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[o.jsxs("div",{className:"flex-shrink-0 space-y-4 p-3 sm:p-4 lg:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-xl sm:text-2xl lg:text-3xl font-bold",children:"日志查看器"}),o.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:"实时查看和分析麦麦运行日志"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:xe("h-2.5 w-2.5 sm:h-3 sm:w-3 rounded-full",y?"bg-green-500 animate-pulse":"bg-red-500")}),o.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground",children:y?"已连接":"未连接"})]})]}),o.jsx(qt,{className:"p-3 sm:p-4",children:o.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[o.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:gap-4",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(Ni,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(ze,{placeholder:"搜索日志...",value:n,onChange:F=>r(F.target.value),className:"pl-9 h-9 text-sm"})]}),o.jsxs(Vt,{value:s,onValueChange:i,children:[o.jsxs($t,{className:"w-full sm:w-[140px] lg:w-[180px] h-9 text-sm",children:[o.jsx(sk,{className:"h-4 w-4 mr-2"}),o.jsx(Ut,{placeholder:"级别"})]}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部级别"}),o.jsx(De,{value:"DEBUG",children:"DEBUG"}),o.jsx(De,{value:"INFO",children:"INFO"}),o.jsx(De,{value:"WARNING",children:"WARNING"}),o.jsx(De,{value:"ERROR",children:"ERROR"}),o.jsx(De,{value:"CRITICAL",children:"CRITICAL"})]})]}),o.jsxs(Vt,{value:a,onValueChange:l,children:[o.jsxs($t,{className:"w-full sm:w-[160px] lg:w-[200px] h-9 text-sm",children:[o.jsx(sk,{className:"h-4 w-4 mr-2"}),o.jsx(Ut,{placeholder:"模块"})]}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部模块"}),E.map(F=>o.jsx(De,{value:F,children:F},F))]})]})]}),o.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-4",children:[o.jsxs(zo,{children:[o.jsx(Io,{asChild:!0,children:o.jsxs(de,{variant:"outline",size:"sm",className:xe("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!c&&"text-muted-foreground"),children:[o.jsx(w9,{className:"mr-2 h-4 w-4"}),o.jsx("span",{className:"text-xs sm:text-sm",children:c?Ev(c,"PPP",{locale:U1}):"开始日期"})]})}),o.jsx(Xa,{className:"w-auto p-0",align:"start",children:o.jsx(_z,{mode:"single",selected:c,onSelect:d,initialFocus:!0,locale:U1})})]}),o.jsxs(zo,{children:[o.jsx(Io,{asChild:!0,children:o.jsxs(de,{variant:"outline",size:"sm",className:xe("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!h&&"text-muted-foreground"),children:[o.jsx(w9,{className:"mr-2 h-4 w-4"}),o.jsx("span",{className:"text-xs sm:text-sm",children:h?Ev(h,"PPP",{locale:U1}):"结束日期"})]})}),o.jsx(Xa,{className:"w-auto p-0",align:"start",children:o.jsx(_z,{mode:"single",selected:h,onSelect:m,initialFocus:!0,locale:U1})})]}),(c||h)&&o.jsxs(de,{variant:"outline",size:"sm",onClick:U,className:"w-full sm:w-auto h-9",children:[o.jsx(_p,{className:"h-4 w-4 sm:mr-2"}),o.jsx("span",{className:"hidden sm:inline text-sm",children:"清除时间筛选"}),o.jsx("span",{className:"sm:hidden text-sm",children:"清除"})]})]}),o.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center",children:[o.jsxs("div",{className:"flex gap-2 flex-wrap",children:[o.jsxs(de,{variant:g?"default":"outline",size:"sm",onClick:$,className:"flex-1 sm:flex-none h-9",children:[g?o.jsx(tte,{className:"h-4 w-4"}):o.jsx(nte,{className:"h-4 w-4"}),o.jsx("span",{className:"ml-2 text-sm",children:g?"自动滚动":"已暂停"})]}),o.jsxs(de,{variant:"outline",size:"sm",onClick:L,className:"flex-1 sm:flex-none h-9",children:[o.jsx(Ps,{className:"h-4 w-4"}),o.jsx("span",{className:"ml-2 text-sm",children:"刷新"})]}),o.jsxs(de,{variant:"outline",size:"sm",onClick:P,className:"flex-1 sm:flex-none h-9",children:[o.jsx(Sn,{className:"h-4 w-4"}),o.jsx("span",{className:"ml-2 text-sm",children:"清空"})]}),o.jsxs(de,{variant:"outline",size:"sm",onClick:B,className:"flex-1 sm:flex-none h-9",children:[o.jsx(Ku,{className:"h-4 w-4"}),o.jsx("span",{className:"ml-2 text-sm",children:"导出"})]})]}),o.jsx("div",{className:"flex-1 hidden sm:block"}),o.jsxs("div",{className:"text-xs sm:text-sm text-muted-foreground flex items-center justify-center sm:justify-end",children:[o.jsxs("span",{className:"font-mono",children:[te.length," / ",t.length]}),o.jsx("span",{className:"ml-1",children:"条日志"})]})]}),o.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-6 pt-2 border-t border-border/50",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o.jsx(rte,{className:"h-4 w-4"}),o.jsx("span",{children:"字号"})]}),o.jsx("div",{className:"flex gap-1",children:Object.keys(W1).map(F=>o.jsx(de,{variant:S===F?"default":"outline",size:"sm",onClick:()=>k(F),className:"h-7 px-3 text-xs",children:W1[F].label},F))})]}),o.jsxs("div",{className:"flex items-center gap-3 flex-1 max-w-xs",children:[o.jsx("span",{className:"text-sm text-muted-foreground whitespace-nowrap",children:"行距"}),o.jsx(Bp,{value:[j],onValueChange:([F])=>N(F),min:0,max:12,step:2,className:"flex-1"}),o.jsxs("span",{className:"text-xs text-muted-foreground w-8",children:[j,"px"]})]})]})]})})]}),o.jsx("div",{className:"flex-1 min-h-0 px-3 sm:px-4 lg:px-6 pb-3 sm:pb-4 lg:pb-6",children:o.jsx(qt,{className:"bg-black dark:bg-gray-950 border-gray-800 dark:border-gray-900 h-full",children:o.jsx(gn,{viewportRef:T,className:"h-full",children:o.jsx("div",{className:xe("p-2 sm:p-3 font-mono relative",W1[S].class),style:{height:`${Q.getTotalSize()}px`},children:te.length===0?o.jsx("div",{className:"text-gray-500 dark:text-gray-600 text-center py-8 text-sm",children:"暂无日志数据"}):Q.getVirtualItems().map(F=>{const Y=te[F.index];return o.jsxs("div",{"data-index":F.index,ref:Q.measureElement,className:xe("absolute top-0 left-0 w-full px-2 sm:px-3 rounded hover:bg-white/5 transition-colors group",A(Y.level)),style:{transform:`translateY(${F.start}px)`,paddingTop:`${j/2}px`,paddingBottom:`${j/2}px`},children:[o.jsxs("div",{className:"flex flex-col gap-0.5 sm:hidden",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-gray-500 dark:text-gray-600",children:Y.timestamp}),o.jsxs("span",{className:xe("font-semibold",_(Y.level)),children:["[",Y.level,"]"]})]}),o.jsx("div",{className:"text-cyan-400 dark:text-cyan-500 truncate",children:Y.module}),o.jsx("div",{className:"text-gray-300 dark:text-gray-400 whitespace-pre-wrap break-words",children:Y.message})]}),o.jsxs("div",{className:"hidden sm:flex gap-2 items-start",children:[o.jsx("span",{className:"text-gray-500 dark:text-gray-600 flex-shrink-0 w-[130px] lg:w-[160px]",children:Y.timestamp}),o.jsxs("span",{className:xe("flex-shrink-0 w-[65px] lg:w-[75px] font-semibold",_(Y.level)),children:["[",Y.level,"]"]}),o.jsx("span",{className:"text-cyan-400 dark:text-cyan-500 flex-shrink-0 w-[100px] lg:w-[130px] truncate",children:Y.module}),o.jsx("span",{className:"text-gray-300 dark:text-gray-400 flex-1 whitespace-pre-wrap break-words",children:Y.message})]})]},F.key)})})})})})]})}const yAe="Mai-with-u",bAe="plugin-repo",wAe="main",SAe="plugin_details.json";async function kAe(){try{const t=await St("/api/webui/plugins/fetch-raw",{method:"POST",headers:Dt(),body:JSON.stringify({owner:yAe,repo:bAe,branch:wAe,file_path:SAe})});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const e=await t.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(t){throw console.error("Failed to fetch plugin list:",t),t}}async function OAe(){try{const t=await St("/api/webui/plugins/git-status");if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.json()}catch(t){return console.error("Failed to check Git status:",t),{installed:!1,error:"无法检测 Git 安装状态"}}}async function jAe(){try{const t=await St("/api/webui/plugins/version");if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.json()}catch(t){return console.error("Failed to get Maimai version:",t),{version:"0.0.0",version_major:0,version_minor:0,version_patch:0}}}function NAe(t,e,n){const r=t.split(".").map(l=>parseInt(l)||0),s=r[0]||0,i=r[1]||0,a=r[2]||0;if(n.version_majorparseInt(m)||0),c=l[0]||0,d=l[1]||0,h=l[2]||0;if(n.version_major>c||n.version_major===c&&n.version_minor>d||n.version_major===c&&n.version_minor===d&&n.version_patch>h)return!1}return!0}function CAe(t,e){const n=window.location.protocol==="https:"?"wss:":"ws:",r=window.location.host,s=new WebSocket(`${n}//${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 a=JSON.parse(i.data);t(a)}catch(a){console.error("Failed to parse progress data:",a)}},s.onerror=i=>{console.error("Plugin progress WebSocket error:",i),e?.(i)},s.onclose=()=>{console.log("Plugin progress WebSocket disconnected")},s}async function G1(){try{const t=await St("/api/webui/plugins/installed",{headers:Dt()});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const e=await t.json();if(!e.success)throw new Error(e.message||"获取已安装插件列表失败");return e.plugins||[]}catch(t){return console.error("Failed to get installed plugins:",t),[]}}function X1(t,e){return e.some(n=>n.id===t)}function Y1(t,e){const n=e.find(r=>r.id===t);if(n)return n.manifest?.version||n.version}async function TAe(t,e,n="main"){const r=await St("/api/webui/plugins/install",{method:"POST",headers:Dt(),body:JSON.stringify({plugin_id:t,repository_url:e,branch:n})});if(!r.ok){const s=await r.json();throw new Error(s.detail||"安装失败")}return await r.json()}async function EAe(t){const e=await St("/api/webui/plugins/uninstall",{method:"POST",headers:Dt(),body:JSON.stringify({plugin_id:t})});if(!e.ok){const n=await e.json();throw new Error(n.detail||"卸载失败")}return await e.json()}async function _Ae(t,e,n="main"){const r=await St("/api/webui/plugins/update",{method:"POST",headers:Dt(),body:JSON.stringify({plugin_id:t,repository_url:e,branch:n})});if(!r.ok){const s=await r.json();throw new Error(s.detail||"更新失败")}return await r.json()}const Sg="https://maibot-plugin-stats.maibot-webui.workers.dev";async function dX(t){try{const e=await fetch(`${Sg}/stats/${t}`);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 AAe(t,e){try{const n=e||h7(),r=await fetch(`${Sg}/stats/like`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:t,user_id:n})}),s=await r.json();return r.status===429?{success:!1,error:"操作过于频繁,请稍后再试"}:r.ok?{success:!0,...s}:{success:!1,error:s.error||"点赞失败"}}catch(n){return console.error("Error liking plugin:",n),{success:!1,error:"网络错误"}}}async function MAe(t,e){try{const n=e||h7(),r=await fetch(`${Sg}/stats/dislike`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:t,user_id:n})}),s=await r.json();return r.status===429?{success:!1,error:"操作过于频繁,请稍后再试"}:r.ok?{success:!0,...s}:{success:!1,error:s.error||"点踩失败"}}catch(n){return console.error("Error disliking plugin:",n),{success:!1,error:"网络错误"}}}async function RAe(t,e,n,r){if(e<1||e>5)return{success:!1,error:"评分必须在 1-5 之间"};try{const s=r||h7(),i=await fetch(`${Sg}/stats/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:t,rating:e,comment:n,user_id:s})}),a=await i.json();return i.status===429?{success:!1,error:"每天最多评分 3 次"}:i.ok?{success:!0,...a}:{success:!1,error:a.error||"评分失败"}}catch(s){return console.error("Error rating plugin:",s),{success:!1,error:"网络错误"}}}async function DAe(t){try{const e=await fetch(`${Sg}/stats/download`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:t})}),n=await e.json();return e.status===429?(console.warn("Download recording rate limited"),{success:!0}):e.ok?{success:!0,...n}:(console.error("Failed to record download:",n.error),{success:!1,error:n.error})}catch(e){return console.error("Error recording download:",e),{success:!1,error:"网络错误"}}}function PAe(){const t=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,t.deviceMemory||0].join("|");let n=0;for(let r=0;r{i(!0);const k=await dX(t);k&&r(k),i(!1)};b.useEffect(()=>{x()},[t]);const y=async()=>{const k=await AAe(t);k.success?(g({title:"已点赞",description:"感谢你的支持!"}),x()):g({title:"点赞失败",description:k.error||"未知错误",variant:"destructive"})},w=async()=>{const k=await MAe(t);k.success?(g({title:"已反馈",description:"感谢你的反馈!"}),x()):g({title:"操作失败",description:k.error||"未知错误",variant:"destructive"})},S=async()=>{if(a===0){g({title:"请选择评分",description:"至少选择 1 颗星",variant:"destructive"});return}const k=await RAe(t,a,c||void 0);k.success?(g({title:"评分成功",description:"感谢你的评价!"}),m(!1),l(0),d(""),x()):g({title:"评分失败",description:k.error||"未知错误",variant:"destructive"})};return s?o.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Ku,{className:"h-4 w-4"}),o.jsx("span",{children:"-"})]}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Ac,{className:"h-4 w-4"}),o.jsx("span",{children:"-"})]})]}):n?e?o.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[o.jsxs("div",{className:"flex items-center gap-1",title:`下载量: ${n.downloads.toLocaleString()}`,children:[o.jsx(Ku,{className:"h-4 w-4"}),o.jsx("span",{children:n.downloads.toLocaleString()})]}),o.jsxs("div",{className:"flex items-center gap-1",title:`评分: ${n.rating.toFixed(1)} (${n.rating_count} 条评价)`,children:[o.jsx(Ac,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),o.jsx("span",{children:n.rating.toFixed(1)})]}),o.jsxs("div",{className:"flex items-center gap-1",title:`点赞数: ${n.likes}`,children:[o.jsx(y4,{className:"h-4 w-4"}),o.jsx("span",{children:n.likes})]})]}):o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[o.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[o.jsx(Ku,{className:"h-5 w-5 text-muted-foreground mb-1"}),o.jsx("span",{className:"text-2xl font-bold",children:n.downloads.toLocaleString()}),o.jsx("span",{className:"text-xs text-muted-foreground",children:"下载量"})]}),o.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[o.jsx(Ac,{className:"h-5 w-5 text-yellow-400 mb-1 fill-yellow-400"}),o.jsx("span",{className:"text-2xl font-bold",children:n.rating.toFixed(1)}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:[n.rating_count," 条评价"]})]}),o.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[o.jsx(y4,{className:"h-5 w-5 text-green-500 mb-1"}),o.jsx("span",{className:"text-2xl font-bold",children:n.likes}),o.jsx("span",{className:"text-xs text-muted-foreground",children:"点赞"})]}),o.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[o.jsx(S9,{className:"h-5 w-5 text-red-500 mb-1"}),o.jsx("span",{className:"text-2xl font-bold",children:n.dislikes}),o.jsx("span",{className:"text-xs text-muted-foreground",children:"点踩"})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(de,{variant:"outline",size:"sm",onClick:y,children:[o.jsx(y4,{className:"h-4 w-4 mr-1"}),"点赞"]}),o.jsxs(de,{variant:"outline",size:"sm",onClick:w,children:[o.jsx(S9,{className:"h-4 w-4 mr-1"}),"点踩"]}),o.jsxs(Dr,{open:h,onOpenChange:m,children:[o.jsx(Of,{asChild:!0,children:o.jsxs(de,{variant:"default",size:"sm",children:[o.jsx(Ac,{className:"h-4 w-4 mr-1"}),"评分"]})}),o.jsxs(Sr,{children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"为插件评分"}),o.jsx(ss,{children:"分享你的使用体验,帮助其他用户"})]}),o.jsxs("div",{className:"space-y-4 py-4",children:[o.jsxs("div",{className:"flex flex-col items-center gap-2",children:[o.jsx("div",{className:"flex gap-2",children:[1,2,3,4,5].map(k=>o.jsx("button",{onClick:()=>l(k),className:"focus:outline-none",children:o.jsx(Ac,{className:`h-8 w-8 transition-colors ${k<=a?"fill-yellow-400 text-yellow-400":"text-muted-foreground hover:text-yellow-300"}`})},k))}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:[a===0&&"点击星星进行评分",a===1&&"很差",a===2&&"一般",a===3&&"还行",a===4&&"不错",a===5&&"非常好"]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium mb-2 block",children:"评论(可选)"}),o.jsx(Mr,{value:c,onChange:k=>d(k.target.value),placeholder:"分享你的使用体验...",rows:4,maxLength:500}),o.jsxs("div",{className:"text-xs text-muted-foreground mt-1 text-right",children:[c.length," / 500"]})]})]}),o.jsxs(ws,{children:[o.jsx(de,{variant:"outline",onClick:()=>m(!1),children:"取消"}),o.jsx(de,{onClick:S,disabled:a===0,children:"提交评分"})]})]})]})]}),n.recent_ratings&&n.recent_ratings.length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"text-sm font-semibold",children:"最近评价"}),o.jsx("div",{className:"space-y-3",children:n.recent_ratings.map((k,j)=>o.jsxs("div",{className:"p-3 rounded-lg border bg-muted/50",children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("div",{className:"flex gap-1",children:[1,2,3,4,5].map(N=>o.jsx(Ac,{className:`h-3 w-3 ${N<=k.rating?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},N))}),o.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(k.created_at).toLocaleDateString()})]}),k.comment&&o.jsx("p",{className:"text-sm text-muted-foreground",children:k.comment})]},j))})]})]}):null}const Mz={"Group Management":"群组管理","Entertainment & Interaction":"娱乐互动","Utility Tools":"实用工具","Content Generation":"内容生成",Multimedia:"多媒体","External Integration":"外部集成","Data Analysis & Insights":"数据分析与洞察",Other:"其他"};function IAe(){const t=Zi(),[e,n]=b.useState(null),[r,s]=b.useState(""),[i,a]=b.useState("all"),[l,c]=b.useState("all"),[d,h]=b.useState(!0),[m,g]=b.useState([]),[x,y]=b.useState(!0),[w,S]=b.useState(null),[k,j]=b.useState(null),[N,T]=b.useState(null),[E,_]=b.useState(null),[,A]=b.useState([]),[L,P]=b.useState({}),{toast:B}=as(),$=async R=>{const ie=R.map(async V=>{try{const ee=await dX(V.id);return{id:V.id,stats:ee}}catch(ee){return console.warn(`Failed to load stats for ${V.id}:`,ee),{id:V.id,stats:null}}}),G=await Promise.all(ie),I={};G.forEach(({id:V,stats:ee})=>{ee&&(I[V]=ee)}),P(I)};b.useEffect(()=>{let R=null,ie=!1;return(async()=>{if(R=CAe(I=>{ie||(T(I),I.stage==="success"?setTimeout(()=>{ie||T(null)},2e3):I.stage==="error"&&(y(!1),S(I.error||"加载失败")))},I=>{console.error("WebSocket error:",I),ie||B({title:"WebSocket 连接失败",description:"无法实时显示加载进度",variant:"destructive"})}),await new Promise(I=>{if(!R){I();return}const V=()=>{R&&R.readyState===WebSocket.OPEN?(console.log("WebSocket connected, starting to load plugins"),I()):R&&R.readyState===WebSocket.CLOSED?(console.warn("WebSocket closed before loading plugins"),I()):setTimeout(V,100)};V()}),!ie){const I=await OAe();j(I),I.installed||B({title:"Git 未安装",description:I.error||"请先安装 Git 才能使用插件安装功能",variant:"destructive"})}if(!ie){const I=await jAe();_(I)}if(!ie)try{y(!0),S(null);const I=await kAe();if(!ie){const V=await G1();A(V);const ee=I.map(ne=>{const W=X1(ne.id,V),se=Y1(ne.id,V);return{...ne,installed:W,installed_version:se}});for(const ne of V)!ee.some(se=>se.id===ne.id)&&ne.manifest&&ee.push({id:ne.id,manifest:{manifest_version:ne.manifest.manifest_version||1,name:ne.manifest.name,version:ne.manifest.version,description:ne.manifest.description||"",author:ne.manifest.author,license:ne.manifest.license||"Unknown",host_application:ne.manifest.host_application,homepage_url:ne.manifest.homepage_url,repository_url:ne.manifest.repository_url,keywords:ne.manifest.keywords||[],categories:ne.manifest.categories||[],default_locale:ne.manifest.default_locale||"zh-CN",locales_path:ne.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!0,installed_version:ne.manifest.version,published_at:new Date().toISOString(),updated_at:new Date().toISOString()});g(ee),$(ee)}}catch(I){if(!ie){const V=I instanceof Error?I.message:"加载插件列表失败";S(V),B({title:"加载失败",description:V,variant:"destructive"})}}finally{ie||y(!1)}})(),()=>{ie=!0,R&&R.close()}},[B]);const U=R=>{if(!R.installed&&E&&!te(R))return o.jsxs(Xn,{variant:"destructive",className:"gap-1",children:[o.jsx(Uc,{className:"h-3 w-3"}),"不兼容"]});if(R.installed){const ie=R.installed_version?.trim(),G=R.manifest.version?.trim();if(ie!==G){const I=ie?.split(".").map(Number)||[0,0,0],V=G?.split(".").map(Number)||[0,0,0];for(let ee=0;ee<3;ee++){if((V[ee]||0)>(I[ee]||0))return o.jsxs(Xn,{variant:"outline",className:"gap-1 text-orange-600 border-orange-600",children:[o.jsx(Uc,{className:"h-3 w-3"}),"可更新"]});if((V[ee]||0)<(I[ee]||0))break}}return o.jsxs(Xn,{variant:"default",className:"gap-1",children:[o.jsx(Vc,{className:"h-3 w-3"}),"已安装"]})}return null},te=R=>!E||!R.manifest?.host_application?!0:NAe(R.manifest.host_application.min_version,R.manifest.host_application.max_version,E),z=R=>{if(!R.installed||!R.installed_version||!R.manifest?.version)return!1;const ie=R.installed_version.trim(),G=R.manifest.version.trim();if(ie===G)return!1;const I=ie.split(".").map(Number),V=G.split(".").map(Number);for(let ee=0;ee<3;ee++){if((V[ee]||0)>(I[ee]||0))return!0;if((V[ee]||0)<(I[ee]||0))return!1}return!1},Q=m.filter(R=>{if(!R.manifest)return console.warn("[过滤] 跳过无 manifest 的插件:",R.id),!1;const ie=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(ee=>ee.toLowerCase().includes(r.toLowerCase())),G=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i);let I=!0;l==="installed"?I=R.installed===!0:l==="updates"&&(I=R.installed===!0&&z(R));const V=!d||!E||te(R);return ie&&G&&I&&V}),F=()=>{n(null)},Y=async R=>{if(!k?.installed){B({title:"无法安装",description:"Git 未安装",variant:"destructive"});return}if(E&&!te(R)){B({title:"无法安装",description:"插件与当前麦麦版本不兼容",variant:"destructive"});return}try{await TAe(R.id,R.manifest.repository_url||"","main"),DAe(R.id).catch(G=>{console.warn("Failed to record download:",G)}),B({title:"安装成功",description:`${R.manifest.name} 已成功安装`});const ie=await G1();A(ie),g(G=>G.map(I=>{if(I.id===R.id){const V=X1(I.id,ie),ee=Y1(I.id,ie);return{...I,installed:V,installed_version:ee}}return I}))}catch(ie){B({title:"安装失败",description:ie instanceof Error?ie.message:"未知错误",variant:"destructive"})}},J=async R=>{try{await EAe(R.id),B({title:"卸载成功",description:`${R.manifest.name} 已成功卸载`});const ie=await G1();A(ie),g(G=>G.map(I=>{if(I.id===R.id){const V=X1(I.id,ie),ee=Y1(I.id,ie);return{...I,installed:V,installed_version:ee}}return I}))}catch(ie){B({title:"卸载失败",description:ie instanceof Error?ie.message:"未知错误",variant:"destructive"})}},X=async R=>{if(!k?.installed){B({title:"无法更新",description:"Git 未安装",variant:"destructive"});return}try{const ie=await _Ae(R.id,R.manifest.repository_url||"","main");B({title:"更新成功",description:`${R.manifest.name} 已从 ${ie.old_version} 更新到 ${ie.new_version}`});const G=await G1();A(G),g(I=>I.map(V=>{if(V.id===R.id){const ee=X1(V.id,G),ne=Y1(V.id,G);return{...V,installed:ee,installed_version:ne}}return V}))}catch(ie){B({title:"更新失败",description:ie instanceof Error?ie.message:"未知错误",variant:"destructive"})}};return o.jsx(gn,{className:"h-full",children:o.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件市场"}),o.jsx("p",{className:"text-muted-foreground mt-2",children:"浏览和管理麦麦的插件"})]}),o.jsxs(de,{onClick:()=>t({to:"/plugin-mirrors"}),children:[o.jsx(ste,{className:"h-4 w-4 mr-2"}),"配置镜像源"]})]}),k&&!k.installed&&o.jsxs(qt,{className:"border-orange-600 bg-orange-50 dark:bg-orange-950/20",children:[o.jsx(Fn,{children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Wa,{className:"h-5 w-5 text-orange-600"}),o.jsxs("div",{children:[o.jsx(qn,{className:"text-lg text-orange-900 dark:text-orange-100",children:"Git 未安装"}),o.jsx(ts,{className:"text-orange-800 dark:text-orange-200",children:k.error||"请先安装 Git 才能使用插件安装功能"})]})]})}),o.jsx(Gn,{children:o.jsxs("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:["您可以从 ",o.jsx("a",{href:"https://git-scm.com/downloads",target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"git-scm.com"})," 下载并安装 Git。 安装完成后,请重启麦麦应用。"]})})]}),o.jsx(qt,{className:"p-4",children:o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(Ni,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(ze,{placeholder:"搜索插件...",value:r,onChange:R=>s(R.target.value),className:"pl-9"})]}),o.jsxs(Vt,{value:i,onValueChange:a,children:[o.jsx($t,{className:"w-full sm:w-[200px]",children:o.jsx(Ut,{placeholder:"选择分类"})}),o.jsxs(Ht,{children:[o.jsx(De,{value:"all",children:"全部分类"}),o.jsx(De,{value:"Group Management",children:"群组管理"}),o.jsx(De,{value:"Entertainment & Interaction",children:"娱乐互动"}),o.jsx(De,{value:"Utility Tools",children:"实用工具"}),o.jsx(De,{value:"Content Generation",children:"内容生成"}),o.jsx(De,{value:"Multimedia",children:"多媒体"}),o.jsx(De,{value:"External Integration",children:"外部集成"}),o.jsx(De,{value:"Data Analysis & Insights",children:"数据分析与洞察"}),o.jsx(De,{value:"Other",children:"其他"})]})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Oi,{id:"compatible-only",checked:d,onCheckedChange:R=>h(R===!0)}),o.jsx("label",{htmlFor:"compatible-only",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:"只显示兼容当前版本的插件"})]})]})}),o.jsx(ja,{value:l,onValueChange:c,className:"w-full",children:o.jsxs(Wi,{className:"grid w-full grid-cols-3",children:[o.jsxs(Lt,{value:"all",children:["全部插件 (",m.filter(R=>{if(!R.manifest)return!1;const ie=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(V=>V.toLowerCase().includes(r.toLowerCase())),G=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i),I=!d||!E||te(R);return ie&&G&&I}).length,")"]}),o.jsxs(Lt,{value:"installed",children:["已安装 (",m.filter(R=>{if(!R.manifest)return!1;const ie=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(V=>V.toLowerCase().includes(r.toLowerCase())),G=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i),I=!d||!E||te(R);return R.installed&&ie&&G&&I}).length,")"]}),o.jsxs(Lt,{value:"updates",children:["可更新 (",m.filter(R=>{if(!R.manifest)return!1;const ie=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(V=>V.toLowerCase().includes(r.toLowerCase())),G=i==="all"||R.manifest.categories&&R.manifest.categories.includes(i),I=!d||!E||te(R);return R.installed&&z(R)&&ie&&G&&I}).length,")"]})]})}),N&&N.stage==="loading"&&o.jsx(qt,{className:"p-4",children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Po,{className:"h-4 w-4 animate-spin"}),o.jsxs("span",{className:"text-sm font-medium",children:[N.operation==="fetch"&&"加载插件列表",N.operation==="install"&&`安装插件${N.plugin_id?`: ${N.plugin_id}`:""}`,N.operation==="uninstall"&&`卸载插件${N.plugin_id?`: ${N.plugin_id}`:""}`,N.operation==="update"&&`更新插件${N.plugin_id?`: ${N.plugin_id}`:""}`]})]}),o.jsxs("span",{className:"text-sm font-medium",children:[N.progress,"%"]})]}),o.jsx(Lp,{value:N.progress,className:"h-2"}),o.jsx("div",{className:"text-xs text-muted-foreground",children:N.message}),N.operation==="fetch"&&N.total_plugins>0&&o.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["已加载 ",N.loaded_plugins," / ",N.total_plugins," 个插件"]})]})}),N&&N.stage==="error"&&N.error&&o.jsx(qt,{className:"border-destructive bg-destructive/10",children:o.jsx(Fn,{children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Wa,{className:"h-5 w-5 text-destructive"}),o.jsxs("div",{children:[o.jsx(qn,{className:"text-lg text-destructive",children:"加载失败"}),o.jsx(ts,{className:"text-destructive/80",children:N.error})]})]})})}),x?o.jsxs("div",{className:"flex items-center justify-center py-12",children:[o.jsx(Po,{className:"h-8 w-8 animate-spin text-muted-foreground"}),o.jsx("span",{className:"ml-3 text-muted-foreground",children:"加载插件列表中..."})]}):w?o.jsx(qt,{className:"p-6",children:o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[o.jsx(Wa,{className:"h-12 w-12 text-destructive mb-4"}),o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),o.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:w}),o.jsx(de,{onClick:()=>window.location.reload(),children:"重新加载"})]})}):Q.length===0?o.jsx(qt,{className:"p-6",children:o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[o.jsx(Ni,{className:"h-12 w-12 text-muted-foreground mb-4"}),o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"未找到插件"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:r||i!=="all"?"尝试调整搜索条件或筛选器":"暂无可用插件"})]})}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:Q.map(R=>o.jsxs(qt,{className:"flex flex-col hover:shadow-lg transition-shadow h-full",children:[o.jsxs(Fn,{children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsx(qn,{className:"text-xl",children:R.manifest?.name||R.id}),o.jsxs("div",{className:"flex flex-col gap-1",children:[R.manifest?.categories&&R.manifest.categories[0]&&o.jsx(Xn,{variant:"secondary",className:"text-xs whitespace-nowrap",children:Mz[R.manifest.categories[0]]||R.manifest.categories[0]}),U(R)]})]}),o.jsx(ts,{className:"line-clamp-2",children:R.manifest?.description||"无描述"})]}),o.jsx(Gn,{className:"flex-1",children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Ku,{className:"h-4 w-4"}),o.jsx("span",{children:(L[R.id]?.downloads??R.downloads??0).toLocaleString()})]}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Ac,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),o.jsx("span",{children:(L[R.id]?.rating??R.rating??0).toFixed(1)})]})]}),o.jsxs("div",{className:"flex flex-wrap gap-2",children:[R.manifest?.keywords&&R.manifest.keywords.slice(0,3).map(ie=>o.jsx(Xn,{variant:"outline",className:"text-xs",children:ie},ie)),R.manifest?.keywords&&R.manifest.keywords.length>3&&o.jsxs(Xn,{variant:"outline",className:"text-xs",children:["+",R.manifest.keywords.length-3]})]}),o.jsxs("div",{className:"text-xs text-muted-foreground pt-2 border-t space-y-1",children:[o.jsxs("div",{children:["v",R.manifest?.version||"unknown"," · ",R.manifest?.author?.name||"Unknown"]}),R.manifest?.host_application&&o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{children:"支持:"}),o.jsxs("span",{className:"font-medium",children:[R.manifest.host_application.min_version,R.manifest.host_application.max_version?` - ${R.manifest.host_application.max_version}`:" - 最新版本"]})]})]})]})}),o.jsx(lL,{className:"pt-4",children:o.jsxs("div",{className:"flex items-center justify-end gap-2 w-full",children:[o.jsx(de,{variant:"outline",size:"sm",onClick:()=>n(R),children:"查看详情"}),R.installed?z(R)?o.jsxs(de,{size:"sm",disabled:!k?.installed,title:k?.installed?void 0:"Git 未安装",onClick:()=>X(R),children:[o.jsx(Ps,{className:"h-4 w-4 mr-1"}),"更新"]}):o.jsxs(de,{variant:"destructive",size:"sm",disabled:!k?.installed,title:k?.installed?void 0:"Git 未安装",onClick:()=>J(R),children:[o.jsx(Sn,{className:"h-4 w-4 mr-1"}),"卸载"]}):o.jsxs(de,{size:"sm",disabled:!k?.installed||N?.operation==="install"||E!==null&&!te(R),title:k?.installed?E!==null&&!te(R)?`不兼容当前版本 (需要 ${R.manifest?.host_application?.min_version||"未知"}${R.manifest?.host_application?.max_version?` - ${R.manifest.host_application.max_version}`:"+"},当前 ${E?.version})`:void 0:"Git 未安装",onClick:()=>Y(R),children:[o.jsx(Ku,{className:"h-4 w-4 mr-1"}),N?.operation==="install"&&N?.plugin_id===R.id?"安装中...":"安装"]})]})})]},R.id))}),o.jsx(Dr,{open:e!==null,onOpenChange:F,children:e&&e.manifest&&o.jsxs(Sr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsx(kr,{children:o.jsxs("div",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"space-y-2 flex-1",children:[o.jsx(Or,{className:"text-2xl",children:e.manifest.name}),o.jsxs(ss,{children:["作者: ",e.manifest.author?.name||"Unknown",e.manifest.author?.url&&o.jsx("a",{href:e.manifest.author.url,target:"_blank",rel:"noopener noreferrer",className:"ml-2 text-primary hover:underline",children:o.jsx(Ah,{className:"h-3 w-3 inline"})})]})]}),o.jsxs("div",{className:"flex flex-col gap-2",children:[e.manifest.categories&&e.manifest.categories[0]&&o.jsx(Xn,{variant:"secondary",children:Mz[e.manifest.categories[0]]||e.manifest.categories[0]}),U(e)]})]})}),o.jsxs("div",{className:"space-y-6",children:[o.jsx(zAe,{pluginId:e.id}),o.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:"版本"}),o.jsxs("p",{className:"text-sm text-muted-foreground",children:["v",e.manifest?.version||"unknown"]}),e.installed&&e.installed_version&&o.jsxs("p",{className:"text-xs text-muted-foreground",children:["已安装: v",e.installed_version]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:"下载量"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:(L[e.id]?.downloads??e.downloads??0).toLocaleString()})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:"评分"}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Ac,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),o.jsxs("span",{className:"text-sm text-muted-foreground",children:[(L[e.id]?.rating??e.rating??0).toFixed(1)," (",L[e.id]?.rating_count??e.review_count??0,")"]})]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:"许可证"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e.manifest.license||"Unknown"})]}),o.jsxs("div",{className:"col-span-2",children:[o.jsx("p",{className:"text-sm font-medium",children:"支持版本"}),o.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}`:" - 最新版本"]})]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium mb-2",children:"关键词"}),o.jsx("div",{className:"flex flex-wrap gap-2",children:e.manifest.keywords&&e.manifest.keywords.map(R=>o.jsx(Xn,{variant:"outline",children:R},R))})]}),e.detailed_description&&o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium mb-2",children:"详细说明"}),o.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:e.detailed_description})]}),!e.detailed_description&&o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium mb-2",children:"说明"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e.manifest.description||"无描述"})]}),o.jsxs("div",{className:"space-y-2",children:[e.manifest.homepage_url&&o.jsxs("div",{className:"text-sm",children:[o.jsx("span",{className:"font-medium",children:"主页: "}),o.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&&o.jsxs("div",{className:"text-sm",children:[o.jsx("span",{className:"font-medium",children:"仓库: "}),o.jsx("a",{href:e.manifest.repository_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:e.manifest.repository_url})]})]})]}),o.jsxs(ws,{children:[e.manifest.homepage_url&&o.jsxs(de,{onClick:()=>window.open(e.manifest.homepage_url,"_blank"),children:[o.jsx(Ah,{className:"h-4 w-4 mr-2"}),"访问主页"]}),e.manifest.repository_url&&o.jsxs(de,{variant:"outline",onClick:()=>window.open(e.manifest.repository_url,"_blank"),children:[o.jsx(Ah,{className:"h-4 w-4 mr-2"}),"查看仓库"]})]})]})})]})})}function LAe(){return o.jsx(gn,{className:"h-full",children:o.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件配置"}),o.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理和配置已安装的插件"})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(de,{variant:"outline",size:"sm",children:[o.jsx(Ps,{className:"h-4 w-4 mr-2"}),"刷新"]}),o.jsxs(de,{size:"sm",children:[o.jsx(Xu,{className:"h-4 w-4 mr-2"}),"全局设置"]})]})]}),o.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[o.jsxs(qt,{children:[o.jsxs(Fn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(qn,{className:"text-sm font-medium",children:"已安装插件"}),o.jsx(Gh,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Gn,{children:[o.jsx("div",{className:"text-2xl font-bold",children:"0"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"正在加载..."})]})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(qn,{className:"text-sm font-medium",children:"已启用"}),o.jsx(Vc,{className:"h-4 w-4 text-green-600"})]}),o.jsxs(Gn,{children:[o.jsx("div",{className:"text-2xl font-bold",children:"0"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"运行中的插件"})]})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(qn,{className:"text-sm font-medium",children:"已禁用"}),o.jsx(Uc,{className:"h-4 w-4 text-orange-600"})]}),o.jsxs(Gn,{children:[o.jsx("div",{className:"text-2xl font-bold",children:"0"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"未激活的插件"})]})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(qn,{className:"text-sm font-medium",children:"可更新"}),o.jsx(Ps,{className:"h-4 w-4 text-blue-600"})]}),o.jsxs(Gn,{children:[o.jsx("div",{className:"text-2xl font-bold",children:"0"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"有新版本可用"})]})]})]}),o.jsxs(qt,{children:[o.jsxs(Fn,{children:[o.jsx(qn,{children:"已安装的插件"}),o.jsx(ts,{children:"查看和管理已安装插件的配置"})]}),o.jsx(Gn,{children:o.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[o.jsx(Gh,{className:"h-16 w-16 text-muted-foreground/50"}),o.jsxs("div",{className:"text-center space-y-2",children:[o.jsx("p",{className:"text-lg font-medium text-muted-foreground",children:"插件配置功能开发中"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"即将支持插件的启用/禁用、参数配置等功能"})]}),o.jsx("div",{className:"flex gap-2",children:o.jsx(de,{variant:"outline",asChild:!0,children:o.jsxs("a",{href:"/plugins",children:[o.jsx(Ah,{className:"h-4 w-4 mr-2"}),"前往插件市场"]})})})]})})]}),o.jsx(qt,{className:"border-blue-200 bg-blue-50 dark:bg-blue-950/20 dark:border-blue-900",children:o.jsx(Gn,{className:"pt-6",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(Uc,{className:"h-5 w-5 text-blue-600 mt-0.5 flex-shrink-0"}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-sm font-medium text-blue-900 dark:text-blue-100",children:"开发进行中"}),o.jsxs("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:["插件配置功能正在积极开发中。目前您可以通过",o.jsx("strong",{children:"插件市场"}),"安装和卸载插件,完整的配置管理功能即将推出。"]})]})]})})})]})})}function BAe(){const t=Zi(),{toast:e}=as(),[n,r]=b.useState([]),[s,i]=b.useState(!0),[a,l]=b.useState(null),[c,d]=b.useState(null),[h,m]=b.useState(!1),[g,x]=b.useState(!1),[y,w]=b.useState({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),S=b.useCallback(async()=>{try{i(!0),l(null);const A=localStorage.getItem("access-token"),L=await fetch("/api/webui/plugins/mirrors",{headers:{Authorization:`Bearer ${A}`}});if(!L.ok)throw new Error("获取镜像源列表失败");const P=await L.json();r(P.mirrors||[])}catch(A){const L=A instanceof Error?A.message:"加载镜像源失败";l(L),e({title:"加载失败",description:L,variant:"destructive"})}finally{i(!1)}},[e]);b.useEffect(()=>{S()},[S]);const k=async()=>{try{const A=localStorage.getItem("access-token"),L=await fetch("/api/webui/plugins/mirrors",{method:"POST",headers:{Authorization:`Bearer ${A}`,"Content-Type":"application/json"},body:JSON.stringify(y)});if(!L.ok){const P=await L.json();throw new Error(P.detail||"添加镜像源失败")}e({title:"添加成功",description:"镜像源已添加"}),m(!1),w({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),S()}catch(A){e({title:"添加失败",description:A instanceof Error?A.message:"未知错误",variant:"destructive"})}},j=async()=>{if(c)try{const A=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${c.id}`,{method:"PUT",headers:{Authorization:`Bearer ${A}`,"Content-Type":"application/json"},body:JSON.stringify({name:y.name,raw_prefix:y.raw_prefix,clone_prefix:y.clone_prefix,enabled:y.enabled,priority:y.priority})})).ok)throw new Error("更新镜像源失败");e({title:"更新成功",description:"镜像源已更新"}),x(!1),d(null),S()}catch(A){e({title:"更新失败",description:A instanceof Error?A.message:"未知错误",variant:"destructive"})}},N=async A=>{if(confirm("确定要删除这个镜像源吗?"))try{const L=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${A}`,{method:"DELETE",headers:{Authorization:`Bearer ${L}`}})).ok)throw new Error("删除镜像源失败");e({title:"删除成功",description:"镜像源已删除"}),S()}catch(L){e({title:"删除失败",description:L instanceof Error?L.message:"未知错误",variant:"destructive"})}},T=async A=>{try{const L=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${A.id}`,{method:"PUT",headers:{Authorization:`Bearer ${L}`,"Content-Type":"application/json"},body:JSON.stringify({enabled:!A.enabled})})).ok)throw new Error("更新状态失败");S()}catch(L){e({title:"更新失败",description:L instanceof Error?L.message:"未知错误",variant:"destructive"})}},E=A=>{d(A),w({id:A.id,name:A.name,raw_prefix:A.raw_prefix,clone_prefix:A.clone_prefix,enabled:A.enabled,priority:A.priority}),x(!0)},_=async(A,L)=>{const P=L==="up"?A.priority-1:A.priority+1;if(!(P<1))try{const B=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${A.id}`,{method:"PUT",headers:{Authorization:`Bearer ${B}`,"Content-Type":"application/json"},body:JSON.stringify({priority:P})})).ok)throw new Error("更新优先级失败");S()}catch(B){e({title:"更新失败",description:B instanceof Error?B.message:"未知错误",variant:"destructive"})}};return o.jsx(gn,{className:"h-full",children:o.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(de,{variant:"ghost",size:"icon",onClick:()=>t({to:"/plugins"}),children:o.jsx(wI,{className:"h-5 w-5"})}),o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"镜像源配置"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理 Git 克隆和文件下载的镜像源"})]})]}),o.jsxs(de,{onClick:()=>m(!0),children:[o.jsx(Ls,{className:"h-4 w-4 mr-2"}),"添加镜像源"]})]}),s?o.jsx(qt,{className:"p-6",children:o.jsx("div",{className:"flex items-center justify-center py-8",children:o.jsx(Po,{className:"h-8 w-8 animate-spin text-primary"})})}):a?o.jsx(qt,{className:"p-6",children:o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[o.jsx(Wa,{className:"h-12 w-12 text-destructive mb-4"}),o.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),o.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:a}),o.jsx(de,{onClick:S,children:"重新加载"})]})}):o.jsxs(qt,{children:[o.jsx("div",{className:"hidden md:block",children:o.jsxs(_f,{children:[o.jsx(Af,{children:o.jsxs(Is,{children:[o.jsx(pn,{children:"状态"}),o.jsx(pn,{children:"名称"}),o.jsx(pn,{children:"ID"}),o.jsx(pn,{children:"优先级"}),o.jsx(pn,{className:"text-right",children:"操作"})]})}),o.jsx(Mf,{children:n.map(A=>o.jsxs(Is,{children:[o.jsx(Gt,{children:o.jsx(Bt,{checked:A.enabled,onCheckedChange:()=>T(A)})}),o.jsx(Gt,{children:o.jsxs("div",{children:[o.jsx("div",{className:"font-medium",children:A.name}),o.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Raw: ",A.raw_prefix]})]})}),o.jsx(Gt,{children:o.jsx(Xn,{variant:"outline",children:A.id})}),o.jsx(Gt,{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"font-mono",children:A.priority}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(de,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>_(A,"up"),disabled:A.priority===1,children:o.jsx(P0,{className:"h-3 w-3"})}),o.jsx(de,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>_(A,"down"),children:o.jsx(nd,{className:"h-3 w-3"})})]})]})}),o.jsx(Gt,{className:"text-right",children:o.jsxs("div",{className:"flex items-center justify-end gap-2",children:[o.jsx(de,{variant:"ghost",size:"icon",onClick:()=>E(A),children:o.jsx(Yu,{className:"h-4 w-4"})}),o.jsx(de,{variant:"ghost",size:"icon",onClick:()=>N(A.id),children:o.jsx(Sn,{className:"h-4 w-4 text-destructive"})})]})})]},A.id))})]})}),o.jsx("div",{className:"md:hidden p-4 space-y-4",children:n.map(A=>o.jsx(qt,{className:"p-4",children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-start justify-between",children:[o.jsxs("div",{className:"flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h3",{className:"font-semibold",children:A.name}),A.enabled&&o.jsx(Xn,{variant:"default",className:"text-xs",children:"启用"})]}),o.jsx(Xn,{variant:"outline",className:"mt-1 text-xs",children:A.id})]}),o.jsx(Bt,{checked:A.enabled,onCheckedChange:()=>T(A)})]}),o.jsxs("div",{className:"text-sm space-y-1",children:[o.jsxs("div",{className:"text-muted-foreground",children:[o.jsx("span",{className:"font-medium",children:"Raw: "}),o.jsx("span",{className:"break-all",children:A.raw_prefix})]}),o.jsxs("div",{className:"text-muted-foreground",children:[o.jsx("span",{className:"font-medium",children:"优先级: "}),o.jsx("span",{className:"font-mono",children:A.priority})]})]}),o.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t",children:[o.jsxs(de,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>E(A),children:[o.jsx(Yu,{className:"h-4 w-4 mr-1"}),"编辑"]}),o.jsx(de,{variant:"outline",size:"sm",onClick:()=>_(A,"up"),disabled:A.priority===1,children:o.jsx(P0,{className:"h-4 w-4"})}),o.jsx(de,{variant:"outline",size:"sm",onClick:()=>_(A,"down"),children:o.jsx(nd,{className:"h-4 w-4"})}),o.jsx(de,{variant:"destructive",size:"sm",onClick:()=>N(A.id),children:o.jsx(Sn,{className:"h-4 w-4"})})]})]})},A.id))})]}),o.jsx(Dr,{open:h,onOpenChange:m,children:o.jsxs(Sr,{className:"max-w-lg",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"添加镜像源"}),o.jsx(ss,{children:"添加新的 Git 镜像源配置"})]}),o.jsxs("div",{className:"space-y-4 py-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"add-id",children:"镜像源 ID *"}),o.jsx(ze,{id:"add-id",placeholder:"例如: my-mirror",value:y.id,onChange:A=>w({...y,id:A.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"add-name",children:"名称 *"}),o.jsx(ze,{id:"add-name",placeholder:"例如: 我的镜像源",value:y.name,onChange:A=>w({...y,name:A.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"add-raw",children:"Raw 文件前缀 *"}),o.jsx(ze,{id:"add-raw",placeholder:"https://example.com/raw",value:y.raw_prefix,onChange:A=>w({...y,raw_prefix:A.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"add-clone",children:"克隆前缀 *"}),o.jsx(ze,{id:"add-clone",placeholder:"https://example.com/clone",value:y.clone_prefix,onChange:A=>w({...y,clone_prefix:A.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"add-priority",children:"优先级"}),o.jsx(ze,{id:"add-priority",type:"number",min:"1",value:y.priority,onChange:A=>w({...y,priority:parseInt(A.target.value)||1})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"add-enabled",checked:y.enabled,onCheckedChange:A=>w({...y,enabled:A})}),o.jsx(he,{htmlFor:"add-enabled",children:"启用此镜像源"})]})]}),o.jsxs(ws,{children:[o.jsx(de,{variant:"outline",onClick:()=>m(!1),children:"取消"}),o.jsx(de,{onClick:k,children:"添加"})]})]})}),o.jsx(Dr,{open:g,onOpenChange:x,children:o.jsxs(Sr,{className:"max-w-lg",children:[o.jsxs(kr,{children:[o.jsx(Or,{children:"编辑镜像源"}),o.jsx(ss,{children:"修改镜像源配置"})]}),o.jsxs("div",{className:"space-y-4 py-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{children:"镜像源 ID"}),o.jsx(ze,{value:y.id,disabled:!0})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"edit-name",children:"名称 *"}),o.jsx(ze,{id:"edit-name",value:y.name,onChange:A=>w({...y,name:A.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"edit-raw",children:"Raw 文件前缀 *"}),o.jsx(ze,{id:"edit-raw",value:y.raw_prefix,onChange:A=>w({...y,raw_prefix:A.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"edit-clone",children:"克隆前缀 *"}),o.jsx(ze,{id:"edit-clone",value:y.clone_prefix,onChange:A=>w({...y,clone_prefix:A.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(he,{htmlFor:"edit-priority",children:"优先级"}),o.jsx(ze,{id:"edit-priority",type:"number",min:"1",value:y.priority,onChange:A=>w({...y,priority:parseInt(A.target.value)||1})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Bt,{id:"edit-enabled",checked:y.enabled,onCheckedChange:A=>w({...y,enabled:A})}),o.jsx(he,{htmlFor:"edit-enabled",children:"启用此镜像源"})]})]}),o.jsxs(ws,{children:[o.jsx(de,{variant:"outline",onClick:()=>x(!1),children:"取消"}),o.jsx(de,{onClick:j,children:"保存"})]})]})})]})})}function FAe(t,e=[]){let n=[];function r(i,a){const l=b.createContext(a);l.displayName=i+"Context";const c=n.length;n=[...n,a];const d=m=>{const{scope:g,children:x,...y}=m,w=g?.[t]?.[c]||l,S=b.useMemo(()=>y,Object.values(y));return o.jsx(w.Provider,{value:S,children:x})};d.displayName=i+"Provider";function h(m,g){const x=g?.[t]?.[c]||l,y=b.useContext(x);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${m}\` must be used within \`${i}\``)}return[d,h]}const s=()=>{const i=n.map(a=>b.createContext(a));return function(l){const c=l?.[t]||i;return b.useMemo(()=>({[`__scope${t}`]:{...l,[t]:c}}),[l,c])}};return s.scopeName=t,[r,qAe(s,...e)]}function qAe(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((l,{useScope:c,scopeName:d})=>{const m=c(i)[`__scope${d}`];return{...l,...m}},{});return b.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var $Ae=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],f7=$Ae.reduce((t,e)=>{const n=Fy(`Primitive.${e}`),r=b.forwardRef((s,i)=>{const{asChild:a,...l}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),HAe=gJ();function QAe(){return HAe.useSyncExternalStore(VAe,()=>!0,()=>!1)}function VAe(){return()=>{}}var m7="Avatar",[UAe]=FAe(m7),[WAe,hX]=UAe(m7),fX=b.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[s,i]=b.useState("idle");return o.jsx(WAe,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:o.jsx(f7.span,{...r,ref:e})})});fX.displayName=m7;var mX="AvatarImage",pX=b.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...i}=t,a=hX(mX,n),l=GAe(r,i),c=Rs(d=>{s(d),a.onImageLoadingStatusChange(d)});return Uh(()=>{l!=="idle"&&c(l)},[l,c]),l==="loaded"?o.jsx(f7.img,{...i,ref:e,src:r}):null});pX.displayName=mX;var gX="AvatarFallback",xX=b.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...s}=t,i=hX(gX,n),[a,l]=b.useState(r===void 0);return b.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>l(!0),r);return()=>window.clearTimeout(c)}},[r]),a&&i.imageLoadingStatus!=="loaded"?o.jsx(f7.span,{...s,ref:e}):null});xX.displayName=gX;function Rz(t,e){return t?e?(t.src!==e&&(t.src=e),t.complete&&t.naturalWidth>0?"loaded":"loading"):"error":"idle"}function GAe(t,{referrerPolicy:e,crossOrigin:n}){const r=QAe(),s=b.useRef(null),i=r?(s.current||(s.current=new window.Image),s.current):null,[a,l]=b.useState(()=>Rz(i,t));return Uh(()=>{l(Rz(i,t))},[i,t]),Uh(()=>{const c=m=>()=>{l(m)};if(!i)return;const d=c("loaded"),h=c("error");return i.addEventListener("load",d),i.addEventListener("error",h),e&&(i.referrerPolicy=e),typeof n=="string"&&(i.crossOrigin=n),()=>{i.removeEventListener("load",d),i.removeEventListener("error",h)}},[i,n,e]),a}var vX=fX,yX=pX,bX=xX;const _v=b.forwardRef(({className:t,...e},n)=>o.jsx(vX,{ref:n,className:xe("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));_v.displayName=vX.displayName;const XAe=b.forwardRef(({className:t,...e},n)=>o.jsx(yX,{ref:n,className:xe("aspect-square h-full w-full",t),...e}));XAe.displayName=yX.displayName;const Av=b.forwardRef(({className:t,...e},n)=>o.jsx(bX,{ref:n,className:xe("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...e}));Av.displayName=bX.displayName;function YAe(){return"webui_"+Math.random().toString(36).substr(2,9)+"_"+Date.now().toString(36)}function KAe(){const t="maibot_webui_user_id";let e=localStorage.getItem(t);return e||(e=YAe(),localStorage.setItem(t,e)),e}function ZAe(){return localStorage.getItem("maibot_webui_user_name")||"WebUI用户"}function JAe(t){localStorage.setItem("maibot_webui_user_name",t)}function eMe(){const[t,e]=b.useState([]),[n,r]=b.useState(""),[s,i]=b.useState(!1),[a,l]=b.useState(!1),[c,d]=b.useState(!1),[h,m]=b.useState(!0),[g,x]=b.useState(ZAe()),[y,w]=b.useState(!1),[S,k]=b.useState(""),[j,N]=b.useState({}),T=b.useRef(KAe()),E=b.useRef(null),_=b.useRef(null),A=b.useRef(null),L=b.useRef(0),P=b.useRef(new Set),{toast:B}=as(),$=I=>(L.current+=1,`${I}-${Date.now()}-${L.current}-${Math.random().toString(36).substr(2,9)}`),U=b.useCallback(()=>{_.current?.scrollIntoView({behavior:"smooth"})},[]);b.useEffect(()=>{U()},[t,U]);const te=b.useCallback(async()=>{m(!0);try{const I=`/api/chat/history?user_id=${T.current}&limit=50`;console.log("[Chat] 正在加载历史消息:",I);const V=await fetch(I);if(console.log("[Chat] 历史消息响应状态:",V.status,V.statusText),console.log("[Chat] 响应 Content-Type:",V.headers.get("content-type")),V.ok){const ee=await V.text();console.log("[Chat] 响应内容前100字符:",ee.substring(0,100));try{const ne=JSON.parse(ee);if(console.log("[Chat] 解析后的数据:",ne),ne.messages&&ne.messages.length>0){const W=ne.messages.map(se=>({id:se.id,type:se.type,content:se.content,timestamp:se.timestamp,sender:{name:se.sender_name||(se.is_bot?"麦麦":"WebUI用户"),user_id:se.user_id,is_bot:se.is_bot}}));e(W),console.log("[Chat] 已加载历史消息数量:",W.length),W.forEach(se=>{if(se.type==="bot"){const re=`bot-${se.content}-${Math.floor(se.timestamp*1e3)}`;P.current.add(re)}})}else console.log("[Chat] 没有历史消息")}catch(ne){console.error("[Chat] JSON 解析失败:",ne),console.error("[Chat] 原始响应内容:",ee)}}else{console.error("[Chat] 响应失败:",V.status);const ee=await V.text();console.error("[Chat] 错误响应内容:",ee.substring(0,200))}}catch(I){console.error("[Chat] 加载历史消息失败:",I)}finally{m(!1)}},[]),z=b.useCallback(()=>{if(E.current?.readyState===WebSocket.OPEN||E.current?.readyState===WebSocket.CONNECTING){console.log("WebSocket 已存在,跳过连接");return}l(!0);const V=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/chat/ws?user_id=${encodeURIComponent(T.current)}&user_name=${encodeURIComponent(g)}`;console.log("正在连接 WebSocket:",V);try{const ee=new WebSocket(V);E.current=ee,ee.onopen=()=>{i(!0),l(!1),console.log("WebSocket 已连接")},ee.onmessage=ne=>{try{const W=JSON.parse(ne.data);switch(W.type){case"session_info":N({session_id:W.session_id,user_id:W.user_id,user_name:W.user_name,bot_name:W.bot_name});break;case"system":e(se=>[...se,{id:$("sys"),type:"system",content:W.content||"",timestamp:W.timestamp||Date.now()/1e3}]);break;case"user_message":e(se=>[...se,{id:W.message_id||$("user"),type:"user",content:W.content||"",timestamp:W.timestamp||Date.now()/1e3,sender:W.sender}]);break;case"bot_message":{d(!1);const se=`bot-${W.content}-${Math.floor((W.timestamp||0)*1e3)}`;if(P.current.has(se)){console.log("跳过重复的机器人消息");break}if(P.current.add(se),P.current.size>100){const re=P.current.values().next().value;re&&P.current.delete(re)}e(re=>[...re,{id:$("bot"),type:"bot",content:W.content||"",timestamp:W.timestamp||Date.now()/1e3,sender:W.sender}]);break}case"typing":d(W.is_typing||!1);break;case"error":e(se=>[...se,{id:$("error"),type:"error",content:W.content||"发生错误",timestamp:W.timestamp||Date.now()/1e3}]),B({title:"错误",description:W.content,variant:"destructive"});break;case"pong":break;default:console.log("未知消息类型:",W.type)}}catch(W){console.error("解析消息失败:",W)}},ee.onclose=()=>{i(!1),l(!1),E.current=null,console.log("WebSocket 已断开"),A.current&&clearTimeout(A.current),A.current=window.setTimeout(()=>{Q.current||z()},5e3)},ee.onerror=ne=>{console.error("WebSocket 错误:",ne),l(!1)}}catch(ee){console.error("创建 WebSocket 失败:",ee),l(!1)}},[B,g]),Q=b.useRef(!1);b.useEffect(()=>{Q.current=!1,te();const I=setTimeout(()=>{Q.current||z()},100),V=setInterval(()=>{E.current?.readyState===WebSocket.OPEN&&E.current.send(JSON.stringify({type:"ping"}))},3e4);return()=>{Q.current=!0,clearTimeout(I),clearInterval(V),A.current&&(clearTimeout(A.current),A.current=null),E.current&&(E.current.close(),E.current=null)}},[z,te]);const F=b.useCallback(()=>{!n.trim()||!E.current||E.current.readyState!==WebSocket.OPEN||(E.current.send(JSON.stringify({type:"message",content:n.trim(),user_name:g})),r(""))},[n,g]),Y=I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),F())},J=()=>{k(g),w(!0)},X=()=>{const I=S.trim()||"WebUI用户";x(I),JAe(I),w(!1),E.current?.readyState===WebSocket.OPEN&&E.current.send(JSON.stringify({type:"update_nickname",user_name:I}))},R=()=>{k(""),w(!1)},ie=I=>new Date(I*1e3).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}),G=()=>{E.current&&E.current.close(),z()};return o.jsxs("div",{className:"h-full flex flex-col",children:[o.jsx("div",{className:"shrink-0 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:o.jsxs("div",{className:"p-3 sm:p-4 max-w-4xl mx-auto",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0",children:[o.jsx(_v,{className:"h-8 w-8 sm:h-10 sm:w-10 shrink-0",children:o.jsx(Av,{className:"bg-primary/10 text-primary",children:o.jsx(a0,{className:"h-4 w-4 sm:h-5 sm:w-5"})})}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("h1",{className:"text-base sm:text-lg font-semibold truncate",children:j.bot_name||"麦麦"}),o.jsx("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:s?o.jsxs(o.Fragment,{children:[o.jsx(ite,{className:"h-3 w-3 text-green-500"}),o.jsx("span",{className:"text-green-600 dark:text-green-400",children:"已连接"})]}):a?o.jsxs(o.Fragment,{children:[o.jsx(Po,{className:"h-3 w-3 animate-spin"}),o.jsx("span",{children:"连接中..."})]}):o.jsxs(o.Fragment,{children:[o.jsx(ate,{className:"h-3 w-3 text-red-500"}),o.jsx("span",{className:"text-red-600 dark:text-red-400",children:"未连接"})]})})]})]}),o.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[h&&o.jsx(Po,{className:"h-4 w-4 animate-spin text-muted-foreground"}),o.jsx(de,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:G,disabled:a,title:"重新连接",children:o.jsx(Ps,{className:xe("h-4 w-4",a&&"animate-spin")})})]})]}),o.jsxs("div",{className:"hidden sm:flex items-center gap-2 mt-2 text-sm text-muted-foreground",children:[o.jsx(Dv,{className:"h-3 w-3"}),o.jsx("span",{children:"当前身份:"}),y?o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ze,{value:S,onChange:I=>k(I.target.value),onKeyDown:I=>{I.key==="Enter"&&X(),I.key==="Escape"&&R()},className:"h-7 w-32",placeholder:"输入昵称",autoFocus:!0}),o.jsx(de,{size:"sm",variant:"ghost",className:"h-7 px-2",onClick:X,children:"保存"}),o.jsx(de,{size:"sm",variant:"ghost",className:"h-7 px-2",onClick:R,children:"取消"})]}):o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"font-medium text-foreground",children:g}),o.jsx(de,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:J,title:"修改昵称",children:o.jsx(ote,{className:"h-3 w-3"})})]})]})]})}),o.jsx("div",{className:"flex-1 overflow-hidden",children:o.jsx(gn,{className:"h-full",children:o.jsxs("div",{className:"p-3 sm:p-4 max-w-4xl mx-auto space-y-3 sm:space-y-4",children:[t.length===0&&!h&&o.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[o.jsx(a0,{className:"h-12 w-12 mb-4 opacity-50"}),o.jsxs("p",{className:"text-sm",children:["开始与 ",j.bot_name||"麦麦"," 对话吧!"]})]}),t.map(I=>o.jsxs("div",{className:xe("flex gap-2 sm:gap-3",I.type==="user"&&"flex-row-reverse",I.type==="system"&&"justify-center",I.type==="error"&&"justify-center"),children:[I.type==="system"&&o.jsx("div",{className:"text-xs text-muted-foreground bg-muted/50 px-3 py-1 rounded-full max-w-[90%]",children:I.content}),I.type==="error"&&o.jsx("div",{className:"text-xs text-red-600 dark:text-red-400 bg-red-100 dark:bg-red-900/30 px-3 py-1 rounded-full max-w-[90%]",children:I.content}),(I.type==="user"||I.type==="bot")&&o.jsxs(o.Fragment,{children:[o.jsx(_v,{className:"h-7 w-7 sm:h-8 sm:w-8 shrink-0",children:o.jsx(Av,{className:xe("text-xs",I.type==="bot"?"bg-primary/10 text-primary":"bg-secondary text-secondary-foreground"),children:I.type==="bot"?o.jsx(a0,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"}):o.jsx(Dv,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"})})}),o.jsxs("div",{className:xe("flex flex-col gap-1 max-w-[75%] sm:max-w-[70%]",I.type==="user"&&"items-end"),children:[o.jsxs("div",{className:"flex items-center gap-2 text-[10px] sm:text-xs text-muted-foreground",children:[o.jsx("span",{className:"hidden sm:inline",children:I.sender?.name||(I.type==="bot"?j.bot_name:g)}),o.jsx("span",{children:ie(I.timestamp)})]}),o.jsx("div",{className:xe("rounded-2xl px-3 py-2 text-sm whitespace-pre-wrap break-words",I.type==="bot"?"bg-muted rounded-tl-sm":"bg-primary text-primary-foreground rounded-tr-sm"),children:I.content})]})]})]},I.id)),c&&o.jsxs("div",{className:"flex gap-2 sm:gap-3",children:[o.jsx(_v,{className:"h-7 w-7 sm:h-8 sm:w-8 shrink-0",children:o.jsx(Av,{className:"bg-primary/10 text-primary",children:o.jsx(a0,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4"})})}),o.jsx("div",{className:"bg-muted rounded-2xl rounded-tl-sm px-4 py-3",children:o.jsxs("div",{className:"flex gap-1",children:[o.jsx("span",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),o.jsx("span",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),o.jsx("span",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})})]}),o.jsx("div",{ref:_})]})})}),o.jsx("div",{className:"shrink-0 border-t bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:o.jsx("div",{className:"p-3 sm:p-4 max-w-4xl mx-auto",children:o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ze,{value:n,onChange:I=>r(I.target.value),onKeyDown:Y,placeholder:s?"输入消息...":"等待连接...",disabled:!s,className:"flex-1 h-10 sm:h-10"}),o.jsx(de,{onClick:F,disabled:!s||!n.trim(),size:"icon",className:"h-10 w-10 shrink-0",children:o.jsx(lte,{className:"h-4 w-4"})})]})})})]})}const tMe=kf("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"}}),wX=b.forwardRef(({className:t,size:e,abbrTitle:n,children:r,...s},i)=>o.jsx("kbd",{className:xe(tMe({size:e,className:t})),ref:i,...s,children:n?o.jsx("abbr",{title:n,children:r}):r}));wX.displayName="Kbd";const nMe=[{icon:D0,title:"首页",description:"查看仪表板概览",path:"/",category:"概览"},{icon:zl,title:"麦麦主程序配置",description:"配置麦麦的核心设置",path:"/config/bot",category:"配置"},{icon:kI,title:"麦麦模型提供商配置",description:"配置模型提供商",path:"/config/modelProvider",category:"配置"},{icon:OI,title:"麦麦模型配置",description:"配置模型参数",path:"/config/model",category:"配置"},{icon:_j,title:"表情包管理",description:"管理麦麦的表情包",path:"/resource/emoji",category:"资源"},{icon:Wh,title:"表达方式管理",description:"管理麦麦的表达方式",path:"/resource/expression",category:"资源"},{icon:jI,title:"人物信息管理",description:"管理人物信息",path:"/resource/person",category:"资源"},{icon:cte,title:"统计信息",description:"查看使用统计",path:"/statistics",category:"监控"},{icon:Gh,title:"插件市场",description:"浏览和安装插件",path:"/plugins",category:"扩展"},{icon:Pv,title:"日志查看器",description:"查看系统日志",path:"/logs",category:"监控"},{icon:Xu,title:"系统设置",description:"配置系统参数",path:"/settings",category:"系统"}];function rMe({open:t,onOpenChange:e}){const[n,r]=b.useState(""),[s,i]=b.useState(0),a=Zi(),l=nMe.filter(h=>h.title.toLowerCase().includes(n.toLowerCase())||h.description.toLowerCase().includes(n.toLowerCase())||h.category.toLowerCase().includes(n.toLowerCase()));b.useEffect(()=>{t&&(r(""),i(0))},[t]);const c=b.useCallback(h=>{a({to:h}),e(!1)},[a,e]),d=b.useCallback(h=>{h.key==="ArrowDown"?(h.preventDefault(),i(m=>(m+1)%l.length)):h.key==="ArrowUp"?(h.preventDefault(),i(m=>(m-1+l.length)%l.length)):h.key==="Enter"&&l[s]&&(h.preventDefault(),c(l[s].path))},[l,s,c]);return o.jsx(Dr,{open:t,onOpenChange:e,children:o.jsxs(Sr,{className:"max-w-2xl p-0 gap-0",children:[o.jsxs(kr,{className:"px-4 pt-4 pb-0",children:[o.jsx(Or,{className:"sr-only",children:"搜索"}),o.jsxs("div",{className:"relative",children:[o.jsx(Ni,{className:"absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground"}),o.jsx(ze,{value:n,onChange:h=>{r(h.target.value),i(0)},onKeyDown:d,placeholder:"搜索页面...",className:"h-12 pl-11 text-base border-0 focus-visible:ring-0 shadow-none",autoFocus:!0})]})]}),o.jsx("div",{className:"border-t",children:o.jsx(gn,{className:"h-[400px]",children:l.length>0?o.jsx("div",{className:"p-2",children:l.map((h,m)=>{const g=h.icon;return o.jsxs("button",{onClick:()=>c(h.path),onMouseEnter:()=>i(m),className:xe("w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-left transition-colors",m===s?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:[o.jsx(g,{className:"h-5 w-5 flex-shrink-0"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"font-medium text-sm",children:h.title}),o.jsx("div",{className:"text-xs text-muted-foreground truncate",children:h.description})]}),o.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1 bg-muted rounded",children:h.category})]},h.path)})}):o.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[o.jsx(Ni,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:n?"未找到匹配的页面":"输入关键词开始搜索"})]})})}),o.jsx("div",{className:"border-t px-4 py-3 flex items-center justify-between text-xs text-muted-foreground",children:o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↑"}),o.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↓"}),"导航"]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Enter"}),"选择"]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Esc"}),"关闭"]})]})})]})})}function sMe(t){const e=iMe(t),n=b.forwardRef((r,s)=>{const{children:i,...a}=r,l=b.Children.toArray(i),c=l.find(oMe);if(c){const d=c.props.children,h=l.map(m=>m===c?b.Children.count(d)>1?b.Children.only(null):b.isValidElement(d)?d.props.children:null:m);return o.jsx(e,{...a,ref:s,children:b.isValidElement(d)?b.cloneElement(d,void 0,h):null})}return o.jsx(e,{...a,ref:s,children:i})});return n.displayName=`${t}.Slot`,n}function iMe(t){const e=b.forwardRef((n,r)=>{const{children:s,...i}=n;if(b.isValidElement(s)){const a=cMe(s),l=lMe(i,s.props);return s.type!==b.Fragment&&(l.ref=r?Qc(r,a):a),b.cloneElement(s,l)}return b.Children.count(s)>1?b.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var aMe=Symbol("radix.slottable");function oMe(t){return b.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===aMe}function lMe(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...l)=>{const c=i(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function cMe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var cj=["Enter"," "],uMe=["ArrowDown","PageUp","Home"],SX=["ArrowUp","PageDown","End"],dMe=[...uMe,...SX],hMe={ltr:[...cj,"ArrowRight"],rtl:[...cj,"ArrowLeft"]},fMe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},kg="Menu",[Np,mMe,pMe]=By(kg),[jd,kX]=Ra(kg,[pMe,vf,eb]),Og=vf(),OX=eb(),[jX,fu]=jd(kg),[gMe,jg]=jd(kg),NX=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:s,onOpenChange:i,modal:a=!0}=t,l=Og(e),[c,d]=b.useState(null),h=b.useRef(!1),m=Rs(i),g=Ep(s);return b.useEffect(()=>{const x=()=>{h.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>h.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),o.jsx(Vy,{...l,children:o.jsx(jX,{scope:e,open:n,onOpenChange:m,content:c,onContentChange:d,children:o.jsx(gMe,{scope:e,onClose:b.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:h,dir:g,modal:a,children:r})})})};NX.displayName=kg;var xMe="MenuAnchor",p7=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=Og(n);return o.jsx(Uy,{...s,...r,ref:e})});p7.displayName=xMe;var g7="MenuPortal",[vMe,CX]=jd(g7,{forceMount:void 0}),TX=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:s}=t,i=fu(g7,e);return o.jsx(vMe,{scope:e,forceMount:n,children:o.jsx(ii,{present:n||i.open,children:o.jsx(Qy,{asChild:!0,container:s,children:r})})})};TX.displayName=g7;var Ta="MenuContent",[yMe,x7]=jd(Ta),EX=b.forwardRef((t,e)=>{const n=CX(Ta,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=fu(Ta,t.__scopeMenu),a=jg(Ta,t.__scopeMenu);return o.jsx(Np.Provider,{scope:t.__scopeMenu,children:o.jsx(ii,{present:r||i.open,children:o.jsx(Np.Slot,{scope:t.__scopeMenu,children:a.modal?o.jsx(bMe,{...s,ref:e}):o.jsx(wMe,{...s,ref:e})})})})}),bMe=b.forwardRef((t,e)=>{const n=fu(Ta,t.__scopeMenu),r=b.useRef(null),s=Yn(e,r);return b.useEffect(()=>{const i=r.current;if(i)return hI(i)},[]),o.jsx(v7,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:nt(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),wMe=b.forwardRef((t,e)=>{const n=fu(Ta,t.__scopeMenu);return o.jsx(v7,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),SMe=sMe("MenuContent.ScrollLock"),v7=b.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:g,onDismiss:x,disableOutsideScroll:y,...w}=t,S=fu(Ta,n),k=jg(Ta,n),j=Og(n),N=OX(n),T=mMe(n),[E,_]=b.useState(null),A=b.useRef(null),L=Yn(e,A,S.onContentChange),P=b.useRef(0),B=b.useRef(""),$=b.useRef(0),U=b.useRef(null),te=b.useRef("right"),z=b.useRef(0),Q=y?fI:b.Fragment,F=y?{as:SMe,allowPinchZoom:!0}:void 0,Y=X=>{const R=B.current+X,ie=T().filter(W=>!W.disabled),G=document.activeElement,I=ie.find(W=>W.ref.current===G)?.textValue,V=ie.map(W=>W.textValue),ee=DMe(V,R,I),ne=ie.find(W=>W.textValue===ee)?.ref.current;(function W(se){B.current=se,window.clearTimeout(P.current),se!==""&&(P.current=window.setTimeout(()=>W(""),1e3))})(R),ne&&setTimeout(()=>ne.focus())};b.useEffect(()=>()=>window.clearTimeout(P.current),[]),mI();const J=b.useCallback(X=>te.current===U.current?.side&&zMe(X,U.current?.area),[]);return o.jsx(yMe,{scope:n,searchRef:B,onItemEnter:b.useCallback(X=>{J(X)&&X.preventDefault()},[J]),onItemLeave:b.useCallback(X=>{J(X)||(A.current?.focus(),_(null))},[J]),onTriggerLeave:b.useCallback(X=>{J(X)&&X.preventDefault()},[J]),pointerGraceTimerRef:$,onPointerGraceIntentChange:b.useCallback(X=>{U.current=X},[]),children:o.jsx(Q,{...F,children:o.jsx(pI,{asChild:!0,trapped:s,onMountAutoFocus:nt(i,X=>{X.preventDefault(),A.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:o.jsx(Cj,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:g,onDismiss:x,children:o.jsx(mL,{asChild:!0,...N,dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:_,onEntryFocus:nt(c,X=>{k.isUsingKeyboardRef.current||X.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(Tj,{role:"menu","aria-orientation":"vertical","data-state":UX(S.open),"data-radix-menu-content":"",dir:k.dir,...j,...w,ref:L,style:{outline:"none",...w.style},onKeyDown:nt(w.onKeyDown,X=>{const ie=X.target.closest("[data-radix-menu-content]")===X.currentTarget,G=X.ctrlKey||X.altKey||X.metaKey,I=X.key.length===1;ie&&(X.key==="Tab"&&X.preventDefault(),!G&&I&&Y(X.key));const V=A.current;if(X.target!==V||!dMe.includes(X.key))return;X.preventDefault();const ne=T().filter(W=>!W.disabled).map(W=>W.ref.current);SX.includes(X.key)&&ne.reverse(),MMe(ne)}),onBlur:nt(t.onBlur,X=>{X.currentTarget.contains(X.target)||(window.clearTimeout(P.current),B.current="")}),onPointerMove:nt(t.onPointerMove,Cp(X=>{const R=X.target,ie=z.current!==X.clientX;if(X.currentTarget.contains(R)&&ie){const G=X.clientX>z.current?"right":"left";te.current=G,z.current=X.clientX}}))})})})})})})});EX.displayName=Ta;var kMe="MenuGroup",y7=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return o.jsx(xn.div,{role:"group",...r,ref:e})});y7.displayName=kMe;var OMe="MenuLabel",_X=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return o.jsx(xn.div,{...r,ref:e})});_X.displayName=OMe;var Py="MenuItem",Dz="menu.itemSelect",rw=b.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...s}=t,i=b.useRef(null),a=jg(Py,t.__scopeMenu),l=x7(Py,t.__scopeMenu),c=Yn(e,i),d=b.useRef(!1),h=()=>{const m=i.current;if(!n&&m){const g=new CustomEvent(Dz,{bubbles:!0,cancelable:!0});m.addEventListener(Dz,x=>r?.(x),{once:!0}),xI(m,g),g.defaultPrevented?d.current=!1:a.onClose()}};return o.jsx(AX,{...s,ref:c,disabled:n,onClick:nt(t.onClick,h),onPointerDown:m=>{t.onPointerDown?.(m),d.current=!0},onPointerUp:nt(t.onPointerUp,m=>{d.current||m.currentTarget?.click()}),onKeyDown:nt(t.onKeyDown,m=>{const g=l.searchRef.current!=="";n||g&&m.key===" "||cj.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});rw.displayName=Py;var AX=b.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=t,a=x7(Py,n),l=OX(n),c=b.useRef(null),d=Yn(e,c),[h,m]=b.useState(!1),[g,x]=b.useState("");return b.useEffect(()=>{const y=c.current;y&&x((y.textContent??"").trim())},[i.children]),o.jsx(Np.ItemSlot,{scope:n,disabled:r,textValue:s??g,children:o.jsx(pL,{asChild:!0,...l,focusable:!r,children:o.jsx(xn.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:d,onPointerMove:nt(t.onPointerMove,Cp(y=>{r?a.onItemLeave(y):(a.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:nt(t.onPointerLeave,Cp(y=>a.onItemLeave(y))),onFocus:nt(t.onFocus,()=>m(!0)),onBlur:nt(t.onBlur,()=>m(!1))})})})}),jMe="MenuCheckboxItem",MX=b.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...s}=t;return o.jsx(IX,{scope:t.__scopeMenu,checked:n,children:o.jsx(rw,{role:"menuitemcheckbox","aria-checked":zy(n)?"mixed":n,...s,ref:e,"data-state":S7(n),onSelect:nt(s.onSelect,()=>r?.(zy(n)?!0:!n),{checkForDefaultPrevented:!1})})})});MX.displayName=jMe;var RX="MenuRadioGroup",[NMe,CMe]=jd(RX,{value:void 0,onValueChange:()=>{}}),DX=b.forwardRef((t,e)=>{const{value:n,onValueChange:r,...s}=t,i=Rs(r);return o.jsx(NMe,{scope:t.__scopeMenu,value:n,onValueChange:i,children:o.jsx(y7,{...s,ref:e})})});DX.displayName=RX;var PX="MenuRadioItem",zX=b.forwardRef((t,e)=>{const{value:n,...r}=t,s=CMe(PX,t.__scopeMenu),i=n===s.value;return o.jsx(IX,{scope:t.__scopeMenu,checked:i,children:o.jsx(rw,{role:"menuitemradio","aria-checked":i,...r,ref:e,"data-state":S7(i),onSelect:nt(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});zX.displayName=PX;var b7="MenuItemIndicator",[IX,TMe]=jd(b7,{checked:!1}),LX=b.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...s}=t,i=TMe(b7,n);return o.jsx(ii,{present:r||zy(i.checked)||i.checked===!0,children:o.jsx(xn.span,{...s,ref:e,"data-state":S7(i.checked)})})});LX.displayName=b7;var EMe="MenuSeparator",BX=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return o.jsx(xn.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});BX.displayName=EMe;var _Me="MenuArrow",FX=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=Og(n);return o.jsx(Ej,{...s,...r,ref:e})});FX.displayName=_Me;var w7="MenuSub",[AMe,qX]=jd(w7),$X=t=>{const{__scopeMenu:e,children:n,open:r=!1,onOpenChange:s}=t,i=fu(w7,e),a=Og(e),[l,c]=b.useState(null),[d,h]=b.useState(null),m=Rs(s);return b.useEffect(()=>(i.open===!1&&m(!1),()=>m(!1)),[i.open,m]),o.jsx(Vy,{...a,children:o.jsx(jX,{scope:e,open:r,onOpenChange:m,content:d,onContentChange:h,children:o.jsx(AMe,{scope:e,contentId:Ui(),triggerId:Ui(),trigger:l,onTriggerChange:c,children:n})})})};$X.displayName=w7;var x0="MenuSubTrigger",HX=b.forwardRef((t,e)=>{const n=fu(x0,t.__scopeMenu),r=jg(x0,t.__scopeMenu),s=qX(x0,t.__scopeMenu),i=x7(x0,t.__scopeMenu),a=b.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=i,d={__scopeMenu:t.__scopeMenu},h=b.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return b.useEffect(()=>h,[h]),b.useEffect(()=>{const m=l.current;return()=>{window.clearTimeout(m),c(null)}},[l,c]),o.jsx(p7,{asChild:!0,...d,children:o.jsx(AX,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":UX(n.open),...t,ref:Qc(e,s.onTriggerChange),onClick:m=>{t.onClick?.(m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:nt(t.onPointerMove,Cp(m=>{i.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:nt(t.onPointerLeave,Cp(m=>{h();const g=n.content?.getBoundingClientRect();if(g){const x=n.content?.dataset.side,y=x==="right",w=y?-5:5,S=g[y?"left":"right"],k=g[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:m.clientX+w,y:m.clientY},{x:S,y:g.top},{x:k,y:g.top},{x:k,y:g.bottom},{x:S,y:g.bottom}],side:x}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(m),m.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:nt(t.onKeyDown,m=>{const g=i.searchRef.current!=="";t.disabled||g&&m.key===" "||hMe[r.dir].includes(m.key)&&(n.onOpenChange(!0),n.content?.focus(),m.preventDefault())})})})});HX.displayName=x0;var QX="MenuSubContent",VX=b.forwardRef((t,e)=>{const n=CX(Ta,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=fu(Ta,t.__scopeMenu),a=jg(Ta,t.__scopeMenu),l=qX(QX,t.__scopeMenu),c=b.useRef(null),d=Yn(e,c);return o.jsx(Np.Provider,{scope:t.__scopeMenu,children:o.jsx(ii,{present:r||i.open,children:o.jsx(Np.Slot,{scope:t.__scopeMenu,children:o.jsx(v7,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:d,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{a.isUsingKeyboardRef.current&&c.current?.focus(),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:nt(t.onFocusOutside,h=>{h.target!==l.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:nt(t.onEscapeKeyDown,h=>{a.onClose(),h.preventDefault()}),onKeyDown:nt(t.onKeyDown,h=>{const m=h.currentTarget.contains(h.target),g=fMe[a.dir].includes(h.key);m&&g&&(i.onOpenChange(!1),l.trigger?.focus(),h.preventDefault())})})})})})});VX.displayName=QX;function UX(t){return t?"open":"closed"}function zy(t){return t==="indeterminate"}function S7(t){return zy(t)?"indeterminate":t?"checked":"unchecked"}function MMe(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function RMe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function DMe(t,e,n){const s=e.length>1&&Array.from(e).every(d=>d===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let a=RMe(t,Math.max(i,0));s.length===1&&(a=a.filter(d=>d!==n));const c=a.find(d=>d.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function PMe(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;ir!=g>r&&n<(m-d)*(r-h)/(g-h)+d&&(s=!s)}return s}function zMe(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return PMe(n,e)}function Cp(t){return e=>e.pointerType==="mouse"?t(e):void 0}var IMe=NX,LMe=p7,BMe=TX,FMe=EX,qMe=y7,$Me=_X,HMe=rw,QMe=MX,VMe=DX,UMe=zX,WMe=LX,GMe=BX,XMe=FX,YMe=$X,KMe=HX,ZMe=VX,k7="ContextMenu",[JMe]=Ra(k7,[kX]),Gs=kX(),[eRe,WX]=JMe(k7),GX=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:s,modal:i=!0}=t,[a,l]=b.useState(!1),c=Gs(e),d=Rs(r),h=b.useCallback(m=>{l(m),d(m)},[d]);return o.jsx(eRe,{scope:e,open:a,onOpenChange:h,modal:i,children:o.jsx(IMe,{...c,dir:s,open:a,onOpenChange:h,modal:i,children:n})})};GX.displayName=k7;var XX="ContextMenuTrigger",YX=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=t,i=WX(XX,n),a=Gs(n),l=b.useRef({x:0,y:0}),c=b.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...l.current})}),d=b.useRef(0),h=b.useCallback(()=>window.clearTimeout(d.current),[]),m=g=>{l.current={x:g.clientX,y:g.clientY},i.onOpenChange(!0)};return b.useEffect(()=>h,[h]),b.useEffect(()=>void(r&&h()),[r,h]),o.jsxs(o.Fragment,{children:[o.jsx(LMe,{...a,virtualRef:c}),o.jsx(xn.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:nt(t.onContextMenu,g=>{h(),m(g),g.preventDefault()}),onPointerDown:r?t.onPointerDown:nt(t.onPointerDown,K1(g=>{h(),d.current=window.setTimeout(()=>m(g),700)})),onPointerMove:r?t.onPointerMove:nt(t.onPointerMove,K1(h)),onPointerCancel:r?t.onPointerCancel:nt(t.onPointerCancel,K1(h)),onPointerUp:r?t.onPointerUp:nt(t.onPointerUp,K1(h))})]})});YX.displayName=XX;var tRe="ContextMenuPortal",KX=t=>{const{__scopeContextMenu:e,...n}=t,r=Gs(e);return o.jsx(BMe,{...r,...n})};KX.displayName=tRe;var ZX="ContextMenuContent",JX=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=WX(ZX,n),i=Gs(n),a=b.useRef(!1);return o.jsx(FMe,{...i,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:l=>{t.onCloseAutoFocus?.(l),!l.defaultPrevented&&a.current&&l.preventDefault(),a.current=!1},onInteractOutside:l=>{t.onInteractOutside?.(l),!l.defaultPrevented&&!s.modal&&(a.current=!0)},style:{...t.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)"}})});JX.displayName=ZX;var nRe="ContextMenuGroup",rRe=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Gs(n);return o.jsx(qMe,{...s,...r,ref:e})});rRe.displayName=nRe;var sRe="ContextMenuLabel",eY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Gs(n);return o.jsx($Me,{...s,...r,ref:e})});eY.displayName=sRe;var iRe="ContextMenuItem",tY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Gs(n);return o.jsx(HMe,{...s,...r,ref:e})});tY.displayName=iRe;var aRe="ContextMenuCheckboxItem",nY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Gs(n);return o.jsx(QMe,{...s,...r,ref:e})});nY.displayName=aRe;var oRe="ContextMenuRadioGroup",lRe=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Gs(n);return o.jsx(VMe,{...s,...r,ref:e})});lRe.displayName=oRe;var cRe="ContextMenuRadioItem",rY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Gs(n);return o.jsx(UMe,{...s,...r,ref:e})});rY.displayName=cRe;var uRe="ContextMenuItemIndicator",sY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Gs(n);return o.jsx(WMe,{...s,...r,ref:e})});sY.displayName=uRe;var dRe="ContextMenuSeparator",iY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Gs(n);return o.jsx(GMe,{...s,...r,ref:e})});iY.displayName=dRe;var hRe="ContextMenuArrow",fRe=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Gs(n);return o.jsx(XMe,{...s,...r,ref:e})});fRe.displayName=hRe;var aY="ContextMenuSub",oY=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:s,defaultOpen:i}=t,a=Gs(e),[l,c]=Xl({prop:s,defaultProp:i??!1,onChange:r,caller:aY});return o.jsx(YMe,{...a,open:l,onOpenChange:c,children:n})};oY.displayName=aY;var mRe="ContextMenuSubTrigger",lY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Gs(n);return o.jsx(KMe,{...s,...r,ref:e})});lY.displayName=mRe;var pRe="ContextMenuSubContent",cY=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Gs(n);return o.jsx(ZMe,{...s,...r,ref:e,style:{...t.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)"}})});cY.displayName=pRe;function K1(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var gRe=GX,xRe=YX,vRe=KX,uY=JX,dY=eY,hY=tY,fY=nY,mY=rY,pY=sY,gY=iY,yRe=oY,xY=lY,vY=cY;const bRe=gRe,wRe=xRe,SRe=yRe,yY=b.forwardRef(({className:t,inset:e,children:n,...r},s)=>o.jsxs(xY,{ref:s,className:xe("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",t),...r,children:[n,o.jsx(yd,{className:"ml-auto h-4 w-4"})]}));yY.displayName=xY.displayName;const bY=b.forwardRef(({className:t,...e},n)=>o.jsx(vY,{ref:n,className:xe("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]",t),...e}));bY.displayName=vY.displayName;const wY=b.forwardRef(({className:t,...e},n)=>o.jsx(vRe,{children:o.jsx(uY,{ref:n,className:xe("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]",t),...e})}));wY.displayName=uY.displayName;const qa=b.forwardRef(({className:t,inset:e,...n},r)=>o.jsx(hY,{ref:r,className:xe("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",t),...n}));qa.displayName=hY.displayName;const kRe=b.forwardRef(({className:t,children:e,checked:n,...r},s)=>o.jsxs(fY,{ref:s,className:xe("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",t),checked:n,...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(pY,{children:o.jsx(Ro,{className:"h-4 w-4"})})}),e]}));kRe.displayName=fY.displayName;const ORe=b.forwardRef(({className:t,children:e,...n},r)=>o.jsxs(mY,{ref:r,className:xe("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",t),...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(pY,{children:o.jsx(ute,{className:"h-2 w-2 fill-current"})})}),e]}));ORe.displayName=mY.displayName;const jRe=b.forwardRef(({className:t,inset:e,...n},r)=>o.jsx(dY,{ref:r,className:xe("px-2 py-1.5 text-sm font-semibold text-foreground",e&&"pl-8",t),...n}));jRe.displayName=dY.displayName;const v0=b.forwardRef(({className:t,...e},n)=>o.jsx(gY,{ref:n,className:xe("-mx-1 my-1 h-px bg-border",t),...e}));v0.displayName=gY.displayName;const jh=({className:t,...e})=>o.jsx("span",{className:xe("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});jh.displayName="ContextMenuShortcut";var NRe=Symbol("radix.slottable");function CRe(t){const e=({children:n})=>o.jsx(o.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=NRe,e}var[sw]=Ra("Tooltip",[vf]),iw=vf(),SY="TooltipProvider",TRe=700,uj="tooltip.open",[ERe,O7]=sw(SY),kY=t=>{const{__scopeTooltip:e,delayDuration:n=TRe,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,a=b.useRef(!0),l=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),o.jsx(ERe,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:b.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:i})};kY.displayName=SY;var Tp="Tooltip",[_Re,Ng]=sw(Tp),OY=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:a,delayDuration:l}=t,c=O7(Tp,t.__scopeTooltip),d=iw(e),[h,m]=b.useState(null),g=Ui(),x=b.useRef(0),y=a??c.disableHoverableContent,w=l??c.delayDuration,S=b.useRef(!1),[k,j]=Xl({prop:r,defaultProp:s??!1,onChange:A=>{A?(c.onOpen(),document.dispatchEvent(new CustomEvent(uj))):c.onClose(),i?.(A)},caller:Tp}),N=b.useMemo(()=>k?S.current?"delayed-open":"instant-open":"closed",[k]),T=b.useCallback(()=>{window.clearTimeout(x.current),x.current=0,S.current=!1,j(!0)},[j]),E=b.useCallback(()=>{window.clearTimeout(x.current),x.current=0,j(!1)},[j]),_=b.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{S.current=!0,j(!0),x.current=0},w)},[w,j]);return b.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),o.jsx(Vy,{...d,children:o.jsx(_Re,{scope:e,contentId:g,open:k,stateAttribute:N,trigger:h,onTriggerChange:m,onTriggerEnter:b.useCallback(()=>{c.isOpenDelayedRef.current?_():T()},[c.isOpenDelayedRef,_,T]),onTriggerLeave:b.useCallback(()=>{y?E():(window.clearTimeout(x.current),x.current=0)},[E,y]),onOpen:T,onClose:E,disableHoverableContent:y,children:n})})};OY.displayName=Tp;var dj="TooltipTrigger",jY=b.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=Ng(dj,n),i=O7(dj,n),a=iw(n),l=b.useRef(null),c=Yn(e,l,s.onTriggerChange),d=b.useRef(!1),h=b.useRef(!1),m=b.useCallback(()=>d.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),o.jsx(Uy,{asChild:!0,...a,children:o.jsx(xn.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:nt(t.onPointerMove,g=>{g.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),h.current=!0)}),onPointerLeave:nt(t.onPointerLeave,()=>{s.onTriggerLeave(),h.current=!1}),onPointerDown:nt(t.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:nt(t.onFocus,()=>{d.current||s.onOpen()}),onBlur:nt(t.onBlur,s.onClose),onClick:nt(t.onClick,s.onClose)})})});jY.displayName=dj;var j7="TooltipPortal",[ARe,MRe]=sw(j7,{forceMount:void 0}),NY=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=Ng(j7,e);return o.jsx(ARe,{scope:e,forceMount:n,children:o.jsx(ii,{present:n||i.open,children:o.jsx(Qy,{asChild:!0,container:s,children:r})})})};NY.displayName=j7;var xf="TooltipContent",CY=b.forwardRef((t,e)=>{const n=MRe(xf,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,a=Ng(xf,t.__scopeTooltip);return o.jsx(ii,{present:r||a.open,children:a.disableHoverableContent?o.jsx(TY,{side:s,...i,ref:e}):o.jsx(RRe,{side:s,...i,ref:e})})}),RRe=b.forwardRef((t,e)=>{const n=Ng(xf,t.__scopeTooltip),r=O7(xf,t.__scopeTooltip),s=b.useRef(null),i=Yn(e,s),[a,l]=b.useState(null),{trigger:c,onClose:d}=n,h=s.current,{onPointerInTransitChange:m}=r,g=b.useCallback(()=>{l(null),m(!1)},[m]),x=b.useCallback((y,w)=>{const S=y.currentTarget,k={x:y.clientX,y:y.clientY},j=LRe(k,S.getBoundingClientRect()),N=BRe(k,j),T=FRe(w.getBoundingClientRect()),E=$Re([...N,...T]);l(E),m(!0)},[m]);return b.useEffect(()=>()=>g(),[g]),b.useEffect(()=>{if(c&&h){const y=S=>x(S,h),w=S=>x(S,c);return c.addEventListener("pointerleave",y),h.addEventListener("pointerleave",w),()=>{c.removeEventListener("pointerleave",y),h.removeEventListener("pointerleave",w)}}},[c,h,x,g]),b.useEffect(()=>{if(a){const y=w=>{const S=w.target,k={x:w.clientX,y:w.clientY},j=c?.contains(S)||h?.contains(S),N=!qRe(k,a);j?g():N&&(g(),d())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,h,a,d,g]),o.jsx(TY,{...t,ref:i})}),[DRe,PRe]=sw(Tp,{isInside:!1}),zRe=CRe("TooltipContent"),TY=b.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:a,...l}=t,c=Ng(xf,n),d=iw(n),{onClose:h}=c;return b.useEffect(()=>(document.addEventListener(uj,h),()=>document.removeEventListener(uj,h)),[h]),b.useEffect(()=>{if(c.trigger){const m=g=>{g.target?.contains(c.trigger)&&h()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[c.trigger,h]),o.jsx(Cj,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:m=>m.preventDefault(),onDismiss:h,children:o.jsxs(Tj,{"data-state":c.stateAttribute,...d,...l,ref:e,style:{...l.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:[o.jsx(zRe,{children:r}),o.jsx(DRe,{scope:n,isInside:!0,children:o.jsx(Dee,{id:c.contentId,role:"tooltip",children:s||r})})]})})});CY.displayName=xf;var EY="TooltipArrow",IRe=b.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=iw(n);return PRe(EY,n).isInside?null:o.jsx(Ej,{...s,...r,ref:e})});IRe.displayName=EY;function LRe(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function BRe(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function FRe(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}function qRe(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;ir!=g>r&&n<(m-d)*(r-h)/(g-h)+d&&(s=!s)}return s}function $Re(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),HRe(e)}function HRe(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const i=e[e.length-1],a=e[e.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var QRe=kY,VRe=OY,URe=jY,WRe=NY,_Y=CY;const GRe=QRe,XRe=VRe,YRe=URe,AY=b.forwardRef(({className:t,sideOffset:e=4,...n},r)=>o.jsx(WRe,{children:o.jsx(_Y,{ref:r,sideOffset:e,className:xe("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]",t),...n})}));AY.displayName=_Y.displayName;function KRe({children:t}){uie();const[e,n]=b.useState(!0),[r,s]=b.useState(!1),[i,a]=b.useState(!1),{theme:l,setTheme:c}=Vj(),d=xJ(),h=Zi();b.useEffect(()=>{const w=S=>{(S.metaKey||S.ctrlKey)&&S.key==="k"&&(S.preventDefault(),a(!0))};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[]);const m=[{title:"概览",items:[{icon:D0,label:"首页",path:"/"}]},{title:"麦麦配置编辑",items:[{icon:zl,label:"麦麦主程序配置",path:"/config/bot"},{icon:kI,label:"AI模型厂商配置",path:"/config/modelProvider",tourId:"sidebar-model-provider"},{icon:OI,label:"模型管理与分配",path:"/config/model",tourId:"sidebar-model-management"},{icon:k9,label:"麦麦适配器配置",path:"/config/adapter"}]},{title:"麦麦资源管理",items:[{icon:_j,label:"表情包管理",path:"/resource/emoji"},{icon:Wh,label:"表达方式管理",path:"/resource/expression"},{icon:jI,label:"人物信息管理",path:"/resource/person"},{icon:SI,label:"知识库图谱可视化",path:"/resource/knowledge-graph"}]},{title:"扩展与监控",items:[{icon:Gh,label:"插件市场",path:"/plugins"},{icon:k9,label:"插件配置",path:"/plugin-config"},{icon:Pv,label:"日志查看器",path:"/logs"},{icon:Wh,label:"本地聊天室",path:"/chat"}]},{title:"系统",items:[{icon:Xu,label:"系统设置",path:"/settings"}]}],x=l==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":l,y=()=>{localStorage.removeItem("access-token"),h({to:"/auth"})};return o.jsx(GRe,{delayDuration:300,children:o.jsxs("div",{className:"flex h-screen overflow-hidden",children:[o.jsxs("aside",{className:xe("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:[o.jsx("div",{className:"flex h-16 items-center border-b px-4",children:o.jsxs("div",{className:xe("relative flex items-center justify-center flex-1 transition-all overflow-hidden","lg:flex-1",!e&&"lg:flex-none lg:w-8"),children:[o.jsxs("div",{className:xe("flex items-baseline gap-2",!e&&"lg:hidden"),children:[o.jsx("span",{className:"font-bold text-xl text-primary-gradient whitespace-nowrap",children:"MaiBot WebUI"}),o.jsx("span",{className:"text-xs text-primary/60 whitespace-nowrap",children:Fse()})]}),!e&&o.jsx("span",{className:"hidden lg:block font-bold text-primary-gradient text-2xl",children:"M"})]})}),o.jsx(gn,{className:xe("flex-1 overflow-x-hidden",!e&&"lg:w-16"),children:o.jsx("nav",{className:xe("p-4",!e&&"lg:p-2 lg:w-16"),children:o.jsx("ul",{className:xe("space-y-6",!e&&"lg:space-y-3 lg:w-full"),children:m.map((w,S)=>o.jsxs("li",{children:[o.jsx("div",{className:xe("px-3 h-[1.25rem]","mb-2",!e&&"lg:mb-1 lg:invisible"),children:o.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/60 whitespace-nowrap",children:w.title})}),!e&&S>0&&o.jsx("div",{className:"hidden lg:block mb-2 border-t border-border"}),o.jsx("ul",{className:"space-y-1",children:w.items.map(k=>{const j=d({to:k.path}),N=k.icon,T=o.jsxs(o.Fragment,{children:[j&&o.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"}),o.jsxs("div",{className:xe("flex items-center transition-all duration-300",e?"gap-3":"gap-3 lg:gap-0"),children:[o.jsx(N,{className:xe("h-5 w-5 flex-shrink-0",j&&"text-primary"),strokeWidth:2,fill:"none"}),o.jsx("span",{className:xe("text-sm font-medium whitespace-nowrap transition-all duration-300",j&&"font-semibold",e?"opacity-100 max-w-[200px]":"opacity-100 max-w-[200px] lg:opacity-0 lg:max-w-0 lg:overflow-hidden"),children:k.label})]})]});return o.jsx("li",{className:"relative",children:o.jsxs(XRe,{children:[o.jsx(YRe,{asChild:!0,children:o.jsx(vJ,{to:k.path,"data-tour":k.tourId,className:xe("relative flex items-center rounded-lg py-2 transition-all duration-300","hover:bg-accent hover:text-accent-foreground",j?"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:T})}),!e&&o.jsx(AY,{side:"right",className:"hidden lg:block",children:o.jsx("p",{children:k.label})})]})},k.path)})})]},w.title))})})})]}),r&&o.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>s(!1)}),o.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[o.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:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("button",{onClick:()=>s(!r),className:"rounded-lg p-2 hover:bg-accent lg:hidden",children:o.jsx(dte,{className:"h-5 w-5"})}),o.jsx("button",{onClick:()=>n(!e),className:"hidden rounded-lg p-2 hover:bg-accent lg:block",title:e?"收起侧边栏":"展开侧边栏",children:o.jsx(vd,{className:xe("h-5 w-5 transition-transform",!e&&"rotate-180")})})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("button",{onClick:()=>a(!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:[o.jsx(Ni,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),o.jsx("span",{className:"text-sm text-muted-foreground",children:"搜索..."}),o.jsxs(wX,{size:"sm",className:"absolute right-2 top-1/2 -translate-y-1/2",children:[o.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]}),o.jsx(rMe,{open:i,onOpenChange:a}),o.jsxs(de,{variant:"ghost",size:"sm",onClick:()=>window.open("https://docs.mai-mai.org","_blank"),className:"gap-2",title:"查看麦麦文档",children:[o.jsx(hte,{className:"h-4 w-4"}),o.jsx("span",{className:"hidden sm:inline",children:"麦麦文档"})]}),o.jsx("button",{onClick:w=>{jse(x==="dark"?"light":"dark",c,w)},className:"rounded-lg p-2 hover:bg-accent",title:x==="dark"?"切换到浅色模式":"切换到深色模式",children:x==="dark"?o.jsx(nk,{className:"h-5 w-5"}):o.jsx(rk,{className:"h-5 w-5"})}),o.jsx("div",{className:"h-6 w-px bg-border"}),o.jsxs(de,{variant:"ghost",size:"sm",onClick:y,className:"gap-2",title:"登出系统",children:[o.jsx(O9,{className:"h-4 w-4"}),o.jsx("span",{className:"hidden sm:inline",children:"登出"})]})]})]}),o.jsxs(bRe,{children:[o.jsx(wRe,{asChild:!0,children:o.jsx("main",{className:"flex-1 overflow-hidden bg-background",children:t})}),o.jsxs(wY,{className:"w-64",children:[o.jsxs(qa,{onClick:()=>h({to:"/"}),children:[o.jsx(D0,{className:"mr-2 h-4 w-4"}),"首页"]}),o.jsxs(qa,{onClick:()=>h({to:"/settings"}),children:[o.jsx(Xu,{className:"mr-2 h-4 w-4"}),"系统设置"]}),o.jsxs(qa,{onClick:()=>h({to:"/logs"}),children:[o.jsx(Pv,{className:"mr-2 h-4 w-4"}),"日志查看器"]}),o.jsx(v0,{}),o.jsxs(SRe,{children:[o.jsxs(yY,{children:[o.jsx(yI,{className:"mr-2 h-4 w-4"}),"切换主题"]}),o.jsxs(bY,{className:"w-48",children:[o.jsxs(qa,{onClick:()=>c("light"),disabled:l==="light",children:[o.jsx(nk,{className:"mr-2 h-4 w-4"}),"浅色",l==="light"&&o.jsx(jh,{children:"✓"})]}),o.jsxs(qa,{onClick:()=>c("dark"),disabled:l==="dark",children:[o.jsx(rk,{className:"mr-2 h-4 w-4"}),"深色",l==="dark"&&o.jsx(jh,{children:"✓"})]}),o.jsxs(qa,{onClick:()=>c("system"),disabled:l==="system",children:[o.jsx(Xu,{className:"mr-2 h-4 w-4"}),"跟随系统",l==="system"&&o.jsx(jh,{children:"✓"})]})]})]}),o.jsx(v0,{}),o.jsxs(qa,{onClick:()=>window.location.reload(),children:[o.jsx(fte,{className:"mr-2 h-4 w-4"}),"刷新页面",o.jsx(jh,{children:"⌘R"})]}),o.jsxs(qa,{onClick:()=>a(!0),children:[o.jsx(Ni,{className:"mr-2 h-4 w-4"}),"搜索",o.jsx(jh,{children:"⌘K"})]}),o.jsx(v0,{}),o.jsxs(qa,{onClick:()=>window.open("https://docs.mai-mai.org","_blank"),children:[o.jsx(Ah,{className:"mr-2 h-4 w-4"}),"麦麦文档"]}),o.jsx(v0,{}),o.jsxs(qa,{onClick:y,className:"text-destructive focus:text-destructive",children:[o.jsx(O9,{className:"mr-2 h-4 w-4"}),"登出系统"]})]})]})]})]})})}var aw="Collapsible",[ZRe]=Ra(aw),[JRe,N7]=ZRe(aw),MY=b.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:a,...l}=t,[c,d]=Xl({prop:r,defaultProp:s??!1,onChange:a,caller:aw});return o.jsx(JRe,{scope:n,disabled:i,contentId:Ui(),open:c,onOpenToggle:b.useCallback(()=>d(h=>!h),[d]),children:o.jsx(xn.div,{"data-state":T7(c),"data-disabled":i?"":void 0,...l,ref:e})})});MY.displayName=aw;var RY="CollapsibleTrigger",DY=b.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=N7(RY,n);return o.jsx(xn.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":T7(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:nt(t.onClick,s.onOpenToggle)})});DY.displayName=RY;var C7="CollapsibleContent",PY=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=N7(C7,t.__scopeCollapsible);return o.jsx(ii,{present:n||s.open,children:({present:i})=>o.jsx(eDe,{...r,ref:e,present:i})})});PY.displayName=C7;var eDe=b.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=t,a=N7(C7,n),[l,c]=b.useState(r),d=b.useRef(null),h=Yn(e,d),m=b.useRef(0),g=m.current,x=b.useRef(0),y=x.current,w=a.open||l,S=b.useRef(w),k=b.useRef(void 0);return b.useEffect(()=>{const j=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(j)},[]),Uh(()=>{const j=d.current;if(j){k.current=k.current||{transitionDuration:j.style.transitionDuration,animationName:j.style.animationName},j.style.transitionDuration="0s",j.style.animationName="none";const N=j.getBoundingClientRect();m.current=N.height,x.current=N.width,S.current||(j.style.transitionDuration=k.current.transitionDuration,j.style.animationName=k.current.animationName),c(r)}},[a.open,r]),o.jsx(xn.div,{"data-state":T7(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!w,...i,ref:h,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...t.style},children:w&&s})});function T7(t){return t?"open":"closed"}var tDe=MY;const Pz=tDe,zz=DY,Iz=PY;function nDe(t){const e=t.split(` +`).slice(1),n=[];for(const r of e){const s=r.trim();if(!s.startsWith("at "))continue;const i=s.match(/at\s+(?:(.+?)\s+\()?(.+?):(\d+):(\d+)\)?$/);i?n.push({functionName:i[1]||"",fileName:i[2],lineNumber:i[3],columnNumber:i[4],raw:s}):n.push({functionName:"",fileName:"",lineNumber:"",columnNumber:"",raw:s})}return n}function rDe({error:t,errorInfo:e}){const[n,r]=b.useState(!0),[s,i]=b.useState(!1),[a,l]=b.useState(!1),c=t.stack?nDe(t.stack):[],d=async()=>{const h=` Error: ${t.name} Message: ${t.message} @@ -404,4 +404,4 @@ ${e?.componentStack||"No component stack available"} URL: ${window.location.href} User Agent: ${navigator.userAgent} Time: ${new Date().toISOString()} - `.trim();try{await navigator.clipboard.writeText(h),l(!0),setTimeout(()=>l(!1),2e3)}catch(m){console.error("Failed to copy:",m)}};return o.jsxs("div",{className:"space-y-4",children:[o.jsxs(ga,{variant:"destructive",className:"border-red-500/50 bg-red-500/10",children:[o.jsx(Wa,{className:"h-4 w-4"}),o.jsxs(xa,{className:"font-mono text-sm",children:[o.jsxs("span",{className:"font-semibold",children:[t.name,":"]})," ",t.message]})]}),c.length>0&&o.jsxs(Tz,{open:n,onOpenChange:r,children:[o.jsx(Ez,{asChild:!0,children:o.jsxs(he,{variant:"ghost",className:"w-full justify-between p-3 h-auto",children:[o.jsxs("span",{className:"font-semibold text-sm flex items-center gap-2",children:[o.jsx(Xee,{className:"h-4 w-4"}),"Stack Trace (",c.length," frames)"]}),n?o.jsx(A0,{className:"h-4 w-4"}):o.jsx(nd,{className:"h-4 w-4"})]})}),o.jsx(_z,{children:o.jsx(wn,{className:"h-[280px] rounded-md border bg-muted/30",children:o.jsx("div",{className:"p-3 space-y-1",children:c.map((h,m)=>o.jsx("div",{className:"font-mono text-xs p-2 rounded hover:bg-muted/50 transition-colors",children:o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsxs("span",{className:"text-muted-foreground w-6 text-right flex-shrink-0",children:[m+1,"."]}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("span",{className:"text-primary font-medium",children:h.functionName}),h.fileName&&o.jsxs("div",{className:"text-muted-foreground mt-0.5 break-all",children:[h.fileName,h.lineNumber&&o.jsxs("span",{className:"text-yellow-600 dark:text-yellow-400",children:[":",h.lineNumber,":",h.columnNumber]})]})]})]})},m))})})})]}),e?.componentStack&&o.jsxs(Tz,{open:s,onOpenChange:i,children:[o.jsx(Ez,{asChild:!0,children:o.jsxs(he,{variant:"ghost",className:"w-full justify-between p-3 h-auto",children:[o.jsxs("span",{className:"font-semibold text-sm flex items-center gap-2",children:[o.jsx(Wa,{className:"h-4 w-4"}),"Component Stack"]}),s?o.jsx(A0,{className:"h-4 w-4"}):o.jsx(nd,{className:"h-4 w-4"})]})}),o.jsx(_z,{children:o.jsx(wn,{className:"h-[200px] rounded-md border bg-muted/30",children:o.jsx("pre",{className:"p-3 font-mono text-xs whitespace-pre-wrap text-muted-foreground",children:e.componentStack})})})]}),o.jsx(he,{variant:"outline",size:"sm",onClick:d,className:"w-full",children:a?o.jsxs(o.Fragment,{children:[o.jsx(Ro,{className:"mr-2 h-4 w-4 text-green-500"}),"已复制到剪贴板"]}):o.jsxs(o.Fragment,{children:[o.jsx(Tv,{className:"mr-2 h-4 w-4"}),"复制错误信息"]})})]})}function wY({error:t,errorInfo:e}){const n=()=>{window.location.href="/"},r=()=>{window.location.reload()};return o.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:o.jsxs(qt,{className:"w-full max-w-2xl shadow-lg",children:[o.jsxs(Fn,{className:"text-center pb-2",children:[o.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30 mb-4",children:o.jsx(Wa,{className:"h-8 w-8 text-red-600 dark:text-red-400"})}),o.jsx(qn,{className:"text-2xl font-bold",children:"页面出现了问题"}),o.jsx(ts,{className:"text-base mt-2",children:"应用程序遇到了意外错误。您可以尝试刷新页面或返回首页。"})]}),o.jsxs(Gn,{className:"space-y-4",children:[o.jsx(kRe,{error:t,errorInfo:e}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 pt-2",children:[o.jsxs(he,{onClick:r,className:"flex-1",children:[o.jsx(Qs,{className:"mr-2 h-4 w-4"}),"刷新页面"]}),o.jsxs(he,{onClick:n,variant:"outline",className:"flex-1",children:[o.jsx(M0,{className:"mr-2 h-4 w-4"}),"返回首页"]})]}),o.jsx("p",{className:"text-xs text-center text-muted-foreground pt-2",children:"如果问题持续存在,请将错误信息复制并反馈给开发者"})]})]})})}class ORe extends b.Component{constructor(e){super(e),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){console.error("ErrorBoundary caught an error:",e,n),this.setState({errorInfo:n})}handleReset=()=>{this.setState({hasError:!1,error:null,errorInfo:null})};render(){return this.state.hasError&&this.state.error?this.props.fallback?this.props.fallback:o.jsx(wY,{error:this.state.error,errorInfo:this.state.errorInfo}):this.props.children}}function SY({error:t}){return o.jsx(wY,{error:t,errorInfo:null})}const jg=rJ({component:()=>o.jsxs(o.Fragment,{children:[o.jsx(Az,{}),!1]}),beforeLoad:()=>{if(window.location.pathname==="/"&&!wB())throw iJ({to:"/auth"})}}),jRe=ks({getParentRoute:()=>jg,path:"/auth",component:Use}),NRe=ks({getParentRoute:()=>jg,path:"/setup",component:pie}),ai=ks({getParentRoute:()=>jg,id:"protected",component:()=>o.jsx(xRe,{children:o.jsx(Az,{})}),errorComponent:({error:t})=>o.jsx(SY,{error:t})}),CRe=ks({getParentRoute:()=>ai,path:"/",component:sse}),TRe=ks({getParentRoute:()=>ai,path:"/config/bot",component:f0e}),ERe=ks({getParentRoute:()=>ai,path:"/config/modelProvider",component:Rxe}),_Re=ks({getParentRoute:()=>ai,path:"/config/model",component:Ove}),MRe=ks({getParentRoute:()=>ai,path:"/config/adapter",component:Nve}),ARe=ks({getParentRoute:()=>ai,path:"/resource/emoji",component:Yke}),RRe=ks({getParentRoute:()=>ai,path:"/resource/expression",component:oOe}),DRe=ks({getParentRoute:()=>ai,path:"/resource/person",component:vOe}),PRe=ks({getParentRoute:()=>ai,path:"/resource/knowledge-graph",component:lTe}),zRe=ks({getParentRoute:()=>ai,path:"/logs",component:J_e}),IRe=ks({getParentRoute:()=>ai,path:"/plugins",component:vMe}),LRe=ks({getParentRoute:()=>ai,path:"/plugin-config",component:yMe}),BRe=ks({getParentRoute:()=>ai,path:"/plugin-mirrors",component:bMe}),FRe=ks({getParentRoute:()=>ai,path:"/settings",component:Lse}),qRe=ks({getParentRoute:()=>jg,path:"*",component:OB}),$Re=jg.addChildren([jRe,NRe,ai.addChildren([CRe,TRe,ERe,_Re,MRe,ARe,RRe,DRe,PRe,IRe,LRe,BRe,zRe,FRe]),qRe]),HRe=sJ({routeTree:$Re,defaultNotFoundComponent:OB,defaultErrorComponent:({error:t})=>o.jsx(SY,{error:t})});function QRe({children:t,defaultTheme:e="system",storageKey:n="ui-theme",...r}){const[s,i]=b.useState(()=>localStorage.getItem(n)||e);b.useEffect(()=>{const l=window.document.documentElement;if(l.classList.remove("light","dark"),s==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";l.classList.add(c);return}l.classList.add(s)},[s]),b.useEffect(()=>{const l=localStorage.getItem("accent-color");if(l){const c=document.documentElement,h={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%)"}}[l];h&&(c.style.setProperty("--primary",h.hsl),h.gradient?(c.style.setProperty("--primary-gradient",h.gradient),c.classList.add("has-gradient")):(c.style.removeProperty("--primary-gradient"),c.classList.remove("has-gradient")))}},[]);const a={theme:s,setTheme:l=>{localStorage.setItem(n,l),i(l)}};return o.jsx(VL.Provider,{...r,value:a,children:t})}function VRe({children:t,defaultEnabled:e=!0,defaultWavesEnabled:n=!0,storageKey:r="enable-animations",wavesStorageKey:s="enable-waves-background"}){const[i,a]=b.useState(()=>{const h=localStorage.getItem(r);return h!==null?h==="true":e}),[l,c]=b.useState(()=>{const h=localStorage.getItem(s);return h!==null?h==="true":n});b.useEffect(()=>{const h=document.documentElement;i?h.classList.remove("no-animations"):h.classList.add("no-animations"),localStorage.setItem(r,String(i))},[i,r]),b.useEffect(()=>{localStorage.setItem(s,String(l))},[l,s]);const d={enableAnimations:i,setEnableAnimations:a,enableWavesBackground:l,setEnableWavesBackground:c};return o.jsx(UL.Provider,{value:d,children:t})}var k7="ToastProvider",[O7,URe,WRe]=Dy("Toast"),[kY]=Ra("Toast",[WRe]),[GRe,tw]=kY(k7),OY=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:a}=t,[l,c]=b.useState(null),[d,h]=b.useState(0),m=b.useRef(!1),g=b.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${k7}\`. Expected non-empty \`string\`.`),o.jsx(O7.Provider,{scope:e,children:o.jsx(GRe,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:d,viewport:l,onViewportChange:c,onToastAdd:b.useCallback(()=>h(x=>x+1),[]),onToastRemove:b.useCallback(()=>h(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:m,isClosePausedRef:g,children:a})})};OY.displayName=k7;var jY="ToastViewport",XRe=["F8"],aj="toast.viewportPause",oj="toast.viewportResume",NY=b.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=XRe,label:s="Notifications ({hotkey})",...i}=t,a=tw(jY,n),l=URe(n),c=b.useRef(null),d=b.useRef(null),h=b.useRef(null),m=b.useRef(null),g=Yn(e,m,a.onViewportChange),x=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=a.toastCount>0;b.useEffect(()=>{const S=k=>{r.length!==0&&r.every(N=>k[N]||k.code===N)&&m.current?.focus()};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[r]),b.useEffect(()=>{const S=c.current,k=m.current;if(y&&S&&k){const j=()=>{if(!a.isClosePausedRef.current){const _=new CustomEvent(aj);k.dispatchEvent(_),a.isClosePausedRef.current=!0}},N=()=>{if(a.isClosePausedRef.current){const _=new CustomEvent(oj);k.dispatchEvent(_),a.isClosePausedRef.current=!1}},T=_=>{!S.contains(_.relatedTarget)&&N()},E=()=>{S.contains(document.activeElement)||N()};return S.addEventListener("focusin",j),S.addEventListener("focusout",T),S.addEventListener("pointermove",j),S.addEventListener("pointerleave",E),window.addEventListener("blur",j),window.addEventListener("focus",N),()=>{S.removeEventListener("focusin",j),S.removeEventListener("focusout",T),S.removeEventListener("pointermove",j),S.removeEventListener("pointerleave",E),window.removeEventListener("blur",j),window.removeEventListener("focus",N)}}},[y,a.isClosePausedRef]);const w=b.useCallback(({tabbingDirection:S})=>{const j=l().map(N=>{const T=N.ref.current,E=[T,...lDe(T)];return S==="forwards"?E:E.reverse()});return(S==="forwards"?j.reverse():j).flat()},[l]);return b.useEffect(()=>{const S=m.current;if(S){const k=j=>{const N=j.altKey||j.ctrlKey||j.metaKey;if(j.key==="Tab"&&!N){const E=document.activeElement,_=j.shiftKey;if(j.target===S&&_){d.current?.focus();return}const P=w({tabbingDirection:_?"backwards":"forwards"}),L=P.findIndex(H=>H===E);W3(P.slice(L+1))?j.preventDefault():_?d.current?.focus():h.current?.focus()}};return S.addEventListener("keydown",k),()=>S.removeEventListener("keydown",k)}},[l,w]),o.jsxs(yee,{ref:c,role:"region","aria-label":s.replace("{hotkey}",x),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&o.jsx(lj,{ref:d,onFocusFromOutsideViewport:()=>{const S=w({tabbingDirection:"forwards"});W3(S)}}),o.jsx(O7.Slot,{scope:n,children:o.jsx(gn.ol,{tabIndex:-1,...i,ref:g})}),y&&o.jsx(lj,{ref:h,onFocusFromOutsideViewport:()=>{const S=w({tabbingDirection:"backwards"});W3(S)}})]})});NY.displayName=jY;var CY="ToastFocusProxy",lj=b.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=tw(CY,n);return o.jsx(dI,{tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:a=>{const l=a.relatedTarget;!i.viewport?.contains(l)&&r()}})});lj.displayName=CY;var Ng="Toast",YRe="toast.swipeStart",KRe="toast.swipeMove",ZRe="toast.swipeCancel",JRe="toast.swipeEnd",TY=b.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...a}=t,[l,c]=Gl({prop:r,defaultProp:s??!0,onChange:i,caller:Ng});return o.jsx(si,{present:n||l,children:o.jsx(nDe,{open:l,...a,ref:e,onClose:()=>c(!1),onPause:qs(t.onPause),onResume:qs(t.onResume),onSwipeStart:nt(t.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:nt(t.onSwipeMove,d=>{const{x:h,y:m}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${h}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${m}px`)}),onSwipeCancel:nt(t.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:nt(t.onSwipeEnd,d=>{const{x:h,y:m}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${h}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${m}px`),c(!1)})})})});TY.displayName=Ng;var[eDe,tDe]=kY(Ng,{onClose(){}}),nDe=b.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:a,onEscapeKeyDown:l,onPause:c,onResume:d,onSwipeStart:h,onSwipeMove:m,onSwipeCancel:g,onSwipeEnd:x,...y}=t,w=tw(Ng,n),[S,k]=b.useState(null),j=Yn(e,z=>k(z)),N=b.useRef(null),T=b.useRef(null),E=s||w.duration,_=b.useRef(0),M=b.useRef(E),I=b.useRef(0),{onToastAdd:P,onToastRemove:L}=w,H=qs(()=>{S?.contains(document.activeElement)&&w.viewport?.focus(),a()}),U=b.useCallback(z=>{!z||z===1/0||(window.clearTimeout(I.current),_.current=new Date().getTime(),I.current=window.setTimeout(H,z))},[H]);b.useEffect(()=>{const z=w.viewport;if(z){const Q=()=>{U(M.current),d?.()},B=()=>{const X=new Date().getTime()-_.current;M.current=M.current-X,window.clearTimeout(I.current),c?.()};return z.addEventListener(aj,B),z.addEventListener(oj,Q),()=>{z.removeEventListener(aj,B),z.removeEventListener(oj,Q)}}},[w.viewport,E,c,d,U]),b.useEffect(()=>{i&&!w.isClosePausedRef.current&&U(E)},[i,E,w.isClosePausedRef,U]),b.useEffect(()=>(P(),()=>L()),[P,L]);const ee=b.useMemo(()=>S?PY(S):null,[S]);return w.viewport?o.jsxs(o.Fragment,{children:[ee&&o.jsx(rDe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:ee}),o.jsx(eDe,{scope:n,onClose:H,children:pa.createPortal(o.jsx(O7.ItemSlot,{scope:n,children:o.jsx(bee,{asChild:!0,onEscapeKeyDown:nt(l,()=>{w.isFocusedToastEscapeKeyDownRef.current||H(),w.isFocusedToastEscapeKeyDownRef.current=!1}),children:o.jsx(gn.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":w.swipeDirection,...y,ref:j,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:nt(t.onKeyDown,z=>{z.key==="Escape"&&(l?.(z.nativeEvent),z.nativeEvent.defaultPrevented||(w.isFocusedToastEscapeKeyDownRef.current=!0,H()))}),onPointerDown:nt(t.onPointerDown,z=>{z.button===0&&(N.current={x:z.clientX,y:z.clientY})}),onPointerMove:nt(t.onPointerMove,z=>{if(!N.current)return;const Q=z.clientX-N.current.x,B=z.clientY-N.current.y,X=!!T.current,J=["left","right"].includes(w.swipeDirection),G=["left","up"].includes(w.swipeDirection)?Math.min:Math.max,R=J?G(0,Q):0,ie=J?0:G(0,B),W=z.pointerType==="touch"?10:2,q={x:R,y:ie},V={originalEvent:z,delta:q};X?(T.current=q,Y1(KRe,m,V,{discrete:!1})):Mz(q,w.swipeDirection,W)?(T.current=q,Y1(YRe,h,V,{discrete:!1}),z.target.setPointerCapture(z.pointerId)):(Math.abs(Q)>W||Math.abs(B)>W)&&(N.current=null)}),onPointerUp:nt(t.onPointerUp,z=>{const Q=T.current,B=z.target;if(B.hasPointerCapture(z.pointerId)&&B.releasePointerCapture(z.pointerId),T.current=null,N.current=null,Q){const X=z.currentTarget,J={originalEvent:z,delta:Q};Mz(Q,w.swipeDirection,w.swipeThreshold)?Y1(JRe,x,J,{discrete:!0}):Y1(ZRe,g,J,{discrete:!0}),X.addEventListener("click",G=>G.preventDefault(),{once:!0})}})})})}),w.viewport)})]}):null}),rDe=t=>{const{__scopeToast:e,children:n,...r}=t,s=tw(Ng,e),[i,a]=b.useState(!1),[l,c]=b.useState(!1);return aDe(()=>a(!0)),b.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),l?null:o.jsx(Ly,{asChild:!0,children:o.jsx(dI,{...r,children:i&&o.jsxs(o.Fragment,{children:[s.label," ",n]})})})},sDe="ToastTitle",EY=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return o.jsx(gn.div,{...r,ref:e})});EY.displayName=sDe;var iDe="ToastDescription",_Y=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return o.jsx(gn.div,{...r,ref:e})});_Y.displayName=iDe;var MY="ToastAction",AY=b.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?o.jsx(DY,{altText:n,asChild:!0,children:o.jsx(j7,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${MY}\`. Expected non-empty \`string\`.`),null)});AY.displayName=MY;var RY="ToastClose",j7=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=tDe(RY,n);return o.jsx(DY,{asChild:!0,children:o.jsx(gn.button,{type:"button",...r,ref:e,onClick:nt(t.onClick,s.onClose)})})});j7.displayName=RY;var DY=b.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return o.jsx(gn.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function PY(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),oDe(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const a=r.dataset.radixToastAnnounceAlt;a&&e.push(a)}else e.push(...PY(r))}}),e}function Y1(t,e,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?uI(s,i):s.dispatchEvent(i)}var Mz=(t,e,n=0)=>{const r=Math.abs(t.x),s=Math.abs(t.y),i=r>s;return e==="left"||e==="right"?i&&r>n:!i&&s>n};function aDe(t=()=>{}){const e=qs(t);gj(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function oDe(t){return t.nodeType===t.ELEMENT_NODE}function lDe(t){const e=[],n=document.createTreeWalker(t,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(;n.nextNode();)e.push(n.currentNode);return e}function W3(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var cDe=OY,zY=NY,IY=TY,LY=EY,BY=_Y,FY=AY,qY=j7;const uDe=cDe,$Y=b.forwardRef(({className:t,...e},n)=>o.jsx(zY,{ref:n,className:ve("fixed bottom-0 right-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:max-w-[420px] gap-2",t),...e}));$Y.displayName=zY.displayName;const dDe=wf("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-slide-in-from-right data-[state=open]:animate-fade-in data-[state=closed]:animate-slide-out-to-right data-[state=closed]:animate-fade-out data-[swipe=end]:animate-slide-out-to-right",{variants:{variant:{default:"border bg-primary/5 text-foreground backdrop-blur-sm",destructive:"destructive group border-destructive bg-destructive/10 text-destructive-foreground backdrop-blur-sm"}},defaultVariants:{variant:"default"}}),HY=b.forwardRef(({className:t,variant:e,...n},r)=>o.jsx(IY,{ref:r,className:ve(dDe({variant:e}),t),...n}));HY.displayName=IY.displayName;const hDe=b.forwardRef(({className:t,...e},n)=>o.jsx(FY,{ref:n,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",t),...e}));hDe.displayName=FY.displayName;const QY=b.forwardRef(({className:t,...e},n)=>o.jsx(qY,{ref:n,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",t),"toast-close":"",...e,children:o.jsx(Tp,{className:"h-4 w-4"})}));QY.displayName=qY.displayName;const VY=b.forwardRef(({className:t,...e},n)=>o.jsx(LY,{ref:n,className:ve("text-sm font-semibold [&+div]:text-xs",t),...e}));VY.displayName=LY.displayName;const UY=b.forwardRef(({className:t,...e},n)=>o.jsx(BY,{ref:n,className:ve("text-sm opacity-90",t),...e}));UY.displayName=BY.displayName;function fDe(){const{toasts:t}=fs();return o.jsxs(uDe,{children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return o.jsxs(HY,{...i,children:[o.jsxs("div",{className:"grid gap-1",children:[n&&o.jsx(VY,{children:n}),r&&o.jsx(UY,{children:r})]}),s,o.jsx(QY,{})]},e)}),o.jsx($Y,{})]})}ete.createRoot(document.getElementById("root")).render(o.jsx(b.StrictMode,{children:o.jsx(ORe,{children:o.jsx(QRe,{defaultTheme:"system",children:o.jsx(VRe,{children:o.jsxs(rpe,{children:[o.jsx(aJ,{router:HRe}),o.jsx(Mxe,{}),o.jsx(fDe,{})]})})})})})); + `.trim();try{await navigator.clipboard.writeText(h),l(!0),setTimeout(()=>l(!1),2e3)}catch(m){console.error("Failed to copy:",m)}};return o.jsxs("div",{className:"space-y-4",children:[o.jsxs(ga,{variant:"destructive",className:"border-red-500/50 bg-red-500/10",children:[o.jsx(Wa,{className:"h-4 w-4"}),o.jsxs(xa,{className:"font-mono text-sm",children:[o.jsxs("span",{className:"font-semibold",children:[t.name,":"]})," ",t.message]})]}),c.length>0&&o.jsxs(Pz,{open:n,onOpenChange:r,children:[o.jsx(zz,{asChild:!0,children:o.jsxs(de,{variant:"ghost",className:"w-full justify-between p-3 h-auto",children:[o.jsxs("span",{className:"font-semibold text-sm flex items-center gap-2",children:[o.jsx(mte,{className:"h-4 w-4"}),"Stack Trace (",c.length," frames)"]}),n?o.jsx(P0,{className:"h-4 w-4"}):o.jsx(nd,{className:"h-4 w-4"})]})}),o.jsx(Iz,{children:o.jsx(gn,{className:"h-[280px] rounded-md border bg-muted/30",children:o.jsx("div",{className:"p-3 space-y-1",children:c.map((h,m)=>o.jsx("div",{className:"font-mono text-xs p-2 rounded hover:bg-muted/50 transition-colors",children:o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsxs("span",{className:"text-muted-foreground w-6 text-right flex-shrink-0",children:[m+1,"."]}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("span",{className:"text-primary font-medium",children:h.functionName}),h.fileName&&o.jsxs("div",{className:"text-muted-foreground mt-0.5 break-all",children:[h.fileName,h.lineNumber&&o.jsxs("span",{className:"text-yellow-600 dark:text-yellow-400",children:[":",h.lineNumber,":",h.columnNumber]})]})]})]})},m))})})})]}),e?.componentStack&&o.jsxs(Pz,{open:s,onOpenChange:i,children:[o.jsx(zz,{asChild:!0,children:o.jsxs(de,{variant:"ghost",className:"w-full justify-between p-3 h-auto",children:[o.jsxs("span",{className:"font-semibold text-sm flex items-center gap-2",children:[o.jsx(Wa,{className:"h-4 w-4"}),"Component Stack"]}),s?o.jsx(P0,{className:"h-4 w-4"}):o.jsx(nd,{className:"h-4 w-4"})]})}),o.jsx(Iz,{children:o.jsx(gn,{className:"h-[200px] rounded-md border bg-muted/30",children:o.jsx("pre",{className:"p-3 font-mono text-xs whitespace-pre-wrap text-muted-foreground",children:e.componentStack})})})]}),o.jsx(de,{variant:"outline",size:"sm",onClick:d,className:"w-full",children:a?o.jsxs(o.Fragment,{children:[o.jsx(Ro,{className:"mr-2 h-4 w-4 text-green-500"}),"已复制到剪贴板"]}):o.jsxs(o.Fragment,{children:[o.jsx(Mv,{className:"mr-2 h-4 w-4"}),"复制错误信息"]})})]})}function zY({error:t,errorInfo:e}){const n=()=>{window.location.href="/"},r=()=>{window.location.reload()};return o.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:o.jsxs(qt,{className:"w-full max-w-2xl shadow-lg",children:[o.jsxs(Fn,{className:"text-center pb-2",children:[o.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30 mb-4",children:o.jsx(Wa,{className:"h-8 w-8 text-red-600 dark:text-red-400"})}),o.jsx(qn,{className:"text-2xl font-bold",children:"页面出现了问题"}),o.jsx(ts,{className:"text-base mt-2",children:"应用程序遇到了意外错误。您可以尝试刷新页面或返回首页。"})]}),o.jsxs(Gn,{className:"space-y-4",children:[o.jsx(rDe,{error:t,errorInfo:e}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 pt-2",children:[o.jsxs(de,{onClick:r,className:"flex-1",children:[o.jsx(Ps,{className:"mr-2 h-4 w-4"}),"刷新页面"]}),o.jsxs(de,{onClick:n,variant:"outline",className:"flex-1",children:[o.jsx(D0,{className:"mr-2 h-4 w-4"}),"返回首页"]})]}),o.jsx("p",{className:"text-xs text-center text-muted-foreground pt-2",children:"如果问题持续存在,请将错误信息复制并反馈给开发者"})]})]})})}class sDe extends b.Component{constructor(e){super(e),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){console.error("ErrorBoundary caught an error:",e,n),this.setState({errorInfo:n})}handleReset=()=>{this.setState({hasError:!1,error:null,errorInfo:null})};render(){return this.state.hasError&&this.state.error?this.props.fallback?this.props.fallback:o.jsx(zY,{error:this.state.error,errorInfo:this.state.errorInfo}):this.props.children}}function IY({error:t}){return o.jsx(zY,{error:t,errorInfo:null})}const Cg=yJ({component:()=>o.jsxs(o.Fragment,{children:[o.jsx(Bz,{}),!1]}),beforeLoad:()=>{if(window.location.pathname==="/"&&!CB())throw wJ({to:"/auth"})}}),iDe=ms({getParentRoute:()=>Cg,path:"/auth",component:die}),aDe=ms({getParentRoute:()=>Cg,path:"/setup",component:Die}),Xs=ms({getParentRoute:()=>Cg,id:"protected",component:()=>o.jsx(KRe,{children:o.jsx(Bz,{})}),errorComponent:({error:t})=>o.jsx(IY,{error:t})}),oDe=ms({getParentRoute:()=>Xs,path:"/",component:kse}),lDe=ms({getParentRoute:()=>Xs,path:"/config/bot",component:M0e}),cDe=ms({getParentRoute:()=>Xs,path:"/config/modelProvider",component:Zxe}),uDe=ms({getParentRoute:()=>Xs,path:"/config/model",component:Hve}),dDe=ms({getParentRoute:()=>Xs,path:"/config/adapter",component:Vve}),hDe=ms({getParentRoute:()=>Xs,path:"/resource/emoji",component:pOe}),fDe=ms({getParentRoute:()=>Xs,path:"/resource/expression",component:NOe}),mDe=ms({getParentRoute:()=>Xs,path:"/resource/person",component:IOe}),pDe=ms({getParentRoute:()=>Xs,path:"/resource/knowledge-graph",component:CTe}),gDe=ms({getParentRoute:()=>Xs,path:"/logs",component:vAe}),xDe=ms({getParentRoute:()=>Xs,path:"/chat",component:eMe}),vDe=ms({getParentRoute:()=>Xs,path:"/plugins",component:IAe}),yDe=ms({getParentRoute:()=>Xs,path:"/plugin-config",component:LAe}),bDe=ms({getParentRoute:()=>Xs,path:"/plugin-mirrors",component:BAe}),wDe=ms({getParentRoute:()=>Xs,path:"/settings",component:rie}),SDe=ms({getParentRoute:()=>Cg,path:"*",component:_B}),kDe=Cg.addChildren([iDe,aDe,Xs.addChildren([oDe,lDe,cDe,uDe,dDe,hDe,fDe,mDe,pDe,vDe,yDe,bDe,gDe,xDe,wDe]),SDe]),ODe=bJ({routeTree:kDe,defaultNotFoundComponent:_B,defaultErrorComponent:({error:t})=>o.jsx(IY,{error:t})});function jDe({children:t,defaultTheme:e="system",storageKey:n="ui-theme",...r}){const[s,i]=b.useState(()=>localStorage.getItem(n)||e);b.useEffect(()=>{const l=window.document.documentElement;if(l.classList.remove("light","dark"),s==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";l.classList.add(c);return}l.classList.add(s)},[s]),b.useEffect(()=>{const l=localStorage.getItem("accent-color");if(l){const c=document.documentElement,h={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%)"}}[l];h&&(c.style.setProperty("--primary",h.hsl),h.gradient?(c.style.setProperty("--primary-gradient",h.gradient),c.classList.add("has-gradient")):(c.style.removeProperty("--primary-gradient"),c.classList.remove("has-gradient")))}},[]);const a={theme:s,setTheme:l=>{localStorage.setItem(n,l),i(l)}};return o.jsx(KL.Provider,{...r,value:a,children:t})}function NDe({children:t,defaultEnabled:e=!0,defaultWavesEnabled:n=!0,storageKey:r="enable-animations",wavesStorageKey:s="enable-waves-background"}){const[i,a]=b.useState(()=>{const h=localStorage.getItem(r);return h!==null?h==="true":e}),[l,c]=b.useState(()=>{const h=localStorage.getItem(s);return h!==null?h==="true":n});b.useEffect(()=>{const h=document.documentElement;i?h.classList.remove("no-animations"):h.classList.add("no-animations"),localStorage.setItem(r,String(i))},[i,r]),b.useEffect(()=>{localStorage.setItem(s,String(l))},[l,s]);const d={enableAnimations:i,setEnableAnimations:a,enableWavesBackground:l,setEnableWavesBackground:c};return o.jsx(ZL.Provider,{value:d,children:t})}var E7="ToastProvider",[_7,CDe,TDe]=By("Toast"),[LY]=Ra("Toast",[TDe]),[EDe,ow]=LY(E7),BY=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:a}=t,[l,c]=b.useState(null),[d,h]=b.useState(0),m=b.useRef(!1),g=b.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${E7}\`. Expected non-empty \`string\`.`),o.jsx(_7.Provider,{scope:e,children:o.jsx(EDe,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:d,viewport:l,onViewportChange:c,onToastAdd:b.useCallback(()=>h(x=>x+1),[]),onToastRemove:b.useCallback(()=>h(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:m,isClosePausedRef:g,children:a})})};BY.displayName=E7;var FY="ToastViewport",_De=["F8"],hj="toast.viewportPause",fj="toast.viewportResume",qY=b.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=_De,label:s="Notifications ({hotkey})",...i}=t,a=ow(FY,n),l=CDe(n),c=b.useRef(null),d=b.useRef(null),h=b.useRef(null),m=b.useRef(null),g=Yn(e,m,a.onViewportChange),x=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=a.toastCount>0;b.useEffect(()=>{const S=k=>{r.length!==0&&r.every(N=>k[N]||k.code===N)&&m.current?.focus()};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[r]),b.useEffect(()=>{const S=c.current,k=m.current;if(y&&S&&k){const j=()=>{if(!a.isClosePausedRef.current){const _=new CustomEvent(hj);k.dispatchEvent(_),a.isClosePausedRef.current=!0}},N=()=>{if(a.isClosePausedRef.current){const _=new CustomEvent(fj);k.dispatchEvent(_),a.isClosePausedRef.current=!1}},T=_=>{!S.contains(_.relatedTarget)&&N()},E=()=>{S.contains(document.activeElement)||N()};return S.addEventListener("focusin",j),S.addEventListener("focusout",T),S.addEventListener("pointermove",j),S.addEventListener("pointerleave",E),window.addEventListener("blur",j),window.addEventListener("focus",N),()=>{S.removeEventListener("focusin",j),S.removeEventListener("focusout",T),S.removeEventListener("pointermove",j),S.removeEventListener("pointerleave",E),window.removeEventListener("blur",j),window.removeEventListener("focus",N)}}},[y,a.isClosePausedRef]);const w=b.useCallback(({tabbingDirection:S})=>{const j=l().map(N=>{const T=N.ref.current,E=[T,...HDe(T)];return S==="forwards"?E:E.reverse()});return(S==="forwards"?j.reverse():j).flat()},[l]);return b.useEffect(()=>{const S=m.current;if(S){const k=j=>{const N=j.altKey||j.ctrlKey||j.metaKey;if(j.key==="Tab"&&!N){const E=document.activeElement,_=j.shiftKey;if(j.target===S&&_){d.current?.focus();return}const P=w({tabbingDirection:_?"backwards":"forwards"}),B=P.findIndex($=>$===E);J3(P.slice(B+1))?j.preventDefault():_?d.current?.focus():h.current?.focus()}};return S.addEventListener("keydown",k),()=>S.removeEventListener("keydown",k)}},[l,w]),o.jsxs(Pee,{ref:c,role:"region","aria-label":s.replace("{hotkey}",x),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&o.jsx(mj,{ref:d,onFocusFromOutsideViewport:()=>{const S=w({tabbingDirection:"forwards"});J3(S)}}),o.jsx(_7.Slot,{scope:n,children:o.jsx(xn.ol,{tabIndex:-1,...i,ref:g})}),y&&o.jsx(mj,{ref:h,onFocusFromOutsideViewport:()=>{const S=w({tabbingDirection:"backwards"});J3(S)}})]})});qY.displayName=FY;var $Y="ToastFocusProxy",mj=b.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=ow($Y,n);return o.jsx(vI,{tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:a=>{const l=a.relatedTarget;!i.viewport?.contains(l)&&r()}})});mj.displayName=$Y;var Tg="Toast",ADe="toast.swipeStart",MDe="toast.swipeMove",RDe="toast.swipeCancel",DDe="toast.swipeEnd",HY=b.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...a}=t,[l,c]=Xl({prop:r,defaultProp:s??!0,onChange:i,caller:Tg});return o.jsx(ii,{present:n||l,children:o.jsx(IDe,{open:l,...a,ref:e,onClose:()=>c(!1),onPause:Rs(t.onPause),onResume:Rs(t.onResume),onSwipeStart:nt(t.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:nt(t.onSwipeMove,d=>{const{x:h,y:m}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${h}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${m}px`)}),onSwipeCancel:nt(t.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:nt(t.onSwipeEnd,d=>{const{x:h,y:m}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${h}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${m}px`),c(!1)})})})});HY.displayName=Tg;var[PDe,zDe]=LY(Tg,{onClose(){}}),IDe=b.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:a,onEscapeKeyDown:l,onPause:c,onResume:d,onSwipeStart:h,onSwipeMove:m,onSwipeCancel:g,onSwipeEnd:x,...y}=t,w=ow(Tg,n),[S,k]=b.useState(null),j=Yn(e,z=>k(z)),N=b.useRef(null),T=b.useRef(null),E=s||w.duration,_=b.useRef(0),A=b.useRef(E),L=b.useRef(0),{onToastAdd:P,onToastRemove:B}=w,$=Rs(()=>{S?.contains(document.activeElement)&&w.viewport?.focus(),a()}),U=b.useCallback(z=>{!z||z===1/0||(window.clearTimeout(L.current),_.current=new Date().getTime(),L.current=window.setTimeout($,z))},[$]);b.useEffect(()=>{const z=w.viewport;if(z){const Q=()=>{U(A.current),d?.()},F=()=>{const Y=new Date().getTime()-_.current;A.current=A.current-Y,window.clearTimeout(L.current),c?.()};return z.addEventListener(hj,F),z.addEventListener(fj,Q),()=>{z.removeEventListener(hj,F),z.removeEventListener(fj,Q)}}},[w.viewport,E,c,d,U]),b.useEffect(()=>{i&&!w.isClosePausedRef.current&&U(E)},[i,E,w.isClosePausedRef,U]),b.useEffect(()=>(P(),()=>B()),[P,B]);const te=b.useMemo(()=>S?YY(S):null,[S]);return w.viewport?o.jsxs(o.Fragment,{children:[te&&o.jsx(LDe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:te}),o.jsx(PDe,{scope:n,onClose:$,children:pa.createPortal(o.jsx(_7.ItemSlot,{scope:n,children:o.jsx(zee,{asChild:!0,onEscapeKeyDown:nt(l,()=>{w.isFocusedToastEscapeKeyDownRef.current||$(),w.isFocusedToastEscapeKeyDownRef.current=!1}),children:o.jsx(xn.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":w.swipeDirection,...y,ref:j,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:nt(t.onKeyDown,z=>{z.key==="Escape"&&(l?.(z.nativeEvent),z.nativeEvent.defaultPrevented||(w.isFocusedToastEscapeKeyDownRef.current=!0,$()))}),onPointerDown:nt(t.onPointerDown,z=>{z.button===0&&(N.current={x:z.clientX,y:z.clientY})}),onPointerMove:nt(t.onPointerMove,z=>{if(!N.current)return;const Q=z.clientX-N.current.x,F=z.clientY-N.current.y,Y=!!T.current,J=["left","right"].includes(w.swipeDirection),X=["left","up"].includes(w.swipeDirection)?Math.min:Math.max,R=J?X(0,Q):0,ie=J?0:X(0,F),G=z.pointerType==="touch"?10:2,I={x:R,y:ie},V={originalEvent:z,delta:I};Y?(T.current=I,Z1(MDe,m,V,{discrete:!1})):Lz(I,w.swipeDirection,G)?(T.current=I,Z1(ADe,h,V,{discrete:!1}),z.target.setPointerCapture(z.pointerId)):(Math.abs(Q)>G||Math.abs(F)>G)&&(N.current=null)}),onPointerUp:nt(t.onPointerUp,z=>{const Q=T.current,F=z.target;if(F.hasPointerCapture(z.pointerId)&&F.releasePointerCapture(z.pointerId),T.current=null,N.current=null,Q){const Y=z.currentTarget,J={originalEvent:z,delta:Q};Lz(Q,w.swipeDirection,w.swipeThreshold)?Z1(DDe,x,J,{discrete:!0}):Z1(RDe,g,J,{discrete:!0}),Y.addEventListener("click",X=>X.preventDefault(),{once:!0})}})})})}),w.viewport)})]}):null}),LDe=t=>{const{__scopeToast:e,children:n,...r}=t,s=ow(Tg,e),[i,a]=b.useState(!1),[l,c]=b.useState(!1);return qDe(()=>a(!0)),b.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),l?null:o.jsx(Qy,{asChild:!0,children:o.jsx(vI,{...r,children:i&&o.jsxs(o.Fragment,{children:[s.label," ",n]})})})},BDe="ToastTitle",QY=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return o.jsx(xn.div,{...r,ref:e})});QY.displayName=BDe;var FDe="ToastDescription",VY=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return o.jsx(xn.div,{...r,ref:e})});VY.displayName=FDe;var UY="ToastAction",WY=b.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?o.jsx(XY,{altText:n,asChild:!0,children:o.jsx(A7,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${UY}\`. Expected non-empty \`string\`.`),null)});WY.displayName=UY;var GY="ToastClose",A7=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=zDe(GY,n);return o.jsx(XY,{asChild:!0,children:o.jsx(xn.button,{type:"button",...r,ref:e,onClick:nt(t.onClick,s.onClose)})})});A7.displayName=GY;var XY=b.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return o.jsx(xn.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function YY(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),$De(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const a=r.dataset.radixToastAnnounceAlt;a&&e.push(a)}else e.push(...YY(r))}}),e}function Z1(t,e,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?xI(s,i):s.dispatchEvent(i)}var Lz=(t,e,n=0)=>{const r=Math.abs(t.x),s=Math.abs(t.y),i=r>s;return e==="left"||e==="right"?i&&r>n:!i&&s>n};function qDe(t=()=>{}){const e=Rs(t);Uh(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function $De(t){return t.nodeType===t.ELEMENT_NODE}function HDe(t){const e=[],n=document.createTreeWalker(t,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(;n.nextNode();)e.push(n.currentNode);return e}function J3(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var QDe=BY,KY=qY,ZY=HY,JY=QY,eK=VY,tK=WY,nK=A7;const VDe=QDe,rK=b.forwardRef(({className:t,...e},n)=>o.jsx(KY,{ref:n,className:xe("fixed bottom-0 right-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:max-w-[420px] gap-2",t),...e}));rK.displayName=KY.displayName;const UDe=kf("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-slide-in-from-right data-[state=open]:animate-fade-in data-[state=closed]:animate-slide-out-to-right data-[state=closed]:animate-fade-out data-[swipe=end]:animate-slide-out-to-right",{variants:{variant:{default:"border bg-primary/5 text-foreground backdrop-blur-sm",destructive:"destructive group border-destructive bg-destructive/10 text-destructive-foreground backdrop-blur-sm"}},defaultVariants:{variant:"default"}}),sK=b.forwardRef(({className:t,variant:e,...n},r)=>o.jsx(ZY,{ref:r,className:xe(UDe({variant:e}),t),...n}));sK.displayName=ZY.displayName;const WDe=b.forwardRef(({className:t,...e},n)=>o.jsx(tK,{ref:n,className:xe("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",t),...e}));WDe.displayName=tK.displayName;const iK=b.forwardRef(({className:t,...e},n)=>o.jsx(nK,{ref:n,className:xe("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",t),"toast-close":"",...e,children:o.jsx(_p,{className:"h-4 w-4"})}));iK.displayName=nK.displayName;const aK=b.forwardRef(({className:t,...e},n)=>o.jsx(JY,{ref:n,className:xe("text-sm font-semibold [&+div]:text-xs",t),...e}));aK.displayName=JY.displayName;const oK=b.forwardRef(({className:t,...e},n)=>o.jsx(eK,{ref:n,className:xe("text-sm opacity-90",t),...e}));oK.displayName=eK.displayName;function GDe(){const{toasts:t}=as();return o.jsxs(VDe,{children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return o.jsxs(sK,{...i,children:[o.jsxs("div",{className:"grid gap-1",children:[n&&o.jsx(aK,{children:n}),r&&o.jsx(oK,{children:r})]}),s,o.jsx(iK,{})]},e)}),o.jsx(rK,{})]})}yte.createRoot(document.getElementById("root")).render(o.jsx(b.StrictMode,{children:o.jsx(sDe,{children:o.jsx(jDe,{defaultTheme:"system",children:o.jsx(NDe,{children:o.jsxs(Spe,{children:[o.jsx(SJ,{router:ODe}),o.jsx(Yxe,{}),o.jsx(GDe,{})]})})})})})); diff --git a/webui/dist/assets/index-Rqzi5c1P.css b/webui/dist/assets/index-Rqzi5c1P.css new file mode 100644 index 00000000..fe11943e --- /dev/null +++ b/webui/dist/assets/index-Rqzi5c1P.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 221.2 83.2% 53.3%;--primary-foreground: 210 40% 98%;--primary-gradient: none;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 221.2 83.2% 53.3%;--radius: .5rem;--chart-1: 221.2 83.2% 53.3%;--chart-2: 160 60% 45%;--chart-3: 30 80% 55%;--chart-4: 280 65% 60%;--chart-5: 340 75% 55%}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 217.2 91.2% 59.8%;--primary-foreground: 222.2 47.4% 11.2%;--primary-gradient: none;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 224.3 76.3% 48%;--chart-1: 217.2 91.2% 59.8%;--chart-2: 160 60% 50%;--chart-3: 30 80% 60%;--chart-4: 280 65% 65%;--chart-5: 340 75% 60%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield;-webkit-appearance:textfield;appearance:textfield}.\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.bottom-1\/4{bottom:25%}.bottom-4{bottom:1rem}.left-0{left:0}.left-1{left:.25rem}.left-1\/2{left:50%}.left-1\/4{left:25%}.left-2{left:.5rem}.left-2\.5{left:.625rem}.left-3{left:.75rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-1{right:.25rem}.right-1\.5{right:.375rem}.right-1\/4{right:25%}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-1\/4{top:25%}.top-2{top:.5rem}.top-2\.5{top:.625rem}.top-3{top:.75rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.order-1{order:1}.order-2{order:2}.col-span-2{grid-column:span 2 / span 2}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.-mt-2{margin-top:-.5rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-12{margin-top:3rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-auto{aspect-ratio:auto}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.size-4{width:1rem;height:1rem}.size-\[--cell-size\]{width:var(--cell-size);height:var(--cell-size)}.h-0\.5{height:.125rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[--cell-size\]{height:var(--cell-size)}.h-\[1\.25rem\]{height:1.25rem}.h-\[1px\]{height:1px}.h-\[200px\]{height:200px}.h-\[250px\]{height:250px}.h-\[280px\]{height:280px}.h-\[300px\]{height:300px}.h-\[400px\]{height:400px}.h-\[calc\(100vh-200px\)\]{height:calc(100vh - 200px)}.h-\[calc\(100vh-240px\)\]{height:calc(100vh - 240px)}.h-\[calc\(100vh-260px\)\]{height:calc(100vh - 260px)}.h-\[calc\(100vh-4rem\)\]{height:calc(100vh - 4rem)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\[--radix-context-menu-content-available-height\]{max-height:var(--radix-context-menu-content-available-height)}.max-h-\[--radix-select-content-available-height\]{max-height:var(--radix-select-content-available-height)}.max-h-\[300px\]{max-height:300px}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(90vh-120px\)\]{max-height:calc(90vh - 120px)}.max-h-\[calc\(90vh-8rem\)\]{max-height:calc(90vh - 8rem)}.max-h-none{max-height:none}.max-h-screen{max-height:100vh}.min-h-0{min-height:0px}.min-h-10{min-height:2.5rem}.min-h-\[100px\]{min-height:100px}.min-h-\[300px\]{min-height:300px}.min-h-\[60px\]{min-height:60px}.min-h-screen{min-height:100vh}.w-0{width:0px}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\[--cell-size\]{width:var(--cell-size)}.w-\[100px\]{width:100px}.w-\[120px\]{width:120px}.w-\[130px\]{width:130px}.w-\[1px\]{width:1px}.w-\[65px\]{width:65px}.w-\[95vw\]{width:95vw}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-\[--cell-size\]{min-width:var(--cell-size)}.min-w-\[100px\]{min-width:100px}.min-w-\[120px\]{min-width:120px}.min-w-\[80px\]{min-width:80px}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.min-w-full{min-width:100%}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-\[150px\]{max-width:150px}.max-w-\[200px\]{max-width:200px}.max-w-\[60px\]{max-width:60px}.max-w-\[75\%\]{max-width:75%}.max-w-\[90\%\]{max-width:90%}.max-w-\[95vw\]{max-width:95vw}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.origin-\[--radix-context-menu-content-transform-origin\]{transform-origin:var(--radix-context-menu-content-transform-origin)}.origin-\[--radix-popover-content-transform-origin\]{transform-origin:var(--radix-popover-content-transform-origin)}.origin-\[--radix-select-content-transform-origin\]{transform-origin:var(--radix-select-content-transform-origin)}.origin-\[--radix-tooltip-content-transform-origin\]{transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-move{cursor:move}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize{resize:both}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-l-md{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.rounded-r-md{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.rounded-tr-sm{border-top-right-radius:calc(var(--radius) - 4px)}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-4{border-width:4px}.border-\[1\.5px\]{border-width:1.5px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[--color-border\]{border-color:var(--color-border)}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-amber-500\/50{border-color:#f59e0b80}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-700{--tw-border-opacity: 1;border-color:rgb(29 78 216 / var(--tw-border-opacity, 1))}.border-border{border-color:hsl(var(--border))}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-current{border-color:currentColor}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-green-700{--tw-border-opacity: 1;border-color:rgb(21 128 61 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-muted{border-color:hsl(var(--muted))}.border-muted-foreground\/30{border-color:hsl(var(--muted-foreground) / .3)}.border-muted-foreground\/50{border-color:hsl(var(--muted-foreground) / .5)}.border-orange-600{--tw-border-opacity: 1;border-color:rgb(234 88 12 / var(--tw-border-opacity, 1))}.border-primary{border-color:hsl(var(--primary))}.border-primary\/20{border-color:hsl(var(--primary) / .2)}.border-primary\/30{border-color:hsl(var(--primary) / .3)}.border-primary\/50{border-color:hsl(var(--primary) / .5)}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-red-500\/50{border-color:#ef444480}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.border-yellow-500\/50{border-color:#eab30880}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\[--color-bg\]{background-color:var(--color-bg)}.bg-accent{background-color:hsl(var(--accent))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500\/10{background-color:#f59e0b1a}.bg-background{background-color:hsl(var(--background))}.bg-background\/50{background-color:hsl(var(--background) / .5)}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-background\/95{background-color:hsl(var(--background) / .95)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/50{background-color:#00000080}.bg-black\/80{background-color:#000c}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-900\/20{background-color:#1e3a8a33}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-card\/80{background-color:hsl(var(--card) / .8)}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-gray-800\/20{background-color:#1f293733}.bg-gray-800\/30{background-color:#1f29374d}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted-foreground\/50{background-color:hsl(var(--muted-foreground) / .5)}.bg-muted\/20{background-color:hsl(var(--muted) / .2)}.bg-muted\/30{background-color:hsl(var(--muted) / .3)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-orange-50{--tw-bg-opacity: 1;background-color:rgb(255 247 237 / var(--tw-bg-opacity, 1))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-orange-600{--tw-bg-opacity: 1;background-color:rgb(234 88 12 / var(--tw-bg-opacity, 1))}.bg-pink-500{--tw-bg-opacity: 1;background-color:rgb(236 72 153 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/5{background-color:hsl(var(--primary) / .05)}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-red-900\/20{background-color:#7f1d1d33}.bg-red-900\/30{background-color:#7f1d1d4d}.bg-secondary{background-color:hsl(var(--secondary))}.bg-secondary\/5{background-color:hsl(var(--secondary) / .05)}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-300{--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}.bg-slate-400{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.bg-slate-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/10{background-color:#eab3081a}.bg-yellow-500\/5{background-color:#eab3080d}.bg-yellow-900\/20{background-color:#713f1233}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-500{--tw-gradient-from: #22c55e var(--tw-gradient-from-position);--tw-gradient-to: rgb(34 197 94 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-indigo-500{--tw-gradient-from: #6366f1 var(--tw-gradient-from-position);--tw-gradient-to: rgb(99 102 241 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-orange-500{--tw-gradient-from: #f97316 var(--tw-gradient-from-position);--tw-gradient-to: rgb(249 115 22 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary\/5{--tw-gradient-from: hsl(var(--primary) / .05) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from: #a855f7 var(--tw-gradient-from-position);--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-500{--tw-gradient-from: #ef4444 var(--tw-gradient-from-position);--tw-gradient-to: rgb(239 68 68 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-200{--tw-gradient-from: #e2e8f0 var(--tw-gradient-from-position);--tw-gradient-to: rgb(226 232 240 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-300{--tw-gradient-from: #cbd5e1 var(--tw-gradient-from-position);--tw-gradient-to: rgb(203 213 225 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-400{--tw-gradient-from: #94a3b8 var(--tw-gradient-from-position);--tw-gradient-to: rgb(148 163 184 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-background{--tw-gradient-to: hsl(var(--background) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--background)) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-blue-600{--tw-gradient-to: #2563eb var(--tw-gradient-to-position)}.to-cyan-500{--tw-gradient-to: #06b6d4 var(--tw-gradient-to-position)}.to-emerald-500{--tw-gradient-to: #10b981 var(--tw-gradient-to-position)}.to-green-600{--tw-gradient-to: #16a34a var(--tw-gradient-to-position)}.to-orange-500{--tw-gradient-to: #f97316 var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to: #ec4899 var(--tw-gradient-to-position)}.to-primary\/10{--tw-gradient-to: hsl(var(--primary) / .1) var(--tw-gradient-to-position)}.to-purple-500{--tw-gradient-to: #a855f7 var(--tw-gradient-to-position)}.to-secondary\/5{--tw-gradient-to: hsl(var(--secondary) / .05) var(--tw-gradient-to-position)}.to-slate-700{--tw-gradient-to: #334155 var(--tw-gradient-to-position)}.to-slate-800{--tw-gradient-to: #1e293b var(--tw-gradient-to-position)}.to-slate-900{--tw-gradient-to: #0f172a var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.fill-yellow-400{fill:#facc15}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\[--cell-size\]{padding-left:var(--cell-size);padding-right:var(--cell-size)}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-0{padding-bottom:0}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pl-10{padding-left:2.5rem}.pl-11{padding-left:2.75rem}.pl-2{padding-left:.5rem}.pl-4{padding-left:1rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-10{padding-right:2.5rem}.pr-16{padding-right:4rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pr-6{padding-right:1.5rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[0\.8rem\]{font-size:.8rem}.text-\[10px\]{font-size:10px}.text-\[150px\]{font-size:150px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-black{font-weight:900}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.tracking-tight{letter-spacing:-.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/50{color:hsl(var(--muted-foreground) / .5)}.text-muted-foreground\/60{color:hsl(var(--muted-foreground) / .6)}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-orange-900{--tw-text-opacity: 1;color:rgb(124 45 18 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-primary\/10{color:hsl(var(--primary) / .1)}.text-primary\/30{color:hsl(var(--primary) / .3)}.text-primary\/60{color:hsl(var(--primary) / .6)}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.text-yellow-900{--tw-text-opacity: 1;color:rgb(113 63 18 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-primary{--tw-ring-color: hsl(var(--primary))}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.blur-3xl{--tw-blur: blur(64px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-xl{--tw-backdrop-blur: blur(24px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.text-primary-gradient{color:hsl(var(--primary))}.has-gradient .text-primary-gradient{background:var(--primary-gradient);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent}.\[--cell-size\:2rem\]{--cell-size: 2rem}.no-animations *,.no-animations *:before,.no-animations *:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}.no-animations *:hover{transition-duration:.01ms!important}::view-transition-old(root),::view-transition-new(root){animation:none;mix-blend-mode:normal}::view-transition-old(root){z-index:1}::view-transition-new(root){z-index:999}.__floater{z-index:99999!important;pointer-events:auto!important}.react-joyride__overlay,.react-joyride__spotlight{z-index:99998!important}.react-joyride__tooltip{pointer-events:auto!important}#tour-portal-container *{pointer-events:auto}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:border-primary\/50:hover{border-color:hsl(var(--primary) / .5)}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-accent\/50:hover{background-color:hsl(var(--accent) / .5)}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-orange-700:hover{--tw-bg-opacity: 1;background-color:rgb(194 65 12 / var(--tw-bg-opacity, 1))}.hover\:bg-primary\/10:hover{background-color:hsl(var(--primary) / .1)}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-secondary\/90:hover{background-color:hsl(var(--secondary) / .9)}.hover\:bg-transparent:hover{background-color:transparent}.hover\:bg-white\/5:hover{background-color:#ffffff0d}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-green-700:hover{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.hover\:text-orange-700:hover{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.hover\:text-primary\/80:hover{color:hsl(var(--primary) / .8)}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.hover\:text-yellow-300:hover{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.hover\:text-yellow-800:hover{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:ring-2:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.hover\:ring-primary:hover{--tw-ring-color: hsl(var(--primary))}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:bg-gray-100:focus{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-0:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-red-500:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.active\:cursor-grabbing:active{cursor:grabbing}.active\:border-primary\/70:active{border-color:hsl(var(--primary) / .7)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group[open] .group-open\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:opacity-100{opacity:1}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.destructive .group-\[\.destructive\]\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-selected\:text-muted-foreground[aria-selected=true]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked],.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes fade-out{0%{opacity:1}to{opacity:0}}.data-\[state\=closed\]\:animate-fade-out[data-state=closed]{animation:fade-out .15s ease-in}.data-\[state\=closed\]\:animate-slide-out-to-right[data-state=closed]{animation:slide-out-to-right .2s ease-in}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.data-\[state\=open\]\:animate-fade-in[data-state=open]{animation:fade-in .2s ease-out}@keyframes slide-in-from-right{0%{transform:translate(100%)}to{transform:translate(0)}}.data-\[state\=open\]\:animate-slide-in-from-right[data-state=open]{animation:slide-in-from-right .3s ease-out}@keyframes slide-out-to-right{0%{transform:translate(0)}to{transform:translate(100%)}}.data-\[swipe\=end\]\:animate-slide-out-to-right[data-swipe=end]{animation:slide-out-to-right .2s ease-in}.data-\[range-end\=true\]\:rounded-md[data-range-end=true]{border-radius:calc(var(--radius) - 2px)}.data-\[range-middle\=true\]\:rounded-none[data-range-middle=true]{border-radius:0}.data-\[range-start\=true\]\:rounded-md[data-range-start=true]{border-radius:calc(var(--radius) - 2px)}.data-\[selected\=true\]\:rounded-none[data-selected=true]{border-radius:0}.data-\[range-end\=true\]\:bg-primary[data-range-end=true]{background-color:hsl(var(--primary))}.data-\[range-middle\=true\]\:bg-accent[data-range-middle=true]{background-color:hsl(var(--accent))}.data-\[range-start\=true\]\:bg-primary[data-range-start=true],.data-\[selected-single\=true\]\:bg-primary[data-selected-single=true]{background-color:hsl(var(--primary))}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:hsl(var(--muted-foreground))}.data-\[range-end\=true\]\:text-primary-foreground[data-range-end=true]{color:hsl(var(--primary-foreground))}.data-\[range-middle\=true\]\:text-accent-foreground[data-range-middle=true]{color:hsl(var(--accent-foreground))}.data-\[range-start\=true\]\:text-primary-foreground[data-range-start=true],.data-\[selected-single\=true\]\:text-primary-foreground[data-selected-single=true]{color:hsl(var(--primary-foreground))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:hsl(var(--accent-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=active\]\:duration-300[data-state=active]{transition-duration:.3s}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:relative{position:relative}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:z-10{z-index:10}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:border-ring{border-color:hsl(var(--ring))}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:ring-\[3px\]{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.group\/day[data-focused=true] .group-data-\[focused\=true\]\/day\:ring-ring\/50{--tw-ring-color: hsl(var(--ring) / .5)}@supports (backdrop-filter: var(--tw)){.supports-\[backdrop-filter\]\:bg-background\/60{background-color:hsl(var(--background) / .6)}}.dark\:border-amber-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(146 64 14 / var(--tw-border-opacity, 1))}.dark\:border-blue-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 64 175 / var(--tw-border-opacity, 1))}.dark\:border-blue-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 58 138 / var(--tw-border-opacity, 1))}.dark\:border-gray-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(17 24 39 / var(--tw-border-opacity, 1))}.dark\:border-green-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(22 101 52 / var(--tw-border-opacity, 1))}.dark\:border-yellow-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(113 63 18 / var(--tw-border-opacity, 1))}.dark\:bg-amber-950\/30:is(.dark *){background-color:#451a034d}.dark\:bg-blue-500\/20:is(.dark *){background-color:#3b82f633}.dark\:bg-blue-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(23 37 84 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-950\/20:is(.dark *){background-color:#17255433}.dark\:bg-blue-950\/30:is(.dark *){background-color:#1725544d}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800\/30:is(.dark *){background-color:#1f29374d}.dark\:bg-gray-800\/50:is(.dark *){background-color:#1f293780}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity, 1))}.dark\:bg-green-900\/30:is(.dark *){background-color:#14532d4d}.dark\:bg-green-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(5 46 22 / var(--tw-bg-opacity, 1))}.dark\:bg-orange-950\/20:is(.dark *){background-color:#43140733}.dark\:bg-red-500\/20:is(.dark *){background-color:#ef444433}.dark\:bg-red-600\/30:is(.dark *){background-color:#dc26264d}.dark\:bg-red-900\/30:is(.dark *){background-color:#7f1d1d4d}.dark\:bg-red-950\/50:is(.dark *){background-color:#450a0a80}.dark\:bg-yellow-500\/20:is(.dark *){background-color:#eab30833}.dark\:bg-yellow-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(113 63 18 / var(--tw-bg-opacity, 1))}.dark\:bg-yellow-950\/30:is(.dark *){background-color:#4220064d}.dark\:text-amber-100:is(.dark *){--tw-text-opacity: 1;color:rgb(254 243 199 / var(--tw-text-opacity, 1))}.dark\:text-amber-400:is(.dark *){--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.dark\:text-blue-100:is(.dark *){--tw-text-opacity: 1;color:rgb(219 234 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-200:is(.dark *){--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:text-blue-400:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\:text-cyan-500:is(.dark *){--tw-text-opacity: 1;color:rgb(6 182 212 / var(--tw-text-opacity, 1))}.dark\:text-gray-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-gray-600:is(.dark *){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-orange-100:is(.dark *){--tw-text-opacity: 1;color:rgb(255 237 213 / var(--tw-text-opacity, 1))}.dark\:text-orange-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 215 170 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-red-500:is(.dark *){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.dark\:text-yellow-100:is(.dark *){--tw-text-opacity: 1;color:rgb(254 249 195 / var(--tw-text-opacity, 1))}.dark\:text-yellow-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.dark\:text-yellow-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.dark\:text-yellow-400:is(.dark *){--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.dark\:text-yellow-500:is(.dark *){--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.dark\:hover\:bg-gray-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-yellow-200:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.dark\:focus\:bg-gray-800:focus:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}@media(min-width:640px){.sm\:right-2{right:.5rem}.sm\:right-3{right:.75rem}.sm\:top-2{top:.5rem}.sm\:top-3{top:.75rem}.sm\:order-1{order:1}.sm\:order-2{order:2}.sm\:col-span-2{grid-column:span 2 / span 2}.sm\:mx-0{margin-left:0;margin-right:0}.sm\:mb-3{margin-bottom:.75rem}.sm\:mb-4{margin-bottom:1rem}.sm\:mb-6{margin-bottom:1.5rem}.sm\:ml-1{margin-left:.25rem}.sm\:mr-1{margin-right:.25rem}.sm\:mr-2{margin-right:.5rem}.sm\:mt-0{margin-top:0}.sm\:mt-2{margin-top:.5rem}.sm\:mt-3{margin-top:.75rem}.sm\:mt-6{margin-top:1.5rem}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:h-10{height:2.5rem}.sm\:h-12{height:3rem}.sm\:h-2{height:.5rem}.sm\:h-24{height:6rem}.sm\:h-3{height:.75rem}.sm\:h-4{height:1rem}.sm\:h-5{height:1.25rem}.sm\:h-8{height:2rem}.sm\:h-\[300px\]{height:300px}.sm\:h-\[400px\]{height:400px}.sm\:h-\[500px\]{height:500px}.sm\:h-\[calc\(100vh-280px\)\]{height:calc(100vh - 280px)}.sm\:w-10{width:2.5rem}.sm\:w-2{width:.5rem}.sm\:w-24{width:6rem}.sm\:w-3{width:.75rem}.sm\:w-4{width:1rem}.sm\:w-5{width:1.25rem}.sm\:w-8{width:2rem}.sm\:w-\[140px\]{width:140px}.sm\:w-\[160px\]{width:160px}.sm\:w-\[200px\]{width:200px}.sm\:w-\[500px\]{width:500px}.sm\:w-auto{width:auto}.sm\:w-full{width:100%}.sm\:min-w-\[120px\]{min-width:120px}.sm\:max-w-2xl{max-width:42rem}.sm\:max-w-\[420px\]{max-width:420px}.sm\:max-w-\[70\%\]{max-width:70%}.sm\:max-w-\[900px\]{max-width:900px}.sm\:max-w-md{max-width:28rem}.sm\:max-w-sm{max-width:24rem}.sm\:flex-1{flex:1 1 0%}.sm\:flex-none{flex:none}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.sm\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-start{align-items:flex-start}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-0{gap:0px}.sm\:gap-1{gap:.25rem}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:gap-6{gap:1.5rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.sm\:space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.sm\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.sm\:space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:p-3{padding:.75rem}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:pb-4{padding-bottom:1rem}.sm\:text-left{text-align:left}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}.sm\:text-\[200px\]{font-size:200px}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}.sm\:text-xs{font-size:.75rem;line-height:1rem}}@media(min-width:768px){.md\:top-4{top:1rem}.md\:mb-4{margin-bottom:1rem}.md\:mb-6{margin-bottom:1.5rem}.md\:mb-8{margin-bottom:2rem}.md\:mt-8{margin-top:2rem}.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:h-16{height:4rem}.md\:h-4{height:1rem}.md\:h-5{height:1.25rem}.md\:h-8{height:2rem}.md\:h-96{height:24rem}.md\:h-\[500px\]{height:500px}.md\:min-h-\[400px\]{min-height:400px}.md\:w-16{width:4rem}.md\:w-4{width:1rem}.md\:w-5{width:1.25rem}.md\:w-8{width:2rem}.md\:w-96{width:24rem}.md\:max-w-none{max-width:none}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:gap-2{gap:.5rem}.md\:gap-3{gap:.75rem}.md\:gap-4{gap:1rem}.md\:gap-6{gap:1.5rem}.md\:space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.md\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.md\:whitespace-normal{white-space:normal}.md\:p-12{padding:3rem}.md\:p-4{padding:1rem}.md\:p-6{padding:1.5rem}.md\:p-8{padding:2rem}.md\:text-2xl{font-size:1.5rem;line-height:2rem}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-base{font-size:1rem;line-height:1.5rem}.md\:text-lg{font-size:1.125rem;line-height:1.75rem}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:text-xs{font-size:.75rem;line-height:1rem}}@media(min-width:1024px){.lg\:invisible{visibility:hidden}.lg\:relative{position:relative}.lg\:z-0{z-index:0}.lg\:mx-auto{margin-left:auto;margin-right:auto}.lg\:mb-1{margin-bottom:.25rem}.lg\:block{display:block}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:w-12{width:3rem}.lg\:w-16{width:4rem}.lg\:w-64{width:16rem}.lg\:w-8{width:2rem}.lg\:w-\[130px\]{width:130px}.lg\:w-\[160px\]{width:160px}.lg\:w-\[180px\]{width:180px}.lg\:w-\[200px\]{width:200px}.lg\:w-\[240px\]{width:240px}.lg\:w-\[75px\]{width:75px}.lg\:w-auto{width:auto}.lg\:w-full{width:100%}.lg\:max-w-0{max-width:0px}.lg\:flex-1{flex:1 1 0%}.lg\:flex-none{flex:none}.lg\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.lg\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.lg\:justify-center{justify-content:center}.lg\:gap-0{gap:0px}.lg\:space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.lg\:overflow-hidden{overflow:hidden}.lg\:p-2{padding:.5rem}.lg\:p-6{padding:1.5rem}.lg\:px-0{padding-left:0;padding-right:0}.lg\:px-6{padding-left:1.5rem;padding-right:1.5rem}.lg\:pb-6{padding-bottom:1.5rem}.lg\:text-3xl{font-size:1.875rem;line-height:2.25rem}.lg\:opacity-0{opacity:0}}@media(min-width:1280px){.xl\:grid-cols-10{grid-template-columns:repeat(10,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}}.\[\&\+div\]\:text-xs+div{font-size:.75rem;line-height:1rem}.\[\&\:first-child\[data-selected\=true\]_button\]\:rounded-l-md:first-child[data-selected=true] button{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\:last-child\[data-selected\=true\]_button\]\:rounded-r-md:last-child[data-selected=true] button{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y: 2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>span\]\:text-xs>span{font-size:.75rem;line-height:1rem}.\[\&\>span\]\:opacity-70>span{opacity:.7}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:size-3\.5>svg{width:.875rem;height:.875rem}.\[\&\>svg\]\:h-2\.5>svg{height:.625rem}.\[\&\>svg\]\:h-3>svg{height:.75rem}.\[\&\>svg\]\:w-2\.5>svg{width:.625rem}.\[\&\>svg\]\:w-3>svg{width:.75rem}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\]\:text-muted-foreground>svg{color:hsl(var(--muted-foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:hsl(var(--muted-foreground))}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:hsl(var(--border) / .5)}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:hsl(var(--border))}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-layer\]\:outline-none .recharts-layer{outline:2px solid transparent;outline-offset:2px}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:hsl(var(--muted))}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-sector\]\:outline-none .recharts-sector,.\[\&_\.recharts-surface\]\:outline-none .recharts-surface{outline:2px solid transparent;outline-offset:2px}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:invisible svg{visibility:hidden}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}[data-slot=card-content] .\[\[data-slot\=card-content\]_\&\]\:bg-transparent,[data-slot=popover-content] .\[\[data-slot\=popover-content\]_\&\]\:bg-transparent{background-color:transparent}@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2) format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff) format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff) format("woff"),url(/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff) format("woff"),url(/assets/KaTeX_Fraktur-Regular-CB_wures.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Main-Bold-Cx986IdX.woff2) format("woff2"),url(/assets/KaTeX_Main-Bold-Jm3AIy58.woff) format("woff"),url(/assets/KaTeX_Main-Bold-waoOVXN0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2) format("woff2"),url(/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff) format("woff"),url(/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2) format("woff2"),url(/assets/KaTeX_Main-Italic-BMLOBm91.woff) format("woff"),url(/assets/KaTeX_Main-Italic-3WenGoN9.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Main-Regular-B22Nviop.woff2) format("woff2"),url(/assets/KaTeX_Main-Regular-Dr94JaBh.woff) format("woff"),url(/assets/KaTeX_Main-Regular-ypZvNtVU.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2) format("woff2"),url(/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff) format("woff"),url(/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Math-Italic-t53AETM-.woff2) format("woff2"),url(/assets/KaTeX_Math-Italic-DA0__PXp.woff) format("woff"),url(/assets/KaTeX_Math-Italic-flOr_0UB.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff) format("woff"),url(/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff) format("woff"),url(/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff) format("woff"),url(/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Script-Regular-D3wIWfF6.woff2) format("woff2"),url(/assets/KaTeX_Script-Regular-D5yQViql.woff) format("woff"),url(/assets/KaTeX_Script-Regular-C5JkGWo-.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2) format("woff2"),url(/assets/KaTeX_Size1-Regular-C195tn64.woff) format("woff"),url(/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2) format("woff2"),url(/assets/KaTeX_Size2-Regular-oD1tc_U0.woff) format("woff"),url(/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC) format("woff2"),url(/assets/KaTeX_Size3-Regular-CTq5MqoE.woff) format("woff"),url(/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2) format("woff2"),url(/assets/KaTeX_Size4-Regular-BF-4gkZK.woff) format("woff"),url(/assets/KaTeX_Size4-Regular-DWFBv043.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2) format("woff2"),url(/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff) format("woff"),url(/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf) format("truetype")}.katex{font: 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.25"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}.react-flow{direction:ltr}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;cursor:grab}.react-flow__pane.selection{cursor:pointer}.react-flow__pane.dragging{cursor:grabbing}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow .react-flow__edges{pointer-events:none;overflow:visible}.react-flow__edge-path,.react-flow__connection-path{stroke:#b1b1b7;stroke-width:1;fill:none}.react-flow__edge{pointer-events:visibleStroke;cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge:focus .react-flow__edge-path,.react-flow__edge:focus-visible .react-flow__edge-path{stroke:#555}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge-textbg{fill:#fff}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__connectionline{z-index:1001}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:grab}.react-flow__node.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background:#1a192b;border:1px solid white;border-radius:100%}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:-4px;transform:translate(-50%)}.react-flow__handle-top{left:50%;top:-4px;transform:translate(-50%)}.react-flow__handle-left{top:50%;left:-4px;transform:translateY(-50%)}.react-flow__handle-right{right:-4px;top:50%;transform:translateY(-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.center{left:50%;transform:translate(-50%)}.react-flow__attribution{font-size:10px;background:#ffffff80;padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-default,.react-flow__node-input,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:3px;width:150px;font-size:12px;color:#222;text-align:center;border-width:1px;border-style:solid;border-color:#1a192b;background-color:#fff}.react-flow__node-default.selectable:hover,.react-flow__node-input.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:0 1px 4px 1px #00000014}.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:0 0 0 .5px #1a192b}.react-flow__node-group{background-color:#f0f0f040}.react-flow__nodesselection-rect,.react-flow__selection{background:#0059dc14;border:1px dotted rgba(0,89,220,.8)}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls{box-shadow:0 0 2px 1px #00000014}.react-flow__controls-button{border:none;background:#fefefe;border-bottom:1px solid #eee;box-sizing:content-box;display:flex;justify-content:center;align-items:center;width:16px;height:16px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:5px}.react-flow__controls-button:hover{background:#f4f4f4}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__minimap{background-color:#fff}.react-flow__minimap svg{display:block}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:4px;height:4px;border:1px solid #fff;border-radius:1px;background-color:#3367d9;transform:translate(-50%,-50%)}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:#3367d9;border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%} diff --git a/webui/dist/assets/router-SinpzM5S.js b/webui/dist/assets/router-DQNkr8RI.js similarity index 99% rename from webui/dist/assets/router-SinpzM5S.js rename to webui/dist/assets/router-DQNkr8RI.js index c8b8f8ad..70f3abb1 100644 --- a/webui/dist/assets/router-SinpzM5S.js +++ b/webui/dist/assets/router-DQNkr8RI.js @@ -1,2 +1,2 @@ import{r as po,a as ee,g as oe,b as mo}from"./react-vendor-Dtc2IqVY.js";function go(t,o){for(var e=0;es[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var g=po(),R=ee();const rt=oe(R),hn=go({__proto__:null,default:rt},[R]),Yt=new WeakMap,yo=new WeakMap,bt={current:[]};let Nt=!1,mt=0;const pt=new Set,Pt=new Map;function Ue(t){for(const o of t){if(bt.current.includes(o))continue;bt.current.push(o),o.recompute();const e=yo.get(o);if(e)for(const s of e){const n=Yt.get(s);n?.length&&Ue(n)}}}function vo(t){const o={prevVal:t.prevState,currentVal:t.state};for(const e of t.listeners)e(o)}function So(t){const o={prevVal:t.prevState,currentVal:t.state};for(const e of t.listeners)e(o)}function Ve(t){if(mt>0&&!Pt.has(t)&&Pt.set(t,t.prevState),pt.add(t),!(mt>0)&&!Nt)try{for(Nt=!0;pt.size>0;){const o=Array.from(pt);pt.clear();for(const e of o){const s=Pt.get(e)??e.prevState;e.prevState=s,vo(e)}for(const e of o){const s=Yt.get(e);s&&(bt.current.push(e),Ue(s))}for(const e of o){const s=Yt.get(e);if(s)for(const n of s)So(n)}}}finally{Nt=!1,bt.current=[],Pt.clear()}}function gt(t){mt++;try{t()}finally{if(mt--,mt===0){const o=pt.values().next().value;o&&Ve(o)}}}function _o(t){return typeof t=="function"}class Ro{constructor(o,e){this.listeners=new Set,this.subscribe=s=>{var n,r;this.listeners.add(s);const i=(r=(n=this.options)==null?void 0:n.onSubscribe)==null?void 0:r.call(n,s,this);return()=>{this.listeners.delete(s),i?.()}},this.prevState=o,this.state=o,this.options=e}setState(o){var e,s,n;this.prevState=this.state,(e=this.options)!=null&&e.updateFn?this.state=this.options.updateFn(this.prevState)(o):_o(o)?this.state=o(this.prevState):this.state=o,(n=(s=this.options)==null?void 0:s.onUpdate)==null||n.call(s),Ve(this)}}const G="__TSR_index",Se="popstate",_e="beforeunload";function Po(t){let o=t.getLocation();const e=new Set,s=i=>{o=t.getLocation(),e.forEach(c=>c({location:o,action:i}))},n=i=>{t.notifyOnIndexChange??!0?s(i):o=t.getLocation()},r=async({task:i,navigateOpts:c,...a})=>{if(c?.ignoreBlocker??!1){i();return}const u=t.getBlockers?.()??[],h=a.type==="PUSH"||a.type==="REPLACE";if(typeof document<"u"&&u.length&&h)for(const f of u){const d=Et(a.path,a.state);if(await f.blockerFn({currentLocation:o,nextLocation:d,action:a.type})){t.onBlocked?.();return}}i()};return{get location(){return o},get length(){return t.getLength()},subscribers:e,subscribe:i=>(e.add(i),()=>{e.delete(i)}),push:(i,c,a)=>{const l=o.state[G];c=Re(l+1,c),r({task:()=>{t.pushState(i,c),s({type:"PUSH"})},navigateOpts:a,type:"PUSH",path:i,state:c})},replace:(i,c,a)=>{const l=o.state[G];c=Re(l,c),r({task:()=>{t.replaceState(i,c),s({type:"REPLACE"})},navigateOpts:a,type:"REPLACE",path:i,state:c})},go:(i,c)=>{r({task:()=>{t.go(i),n({type:"GO",index:i})},navigateOpts:c,type:"GO"})},back:i=>{r({task:()=>{t.back(i?.ignoreBlocker??!1),n({type:"BACK"})},navigateOpts:i,type:"BACK"})},forward:i=>{r({task:()=>{t.forward(i?.ignoreBlocker??!1),n({type:"FORWARD"})},navigateOpts:i,type:"FORWARD"})},canGoBack:()=>o.state[G]!==0,createHref:i=>t.createHref(i),block:i=>{if(!t.setBlockers)return()=>{};const c=t.getBlockers?.()??[];return t.setBlockers([...c,i]),()=>{const a=t.getBlockers?.()??[];t.setBlockers?.(a.filter(l=>l!==i))}},flush:()=>t.flush?.(),destroy:()=>t.destroy?.(),notify:s}}function Re(t,o){o||(o={});const e=se();return{...o,key:e,__TSR_key:e,[G]:t}}function wo(t){const o=typeof document<"u"?window:void 0,e=o.history.pushState,s=o.history.replaceState;let n=[];const r=()=>n,i=v=>n=v,c=(v=>v),a=(()=>Et(`${o.location.pathname}${o.location.search}${o.location.hash}`,o.history.state));if(!o.history.state?.__TSR_key&&!o.history.state?.key){const v=se();o.history.replaceState({[G]:0,key:v,__TSR_key:v},"")}let l=a(),u,h=!1,f=!1,d=!1,p=!1;const m=()=>l;let y,_;const x=()=>{y&&(S._ignoreSubscribers=!0,(y.isPush?o.history.pushState:o.history.replaceState)(y.state,"",y.href),S._ignoreSubscribers=!1,y=void 0,_=void 0,u=void 0)},P=(v,C,M)=>{const T=c(C);_||(u=l),l=Et(C,M),y={href:T,state:M,isPush:y?.isPush||v==="push"},_||(_=Promise.resolve().then(()=>x()))},L=v=>{l=a(),S.notify({type:v})},E=async()=>{if(f){f=!1;return}const v=a(),C=v.state[G]-l.state[G],M=C===1,T=C===-1,I=!M&&!T||h;h=!1;const Y=I?"GO":T?"BACK":"FORWARD",D=I?{type:"GO",index:C}:{type:T?"BACK":"FORWARD"};if(d)d=!1;else{const X=r();if(typeof document<"u"&&X.length){for(const fe of X)if(await fe.blockerFn({currentLocation:l,nextLocation:v,action:Y})){f=!0,o.history.go(1),S.notify(D);return}}}l=a(),S.notify(D)},w=v=>{if(p){p=!1;return}let C=!1;const M=r();if(typeof document<"u"&&M.length)for(const T of M){const I=T.enableBeforeUnload??!0;if(I===!0){C=!0;break}if(typeof I=="function"&&I()===!0){C=!0;break}}if(C)return v.preventDefault(),v.returnValue=""},S=Po({getLocation:m,getLength:()=>o.history.length,pushState:(v,C)=>P("push",v,C),replaceState:(v,C)=>P("replace",v,C),back:v=>(v&&(d=!0),p=!0,o.history.back()),forward:v=>{v&&(d=!0),p=!0,o.history.forward()},go:v=>{h=!0,o.history.go(v)},createHref:v=>c(v),flush:x,destroy:()=>{o.history.pushState=e,o.history.replaceState=s,o.removeEventListener(_e,w,{capture:!0}),o.removeEventListener(Se,E)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:r,setBlockers:i,notifyOnIndexChange:!1});return o.addEventListener(_e,w,{capture:!0}),o.addEventListener(Se,E),o.history.pushState=function(...v){const C=e.apply(o.history,v);return S._ignoreSubscribers||L("PUSH"),C},o.history.replaceState=function(...v){const C=s.apply(o.history,v);return S._ignoreSubscribers||L("REPLACE"),C},S}function Et(t,o){const e=t.indexOf("#"),s=t.indexOf("?"),n=se();return{href:t,pathname:t.substring(0,e>0?s>0?Math.min(e,s):e:s>0?s:t.length),hash:e>-1?t.substring(e):"",search:s>-1?t.slice(s,e===-1?void 0:e):"",state:o||{[G]:0,key:n,__TSR_key:n}}}function se(){return(Math.random()+1).toString(36).substring(7)}function Xt(t){return t[t.length-1]}function xo(t){return typeof t=="function"}function Q(t,o){return xo(t)?t(o):t}const Lo=Object.prototype.hasOwnProperty;function B(t,o){if(t===o)return t;const e=o,s=xe(t)&&xe(e);if(!s&&!(Tt(t)&&Tt(e)))return e;const n=s?t:Pe(t);if(!n)return e;const r=s?e:Pe(e);if(!r)return e;const i=n.length,c=r.length,a=s?new Array(c):{};let l=0;for(let u=0;u"u")return!0;const e=o.prototype;return!(!we(e)||!e.hasOwnProperty("isPrototypeOf"))}function we(t){return Object.prototype.toString.call(t)==="[object Object]"}function xe(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function tt(t,o,e){if(t===o)return!0;if(typeof t!=typeof o)return!1;if(Array.isArray(t)&&Array.isArray(o)){if(t.length!==o.length)return!1;for(let s=0,n=t.length;sn||!tt(t[i],o[i],e)))return!1;return n===r}return!1}function it(t){let o,e;const s=new Promise((n,r)=>{o=n,e=r});return s.status="pending",s.resolve=n=>{s.status="resolved",s.value=n,o(n),t?.(n)},s.reject=n=>{s.status="rejected",e(n)},s}function q(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}const Co=Array.from(new Map([["%","%25"],["\\","%5C"]]).values());function Le(t,o=Co){function e(n,r,i=0){for(let c=i;c{try{return decodeURI(c)}catch{return c}})}}if(t===""||!/%[0-9A-Fa-f]{2}/g.test(t))return t;const s=t.replaceAll(/%[0-9a-f]{2}/g,n=>n.toUpperCase());return e(s,o)}var Mo="Invariant failed";function K(t,o){if(!t)throw new Error(Mo)}const U=0,ot=1,at=2,ct=3;function z(t){return ne(t.filter(o=>o!==void 0).join("/"))}function ne(t){return t.replace(/\/{2,}/g,"/")}function re(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}function J(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}function Ct(t){return J(re(t))}function It(t,o){return t?.endsWith("/")&&t!=="/"&&t!==`${o}/`?t.slice(0,-1):t}function bo(t,o,e){return It(t,e)===It(o,e)}function Eo(t){const{type:o,value:e}=t;if(o===U)return e;const{prefixSegment:s,suffixSegment:n}=t;if(o===ot){const r=e.substring(1);if(s&&n)return`${s}{$${r}}${n}`;if(s)return`${s}{$${r}}`;if(n)return`{$${r}}${n}`}if(o===ct){const r=e.substring(1);return s&&n?`${s}{-$${r}}${n}`:s?`${s}{-$${r}}`:n?`{-$${r}}${n}`:`{-$${r}}`}if(o===at){if(s&&n)return`${s}{$}${n}`;if(s)return`${s}{$}`;if(n)return`{$}${n}`}return e}function To({base:t,to:o,trailingSlash:e="never",parseCache:s}){let n=ut(t,s).slice();const r=ut(o,s);n.length>1&&Xt(n)?.value==="/"&&n.pop();for(let a=0,l=r.length;a1&&(Xt(n).value==="/"?e==="never"&&n.pop():e==="always"&&n.push({type:U,value:"/"}));const i=n.map(Eo);return z(i)}const ut=(t,o)=>{if(!t)return[];const e=o?.get(t);if(e)return e;const s=Bo(t);return o?.set(t,s),s},Io=/^\$.{1,}$/,ko=/^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,Oo=/^(.*?)\{-(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,Fo=/^\$$/,Ao=/^(.*?)\{\$\}(.*)$/;function Bo(t){t=ne(t);const o=[];if(t.slice(0,1)==="/"&&(t=t.substring(1),o.push({type:U,value:"/"})),!t)return o;const e=t.split("/").filter(Boolean);return o.push(...e.map(s=>{const n=s.match(Ao);if(n){const c=n[1],a=n[2];return{type:at,value:"$",prefixSegment:c||void 0,suffixSegment:a||void 0}}const r=s.match(Oo);if(r){const c=r[1],a=r[2],l=r[3];return{type:ct,value:a,prefixSegment:c||void 0,suffixSegment:l||void 0}}const i=s.match(ko);if(i){const c=i[1],a=i[2],l=i[3];return{type:ot,value:""+a,prefixSegment:c||void 0,suffixSegment:l||void 0}}if(Io.test(s)){const c=s.substring(1);return{type:ot,value:"$"+c,prefixSegment:void 0,suffixSegment:void 0}}return Fo.test(s)?{type:at,value:"$",prefixSegment:void 0,suffixSegment:void 0}:{type:U,value:s}})),t.slice(-1)==="/"&&(t=t.substring(1),o.push({type:U,value:"/"})),o}function Ut({path:t,params:o,decodeCharMap:e,parseCache:s}){const n=ut(t,s);function r(l){const u=o[l],h=typeof u=="string";return l==="*"||l==="_splat"?h?encodeURI(u):u:h?Do(u,e):u}let i=!1;const c={},a=z(n.map(l=>{if(l.type===U)return l.value;if(l.type===at){c._splat=o._splat,c["*"]=o._splat;const u=l.prefixSegment||"",h=l.suffixSegment||"";if(!o._splat)return i=!0,u||h?`${u}${h}`:void 0;const f=r("_splat");return`${u}${f}${h}`}if(l.type===ot){const u=l.value.substring(1);!i&&!(u in o)&&(i=!0),c[u]=o[u];const h=l.prefixSegment||"",f=l.suffixSegment||"";return`${h}${r(u)??"undefined"}${f}`}if(l.type===ct){const u=l.value.substring(1),h=l.prefixSegment||"",f=l.suffixSegment||"";return!(u in o)||o[u]==null?h||f?`${h}${f}`:void 0:(c[u]=o[u],`${h}${r(u)??""}${f}`)}return l.value}));return{usedParams:c,interpolatedPath:a,isMissingParams:i}}function Do(t,o){let e=encodeURIComponent(t);if(o)for(const[s,n]of o)e=e.replaceAll(s,n);return e}function Zt(t,o,e){const s=$o(t,o,e);if(!(o.to&&!s))return s??{}}function $o(t,{to:o,fuzzy:e,caseSensitive:s},n){const r=o,i=ut(t.startsWith("/")?t:`/${t}`,n),c=ut(r.startsWith("/")?r:`/${r}`,n),a={};return jo(i,c,a,e,s)?a:void 0}function jo(t,o,e,s,n){let r=0,i=0;for(;rm.value)));h&&p.startsWith(h)&&(p=p.slice(h.length)),f&&p.endsWith(f)&&(p=p.slice(0,p.length-f.length)),u=p}else u=decodeURI(z(l.map(h=>h.value)));return e["*"]=u,e._splat=u,!0}if(a.type===U){if(a.value==="/"&&!c?.value){i++;continue}if(c){if(n){if(a.value!==c.value)return!1}else if(a.value.toLowerCase()!==c.value.toLowerCase())return!1;r++,i++;continue}else return!1}if(a.type===ot){if(!c||c.value==="/")return!1;let l="",u=!1;if(a.prefixSegment||a.suffixSegment){const h=a.prefixSegment||"",f=a.suffixSegment||"",d=c.value;if(h&&!d.startsWith(h)||f&&!d.endsWith(f))return!1;let p=d;h&&p.startsWith(h)&&(p=p.slice(h.length)),f&&p.endsWith(f)&&(p=p.slice(0,p.length-f.length)),l=decodeURIComponent(p),u=!0}else l=decodeURIComponent(c.value),u=!0;u&&(e[a.value.substring(1)]=l,r++),i++;continue}if(a.type===ct){if(!c){i++;continue}if(c.value==="/"){i++;continue}let l="",u=!1;if(a.prefixSegment||a.suffixSegment){const h=a.prefixSegment||"",f=a.suffixSegment||"",d=c.value;if((!h||d.startsWith(h))&&(!f||d.endsWith(f))){let p=d;h&&p.startsWith(h)&&(p=p.slice(h.length)),f&&p.endsWith(f)&&(p=p.slice(0,p.length-f.length)),l=decodeURIComponent(p),u=!0}}else{let h=!0;for(let f=i+1;f=o.length)return e["**"]=z(t.slice(r).map(l=>l.value)),!!s&&o[o.length-1]?.value!=="/";if(i=t.length){for(let l=i;l{if(s.isRoot||!s.path)return;const r=re(s.fullPath);let i=ut(r),c=0;for(;i.length>c+1&&i[c]?.value==="/";)c++;c>0&&(i=i.slice(c));let a=0,l=!1;const u=i.map((h,f)=>{if(h.value==="/")return No;if(h.type===U)return Uo;let d;h.type===ot?d=Vo:h.type===ct?(d=Wo,a++):d=zo;for(let p=f+1;p{const r=Math.min(s.scores.length,n.scores.length);for(let i=0;in.parsed[i].value?1:-1;return s.index-n.index}).map((s,n)=>(s.child.rank=n,s.child))}function Yo({routeTree:t,initRoute:o}){const e={},s={},n=i=>{i.forEach((c,a)=>{o?.(c,a);const l=e[c.id];if(K(!l,`Duplicate routes found with id: ${String(c.id)}`),e[c.id]=c,!c.isRoot&&c.path){const h=J(c.fullPath);(!s[h]||c.fullPath.endsWith("/"))&&(s[h]=c)}const u=c.children;u?.length&&n(u)})};n([t]);const r=Jo(Object.values(e));return{routesById:e,routesByPath:s,flatRoutes:r}}function j(t){return!!t?.isNotFound}function Xo(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const kt="tsr-scroll-restoration-v1_3",Zo=(t,o)=>{let e;return(...s)=>{e||(e=setTimeout(()=>{t(...s),e=null},o))}};function Qo(){const t=Xo();if(!t)return null;const o=t.getItem(kt);let e=o?JSON.parse(o):{};return{state:e,set:s=>(e=Q(s,e)||e,t.setItem(kt,JSON.stringify(e)))}}const wt=Qo(),Qt=t=>t.state.__TSR_key||t.href;function ts(t){const o=[];let e;for(;e=t.parentNode;)o.push(`${t.tagName}:nth-child(${Array.prototype.indexOf.call(e.children,t)+1})`),t=e;return`${o.reverse().join(" > ")}`.toLowerCase()}let Ot=!1;function We({storageKey:t,key:o,behavior:e,shouldScrollRestoration:s,scrollToTopSelectors:n,location:r}){let i;try{i=JSON.parse(sessionStorage.getItem(t)||"{}")}catch(l){console.error(l);return}const c=o||window.history.state?.__TSR_key,a=i[c];Ot=!0;t:{if(s&&a&&Object.keys(a).length>0){for(const h in a){const f=a[h];if(h==="window")window.scrollTo({top:f.scrollY,left:f.scrollX,behavior:e});else if(h){const d=document.querySelector(h);d&&(d.scrollLeft=f.scrollX,d.scrollTop=f.scrollY)}}break t}const l=(r??window.location).hash.split("#",2)[1];if(l){const h=window.history.state?.__hashScrollIntoViewOptions??!0;if(h){const f=document.getElementById(l);f&&f.scrollIntoView(h)}break t}const u={top:0,left:0,behavior:e};if(window.scrollTo(u),n)for(const h of n){if(h==="window")continue;const f=typeof h=="function"?h():document.querySelector(h);f&&f.scrollTo(u)}}Ot=!1}function es(t,o){if(!wt&&!t.isServer||((t.options.scrollRestoration??!1)&&(t.isScrollRestoring=!0),t.isServer||t.isScrollRestorationSetup||!wt))return;t.isScrollRestorationSetup=!0,Ot=!1;const s=t.options.getScrollRestorationKey||Qt;window.history.scrollRestoration="manual";const n=r=>{if(Ot||!t.isScrollRestoring)return;let i="";if(r.target===document||r.target===window)i="window";else{const a=r.target.getAttribute("data-scroll-restoration-id");a?i=`[data-scroll-restoration-id="${a}"]`:i=ts(r.target)}const c=s(t.state.location);wt.set(a=>{const l=a[c]||={},u=l[i]||={};if(i==="window")u.scrollX=window.scrollX||0,u.scrollY=window.scrollY||0;else if(i){const h=document.querySelector(i);h&&(u.scrollX=h.scrollLeft||0,u.scrollY=h.scrollTop||0)}return a})};typeof document<"u"&&document.addEventListener("scroll",Zo(n,100),!0),t.subscribe("onRendered",r=>{const i=s(r.toLocation);if(!t.resetNextScroll){t.resetNextScroll=!0;return}typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation})||(We({storageKey:kt,key:i,behavior:t.options.scrollRestorationBehavior,shouldScrollRestoration:t.isScrollRestoring,scrollToTopSelectors:t.options.scrollToTopSelectors,location:t.history.location}),t.isScrollRestoring&&wt.set(c=>(c[i]||={},c)))})}function os(t){if(typeof document<"u"&&document.querySelector){const o=t.state.location.state.__hashScrollIntoViewOptions??!0;if(o&&t.state.location.hash!==""){const e=document.getElementById(t.state.location.hash);e&&e.scrollIntoView(o)}}}function ss(t,o=String){const e=new URLSearchParams;for(const s in t){const n=t[s];n!==void 0&&e.set(s,o(n))}return e.toString()}function Vt(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}function ns(t){const o=new URLSearchParams(t),e={};for(const[s,n]of o.entries()){const r=e[s];r==null?e[s]=Vt(n):Array.isArray(r)?r.push(Vt(n)):e[s]=[r,Vt(n)]}return e}const rs=as(JSON.parse),is=cs(JSON.stringify,JSON.parse);function as(t){return o=>{o[0]==="?"&&(o=o.substring(1));const e=ns(o);for(const s in e){const n=e[s];if(typeof n=="string")try{e[s]=t(n)}catch{}}return e}}function cs(t,o){const e=typeof o=="function";function s(n){if(typeof n=="object"&&n!==null)try{return t(n)}catch{}else if(e&&typeof n=="string")try{return o(n),t(n)}catch{}return n}return n=>{const r=ss(n,s);return r?`?${r}`:""}}const A="__root__";function us(t){if(t.statusCode=t.statusCode||t.code||307,!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}const o=new Headers(t.headers);t.href&&o.get("Location")===null&&o.set("Location",t.href);const e=new Response(null,{status:t.statusCode,headers:o});if(e.options=t,t.throw)throw e;return e}function N(t){return t instanceof Response&&!!t.options}function ls(t){const o=new Map;let e,s;const n=r=>{r.next&&(r.prev?(r.prev.next=r.next,r.next.prev=r.prev,r.next=void 0,s&&(s.next=r,r.prev=s)):(r.next.prev=void 0,e=r.next,r.next=void 0,s&&(r.prev=s,s.next=r)),s=r)};return{get(r){const i=o.get(r);if(i)return n(i),i.value},set(r,i){if(o.size>=t&&e){const a=e;o.delete(a.key),a.next&&(e=a.next,a.next.prev=void 0),a===s&&(s=void 0)}const c=o.get(r);if(c)c.value=i,n(c);else{const a={key:r,value:i,prev:s};s&&(s.next=a),s=a,e||(e=a),o.set(r,a)}}}}const Mt=t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},At=(t,o)=>!!(t.preload&&!t.router.state.matches.some(e=>e.id===o)),ze=(t,o)=>{const e=t.router.routesById[o.routeId??""]??t.router.routeTree;!e.options.notFoundComponent&&t.router.options?.defaultNotFoundComponent&&(e.options.notFoundComponent=t.router.options.defaultNotFoundComponent),K(e.options.notFoundComponent);const s=t.matches.find(n=>n.routeId===e.id);K(s,"Could not find match for route: "+e.id),t.updateMatch(s.id,n=>({...n,status:"notFound",error:o,isFetching:!1})),o.routerCode==="BEFORE_LOAD"&&e.parentRoute&&(o.routeId=e.parentRoute.id,ze(t,o))},H=(t,o,e)=>{if(!(!N(e)&&!j(e))){if(N(e)&&e.redirectHandled&&!e.options.reloadDocument)throw e;if(o){o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.loaderPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,o._nonReactive.loaderPromise=void 0;const s=N(e)?"redirected":"notFound";o._nonReactive.error=e,t.updateMatch(o.id,n=>({...n,status:s,isFetching:!1,error:e})),j(e)&&!e.routeId&&(e.routeId=o.routeId),o._nonReactive.loadPromise?.resolve()}throw N(e)?(t.rendered=!0,e.options._fromLocation=t.location,e.redirectHandled=!0,e=t.router.resolveRedirect(e),e):(ze(t,e),e)}},Ke=(t,o)=>{const e=t.router.getMatch(o);return!!(!t.router.isServer&&e._nonReactive.dehydrated||t.router.isServer&&e.ssr===!1)},ht=(t,o,e,s)=>{const{id:n,routeId:r}=t.matches[o],i=t.router.looseRoutesById[r];if(e instanceof Promise)throw e;e.routerCode=s,t.firstBadMatchIndex??=o,H(t,t.router.getMatch(n),e);try{i.options.onError?.(e)}catch(c){e=c,H(t,t.router.getMatch(n),e)}t.updateMatch(n,c=>(c._nonReactive.beforeLoadPromise?.resolve(),c._nonReactive.beforeLoadPromise=void 0,c._nonReactive.loadPromise?.resolve(),{...c,error:e,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},hs=(t,o,e,s)=>{const n=t.router.getMatch(o),r=t.matches[e-1]?.id,i=r?t.router.getMatch(r):void 0;if(t.router.isShell()){n.ssr=s.id===A;return}if(i?.ssr===!1){n.ssr=!1;return}const c=d=>d===!0&&i?.ssr==="data-only"?"data-only":d,a=t.router.options.defaultSsr??!0;if(s.options.ssr===void 0){n.ssr=c(a);return}if(typeof s.options.ssr!="function"){n.ssr=c(s.options.ssr);return}const{search:l,params:u}=n,h={search:xt(l,n.searchError),params:xt(u,n.paramsError),location:t.location,matches:t.matches.map(d=>({index:d.index,pathname:d.pathname,fullPath:d.fullPath,staticData:d.staticData,id:d.id,routeId:d.routeId,search:xt(d.search,d.searchError),params:xt(d.params,d.paramsError),ssr:d.ssr}))},f=s.options.ssr(h);if(q(f))return f.then(d=>{n.ssr=c(d??a)});n.ssr=c(f??a)},He=(t,o,e,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;const n=e.options.pendingMs??t.router.options.defaultPendingMs;if(!!(t.onReady&&!t.router.isServer&&!At(t,o)&&(e.options.loader||e.options.beforeLoad||Je(e))&&typeof n=="number"&&n!==1/0&&(e.options.pendingComponent??t.router.options?.defaultPendingComponent))){const i=setTimeout(()=>{Mt(t)},n);s._nonReactive.pendingTimeout=i}},fs=(t,o,e)=>{const s=t.router.getMatch(o);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;He(t,o,e,s);const n=()=>{const r=t.router.getMatch(o);r.preload&&(r.status==="redirected"||r.status==="notFound")&&H(t,r,r.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(n):n()},ds=(t,o,e,s)=>{const n=t.router.getMatch(o),r=n._nonReactive.loadPromise;n._nonReactive.loadPromise=it(()=>{r?.resolve()});const{paramsError:i,searchError:c}=n;i&&ht(t,e,i,"PARSE_PARAMS"),c&&ht(t,e,c,"VALIDATE_SEARCH"),He(t,o,s,n);const a=new AbortController,l=t.matches[e-1]?.id,f={...(l?t.router.getMatch(l):void 0)?.context??t.router.options.context??void 0,...n.__routeContext};let d=!1;const p=()=>{d||(d=!0,t.updateMatch(o,S=>({...S,isFetching:"beforeLoad",fetchCount:S.fetchCount+1,abortController:a,context:f})))},m=()=>{n._nonReactive.beforeLoadPromise?.resolve(),n._nonReactive.beforeLoadPromise=void 0,t.updateMatch(o,S=>({...S,isFetching:!1}))};if(!s.options.beforeLoad){gt(()=>{p(),m()});return}n._nonReactive.beforeLoadPromise=it();const{search:y,params:_,cause:x}=n,P=At(t,o),L={search:y,abortController:a,params:_,preload:P,context:f,location:t.location,navigate:S=>t.router.navigate({...S,_fromLocation:t.location}),buildLocation:t.router.buildLocation,cause:P?"preload":x,matches:t.matches,...t.router.options.additionalContext},E=S=>{if(S===void 0){gt(()=>{p(),m()});return}(N(S)||j(S))&&(p(),ht(t,e,S,"BEFORE_LOAD")),gt(()=>{p(),t.updateMatch(o,v=>({...v,__beforeLoadContext:S,context:{...v.context,...S}})),m()})};let w;try{if(w=s.options.beforeLoad(L),q(w))return p(),w.catch(S=>{ht(t,e,S,"BEFORE_LOAD")}).then(E)}catch(S){p(),ht(t,e,S,"BEFORE_LOAD")}E(w)},ps=(t,o)=>{const{id:e,routeId:s}=t.matches[o],n=t.router.looseRoutesById[s],r=()=>{if(t.router.isServer){const a=hs(t,e,o,n);if(q(a))return a.then(c)}return c()},i=()=>ds(t,e,o,n),c=()=>{if(Ke(t,e))return;const a=fs(t,e,n);return q(a)?a.then(i):i()};return r()},yt=(t,o,e)=>{const s=t.router.getMatch(o);if(!s||!e.options.head&&!e.options.scripts&&!e.options.headers)return;const n={matches:t.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([e.options.head?.(n),e.options.scripts?.(n),e.options.headers?.(n)]).then(([r,i,c])=>{const a=r?.meta,l=r?.links,u=r?.scripts,h=r?.styles;return{meta:a,links:l,headScripts:u,headers:c,scripts:i,styles:h}})},Ge=(t,o,e,s)=>{const n=t.matchPromises[e-1],{params:r,loaderDeps:i,abortController:c,cause:a}=t.router.getMatch(o);let l=t.router.options.context??{};for(let h=0;h<=e;h++){const f=t.matches[h];if(!f)continue;const d=t.router.getMatch(f.id);d&&(l={...l,...d.__routeContext??{},...d.__beforeLoadContext??{}})}const u=At(t,o);return{params:r,deps:i,preload:!!u,parentMatchPromise:n,abortController:c,context:l,location:t.location,navigate:h=>t.router.navigate({...h,_fromLocation:t.location}),cause:u?"preload":a,route:s,...t.router.options.additionalContext}},Ee=async(t,o,e,s)=>{try{const n=t.router.getMatch(o);try{(!t.router.isServer||n.ssr===!0)&&qe(s);const r=s.options.loader?.(Ge(t,o,e,s)),i=s.options.loader&&q(r);if(!!(i||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||n._nonReactive.minPendingPromise)&&t.updateMatch(o,h=>({...h,isFetching:"loader"})),s.options.loader){const h=i?await r:r;H(t,t.router.getMatch(o),h),h!==void 0&&t.updateMatch(o,f=>({...f,loaderData:h}))}s._lazyPromise&&await s._lazyPromise;const a=yt(t,o,s),l=a?await a:void 0,u=n._nonReactive.minPendingPromise;u&&await u,s._componentsPromise&&await s._componentsPromise,t.updateMatch(o,h=>({...h,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),...l}))}catch(r){let i=r;const c=n._nonReactive.minPendingPromise;c&&await c,j(r)&&await s.options.notFoundComponent?.preload?.(),H(t,t.router.getMatch(o),r);try{s.options.onError?.(r)}catch(u){i=u,H(t,t.router.getMatch(o),u)}const a=yt(t,o,s),l=a?await a:void 0;t.updateMatch(o,u=>({...u,error:i,status:"error",isFetching:!1,...l}))}}catch(n){const r=t.router.getMatch(o);if(r){const i=yt(t,o,s);if(i){const c=await i;t.updateMatch(o,a=>({...a,...c}))}r._nonReactive.loaderPromise=void 0}H(t,r,n)}},ms=async(t,o)=>{const{id:e,routeId:s}=t.matches[o];let n=!1,r=!1;const i=t.router.looseRoutesById[s];if(Ke(t,e)){if(t.router.isServer){const l=yt(t,e,i);if(l){const u=await l;t.updateMatch(e,h=>({...h,...u}))}return t.router.getMatch(e)}}else{const l=t.router.getMatch(e);if(l._nonReactive.loaderPromise){if(l.status==="success"&&!t.sync&&!l.preload)return l;await l._nonReactive.loaderPromise;const u=t.router.getMatch(e),h=u._nonReactive.error||u.error;h&&H(t,u,h)}else{const u=Date.now()-l.updatedAt,h=At(t,e),f=h?i.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:i.options.staleTime??t.router.options.defaultStaleTime??0,d=i.options.shouldReload,p=typeof d=="function"?d(Ge(t,e,o,i)):d,m=!!h&&!t.router.state.matches.some(P=>P.id===e),y=t.router.getMatch(e);y._nonReactive.loaderPromise=it(),m!==y.preload&&t.updateMatch(e,P=>({...P,preload:m}));const{status:_,invalid:x}=y;if(n=_==="success"&&(x||(p??u>f)),!(h&&i.options.preload===!1))if(n&&!t.sync)r=!0,(async()=>{try{await Ee(t,e,o,i);const P=t.router.getMatch(e);P._nonReactive.loaderPromise?.resolve(),P._nonReactive.loadPromise?.resolve(),P._nonReactive.loaderPromise=void 0}catch(P){N(P)&&await t.router.navigate(P.options)}})();else if(_!=="success"||n&&t.sync)await Ee(t,e,o,i);else{const P=yt(t,e,i);if(P){const L=await P;t.updateMatch(e,E=>({...E,...L}))}}}}const c=t.router.getMatch(e);r||(c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loadPromise?.resolve()),clearTimeout(c._nonReactive.pendingTimeout),c._nonReactive.pendingTimeout=void 0,r||(c._nonReactive.loaderPromise=void 0),c._nonReactive.dehydrated=void 0;const a=r?c.isFetching:!1;return a!==c.isFetching||c.invalid!==!1?(t.updateMatch(e,l=>({...l,isFetching:a,invalid:!1})),t.router.getMatch(e)):c};async function Te(t){const o=Object.assign(t,{matchPromises:[]});!o.router.isServer&&o.router.state.matches.some(e=>e._forcePending)&&Mt(o);try{for(let n=0;n{const{id:e,...s}=o.options;Object.assign(t.options,s),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0),!t._componentsLoaded&&t._componentsPromise===void 0){const o=()=>{const e=[];for(const s of Ye){const n=t.options[s]?.preload;n&&e.push(n())}if(e.length)return Promise.all(e).then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0});t._componentsLoaded=!0,t._componentsPromise=void 0};t._componentsPromise=t._lazyPromise?t._lazyPromise.then(o):o()}return t._componentsPromise}function xt(t,o){return o?{status:"error",error:o}:{status:"success",value:t}}function Je(t){for(const o of Ye)if(t.options[o]?.preload)return!0;return!1}const Ye=["component","errorComponent","pendingComponent","notFoundComponent"];function gs(t){return{input:({url:o})=>{for(const e of t)o=Xe(e,o);return o},output:({url:o})=>{for(let e=t.length-1;e>=0;e--)o=Ze(t[e],o);return o}}}function ys(t){const o=Ct(t.basepath),e=`/${o}`,s=`${e}/`,n=t.caseSensitive?e:e.toLowerCase(),r=t.caseSensitive?s:s.toLowerCase();return{input:({url:i})=>{const c=t.caseSensitive?i.pathname:i.pathname.toLowerCase();return c===n?i.pathname="/":c.startsWith(r)&&(i.pathname=i.pathname.slice(e.length)),i},output:({url:i})=>(i.pathname=z(["/",o,i.pathname]),i)}}function Xe(t,o){const e=t?.input?.({url:o});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return o}function Ze(t,o){const e=t?.output?.({url:o});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return o}function et(t){const o=t.resolvedLocation,e=t.location,s=o?.pathname!==e.pathname,n=o?.href!==e.href,r=o?.hash!==e.hash;return{fromLocation:o,toLocation:e,pathChanged:s,hrefChanged:n,hashChanged:r}}class vs{constructor(o){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{e.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const s=this.options,n=this.basepath??s?.basepath??"/",r=this.basepath===void 0,i=s?.rewrite;this.options={...s,...e},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(f=>[encodeURIComponent(f),f])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=wo())),this.origin=this.options.origin,this.origin||(!this.isServer&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new Ro(_s(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(f=>!["redirected"].includes(f.status))}}}),es(this));let c=!1;const a=this.options.basepath??"/",l=this.options.rewrite;if(r||n!==a||i!==l){this.basepath=a;const f=[];Ct(a)!==""&&f.push(ys({basepath:a})),l&&f.push(l),this.rewrite=f.length===0?void 0:f.length===1?f[0]:gs(f),this.history&&this.updateLatestLocation(),c=!0}c&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const{routesById:e,routesByPath:s,flatRoutes:n}=Yo({routeTree:this.routeTree,initRoute:(i,c)=>{i.init({originalIndex:c})}});this.routesById=e,this.routesByPath=s,this.flatRoutes=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)},this.subscribe=(e,s)=>{const n={eventType:e,fn:s};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(s=>{s.eventType===e.type&&s.fn(e)})},this.parseLocation=(e,s)=>{const n=({href:a,state:l})=>{const u=new URL(a,this.origin),h=Xe(this.rewrite,u),f=this.options.parseSearch(h.search),d=this.options.stringifySearch(f);h.search=d;const p=h.href.replace(h.origin,""),{pathname:m,hash:y}=h;return{href:p,publicHref:a,url:h.href,pathname:Le(m),searchStr:d,search:B(s?.search,f),hash:y.split("#").reverse()[0]??"",state:B(s?.state,l)}},r=n(e),{__tempLocation:i,__tempKey:c}=r.state;if(i&&(!c||c===this.tempLocationKey)){const a=n(i);return a.state.key=r.state.key,a.state.__TSR_key=r.state.__TSR_key,delete a.state.__tempLocation,{...a,maskedLocation:r}}return r},this.resolvePathWithBase=(e,s)=>To({base:e,to:ne(s),trailingSlash:this.options.trailingSlash,parseCache:this.parsePathnameCache}),this.matchRoutes=(e,s,n)=>typeof e=="string"?this.matchRoutesInternal({pathname:e,search:s},n):this.matchRoutesInternal(e,s),this.parsePathnameCache=ls(1e3),this.getMatchedRoutes=(e,s)=>Rs({pathname:e,routePathname:s,caseSensitive:this.options.caseSensitive,routesByPath:this.routesByPath,routesById:this.routesById,flatRoutes:this.flatRoutes,parseCache:this.parsePathnameCache}),this.cancelMatch=e=>{const s=this.getMatch(e);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const e=this.state.matches.filter(r=>r.status==="pending"),s=this.state.matches.filter(r=>r.isFetching==="loader");new Set([...this.state.pendingMatches??[],...e,...s]).forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=e=>{const s=(r={})=>{const i=r._fromLocation||this.pendingBuiltLocation||this.latestLocation,c=this.matchRoutes(i,{_buildLocation:!0}),a=Xt(c);r.from;const l=r.unsafeRelative==="path"?i.pathname:r.from??a.fullPath,u=this.resolvePathWithBase(l,"."),h=a.search,f={...a.params},d=r.to?this.resolvePathWithBase(u,`${r.to}`):this.resolvePathWithBase(u,"."),p=r.params===!1||r.params===null?{}:(r.params??!0)===!0?f:Object.assign(f,Q(r.params,f)),m=Ut({path:d,params:p,parseCache:this.parsePathnameCache}).interpolatedPath,y=this.matchRoutes(m,void 0,{_buildLocation:!0}).map(M=>this.looseRoutesById[M.routeId]);if(Object.keys(p).length>0)for(const M of y){const T=M.options.params?.stringify??M.options.stringifyParams;T&&Object.assign(p,T(p))}const _=e.leaveParams?d:Le(Ut({path:d,params:p,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath);let x=h;if(e._includeValidateSearch&&this.options.search?.strict){const M={};y.forEach(T=>{if(T.options.validateSearch)try{Object.assign(M,te(T.options.validateSearch,{...M,...x}))}catch{}}),x=M}x=Ps({search:x,dest:r,destRoutes:y,_includeValidateSearch:e._includeValidateSearch}),x=B(h,x);const P=this.options.stringifySearch(x),L=r.hash===!0?i.hash:r.hash?Q(r.hash,i.hash):void 0,E=L?`#${L}`:"";let w=r.state===!0?i.state:r.state?Q(r.state,i.state):{};w=B(i.state,w);const S=`${_}${P}${E}`,v=new URL(S,this.origin),C=Ze(this.rewrite,v);return{publicHref:C.pathname+C.search+C.hash,href:S,url:C.href,pathname:_,search:x,searchStr:P,state:w,hash:L??"",unmaskOnReload:r.unmaskOnReload}},n=(r={},i)=>{const c=s(r);let a=i?s(i):void 0;if(!a){let l={};const u=this.options.routeMasks?.find(h=>{const f=Zt(c.pathname,{to:h.from,caseSensitive:!1,fuzzy:!1},this.parsePathnameCache);return f?(l=f,!0):!1});if(u){const{from:h,...f}=u;i={from:e.from,...f,params:l},a=s(i)}}return a&&(c.maskedLocation=a),c};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=({viewTransition:e,ignoreBlocker:s,...n})=>{const r=()=>{const a=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];a.forEach(u=>{n.state[u]=this.latestLocation.state[u]});const l=tt(n.state,this.latestLocation.state);return a.forEach(u=>{delete n.state[u]}),l},i=J(this.latestLocation.href)===J(n.href),c=this.commitLocationPromise;if(this.commitLocationPromise=it(()=>{c?.resolve()}),i&&r())this.load();else{let{maskedLocation:a,hashScrollIntoView:l,...u}=n;a&&(u={...a,state:{...a.state,__tempKey:void 0,__tempLocation:{...u,search:u.searchStr,state:{...u.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(u.unmaskOnReload??this.options.unmaskOnReload??!1)&&(u.state.__tempKey=this.tempLocationKey)),u.state.__hashScrollIntoViewOptions=l??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?"replace":"push"](u.publicHref,u.state,{ignoreBlocker:s})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:s,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:c,...a}={})=>{if(c){const h=this.history.location.state.__TSR_index,f=Et(c,{__TSR_index:e?h:h+1});a.to=f.pathname,a.search=this.options.parseSearch(f.search),a.hash=f.hash.slice(1)}const l=this.buildLocation({...a,_includeValidateSearch:!0});this.pendingBuiltLocation=l;const u=this.commitLocation({...l,viewTransition:r,replace:e,resetScroll:s,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===l&&(this.pendingBuiltLocation=void 0)}),u},this.navigate=({to:e,reloadDocument:s,href:n,...r})=>{if(!s&&n)try{new URL(`${n}`),s=!0}catch{}return s?(n||(n=this.buildLocation({to:e,...r}).url),r.replace?window.location.replace(n):window.location.href=n,Promise.resolve()):this.buildAndCommitLocation({...r,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const s=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0}),n=r=>{try{return encodeURI(decodeURI(r))}catch{return r}};if(Ct(n(this.latestLocation.href))!==Ct(n(s.href))){let r=s.url;throw this.origin&&r.startsWith(this.origin)&&(r=r.replace(this.origin,"")||"/"),us({href:r})}}const e=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:e,cachedMatches:s.cachedMatches.filter(n=>!e.some(r=>r.id===n.id))}))},this.load=async e=>{let s,n,r;for(r=new Promise(c=>{this.startTransition(async()=>{try{this.beforeLoad();const a=this.latestLocation,l=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...et({resolvedLocation:l,location:a})}),this.emit({type:"onBeforeLoad",...et({resolvedLocation:l,location:a})}),await Te({router:this,sync:e?.sync,matches:this.state.pendingMatches,location:a,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let u=[],h=[],f=[];gt(()=>{this.__store.setState(d=>{const p=d.matches,m=d.pendingMatches||d.matches;return u=p.filter(y=>!m.some(_=>_.id===y.id)),h=m.filter(y=>!p.some(_=>_.id===y.id)),f=m.filter(y=>p.some(_=>_.id===y.id)),{...d,isLoading:!1,loadedAt:Date.now(),matches:m,pendingMatches:void 0,cachedMatches:[...d.cachedMatches,...u.filter(y=>y.status!=="error")]}}),this.clearExpiredCache()}),[[u,"onLeave"],[h,"onEnter"],[f,"onStay"]].forEach(([d,p])=>{d.forEach(m=>{this.looseRoutesById[m.routeId].options[p]?.(m)})})})})}})}catch(a){N(a)?(s=a,this.isServer||this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):j(a)&&(n=a),this.__store.setState(l=>({...l,statusCode:s?s.status:n?404:l.matches.some(u=>u.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),c()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let i;this.hasNotFoundMatch()?i=404:this.__store.state.matches.some(c=>c.status==="error")&&(i=500),i!==void 0&&this.__store.setState(c=>({...c,statusCode:i}))},this.startViewTransition=e=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let n;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const r=this.latestLocation,i=this.state.resolvedLocation,c=typeof s.types=="function"?s.types(et({resolvedLocation:i,location:r})):s.types;if(c===!1){e();return}n={update:e,types:c}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,s)=>{this.startTransition(()=>{const n=this.state.pendingMatches?.some(r=>r.id===e)?"pendingMatches":this.state.matches.some(r=>r.id===e)?"matches":this.state.cachedMatches.some(r=>r.id===e)?"cachedMatches":"";n&&this.__store.setState(r=>({...r,[n]:r[n]?.map(i=>i.id===e?s(i):i)}))})},this.getMatch=e=>{const s=n=>n.id===e;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=e=>{const s=n=>e?.filter?.(n)??!0?{...n,invalid:!0,...e?.forcePending||n.status==="error"?{status:"pending",error:void 0}:void 0}:n;return this.__store.setState(n=>({...n,matches:n.matches.map(s),cachedMatches:n.cachedMatches.map(s),pendingMatches:n.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{if(!e.options.href){const s=this.buildLocation(e.options);let n=s.url;this.origin&&n.startsWith(this.origin)&&(n=n.replace(this.origin,"")||"/"),e.options.href=s.href,e.headers.set("Location",n)}return e.headers.get("Location")||e.headers.set("Location",e.options.href),e},this.clearCache=e=>{const s=e?.filter;s!==void 0?this.__store.setState(n=>({...n,cachedMatches:n.cachedMatches.filter(r=>!s(r))})):this.__store.setState(n=>({...n,cachedMatches:[]}))},this.clearExpiredCache=()=>{const e=s=>{const n=this.looseRoutesById[s.routeId];if(!n.options.loader)return!0;const r=(s.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=r};this.clearCache({filter:e})},this.loadRouteChunk=qe,this.preloadRoute=async e=>{const s=this.buildLocation(e);let n=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:e});const r=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(c=>c.id)),i=new Set([...r,...this.state.cachedMatches.map(c=>c.id)]);gt(()=>{n.forEach(c=>{i.has(c.id)||this.__store.setState(a=>({...a,cachedMatches:[...a.cachedMatches,c]}))})});try{return n=await Te({router:this,matches:n,location:s,preload:!0,updateMatch:(c,a)=>{r.has(c)?n=n.map(l=>l.id===c?a(l):l):this.updateMatch(c,a)}}),n}catch(c){if(N(c))return c.options.reloadDocument?void 0:await this.preloadRoute({...c.options,_fromLocation:s});j(c)||console.error(c);return}},this.matchRoute=(e,s)=>{const n={...e,to:e.to?this.resolvePathWithBase(e.from||"",e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(s?.pending&&this.state.status!=="pending")return!1;const c=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,a=Zt(c.pathname,{...s,to:r.pathname},this.parsePathnameCache);return!a||e.params&&!tt(a,e.params,{partial:!0})?!1:a&&(s?.includeSearch??!0)?tt(c.search,r.search,{partial:!0})?a:!1:a},this.hasNotFoundMatch=()=>this.__store.state.matches.some(e=>e.status==="notFound"||e.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...o,caseSensitive:o.caseSensitive??!1,notFoundMode:o.notFoundMode??"fuzzy",stringifySearch:o.stringifySearch??is,parseSearch:o.parseSearch??rs}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(o,e){const{foundRoute:s,matchedRoutes:n,routeParams:r}=this.getMatchedRoutes(o.pathname,e?.dest?.to);let i=!1;(s?s.path!=="/"&&r["**"]:J(o.pathname))&&(this.options.notFoundRoute?n.push(this.options.notFoundRoute):i=!0);const c=(()=>{if(i){if(this.options.notFoundMode!=="root")for(let u=n.length-1;u>=0;u--){const h=n[u];if(h.children)return h.id}return A}})(),a=[],l=u=>u?.id?u.context??this.options.context??void 0:this.options.context??void 0;return n.forEach((u,h)=>{const f=a[h-1],[d,p,m]=(()=>{const I=f?.search??o.search,Y=f?._strictSearch??void 0;try{const D=te(u.options.validateSearch,{...I})??void 0;return[{...I,...D},{...Y,...D},void 0]}catch(D){let X=D;if(D instanceof Ft||(X=new Ft(D.message,{cause:D})),e?.throwOnError)throw X;return[I,{},X]}})(),y=u.options.loaderDeps?.({search:d})??"",_=y?JSON.stringify(y):"",{interpolatedPath:x,usedParams:P}=Ut({path:u.fullPath,params:r,decodeCharMap:this.pathParamsDecodeCharMap}),L=u.id+x+_,E=this.getMatch(L),w=this.state.matches.find(I=>I.routeId===u.id),S=E?._strictParams??P;let v;if(!E){const I=u.options.params?.parse??u.options.parseParams;if(I)try{Object.assign(S,I(S))}catch(Y){if(v=new Ss(Y.message,{cause:Y}),e?.throwOnError)throw v}}Object.assign(r,S);const C=w?"stay":"enter";let M;if(E)M={...E,cause:C,params:w?B(w.params,r):r,_strictParams:S,search:B(w?w.search:E.search,d),_strictSearch:p};else{const I=u.options.loader||u.options.beforeLoad||u.lazyFn||Je(u)?"pending":"success";M={id:L,index:h,routeId:u.id,params:w?B(w.params,r):r,_strictParams:S,pathname:x,updatedAt:Date.now(),search:w?B(w.search,d):d,_strictSearch:p,searchError:void 0,status:I,isFetching:!1,error:void 0,paramsError:v,__routeContext:void 0,_nonReactive:{loadPromise:it()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:C,loaderDeps:w?B(w.loaderDeps,y):y,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:u.options.staticData||{},fullPath:u.fullPath}}e?.preload||(M.globalNotFound=c===u.id),M.searchError=m;const T=l(f);M.context={...T,...M.__routeContext,...M.__beforeLoadContext},a.push(M)}),a.forEach((u,h)=>{const f=this.looseRoutesById[u.routeId];if(!this.getMatch(u.id)&&e?._buildLocation!==!0){const p=a[h-1],m=l(p);if(f.options.context){const y={deps:u.loaderDeps,params:u.params,context:m??{},location:o,navigate:_=>this.navigate({..._,_fromLocation:o}),buildLocation:this.buildLocation,cause:u.cause,abortController:u.abortController,preload:!!u.preload,matches:a};u.__routeContext=f.options.context(y)??void 0}u.context={...m,...u.__routeContext,...u.__beforeLoadContext}}}),a}}class Ft extends Error{}class Ss extends Error{}function _s(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function te(t,o){if(t==null)return{};if("~standard"in t){const e=t["~standard"].validate(o);if(e instanceof Promise)throw new Ft("Async validation not supported");if(e.issues)throw new Ft(JSON.stringify(e.issues,void 0,2),{cause:e});return e.value}return"parse"in t?t.parse(o):typeof t=="function"?t(o):{}}function Rs({pathname:t,routePathname:o,caseSensitive:e,routesByPath:s,routesById:n,flatRoutes:r,parseCache:i}){let c={};const a=J(t),l=d=>Zt(a,{to:d.fullPath,caseSensitive:d.options?.caseSensitive??e,fuzzy:!0},i);let u=o!==void 0?s[o]:void 0;if(u)c=l(u);else{let d;for(const p of r){const m=l(p);if(m)if(p.path!=="/"&&m["**"])d||(d={foundRoute:p,routeParams:m});else{u=p,c=m;break}}!u&&d&&(u=d.foundRoute,c=d.routeParams)}let h=u||n[A];const f=[h];for(;h.parentRoute;)h=h.parentRoute,f.push(h);return f.reverse(),{matchedRoutes:f,routeParams:c,foundRoute:u}}function Ps({search:t,dest:o,destRoutes:e,_includeValidateSearch:s}){const n=e.reduce((c,a)=>{const l=[];if("search"in a.options)a.options.search?.middlewares&&l.push(...a.options.search.middlewares);else if(a.options.preSearchFilters||a.options.postSearchFilters){const u=({search:h,next:f})=>{let d=h;"preSearchFilters"in a.options&&a.options.preSearchFilters&&(d=a.options.preSearchFilters.reduce((m,y)=>y(m),h));const p=f(d);return"postSearchFilters"in a.options&&a.options.postSearchFilters?a.options.postSearchFilters.reduce((m,y)=>y(m),p):p};l.push(u)}if(s&&a.options.validateSearch){const u=({search:h,next:f})=>{const d=f(h);try{return{...d,...te(a.options.validateSearch,d)??void 0}}catch{return d}};l.push(u)}return c.concat(l)},[])??[],r=({search:c})=>o.search?o.search===!0?c:Q(o.search,c):{};n.push(r);const i=(c,a)=>{if(c>=n.length)return a;const l=n[c];return l({search:a,next:h=>i(c+1,h)})};return i(0,t)}const ws="Error preloading route! ☝️";class Qe{constructor(o){if(this.init=e=>{this.originalIndex=e.originalIndex;const s=this.options,n=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=A:this.parentRoute||K(!1);let r=n?A:s?.path;r&&r!=="/"&&(r=re(r));const i=s?.id||r;let c=n?A:z([this.parentRoute.id===A?"":this.parentRoute.id,i]);r===A&&(r="/"),c!==A&&(c=z(["/",c]));const a=c===A?"/":z([this.parentRoute.fullPath,r]);this._path=r,this._id=c,this._fullPath=a,this._to=a},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e=="object"&&e!==null&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.options=o||{},this.isRoot=!o?.getParentRoute,o?.id&&o?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class xs extends Qe{constructor(o){super(o)}}function ie(t){const o=t.errorComponent??Bt;return g.jsx(Ls,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:e,reset:s})=>e?R.createElement(o,{error:e,reset:s}):t.children})}class Ls extends R.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(o){return{resetKey:o.getResetKey()}}static getDerivedStateFromError(o){return{error:o}}reset(){this.setState({error:null})}componentDidUpdate(o,e){e.error&&e.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(o,e){this.props.onCatch&&this.props.onCatch(o,e)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Bt({error:t}){const[o,e]=R.useState(!1);return g.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[g.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),g.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>e(s=>!s),children:o?"Hide Error":"Show Error"})]}),g.jsx("div",{style:{height:".25rem"}}),o?g.jsx("div",{children:g.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?g.jsx("code",{children:t.message}):null})}):null]})}function Cs({children:t,fallback:o=null}){return Ms()?g.jsx(rt.Fragment,{children:t}):g.jsx(rt.Fragment,{children:o})}function Ms(){return rt.useSyncExternalStore(bs,()=>!0,()=>!1)}function bs(){return()=>{}}var Wt={exports:{}},zt={},Kt={exports:{}},Ht={};var Ie;function Es(){if(Ie)return Ht;Ie=1;var t=ee();function o(h,f){return h===f&&(h!==0||1/h===1/f)||h!==h&&f!==f}var e=typeof Object.is=="function"?Object.is:o,s=t.useState,n=t.useEffect,r=t.useLayoutEffect,i=t.useDebugValue;function c(h,f){var d=f(),p=s({inst:{value:d,getSnapshot:f}}),m=p[0].inst,y=p[1];return r(function(){m.value=d,m.getSnapshot=f,a(m)&&y({inst:m})},[h,d,f]),n(function(){return a(m)&&y({inst:m}),h(function(){a(m)&&y({inst:m})})},[h]),i(d),d}function a(h){var f=h.getSnapshot;h=h.value;try{var d=f();return!e(h,d)}catch{return!0}}function l(h,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:c;return Ht.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,Ht}var ke;function Ts(){return ke||(ke=1,Kt.exports=Es()),Kt.exports}var Oe;function Is(){if(Oe)return zt;Oe=1;var t=ee(),o=Ts();function e(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var s=typeof Object.is=="function"?Object.is:e,n=o.useSyncExternalStore,r=t.useRef,i=t.useEffect,c=t.useMemo,a=t.useDebugValue;return zt.useSyncExternalStoreWithSelector=function(l,u,h,f,d){var p=r(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=c(function(){function _(w){if(!x){if(x=!0,P=w,w=f(w),d!==void 0&&m.hasValue){var S=m.value;if(d(S,w))return L=S}return L=w}if(S=L,s(P,w))return S;var v=f(w);return d!==void 0&&d(S,v)?(P=w,S):(P=w,L=v)}var x=!1,P,L,E=h===void 0?null:h;return[function(){return _(u())},E===null?void 0:function(){return _(E())}]},[u,h,f,d]);var y=n(l,p[0],p[1]);return i(function(){m.hasValue=!0,m.value=y},[y]),a(y),y},zt}var Fe;function ks(){return Fe||(Fe=1,Wt.exports=Is()),Wt.exports}var to=ks();const fn=oe(to);function Os(t,o=s=>s,e={}){const s=e.equal??Fs;return to.useSyncExternalStoreWithSelector(t.subscribe,()=>t.state,()=>t.state,o,s)}function Fs(t,o){if(Object.is(t,o))return!0;if(typeof t!="object"||t===null||typeof o!="object"||o===null)return!1;if(t instanceof Map&&o instanceof Map){if(t.size!==o.size)return!1;for(const[s,n]of t)if(!o.has(s)||!Object.is(n,o.get(s)))return!1;return!0}if(t instanceof Set&&o instanceof Set){if(t.size!==o.size)return!1;for(const s of t)if(!o.has(s))return!1;return!0}if(t instanceof Date&&o instanceof Date)return t.getTime()===o.getTime();const e=Ae(t);if(e.length!==Ae(o).length)return!1;for(let s=0;s"u"?Gt:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Gt,Gt)}function F(t){const o=R.useContext(eo());return t?.warn,o}function O(t){const o=F({warn:t?.router===void 0}),e=t?.router||o,s=R.useRef(void 0);return Os(e.__store,n=>{if(t?.select){if(t.structuralSharing??e.options.defaultStructuralSharing){const r=B(s.current,t.select(n));return s.current=r,r}return t.select(n)}return n})}const Dt=R.createContext(void 0),As=R.createContext(void 0);function V(t){const o=R.useContext(t.from?As:Dt);return O({select:s=>{const n=s.matches.find(r=>t.from?t.from===r.routeId:r.id===o);if(K(!((t.shouldThrow??!0)&&!n),`Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`),n!==void 0)return t.select?t.select(n):n},structuralSharing:t.structuralSharing})}function ae(t){return V({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:o=>t.select?t.select(o.loaderData):o.loaderData})}function ce(t){const{select:o,...e}=t;return V({...e,select:s=>o?o(s.loaderDeps):s.loaderDeps})}function ue(t){return V({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:o=>{const e=t.strict===!1?o.params:o._strictParams;return t.select?t.select(e):e}})}function le(t){return V({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:o=>t.select?t.select(o.search):o.search})}function he(t){const o=F();return R.useCallback(e=>o.navigate({...e,from:e.from??t?.from}),[t?.from,o])}var oo=mo();const dn=oe(oo),Lt=typeof window<"u"?R.useLayoutEffect:R.useEffect;function qt(t){const o=R.useRef({value:t,prev:null}),e=o.current.value;return t!==e&&(o.current={value:t,prev:e}),o.current.prev}function Bs(t,o,e={},s={}){R.useEffect(()=>{if(!t.current||s.disabled||typeof IntersectionObserver!="function")return;const n=new IntersectionObserver(([r])=>{o(r)},e);return n.observe(t.current),()=>{n.disconnect()}},[o,e,s.disabled,t])}function Ds(t){const o=R.useRef(null);return R.useImperativeHandle(t,()=>o.current,[]),o}function $s(t,o){const e=F(),[s,n]=R.useState(!1),r=R.useRef(!1),i=Ds(o),{activeProps:c,inactiveProps:a,activeOptions:l,to:u,preload:h,preloadDelay:f,hashScrollIntoView:d,replace:p,startTransition:m,resetScroll:y,viewTransition:_,children:x,target:P,disabled:L,style:E,className:w,onClick:S,onFocus:v,onMouseEnter:C,onMouseLeave:M,onTouchStart:T,ignoreBlocker:I,params:Y,search:D,hash:X,state:fe,mask:io,reloadDocument:rn,unsafeRelative:an,from:cn,_fromLocation:un,...de}=t,ao=O({select:b=>b.location.search,structuralSharing:!0}),pe=t.from,lt=R.useMemo(()=>({...t,from:pe}),[e,ao,pe,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),W=R.useMemo(()=>e.buildLocation({...lt}),[e,lt]),vt=R.useMemo(()=>{if(L)return;let b=W.maskedLocation?W.maskedLocation.url:W.url,k=!1;return e.origin&&(b.startsWith(e.origin)?b=e.history.createHref(b.replace(e.origin,""))||"/":k=!0),{href:b,external:k}},[L,W.maskedLocation,W.url,e.origin,e.history]),St=R.useMemo(()=>{if(vt?.external)return vt.href;try{return new URL(u),u}catch{}},[u,vt]),st=t.reloadDocument||St?!1:h??e.options.defaultPreload,$t=f??e.options.defaultPreloadDelay??0,jt=O({select:b=>{if(St)return!1;if(l?.exact){if(!bo(b.location.pathname,W.pathname,e.basepath))return!1}else{const k=It(b.location.pathname,e.basepath),$=It(W.pathname,e.basepath);if(!(k.startsWith($)&&(k.length===$.length||k[$.length]==="/")))return!1}return(l?.includeSearch??!0)&&!tt(b.location.search,W.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?b.location.hash===W.hash:!0}}),Z=R.useCallback(()=>{e.preloadRoute({...lt}).catch(b=>{console.warn(b),console.warn(ws)})},[e,lt]),co=R.useCallback(b=>{b?.isIntersecting&&Z()},[Z]);Bs(i,co,Ws,{disabled:!!L||st!=="viewport"}),R.useEffect(()=>{r.current||!L&&st==="render"&&(Z(),r.current=!0)},[L,Z,st]);const uo=b=>{const k=b.currentTarget.getAttribute("target"),$=P!==void 0?P:k;if(!L&&!zs(b)&&!b.defaultPrevented&&(!$||$==="_self")&&b.button===0){b.preventDefault(),oo.flushSync(()=>{n(!0)});const ve=e.subscribe("onResolved",()=>{ve(),n(!1)});e.navigate({...lt,replace:p,resetScroll:y,hashScrollIntoView:d,startTransition:m,viewTransition:_,ignoreBlocker:I})}};if(St)return{...de,ref:i,href:St,...x&&{children:x},...P&&{target:P},...L&&{disabled:L},...E&&{style:E},...w&&{className:w},...S&&{onClick:S},...v&&{onFocus:v},...C&&{onMouseEnter:C},...M&&{onMouseLeave:M},...T&&{onTouchStart:T}};const me=b=>{L||st&&Z()},lo=me,ho=b=>{if(!(L||!st))if(!$t)Z();else{const k=b.target;if(ft.has(k))return;const $=setTimeout(()=>{ft.delete(k),Z()},$t);ft.set(k,$)}},fo=b=>{if(L||!st||!$t)return;const k=b.target,$=ft.get(k);$&&(clearTimeout($),ft.delete(k))},_t=jt?Q(c,{})??js:Jt,Rt=jt?Jt:Q(a,{})??Jt,ge=[w,_t.className,Rt.className].filter(Boolean).join(" "),ye=(E||_t.style||Rt.style)&&{...E,..._t.style,...Rt.style};return{...de,..._t,...Rt,href:vt?.href,ref:i,onClick:dt([S,uo]),onFocus:dt([v,me]),onMouseEnter:dt([C,ho]),onMouseLeave:dt([M,fo]),onTouchStart:dt([T,lo]),disabled:!!L,target:P,...ye&&{style:ye},...ge&&{className:ge},...L&&Ns,...jt&&Us,...s&&Vs}}const Jt={},js={className:"active"},Ns={role:"link","aria-disabled":!0},Us={"data-status":"active","aria-current":"page"},Vs={"data-transitioning":"transitioning"},ft=new WeakMap,Ws={rootMargin:"100px"},dt=t=>o=>{for(const e of t)if(e){if(o.defaultPrevented)return;e(o)}},so=R.forwardRef((t,o)=>{const{_asChild:e,...s}=t,{type:n,ref:r,...i}=$s(s,o),c=typeof s.children=="function"?s.children({isActive:i["data-status"]==="active"}):s.children;return e===void 0&&delete i.disabled,R.createElement(e||"a",{...i,ref:r},c)});function zs(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}class Ks extends Qe{constructor(o){super(o),this.useMatch=e=>V({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>V({...e,from:this.id,select:s=>e?.select?e.select(s.context):s.context}),this.useSearch=e=>le({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ue({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>ce({...e,from:this.id}),this.useLoaderData=e=>ae({...e,from:this.id}),this.useNavigate=()=>he({from:this.fullPath}),this.Link=rt.forwardRef((e,s)=>g.jsx(so,{ref:s,from:this.fullPath,...e})),this.$$typeof=Symbol.for("react.memo")}}function Hs(t){return new Ks(t)}class Gs extends xs{constructor(o){super(o),this.useMatch=e=>V({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>V({...e,from:this.id,select:s=>e?.select?e.select(s.context):s.context}),this.useSearch=e=>le({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ue({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>ce({...e,from:this.id}),this.useLoaderData=e=>ae({...e,from:this.id}),this.useNavigate=()=>he({from:this.fullPath}),this.Link=rt.forwardRef((e,s)=>g.jsx(so,{ref:s,from:this.fullPath,...e})),this.$$typeof=Symbol.for("react.memo")}}function pn(t){return new Gs(t)}function Be(t){return typeof t=="object"?new De(t,{silent:!0}).createRoute(t):new De(t,{silent:!0}).createRoute}class De{constructor(o,e){this.path=o,this.createRoute=s=>{this.silent;const n=Hs(s);return n.isRoot=!1,n},this.silent=e?.silent}}class $e{constructor(o){this.useMatch=e=>V({select:e?.select,from:this.options.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>V({from:this.options.id,select:s=>e?.select?e.select(s.context):s.context}),this.useSearch=e=>le({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useParams=e=>ue({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useLoaderDeps=e=>ce({...e,from:this.options.id}),this.useLoaderData=e=>ae({...e,from:this.options.id}),this.useNavigate=()=>{const e=F();return he({from:e.routesById[this.options.id].fullPath})},this.options=o,this.$$typeof=Symbol.for("react.memo")}}function je(t){return typeof t=="object"?new $e(t):o=>new $e({id:t,...o})}function qs(){const t=F(),o=R.useRef({router:t,mounted:!1}),[e,s]=R.useState(!1),{hasPendingMatches:n,isLoading:r}=O({select:h=>({isLoading:h.isLoading,hasPendingMatches:h.matches.some(f=>f.status==="pending")}),structuralSharing:!0}),i=qt(r),c=r||e||n,a=qt(c),l=r||n,u=qt(l);return t.startTransition=h=>{s(!0),R.startTransition(()=>{h(),s(!1)})},R.useEffect(()=>{const h=t.history.subscribe(t.load),f=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return J(t.latestLocation.href)!==J(f.href)&&t.commitLocation({...f,replace:!0}),()=>{h()}},[t,t.history]),Lt(()=>{if(typeof window<"u"&&t.ssr||o.current.router===t&&o.current.mounted)return;o.current={router:t,mounted:!0},(async()=>{try{await t.load()}catch(f){console.error(f)}})()},[t]),Lt(()=>{i&&!r&&t.emit({type:"onLoad",...et(t.state)})},[i,t,r]),Lt(()=>{u&&!l&&t.emit({type:"onBeforeRouteMount",...et(t.state)})},[l,u,t]),Lt(()=>{a&&!c&&(t.emit({type:"onResolved",...et(t.state)}),t.__store.setState(h=>({...h,status:"idle",resolvedLocation:h.location})),os(t))},[c,a,t]),null}function Js(t){const o=O({select:e=>`not-found-${e.location.pathname}-${e.status}`});return g.jsx(ie,{getResetKey:()=>o,onCatch:(e,s)=>{if(j(e))t.onCatch?.(e,s);else throw e},errorComponent:({error:e})=>{if(j(e))return t.fallback?.(e);throw e},children:t.children})}function Ys(){return g.jsx("p",{children:"Not Found"})}function nt(t){return g.jsx(g.Fragment,{children:t.children})}function no(t,o,e){return o.options.notFoundComponent?g.jsx(o.options.notFoundComponent,{data:e}):t.options.defaultNotFoundComponent?g.jsx(t.options.defaultNotFoundComponent,{data:e}):g.jsx(Ys,{})}function Xs({children:t}){const o=F();return o.isServer?g.jsx("script",{nonce:o.options.ssr?.nonce,className:"$tsr",dangerouslySetInnerHTML:{__html:[t].filter(Boolean).join(` -`)+";$_TSR.c()"}}):null}function Zs(){const t=F();if(!t.isScrollRestoring||!t.isServer||typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return null;const e=(t.options.getScrollRestorationKey||Qt)(t.latestLocation),s=e!==Qt(t.latestLocation)?e:void 0,n={storageKey:kt,shouldScrollRestoration:!0};return s&&(n.key=s),g.jsx(Xs,{children:`(${We.toString()})(${JSON.stringify(n)})`})}const ro=R.memo(function({matchId:o}){const e=F(),s=O({select:_=>{const x=_.matches.find(P=>P.id===o);return K(x),{routeId:x.routeId,ssr:x.ssr,_displayPending:x._displayPending}},structuralSharing:!0}),n=e.routesById[s.routeId],r=n.options.pendingComponent??e.options.defaultPendingComponent,i=r?g.jsx(r,{}):null,c=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,l=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,u=s.ssr===!1||s.ssr==="data-only",h=(!n.isRoot||n.options.wrapInSuspense||u)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||u))?R.Suspense:nt,f=c?ie:nt,d=l?Js:nt,p=O({select:_=>_.loadedAt}),m=O({select:_=>{const x=_.matches.findIndex(P=>P.id===o);return _.matches[x-1]?.routeId}}),y=n.isRoot?n.options.shellComponent??nt:nt;return g.jsxs(y,{children:[g.jsx(Dt.Provider,{value:o,children:g.jsx(h,{fallback:i,children:g.jsx(f,{getResetKey:()=>p,errorComponent:c||Bt,onCatch:(_,x)=>{if(j(_))throw _;a?.(_,x)},children:g.jsx(d,{fallback:_=>{if(!l||_.routeId&&_.routeId!==s.routeId||!_.routeId&&!n.isRoot)throw _;return R.createElement(l,_)},children:u||s._displayPending?g.jsx(Cs,{fallback:i,children:g.jsx(Ne,{matchId:o})}):g.jsx(Ne,{matchId:o})})})})}),m===A&&e.options.scrollRestoration?g.jsxs(g.Fragment,{children:[g.jsx(Qs,{}),g.jsx(Zs,{})]}):null]})});function Qs(){const t=F(),o=R.useRef(void 0);return g.jsx("script",{suppressHydrationWarning:!0,ref:e=>{e&&(o.current===void 0||o.current.href!==t.latestLocation.href)&&(t.emit({type:"onRendered",...et(t.state)}),o.current=t.latestLocation)}},t.latestLocation.state.__TSR_key)}const Ne=R.memo(function({matchId:o}){const e=F(),{match:s,key:n,routeId:r}=O({select:a=>{const l=a.matches.find(p=>p.id===o),u=l.routeId,f=(e.routesById[u].options.remountDeps??e.options.defaultRemountDeps)?.({routeId:u,loaderDeps:l.loaderDeps,params:l._strictParams,search:l._strictSearch});return{key:f?JSON.stringify(f):void 0,routeId:u,match:{id:l.id,status:l.status,error:l.error,_forcePending:l._forcePending,_displayPending:l._displayPending}}},structuralSharing:!0}),i=e.routesById[r],c=R.useMemo(()=>{const a=i.options.component??e.options.defaultComponent;return a?g.jsx(a,{},n):g.jsx(tn,{})},[n,i.options.component,e.options.defaultComponent]);if(s._displayPending)throw e.getMatch(s.id)?._nonReactive.displayPendingPromise;if(s._forcePending)throw e.getMatch(s.id)?._nonReactive.minPendingPromise;if(s.status==="pending"){const a=i.options.pendingMinMs??e.options.defaultPendingMinMs;if(a){const l=e.getMatch(s.id);if(l&&!l._nonReactive.minPendingPromise&&!e.isServer){const u=it();l._nonReactive.minPendingPromise=u,setTimeout(()=>{u.resolve(),l._nonReactive.minPendingPromise=void 0},a)}}throw e.getMatch(s.id)?._nonReactive.loadPromise}if(s.status==="notFound")return K(j(s.error)),no(e,i,s.error);if(s.status==="redirected")throw K(N(s.error)),e.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error"){if(e.isServer){const a=(i.options.errorComponent??e.options.defaultErrorComponent)||Bt;return g.jsx(a,{error:s.error,reset:void 0,info:{componentStack:""}})}throw s.error}return c}),tn=R.memo(function(){const o=F(),e=R.useContext(Dt),s=O({select:l=>l.matches.find(u=>u.id===e)?.routeId}),n=o.routesById[s],r=O({select:l=>{const h=l.matches.find(f=>f.id===e);return K(h),h.globalNotFound}}),i=O({select:l=>{const u=l.matches,h=u.findIndex(f=>f.id===e);return u[h+1]?.id}}),c=o.options.defaultPendingComponent?g.jsx(o.options.defaultPendingComponent,{}):null;if(r)return no(o,n,void 0);if(!i)return null;const a=g.jsx(ro,{matchId:i});return s===A?g.jsx(R.Suspense,{fallback:c,children:a}):a});function en(){const t=F(),e=t.routesById[A].options.pendingComponent??t.options.defaultPendingComponent,s=e?g.jsx(e,{}):null,n=t.isServer||typeof document<"u"&&t.ssr?nt:R.Suspense,r=g.jsxs(n,{fallback:s,children:[!t.isServer&&g.jsx(qs,{}),g.jsx(on,{})]});return t.options.InnerWrap?g.jsx(t.options.InnerWrap,{children:r}):r}function on(){const t=F(),o=O({select:n=>n.matches[0]?.id}),e=O({select:n=>n.loadedAt}),s=o?g.jsx(ro,{matchId:o}):null;return g.jsx(Dt.Provider,{value:o,children:t.options.disableGlobalCatchBoundary?s:g.jsx(ie,{getResetKey:()=>e,errorComponent:Bt,onCatch:n=>{n.message||n.toString()},children:s})})}function mn(){const t=F();return O({select:o=>[o.location.href,o.resolvedLocation?.href,o.status],structuralSharing:!0}),R.useCallback(o=>{const{pending:e,caseSensitive:s,fuzzy:n,includeSearch:r,...i}=o;return t.matchRoute(i,{pending:e,caseSensitive:s,fuzzy:n,includeSearch:r})},[t])}const gn=t=>new sn(t);class sn extends vs{constructor(o){super(o)}}typeof globalThis<"u"?(globalThis.createFileRoute=Be,globalThis.createLazyFileRoute=je):typeof window<"u"&&(window.createFileRoute=Be,window.createLazyFileRoute=je);function nn({router:t,children:o,...e}){Object.keys(e).length>0&&t.update({...t.options,...e,context:{...t.options.context,...e.context}});const s=eo(),n=g.jsx(s.Provider,{value:t,children:o});return t.options.Wrap?g.jsx(t.options.Wrap,{children:n}):n}function yn({router:t,...o}){return g.jsx(nn,{router:t,...o,children:g.jsx(en,{})})}export{so as L,tn as O,rt as R,hn as a,oo as b,dn as c,fn as d,mn as e,pn as f,Hs as g,gn as h,K as i,g as j,us as k,yn as l,R as r,he as u}; +`)+";$_TSR.c()"}}):null}function Zs(){const t=F();if(!t.isScrollRestoring||!t.isServer||typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return null;const e=(t.options.getScrollRestorationKey||Qt)(t.latestLocation),s=e!==Qt(t.latestLocation)?e:void 0,n={storageKey:kt,shouldScrollRestoration:!0};return s&&(n.key=s),g.jsx(Xs,{children:`(${We.toString()})(${JSON.stringify(n)})`})}const ro=R.memo(function({matchId:o}){const e=F(),s=O({select:_=>{const x=_.matches.find(P=>P.id===o);return K(x),{routeId:x.routeId,ssr:x.ssr,_displayPending:x._displayPending}},structuralSharing:!0}),n=e.routesById[s.routeId],r=n.options.pendingComponent??e.options.defaultPendingComponent,i=r?g.jsx(r,{}):null,c=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,l=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,u=s.ssr===!1||s.ssr==="data-only",h=(!n.isRoot||n.options.wrapInSuspense||u)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||u))?R.Suspense:nt,f=c?ie:nt,d=l?Js:nt,p=O({select:_=>_.loadedAt}),m=O({select:_=>{const x=_.matches.findIndex(P=>P.id===o);return _.matches[x-1]?.routeId}}),y=n.isRoot?n.options.shellComponent??nt:nt;return g.jsxs(y,{children:[g.jsx(Dt.Provider,{value:o,children:g.jsx(h,{fallback:i,children:g.jsx(f,{getResetKey:()=>p,errorComponent:c||Bt,onCatch:(_,x)=>{if(j(_))throw _;a?.(_,x)},children:g.jsx(d,{fallback:_=>{if(!l||_.routeId&&_.routeId!==s.routeId||!_.routeId&&!n.isRoot)throw _;return R.createElement(l,_)},children:u||s._displayPending?g.jsx(Cs,{fallback:i,children:g.jsx(Ne,{matchId:o})}):g.jsx(Ne,{matchId:o})})})})}),m===A&&e.options.scrollRestoration?g.jsxs(g.Fragment,{children:[g.jsx(Qs,{}),g.jsx(Zs,{})]}):null]})});function Qs(){const t=F(),o=R.useRef(void 0);return g.jsx("script",{suppressHydrationWarning:!0,ref:e=>{e&&(o.current===void 0||o.current.href!==t.latestLocation.href)&&(t.emit({type:"onRendered",...et(t.state)}),o.current=t.latestLocation)}},t.latestLocation.state.__TSR_key)}const Ne=R.memo(function({matchId:o}){const e=F(),{match:s,key:n,routeId:r}=O({select:a=>{const l=a.matches.find(p=>p.id===o),u=l.routeId,f=(e.routesById[u].options.remountDeps??e.options.defaultRemountDeps)?.({routeId:u,loaderDeps:l.loaderDeps,params:l._strictParams,search:l._strictSearch});return{key:f?JSON.stringify(f):void 0,routeId:u,match:{id:l.id,status:l.status,error:l.error,_forcePending:l._forcePending,_displayPending:l._displayPending}}},structuralSharing:!0}),i=e.routesById[r],c=R.useMemo(()=>{const a=i.options.component??e.options.defaultComponent;return a?g.jsx(a,{},n):g.jsx(tn,{})},[n,i.options.component,e.options.defaultComponent]);if(s._displayPending)throw e.getMatch(s.id)?._nonReactive.displayPendingPromise;if(s._forcePending)throw e.getMatch(s.id)?._nonReactive.minPendingPromise;if(s.status==="pending"){const a=i.options.pendingMinMs??e.options.defaultPendingMinMs;if(a){const l=e.getMatch(s.id);if(l&&!l._nonReactive.minPendingPromise&&!e.isServer){const u=it();l._nonReactive.minPendingPromise=u,setTimeout(()=>{u.resolve(),l._nonReactive.minPendingPromise=void 0},a)}}throw e.getMatch(s.id)?._nonReactive.loadPromise}if(s.status==="notFound")return K(j(s.error)),no(e,i,s.error);if(s.status==="redirected")throw K(N(s.error)),e.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error"){if(e.isServer){const a=(i.options.errorComponent??e.options.defaultErrorComponent)||Bt;return g.jsx(a,{error:s.error,reset:void 0,info:{componentStack:""}})}throw s.error}return c}),tn=R.memo(function(){const o=F(),e=R.useContext(Dt),s=O({select:l=>l.matches.find(u=>u.id===e)?.routeId}),n=o.routesById[s],r=O({select:l=>{const h=l.matches.find(f=>f.id===e);return K(h),h.globalNotFound}}),i=O({select:l=>{const u=l.matches,h=u.findIndex(f=>f.id===e);return u[h+1]?.id}}),c=o.options.defaultPendingComponent?g.jsx(o.options.defaultPendingComponent,{}):null;if(r)return no(o,n,void 0);if(!i)return null;const a=g.jsx(ro,{matchId:i});return s===A?g.jsx(R.Suspense,{fallback:c,children:a}):a});function en(){const t=F(),e=t.routesById[A].options.pendingComponent??t.options.defaultPendingComponent,s=e?g.jsx(e,{}):null,n=t.isServer||typeof document<"u"&&t.ssr?nt:R.Suspense,r=g.jsxs(n,{fallback:s,children:[!t.isServer&&g.jsx(qs,{}),g.jsx(on,{})]});return t.options.InnerWrap?g.jsx(t.options.InnerWrap,{children:r}):r}function on(){const t=F(),o=O({select:n=>n.matches[0]?.id}),e=O({select:n=>n.loadedAt}),s=o?g.jsx(ro,{matchId:o}):null;return g.jsx(Dt.Provider,{value:o,children:t.options.disableGlobalCatchBoundary?s:g.jsx(ie,{getResetKey:()=>e,errorComponent:Bt,onCatch:n=>{n.message||n.toString()},children:s})})}function mn(){const t=F();return O({select:o=>[o.location.href,o.resolvedLocation?.href,o.status],structuralSharing:!0}),R.useCallback(o=>{const{pending:e,caseSensitive:s,fuzzy:n,includeSearch:r,...i}=o;return t.matchRoute(i,{pending:e,caseSensitive:s,fuzzy:n,includeSearch:r})},[t])}const gn=t=>new sn(t);class sn extends vs{constructor(o){super(o)}}typeof globalThis<"u"?(globalThis.createFileRoute=Be,globalThis.createLazyFileRoute=je):typeof window<"u"&&(window.createFileRoute=Be,window.createLazyFileRoute=je);function nn({router:t,children:o,...e}){Object.keys(e).length>0&&t.update({...t.options,...e,context:{...t.options.context,...e.context}});const s=eo(),n=g.jsx(s.Provider,{value:t,children:o});return t.options.Wrap?g.jsx(t.options.Wrap,{children:n}):n}function yn({router:t,...o}){return g.jsx(nn,{router:t,...o,children:g.jsx(en,{})})}export{so as L,tn as O,rt as R,hn as a,oo as b,dn as c,fn as d,Ts as e,mn as f,pn as g,Hs as h,K as i,g as j,gn as k,us as l,yn as m,R as r,he as u}; diff --git a/webui/dist/assets/ui-vendor-BLBhIcJ8.js b/webui/dist/assets/ui-vendor-BgfqR_Xz.js similarity index 99% rename from webui/dist/assets/ui-vendor-BLBhIcJ8.js rename to webui/dist/assets/ui-vendor-BgfqR_Xz.js index 4b143681..93e393f0 100644 --- a/webui/dist/assets/ui-vendor-BLBhIcJ8.js +++ b/webui/dist/assets/ui-vendor-BgfqR_Xz.js @@ -1,4 +1,4 @@ -import{r as a,j as x,R as we,a as Vt,b as at,c as yr}from"./router-SinpzM5S.js";function k(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function wr(e,t){const n=a.createContext(t),o=i=>{const{children:c,...s}=i,l=a.useMemo(()=>s,Object.values(s));return x.jsx(n.Provider,{value:l,children:c})};o.displayName=e+"Provider";function r(i){const c=a.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[o,r]}function Ve(e,t=[]){let n=[];function o(i,c){const s=a.createContext(c),l=n.length;n=[...n,c];const u=p=>{const{scope:h,children:m,...w}=p,f=h?.[e]?.[l]||s,g=a.useMemo(()=>w,Object.values(w));return x.jsx(f.Provider,{value:g,children:m})};u.displayName=i+"Provider";function d(p,h){const m=h?.[e]?.[l]||s,w=a.useContext(m);if(w)return w;if(c!==void 0)return c;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[u,d]}const r=()=>{const i=n.map(c=>a.createContext(c));return function(s){const l=s?.[e]||i;return a.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return r.scopeName=e,[o,xr(r,...t)]}function xr(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const c=o.reduce((s,{useScope:l,scopeName:u})=>{const p=l(i)[`__scope${u}`];return{...s,...p}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function sn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _e(...e){return t=>{let n=!1;const o=e.map(r=>{const i=sn(r,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r{const{children:i,...c}=o,s=a.Children.toArray(i),l=s.find(Cr);if(l){const u=l.props.children,d=s.map(p=>p===l?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:p);return x.jsx(t,{...c,ref:r,children:a.isValidElement(u)?a.cloneElement(u,void 0,d):null})}return x.jsx(t,{...c,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function Sr(e){const t=a.forwardRef((n,o)=>{const{children:r,...i}=n;if(a.isValidElement(r)){const c=Rr(r),s=Er(i,r.props);return r.type!==a.Fragment&&(s.ref=o?_e(o,c):c),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var br=Symbol("radix.slottable");function Cr(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===br}function Er(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...s)=>{const l=i(...s);return r(...s),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Rr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Pr(e){const t=e+"CollectionProvider",[n,o]=Ve(t),[r,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=f=>{const{scope:g,children:y}=f,v=we.useRef(null),S=we.useRef(new Map).current;return x.jsx(r,{scope:g,itemMap:S,collectionRef:v,children:y})};c.displayName=t;const s=e+"CollectionSlot",l=cn(s),u=we.forwardRef((f,g)=>{const{scope:y,children:v}=f,S=i(s,y),b=H(g,S.collectionRef);return x.jsx(l,{ref:b,children:v})});u.displayName=s;const d=e+"CollectionItemSlot",p="data-radix-collection-item",h=cn(d),m=we.forwardRef((f,g)=>{const{scope:y,children:v,...S}=f,b=we.useRef(null),C=H(g,b),R=i(d,y);return we.useEffect(()=>(R.itemMap.set(b,{ref:b,...S}),()=>void R.itemMap.delete(b))),x.jsx(h,{[p]:"",ref:C,children:v})});m.displayName=d;function w(f){const g=i(e+"CollectionConsumer",f);return we.useCallback(()=>{const v=g.collectionRef.current;if(!v)return[];const S=Array.from(v.querySelectorAll(`[${p}]`));return Array.from(g.itemMap.values()).sort((R,E)=>S.indexOf(R.ref.current)-S.indexOf(E.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:c,Slot:u,ItemSlot:m},w,o]}var K=globalThis?.document?a.useLayoutEffect:()=>{},Ar=Vt[" useId ".trim().toString()]||(()=>{}),Or=0;function Te(e){const[t,n]=a.useState(Ar());return K(()=>{n(o=>o??String(Or++))},[e]),t?`radix-${t}`:""}function Tr(e){const t=Nr(e),n=a.forwardRef((o,r)=>{const{children:i,...c}=o,s=a.Children.toArray(i),l=s.find(Dr);if(l){const u=l.props.children,d=s.map(p=>p===l?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:p);return x.jsx(t,{...c,ref:r,children:a.isValidElement(u)?a.cloneElement(u,void 0,d):null})}return x.jsx(t,{...c,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function Nr(e){const t=a.forwardRef((n,o)=>{const{children:r,...i}=n;if(a.isValidElement(r)){const c=Mr(r),s=_r(i,r.props);return r.type!==a.Fragment&&(s.ref=o?_e(o,c):c),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ir=Symbol("radix.slottable");function Dr(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ir}function _r(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...s)=>{const l=i(...s);return r(...s),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Mr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Lr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],M=Lr.reduce((e,t)=>{const n=Tr(`Primitive.${t}`),o=a.forwardRef((r,i)=>{const{asChild:c,...s}=r,l=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(l,{...s,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function kr(e,t){e&&at.flushSync(()=>e.dispatchEvent(t))}function xe(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>t.current?.(...n),[])}var jr=Vt[" useInsertionEffect ".trim().toString()]||K;function et({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,i,c]=Fr({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:r;{const d=a.useRef(e!==void 0);a.useEffect(()=>{const p=d.current;p!==s&&console.warn(`${o} is changing from ${p?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=s},[s,o])}const u=a.useCallback(d=>{if(s){const p=Wr(d)?d(e):d;p!==e&&c.current?.(p)}else i(d)},[s,e,i,c]);return[l,u]}function Fr({defaultProp:e,onChange:t}){const[n,o]=a.useState(e),r=a.useRef(n),i=a.useRef(t);return jr(()=>{i.current=t},[t]),a.useEffect(()=>{r.current!==n&&(i.current?.(n),r.current=n)},[n,r]),[n,o,i]}function Wr(e){return typeof e=="function"}var $r=a.createContext(void 0);function Br(e){const t=a.useContext($r);return e||t||"ltr"}function Vr(e,t){return a.useReducer((n,o)=>t[n][o]??n,e)}var He=e=>{const{present:t,children:n}=e,o=Hr(t),r=typeof n=="function"?n({present:o.isPresent}):a.Children.only(n),i=H(o.ref,Ur(r));return typeof n=="function"||o.isPresent?a.cloneElement(r,{ref:i}):null};He.displayName="Presence";function Hr(e){const[t,n]=a.useState(),o=a.useRef(null),r=a.useRef(e),i=a.useRef("none"),c=e?"mounted":"unmounted",[s,l]=Vr(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const u=ze(o.current);i.current=s==="mounted"?u:"none"},[s]),K(()=>{const u=o.current,d=r.current;if(d!==e){const h=i.current,m=ze(u);e?l("MOUNT"):m==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),K(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,p=m=>{const f=ze(o.current).includes(CSS.escape(m.animationName));if(m.target===t&&f&&(l("ANIMATION_END"),!r.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=m=>{m.target===t&&(i.current=ze(o.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:a.useCallback(u=>{o.current=u?getComputedStyle(u):null,n(u)},[])}}function ze(e){return e?.animationName||"none"}function Ur(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function an(e,[t,n]){return Math.min(n,Math.max(t,e))}var zr=Symbol.for("react.lazy"),tt=Vt[" use ".trim().toString()];function Kr(e){return typeof e=="object"&&e!==null&&"then"in e}function Dn(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===zr&&"_payload"in e&&Kr(e._payload)}function _n(e){const t=Yr(e),n=a.forwardRef((o,r)=>{let{children:i,...c}=o;Dn(i)&&typeof tt=="function"&&(i=tt(i._payload));const s=a.Children.toArray(i),l=s.find(Gr);if(l){const u=l.props.children,d=s.map(p=>p===l?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:p);return x.jsx(t,{...c,ref:r,children:a.isValidElement(u)?a.cloneElement(u,void 0,d):null})}return x.jsx(t,{...c,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}var wa=_n("Slot");function Yr(e){const t=a.forwardRef((n,o)=>{let{children:r,...i}=n;if(Dn(r)&&typeof tt=="function"&&(r=tt(r._payload)),a.isValidElement(r)){const c=Zr(r),s=qr(i,r.props);return r.type!==a.Fragment&&(s.ref=o?_e(o,c):c),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xr=Symbol("radix.slottable");function Gr(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xr}function qr(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...s)=>{const l=i(...s);return r(...s),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Zr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Mn(e){const t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Ln(e){const[t,n]=a.useState(void 0);return K(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let c,s;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;c=u.inlineSize,s=u.blockSize}else c=e.offsetWidth,s=e.offsetHeight;n({width:c,height:s})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var Qr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Jr=Qr.reduce((e,t)=>{const n=_n(`Primitive.${t}`),o=a.forwardRef((r,i)=>{const{asChild:c,...s}=r,l=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(l,{...s,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),ei="Label",kn=a.forwardRef((e,t)=>x.jsx(Jr.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));kn.displayName=ei;var xa=kn;function ti(e,t=globalThis?.document){const n=xe(e);a.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var ni="DismissableLayer",Dt="dismissableLayer.update",oi="dismissableLayer.pointerDownOutside",ri="dismissableLayer.focusOutside",ln,jn=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lt=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:c,onDismiss:s,...l}=e,u=a.useContext(jn),[d,p]=a.useState(null),h=d?.ownerDocument??globalThis?.document,[,m]=a.useState({}),w=H(t,E=>p(E)),f=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=f.indexOf(g),v=d?f.indexOf(d):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,b=v>=y,C=si(E=>{const O=E.target,_=[...u.branches].some(I=>I.contains(O));!b||_||(r?.(E),c?.(E),E.defaultPrevented||s?.())},h),R=ci(E=>{const O=E.target;[...u.branches].some(I=>I.contains(O))||(i?.(E),c?.(E),E.defaultPrevented||s?.())},h);return ti(E=>{v===u.layers.size-1&&(o?.(E),!E.defaultPrevented&&s&&(E.preventDefault(),s()))},h),a.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(ln=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),un(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=ln)}},[d,h,n,u]),a.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),un())},[d,u]),a.useEffect(()=>{const E=()=>m({});return document.addEventListener(Dt,E),()=>document.removeEventListener(Dt,E)},[]),x.jsx(M.div,{...l,ref:w,style:{pointerEvents:S?b?"auto":"none":void 0,...e.style},onFocusCapture:k(e.onFocusCapture,R.onFocusCapture),onBlurCapture:k(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:k(e.onPointerDownCapture,C.onPointerDownCapture)})});lt.displayName=ni;var ii="DismissableLayerBranch",Fn=a.forwardRef((e,t)=>{const n=a.useContext(jn),o=a.useRef(null),r=H(t,o);return a.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),x.jsx(M.div,{...e,ref:r})});Fn.displayName=ii;function si(e,t=globalThis?.document){const n=xe(e),o=a.useRef(!1),r=a.useRef(()=>{});return a.useEffect(()=>{const i=s=>{if(s.target&&!o.current){let l=function(){Wn(oi,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=l,t.addEventListener("click",r.current,{once:!0})):l()}else t.removeEventListener("click",r.current);o.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function ci(e,t=globalThis?.document){const n=xe(e),o=a.useRef(!1);return a.useEffect(()=>{const r=i=>{i.target&&!o.current&&Wn(ri,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function un(){const e=new CustomEvent(Dt);document.dispatchEvent(e)}function Wn(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?kr(r,i):r.dispatchEvent(i)}var Sa=lt,ba=Fn,Ct="focusScope.autoFocusOnMount",Et="focusScope.autoFocusOnUnmount",fn={bubbles:!1,cancelable:!0},ai="FocusScope",Ht=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:i,...c}=e,[s,l]=a.useState(null),u=xe(r),d=xe(i),p=a.useRef(null),h=H(t,f=>l(f)),m=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(o){let f=function(S){if(m.paused||!s)return;const b=S.target;s.contains(b)?p.current=b:ue(p.current,{select:!0})},g=function(S){if(m.paused||!s)return;const b=S.relatedTarget;b!==null&&(s.contains(b)||ue(p.current,{select:!0}))},y=function(S){if(document.activeElement===document.body)for(const C of S)C.removedNodes.length>0&&ue(s)};document.addEventListener("focusin",f),document.addEventListener("focusout",g);const v=new MutationObserver(y);return s&&v.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",g),v.disconnect()}}},[o,s,m.paused]),a.useEffect(()=>{if(s){pn.add(m);const f=document.activeElement;if(!s.contains(f)){const y=new CustomEvent(Ct,fn);s.addEventListener(Ct,u),s.dispatchEvent(y),y.defaultPrevented||(li(mi($n(s)),{select:!0}),document.activeElement===f&&ue(s))}return()=>{s.removeEventListener(Ct,u),setTimeout(()=>{const y=new CustomEvent(Et,fn);s.addEventListener(Et,d),s.dispatchEvent(y),y.defaultPrevented||ue(f??document.body,{select:!0}),s.removeEventListener(Et,d),pn.remove(m)},0)}}},[s,u,d,m]);const w=a.useCallback(f=>{if(!n&&!o||m.paused)return;const g=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,y=document.activeElement;if(g&&y){const v=f.currentTarget,[S,b]=ui(v);S&&b?!f.shiftKey&&y===b?(f.preventDefault(),n&&ue(S,{select:!0})):f.shiftKey&&y===S&&(f.preventDefault(),n&&ue(b,{select:!0})):y===v&&f.preventDefault()}},[n,o,m.paused]);return x.jsx(M.div,{tabIndex:-1,...c,ref:h,onKeyDown:w})});Ht.displayName=ai;function li(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(ue(o,{select:t}),document.activeElement!==n)return}function ui(e){const t=$n(e),n=dn(t,e),o=dn(t.reverse(),e);return[n,o]}function $n(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function dn(e,t){for(const n of e)if(!fi(n,{upTo:t}))return n}function fi(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function di(e){return e instanceof HTMLInputElement&&"select"in e}function ue(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&di(e)&&t&&e.select()}}var pn=pi();function pi(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=mn(e,t),e.unshift(t)},remove(t){e=mn(e,t),e[0]?.resume()}}}function mn(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function mi(e){return e.filter(t=>t.tagName!=="A")}var hi="Portal",Ut=a.forwardRef((e,t)=>{const{container:n,...o}=e,[r,i]=a.useState(!1);K(()=>i(!0),[]);const c=n||r&&globalThis?.document?.body;return c?yr.createPortal(x.jsx(M.div,{...o,ref:t}),c):null});Ut.displayName=hi;var Rt=0;function Bn(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??hn()),document.body.insertAdjacentElement("beforeend",e[1]??hn()),Rt++,()=>{Rt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Rt--}},[])}function hn(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ne=function(){return ne=Object.assign||function(t){for(var n,o=1,r=arguments.length;o"u")return Di;var t=_i(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},Li=zn(),Ne="data-scroll-locked",ki=function(e,t,n,o){var r=e.left,i=e.top,c=e.right,s=e.gap;return n===void 0&&(n="margin"),` +import{r as a,j as x,R as we,a as Vt,b as at,c as yr}from"./router-DQNkr8RI.js";function k(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function wr(e,t){const n=a.createContext(t),o=i=>{const{children:c,...s}=i,l=a.useMemo(()=>s,Object.values(s));return x.jsx(n.Provider,{value:l,children:c})};o.displayName=e+"Provider";function r(i){const c=a.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[o,r]}function Ve(e,t=[]){let n=[];function o(i,c){const s=a.createContext(c),l=n.length;n=[...n,c];const u=p=>{const{scope:h,children:m,...w}=p,f=h?.[e]?.[l]||s,g=a.useMemo(()=>w,Object.values(w));return x.jsx(f.Provider,{value:g,children:m})};u.displayName=i+"Provider";function d(p,h){const m=h?.[e]?.[l]||s,w=a.useContext(m);if(w)return w;if(c!==void 0)return c;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[u,d]}const r=()=>{const i=n.map(c=>a.createContext(c));return function(s){const l=s?.[e]||i;return a.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return r.scopeName=e,[o,xr(r,...t)]}function xr(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const c=o.reduce((s,{useScope:l,scopeName:u})=>{const p=l(i)[`__scope${u}`];return{...s,...p}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function sn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _e(...e){return t=>{let n=!1;const o=e.map(r=>{const i=sn(r,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r{const{children:i,...c}=o,s=a.Children.toArray(i),l=s.find(Cr);if(l){const u=l.props.children,d=s.map(p=>p===l?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:p);return x.jsx(t,{...c,ref:r,children:a.isValidElement(u)?a.cloneElement(u,void 0,d):null})}return x.jsx(t,{...c,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function Sr(e){const t=a.forwardRef((n,o)=>{const{children:r,...i}=n;if(a.isValidElement(r)){const c=Rr(r),s=Er(i,r.props);return r.type!==a.Fragment&&(s.ref=o?_e(o,c):c),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var br=Symbol("radix.slottable");function Cr(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===br}function Er(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...s)=>{const l=i(...s);return r(...s),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Rr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Pr(e){const t=e+"CollectionProvider",[n,o]=Ve(t),[r,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=f=>{const{scope:g,children:y}=f,v=we.useRef(null),S=we.useRef(new Map).current;return x.jsx(r,{scope:g,itemMap:S,collectionRef:v,children:y})};c.displayName=t;const s=e+"CollectionSlot",l=cn(s),u=we.forwardRef((f,g)=>{const{scope:y,children:v}=f,S=i(s,y),b=H(g,S.collectionRef);return x.jsx(l,{ref:b,children:v})});u.displayName=s;const d=e+"CollectionItemSlot",p="data-radix-collection-item",h=cn(d),m=we.forwardRef((f,g)=>{const{scope:y,children:v,...S}=f,b=we.useRef(null),C=H(g,b),R=i(d,y);return we.useEffect(()=>(R.itemMap.set(b,{ref:b,...S}),()=>void R.itemMap.delete(b))),x.jsx(h,{[p]:"",ref:C,children:v})});m.displayName=d;function w(f){const g=i(e+"CollectionConsumer",f);return we.useCallback(()=>{const v=g.collectionRef.current;if(!v)return[];const S=Array.from(v.querySelectorAll(`[${p}]`));return Array.from(g.itemMap.values()).sort((R,E)=>S.indexOf(R.ref.current)-S.indexOf(E.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:c,Slot:u,ItemSlot:m},w,o]}var K=globalThis?.document?a.useLayoutEffect:()=>{},Ar=Vt[" useId ".trim().toString()]||(()=>{}),Or=0;function Te(e){const[t,n]=a.useState(Ar());return K(()=>{n(o=>o??String(Or++))},[e]),t?`radix-${t}`:""}function Tr(e){const t=Nr(e),n=a.forwardRef((o,r)=>{const{children:i,...c}=o,s=a.Children.toArray(i),l=s.find(Dr);if(l){const u=l.props.children,d=s.map(p=>p===l?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:p);return x.jsx(t,{...c,ref:r,children:a.isValidElement(u)?a.cloneElement(u,void 0,d):null})}return x.jsx(t,{...c,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}function Nr(e){const t=a.forwardRef((n,o)=>{const{children:r,...i}=n;if(a.isValidElement(r)){const c=Mr(r),s=_r(i,r.props);return r.type!==a.Fragment&&(s.ref=o?_e(o,c):c),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ir=Symbol("radix.slottable");function Dr(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ir}function _r(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...s)=>{const l=i(...s);return r(...s),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Mr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Lr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],M=Lr.reduce((e,t)=>{const n=Tr(`Primitive.${t}`),o=a.forwardRef((r,i)=>{const{asChild:c,...s}=r,l=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(l,{...s,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function kr(e,t){e&&at.flushSync(()=>e.dispatchEvent(t))}function xe(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>t.current?.(...n),[])}var jr=Vt[" useInsertionEffect ".trim().toString()]||K;function et({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,i,c]=Fr({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:r;{const d=a.useRef(e!==void 0);a.useEffect(()=>{const p=d.current;p!==s&&console.warn(`${o} is changing from ${p?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=s},[s,o])}const u=a.useCallback(d=>{if(s){const p=Wr(d)?d(e):d;p!==e&&c.current?.(p)}else i(d)},[s,e,i,c]);return[l,u]}function Fr({defaultProp:e,onChange:t}){const[n,o]=a.useState(e),r=a.useRef(n),i=a.useRef(t);return jr(()=>{i.current=t},[t]),a.useEffect(()=>{r.current!==n&&(i.current?.(n),r.current=n)},[n,r]),[n,o,i]}function Wr(e){return typeof e=="function"}var $r=a.createContext(void 0);function Br(e){const t=a.useContext($r);return e||t||"ltr"}function Vr(e,t){return a.useReducer((n,o)=>t[n][o]??n,e)}var He=e=>{const{present:t,children:n}=e,o=Hr(t),r=typeof n=="function"?n({present:o.isPresent}):a.Children.only(n),i=H(o.ref,Ur(r));return typeof n=="function"||o.isPresent?a.cloneElement(r,{ref:i}):null};He.displayName="Presence";function Hr(e){const[t,n]=a.useState(),o=a.useRef(null),r=a.useRef(e),i=a.useRef("none"),c=e?"mounted":"unmounted",[s,l]=Vr(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const u=ze(o.current);i.current=s==="mounted"?u:"none"},[s]),K(()=>{const u=o.current,d=r.current;if(d!==e){const h=i.current,m=ze(u);e?l("MOUNT"):m==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),K(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,p=m=>{const f=ze(o.current).includes(CSS.escape(m.animationName));if(m.target===t&&f&&(l("ANIMATION_END"),!r.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=m=>{m.target===t&&(i.current=ze(o.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:a.useCallback(u=>{o.current=u?getComputedStyle(u):null,n(u)},[])}}function ze(e){return e?.animationName||"none"}function Ur(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function an(e,[t,n]){return Math.min(n,Math.max(t,e))}var zr=Symbol.for("react.lazy"),tt=Vt[" use ".trim().toString()];function Kr(e){return typeof e=="object"&&e!==null&&"then"in e}function Dn(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===zr&&"_payload"in e&&Kr(e._payload)}function _n(e){const t=Yr(e),n=a.forwardRef((o,r)=>{let{children:i,...c}=o;Dn(i)&&typeof tt=="function"&&(i=tt(i._payload));const s=a.Children.toArray(i),l=s.find(Gr);if(l){const u=l.props.children,d=s.map(p=>p===l?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:p);return x.jsx(t,{...c,ref:r,children:a.isValidElement(u)?a.cloneElement(u,void 0,d):null})}return x.jsx(t,{...c,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}var wa=_n("Slot");function Yr(e){const t=a.forwardRef((n,o)=>{let{children:r,...i}=n;if(Dn(r)&&typeof tt=="function"&&(r=tt(r._payload)),a.isValidElement(r)){const c=Zr(r),s=qr(i,r.props);return r.type!==a.Fragment&&(s.ref=o?_e(o,c):c),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xr=Symbol("radix.slottable");function Gr(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xr}function qr(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...s)=>{const l=i(...s);return r(...s),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Zr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Mn(e){const t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Ln(e){const[t,n]=a.useState(void 0);return K(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let c,s;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;c=u.inlineSize,s=u.blockSize}else c=e.offsetWidth,s=e.offsetHeight;n({width:c,height:s})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var Qr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Jr=Qr.reduce((e,t)=>{const n=_n(`Primitive.${t}`),o=a.forwardRef((r,i)=>{const{asChild:c,...s}=r,l=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(l,{...s,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),ei="Label",kn=a.forwardRef((e,t)=>x.jsx(Jr.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));kn.displayName=ei;var xa=kn;function ti(e,t=globalThis?.document){const n=xe(e);a.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var ni="DismissableLayer",Dt="dismissableLayer.update",oi="dismissableLayer.pointerDownOutside",ri="dismissableLayer.focusOutside",ln,jn=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lt=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:c,onDismiss:s,...l}=e,u=a.useContext(jn),[d,p]=a.useState(null),h=d?.ownerDocument??globalThis?.document,[,m]=a.useState({}),w=H(t,E=>p(E)),f=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=f.indexOf(g),v=d?f.indexOf(d):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,b=v>=y,C=si(E=>{const O=E.target,_=[...u.branches].some(I=>I.contains(O));!b||_||(r?.(E),c?.(E),E.defaultPrevented||s?.())},h),R=ci(E=>{const O=E.target;[...u.branches].some(I=>I.contains(O))||(i?.(E),c?.(E),E.defaultPrevented||s?.())},h);return ti(E=>{v===u.layers.size-1&&(o?.(E),!E.defaultPrevented&&s&&(E.preventDefault(),s()))},h),a.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(ln=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),un(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=ln)}},[d,h,n,u]),a.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),un())},[d,u]),a.useEffect(()=>{const E=()=>m({});return document.addEventListener(Dt,E),()=>document.removeEventListener(Dt,E)},[]),x.jsx(M.div,{...l,ref:w,style:{pointerEvents:S?b?"auto":"none":void 0,...e.style},onFocusCapture:k(e.onFocusCapture,R.onFocusCapture),onBlurCapture:k(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:k(e.onPointerDownCapture,C.onPointerDownCapture)})});lt.displayName=ni;var ii="DismissableLayerBranch",Fn=a.forwardRef((e,t)=>{const n=a.useContext(jn),o=a.useRef(null),r=H(t,o);return a.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),x.jsx(M.div,{...e,ref:r})});Fn.displayName=ii;function si(e,t=globalThis?.document){const n=xe(e),o=a.useRef(!1),r=a.useRef(()=>{});return a.useEffect(()=>{const i=s=>{if(s.target&&!o.current){let l=function(){Wn(oi,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=l,t.addEventListener("click",r.current,{once:!0})):l()}else t.removeEventListener("click",r.current);o.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function ci(e,t=globalThis?.document){const n=xe(e),o=a.useRef(!1);return a.useEffect(()=>{const r=i=>{i.target&&!o.current&&Wn(ri,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function un(){const e=new CustomEvent(Dt);document.dispatchEvent(e)}function Wn(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?kr(r,i):r.dispatchEvent(i)}var Sa=lt,ba=Fn,Ct="focusScope.autoFocusOnMount",Et="focusScope.autoFocusOnUnmount",fn={bubbles:!1,cancelable:!0},ai="FocusScope",Ht=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:i,...c}=e,[s,l]=a.useState(null),u=xe(r),d=xe(i),p=a.useRef(null),h=H(t,f=>l(f)),m=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(o){let f=function(S){if(m.paused||!s)return;const b=S.target;s.contains(b)?p.current=b:ue(p.current,{select:!0})},g=function(S){if(m.paused||!s)return;const b=S.relatedTarget;b!==null&&(s.contains(b)||ue(p.current,{select:!0}))},y=function(S){if(document.activeElement===document.body)for(const C of S)C.removedNodes.length>0&&ue(s)};document.addEventListener("focusin",f),document.addEventListener("focusout",g);const v=new MutationObserver(y);return s&&v.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",g),v.disconnect()}}},[o,s,m.paused]),a.useEffect(()=>{if(s){pn.add(m);const f=document.activeElement;if(!s.contains(f)){const y=new CustomEvent(Ct,fn);s.addEventListener(Ct,u),s.dispatchEvent(y),y.defaultPrevented||(li(mi($n(s)),{select:!0}),document.activeElement===f&&ue(s))}return()=>{s.removeEventListener(Ct,u),setTimeout(()=>{const y=new CustomEvent(Et,fn);s.addEventListener(Et,d),s.dispatchEvent(y),y.defaultPrevented||ue(f??document.body,{select:!0}),s.removeEventListener(Et,d),pn.remove(m)},0)}}},[s,u,d,m]);const w=a.useCallback(f=>{if(!n&&!o||m.paused)return;const g=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,y=document.activeElement;if(g&&y){const v=f.currentTarget,[S,b]=ui(v);S&&b?!f.shiftKey&&y===b?(f.preventDefault(),n&&ue(S,{select:!0})):f.shiftKey&&y===S&&(f.preventDefault(),n&&ue(b,{select:!0})):y===v&&f.preventDefault()}},[n,o,m.paused]);return x.jsx(M.div,{tabIndex:-1,...c,ref:h,onKeyDown:w})});Ht.displayName=ai;function li(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(ue(o,{select:t}),document.activeElement!==n)return}function ui(e){const t=$n(e),n=dn(t,e),o=dn(t.reverse(),e);return[n,o]}function $n(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function dn(e,t){for(const n of e)if(!fi(n,{upTo:t}))return n}function fi(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function di(e){return e instanceof HTMLInputElement&&"select"in e}function ue(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&di(e)&&t&&e.select()}}var pn=pi();function pi(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=mn(e,t),e.unshift(t)},remove(t){e=mn(e,t),e[0]?.resume()}}}function mn(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function mi(e){return e.filter(t=>t.tagName!=="A")}var hi="Portal",Ut=a.forwardRef((e,t)=>{const{container:n,...o}=e,[r,i]=a.useState(!1);K(()=>i(!0),[]);const c=n||r&&globalThis?.document?.body;return c?yr.createPortal(x.jsx(M.div,{...o,ref:t}),c):null});Ut.displayName=hi;var Rt=0;function Bn(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??hn()),document.body.insertAdjacentElement("beforeend",e[1]??hn()),Rt++,()=>{Rt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Rt--}},[])}function hn(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ne=function(){return ne=Object.assign||function(t){for(var n,o=1,r=arguments.length;o"u")return Di;var t=_i(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},Li=zn(),Ne="data-scroll-locked",ki=function(e,t,n,o){var r=e.left,i=e.top,c=e.right,s=e.gap;return n===void 0&&(n="margin"),` .`.concat(vi,` { overflow: hidden `).concat(o,`; padding-right: `).concat(s,"px ").concat(o,`; diff --git a/webui/dist/index.html b/webui/dist/index.html index e0ee1d7f..2dc900c9 100644 --- a/webui/dist/index.html +++ b/webui/dist/index.html @@ -7,13 +7,13 @@ MaiBot Dashboard - + - - - - - + + + + +